Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. mogh
    3. Posts
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 34
    • Posts 151
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Usage of SplineHelp.InitSplineWith() regarding flags -> returned data

      Hey ferdinand,

      I mixed different questions - I'll keep to the theoretical part to keep the Post relevant to the original question.

      I appreciate the informative post as always. 😳

      Parametric concept of a spline is clear to me -> that's why i asked about "C4D can not get more precise than a 0° degree line object ?" which was formulated to lose as 0° is mathematical problematic? and I know 0.1 would be better. sorry about that.
      The tip about spline 'Adaptive' setting was a good hint, I never use it in work so I forgot about it.

      So to summarize regarding my question.

      The Line object always samples what the user has set in the spline settings and not by a unknown internal setting (for example to give good viewport performance, or nice equal sections)
      And its a better fit for my application, hence there is no "linear transport" shenanigans going on.
      And if I want to display a high resolution of my calculation, I make an internal copy of that spline and edit the spline settings, instead of sampling a low division spline with spline helper.

      Normalization / Jagged lines:
      I use Menger-Krümmung. -> will open a new topic.
      Your code might come in handy when I'll extend the plugin to polygon meshes.
      ...
      ...
      ...

      Remark

      as humans cannot see that level of detail.

      I have to disagree on this topic. As a tell tale we import CAD data here into C4D to evaluate the work of the engineers.

      Not long ago I said to our surface engineer. "take a look at the end of that surface something feels off, it looks like the surface is lifting" -> The engineer reportet back "you just spoted a 0.001mm surface deviation of an unconstrained spline ending I did not set."

      We could argue that the seen result was in fact not 0.001mm but perhaps to surface setup more than 1mm, (or by some rounding error C4D normal tag shading where continuous and then stagnant for 1 pixel) but my point is settings in precision are important and carry through till the final product. Even though a setting of 0.1° for a spline might might be unsuitable in most cases (rendering, performance, ...) it is not for evaluation.

      So even C4D and all that rounding / conversion / floating point precision might look like unrealiable, unecessary or even esotheric it caries through to a certain degree and its more reliable than you think.

      (Yes we evaluate in the original CAD Program, but the tale is that I saw something even after importing it into C4D)

      As reference to why I need this:

      Blender Plugin: Surface Diagnostics - Josef Ludvík Böhm

      Thank You

      posted in Cinema 4D SDK
      M
      mogh
    • RE: Usage of SplineHelp.InitSplineWith() regarding flags -> returned data

      Thank you ferdinand,

      I will implement my own "tagent" / "colinear" ending then, and not use this flag.

      @ferdinand said in Usage of SplineHelp.InitSplineWith() regarding flags -> returned data:

      As a warning: All the spline helpers implement parallel transport, which can make their output for curvature tasks undesirable (as it messes with what is the mathematical tangent of a spline in favour of what humans would expect. When you are at a loss about what I am talking about, search the forum for parallel transport and my username, the topic has come up multiple times in the past). It might be better to get the LineObject of a spline, i.e., its current discrete form, and do all the math based on its vertices.

      Aha ... thank you - this explains why I get so different from spline-helpers tangent and cross tangent. Could also corelate to my "noisy" sampling with splinehelper (see screen below)
      My question other topic but same context would be how to get a more high resolution Line-Object. We talked about this in an early stage about this, but my code wasn't mature enough to be sure. -> Is the short answer C4D can not get more precise than a 0° degree line object ?

      Screenshot line object Bezier 0° degree (for enough resolution). Nice plot but resolution enough? Probably not for edge cases like flatish dips.
      2025-10-27-Cinema 4D 2025.2.1 - [Untitled 1 _] - Main_001065.png 2025-10-27-Cinema 4D 2025.2.1 - [Untitled 1 _] - Main_001066.png

      Splinehelper 200x samples not moving average smoothed. The noise starts to show at about double the resolution of a line object ...
      2924215d-9db8-49a5-acc6-375c68d04b31-image.png

      Should I open another Topic?
      thank you again

      posted in Cinema 4D SDK
      M
      mogh
    • Usage of SplineHelp.InitSplineWith() regarding flags -> returned data

      Dear community,

      Returned Data of Flag c4d.SPLINEHELPFLAGS_CONTINUECURVE unclear.

      I've read that the SplineHelp() has flag called c4d.SPLINEHELPFLAGS_CONTINUECURVE.
      While the written explanation is clear to me :
      Continue the curvature of an existing spline at the end points.

      Its unclear to me how to utilize the data or even how the data I get is different from a "normal" helper.

      Reason of interest: I am coding a "Curvature" displaying Tag Plugin atm.

      thank you for your time.
      cheers mogh

      C4D Python SDK - Splinehelper

      posted in Cinema 4D SDK python
      M
      mogh
    • RE: Broken Push Notifications

      Hm, interesting, It works now,

      either you did something or the solution is to post a comment to trigger it. Anyway Thanks.
      Cheers mogh

      posted in News & Information
      M
      mogh
    • RE: Broken Push Notifications

      I still have the same problem. "No push" no "unread toppics". Clearing my Browser Chache does nothing.

      any idea ?
      cheers mogh

      posted in News & Information
      M
      mogh
    • RE: How to create UV of obj.

      I use this to Thank You Ferdinand.

      This is how I imagine an SDK example should look like .... a simplest version , an altered simple version and a complex touching the boundaries of the subject.
      I am thankful and praise your work .... !

      cheers mogh

      posted in Cinema 4D SDK
      M
      mogh
    • RE: How to receive the high definition / Interpolation version of a spline?

      Ok Understood,

      Ok I guess that explains my "nice" comb from the cache and my jagged flip/flop . sometimes zero comb from the "full" matrix normal ...

      I also have different tangents from manually "calculating" them then v3, v2. But I will make a "sanity" check this weekend (feed manual matrixes into my code instead of spline "point" matrixes), before I post about this.

      Thanks Ferdinand
      I'll divide and conquer away.

      posted in Cinema 4D SDK
      M
      mogh
    • RE: How to receive the high definition / Interpolation version of a spline?

      @ferdinand
      Thank you for your answer, exactly what i need, I am trying to incorporate the additional data but get weird results.

      Is there a switch up /typo in the above code I get m.v3 <-> m.v1 ? meaning v1 is the normal ?

      Is there a page in the SDK besides the "Matrix" one that explains the additional values and their features ?

      Thank you for your Time.
      mogh

      posted in Cinema 4D SDK
      M
      mogh
    • RE: TagData Plugin with Gui not using *.res

      Understood Thanks.

      posted in Cinema 4D SDK
      M
      mogh
    • RE: How to receive the high definition / Interpolation version of a spline?

      Ok I guess I have been vague what my issue is.

      from the above helper I only get the points the spline is set to (eg. adaptive 5°) but I perhaps want more points in between. That of course only makes sense in certain scenarios but even though if the spline is a straight line there must be a solution to get points in between.

      Example different adaptive degree values and the resulting points displayed as lines on the spline - Spline is a copy so no altering of the gizmos.
      2025-02-18-Cinema 4D 2025.1.2 - [Untitled 2 _] - Main_000813.png

      sorry to be so basic
      mogh

      posted in Cinema 4D SDK
      M
      mogh
    • How to receive the high definition / Interpolation version of a spline?

      How to receive the high definition version / Interpolation of a spline even when the user has set it to "low" detail?
      How high definition can I get ? is there more than the user Interface of C4D offers ?

      E.g. Interpolation adaptive, angle 0.0

      Or am I using c4d.utils.SplineHelp() wrong and there is a another helper that gives me requested amount of points from a spline?

      helper = c4d.utils.SplineHelp()
      if not helper.InitSplineWith(spline, c4d.SPLINEHELPFLAGS_RETAINLINEOBJECT):
          raise RuntimeError("Could not initialize spline helper.")
      line = helper.GetLineObject()
      points = line.GetAllPoints()
      

      cheers
      mogh

      posted in Cinema 4D SDK python
      M
      mogh
    • TagData Plugin with Gui not using *.res

      How to add a GUI to a TagData Plugin without *.res files ?
      ... I am on the fence with these 😉

      Hope this is basic an clear enough for no further explanation.

      cheers
      mogh

      posted in Cinema 4D SDK python
      M
      mogh
    • RE: General Question: Which Plugin Type? -> Curvature Comb / Plot

      curvature_comb.png

      not bad for 5 hours of dabbling --- thanks to you @ferdinand

      Gotcha's:
      The Curvature was 90dgree rotated - LLM to the rescue ...

      # c4d.plugins.RegisterTagPlugin( ....
      # That one nearly got me ;-)
      # c4d.TAG_IMPLEMENTS_DRAW_FUNCTION # R22 
      

      cheers

      posted in Cinema 4D SDK
      M
      mogh
    • RE: General Question: Which Plugin Type? -> Curvature Comb / Plot

      Thanks @ferdinand for your considered reply,

      At this stage because I just want to "make stuff" I will start as a tool and perhaps learn / have an idea to transfer it to something more useful.

      The obvious simple minded question - why is a tag Plugin not enough can a tag not draw into viewport ? Or only not via Python?

      Thanks
      mogh

      posted in Cinema 4D SDK
      M
      mogh
    • General Question: Which Plugin Type? -> Curvature Comb / Plot

      Dear Developers,

      I am starting to build a new Plugin, which should in the end, draw Curvature Combs / plots onto the selected edges / splines, preferable real time on editing the splines/models.

      My question is which Plugintype would be best suited ?
      Comb

      Thinking out loud:
      I was thinking a Tag Plugin but It could be to restricted as per the Tag plugin has some programing limits as I understand. Command or Tool plugin could work but I fear it will be clunky from a user experience.
      At best a Polygon model with Hypernurbs applied should display several combs at the same time using the Hypernurbs Subdivision for more "accuracy" than a pure Polygon edge.

      The plugin probably needs a Link Box to "receive" a selection. I am thinking of Ferdinands Dynamyc Link Example would be cool to have more than on comb active but only one "Tag / Plugin / ...." per object ...

      Closest thing C4D has is measure and construct Tool.
      As a starting point I would start to display Combs on Splines ...

      So to Pick the hive mind - > What Plugin Type is best suited for stuff like this?

      Moderators: feel free to move this Topic if aplicable.

      Cheers
      mogh

      posted in Cinema 4D SDK python
      M
      mogh
    • RE: res file, formatting, line ending, or encoding ?

      Thats it !
      Thank you @spedler

      posted in Cinema 4D SDK
      M
      mogh
    • RE: res file, formatting, line ending, or encoding ?

      No the SDK Example has no
      res (Optional[c4d.plugins.GeResource]) – The optional resource.
      for RegisterTagPlugin ...

          c4d.plugins.RegisterTagPlugin(id=PLUGIN_ID,
                                        str="Py - LookAtCamera",
                                        info=c4d.TAG_EXPRESSION | c4d.TAG_VISIBLE,
                                        g=LookAtCamera,
                                        description="Tpylookatcamera",
                                        icon=bmp)
      
      posted in Cinema 4D SDK
      M
      mogh
    • RE: res file, formatting, line ending, or encoding ?

      @spedler Thank you for your time you put into this,

      I managed to get the "original" running with a different ID Name after deleting (.../prefs/symbolcache )

      My own copy with Filename, NAME, CONTAINER, STRINGTABLE, ID Name still bugs out.

      I am probably blind 😕
      mogh

      enum 
      {    
          // End of symbol definition
          _DUMMY_ELEMENT_
      };
      
      #ifndef _curvaturetools_H_
      #define _curvaturetools_H_
      
          enum
          {
              CTBOOL      = 2001
          };
      
      #endif
      
      CONTAINER curvaturetools
      {
      	NAME curvaturetools;
          INCLUDE Texpression;
          
          GROUP ID_TAGPROPERTIES
      	{
      		BOOL CTBOOL { };
      	}
      }
      
      STRINGTABLE curvaturetools
      {
      	curvaturetools     "Py - Look At Camera";
          CTBOOL       "Change Pitch Rotation";
      }
      

      2025-02-16 16_22_33-c4d_symbols.h - plugins - Visual Studio Code.png

      posted in Cinema 4D SDK
      M
      mogh
    • RE: res file, formatting, line ending, or encoding ?

      Thank you for the reply,

      • I learned that all the "names / files" have to be the same ... Filename, NAME, CONTAINER, STRINGTABLE
      • The semi-colon is a thing I tried in several configs, and as soon as you touch the files you need them but the strange thing is that the original SDK example has non! The error above is from a missing semicolon. (its gone now with the semicolon after the curly brackets)
      • I changed the ID name and replaced the name in all corresponding files ... still the new variable name is not "found" by c4d.

      Just as a sanity check I also tried removing a character
      PYLOOKATCAMERA_PITCH_A -> error
      PYLOOKATCAMERA_PITCH -> works
      PYLOOKATCAMERA_PITC -> error

      Res, Str, H Files

      enum
      {
          // End of symbol definition
          _DUMMY_ELEMENT_
      };
      
      CONTAINER Tpylookatcamera
      {
      	NAME Tpylookatcamera;
          INCLUDE Texpression;
          
          GROUP ID_TAGPROPERTIES
      	{
      		BOOL PYLOOKATCAMERA_PITCH_A { };
      	}
      }
      
      STRINGTABLE Tpylookatcamera
      {
      	Tpylookatcamera         "Py - Look At Camera";
          PYLOOKATCAMERA_PITCH_A    "Change Pitch Rotation";
      }
      
      #ifndef _Tpylookatcamera_H_
      #define _Tpylookatcamera_H_
      
          enum
          {
              PYLOOKATCAMERA_PITCH_A     = 1000
          };
      
      #endif
      

      snippet:

      self.InitAttr(node, bool, c4d.PYLOOKATCAMERA_PITCH_A)
      node[c4d.PYLOOKATCAMERA_PITCH_A] = True
      

      Error:

      AttributeError: 'module' object has no attribute 'PYLOOKATCAMERA_PITCH_A'
      
      posted in Cinema 4D SDK
      M
      mogh