Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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. indexofrefraction
    3. Topics
    • Profile
    • Following 0
    • Followers 0
    • Topics 35
    • Posts 133
    • Best 7
    • Controversial 0
    • Groups 0

    Topics created by indexofrefraction

    • indexofrefractionI

      Debug Scene / Generators (Scene heat map)

      Cinema 4D SDK
      • windows macos • • indexofrefraction
      2
      0
      Votes
      2
      Posts
      180
      Views

      ferdinandF

      Hey @indexofrefraction,

      Thank you for reaching out to us. The Object Profiler should do what you want to do.

      7f8ba2c2-8af1-448e-a0d4-f120e3b91e0b-image.png

      It is part of Cinema 4D since 2025.0.0.

      Cheers,
      Ferdinand

    • indexofrefractionI

      find out if generator object? (in case of a Field object)

      Cinema 4D SDK
      • python • • indexofrefraction
      6
      0
      Votes
      6
      Posts
      770
      Views

      indexofrefractionI

      hi, i came up with this now...

      def hasGenFlag(op): description = op.GetDescription(c4d.DESCFLAGS_DESC_NONE) bc = description.GetParameter(c4d.ID_BASEOBJECT_GENERATOR_FLAG) return not bc[c4d.DESC_HIDE] if bc else False

      also its clear that "Generator" is a wide definition which doesn't match the Green Checkmark / Enabled GUI Element.
      in this sense the topic title is wrong bc i was just searching for a way to distinct objects having this GUI element from others which don't.
      (i can't change the topic title, i guess)

    • indexofrefractionI

      developers.maxon.net - offline

      General Talk
      • • • indexofrefraction
      2
      0
      Votes
      2
      Posts
      464
      Views

      ferdinandF

      Hello @indexofrefraction,

      Thank you for reaching out to us.

      FYI, developers.maxon.net is down since about 24 hours....

      We were aware and were working on it, the site should now be accessible again. Please excuse the inconvenience.

      Cheers,
      the SDK Team

    • indexofrefractionI

      Gimbal Lock Safe Target Expression

      Cinema 4D SDK
      • python • • indexofrefraction
      7
      0
      Votes
      7
      Posts
      1.5k
      Views

      ferdinandF

      Hello @indexofrefraction,

      Is this correct / covers all cases to get the targets position in local space?

      There is no "correct" way. The way I showed you is a/the common approach to construct a frame from a vector. A vector in R³ (opposed to a tuple of rotation values which might be stored in a type called Vector) only defines two out of the three degrees of freedom of a rotation in R³. When you construct a frame manually, you can define that third degree of freedom with the up vector (or just right away construct the frame out of two meaningful vectors which are already orthogonal to each other). VectorToHPB() makes this decision for you, as it, quote, '[will always set] the bank [...] to 0.0' because a vector does not store three angles but two. I personally would never go over the Euler angles, as this seems unnecessarily complicated, but this is a question of personal preference and not right or wrong.

      Is this correct / covers all cases to get the targets position in local space?
      (~(op.GetUpMg() * op.GetFrozenMln())) * target.GetMg().off [- op->GetRelPos();]

      What @s_bach did there was specific to that example which operates on Euler angles. I cannot explain all the math here, but in general, the position of an object B relative to an object A, i.e, the local offset of B within the coordinate system of A is just the delta of both offsets transformed by the coordinate system of A.

      A: c4d.BaseObject B: c4d.BaseObject mgA: c4d.Matrix = A.GetMg() mgB: c4d.Matrix = B.GetMg() # This is the location of B in relation to A in world coordinates. delta: c4d.Vector = mgB.off - mgA.off # The same point but in the coordinate system of A. If B were parented to A, it would have # this offset. offBLocalToA: c4d.Vector = mgA * delta

      I again would have personally done some things differently in the loot-at example, but the solution is just as good as others.

      what is m = utils.MatrixMove(op.GetAbsPos()) * utils.HPBToMatrix(op.GetAbsRot()) * utils.MatrixScale(op.GetAbsScale()) in this context? (ps. GetAbsScale misses the brackets in the docs)

      Please read the docs, I cannot explain here transforms from scratch again. Thanks for the hint for the missing parenthesis, I will fix that in an upcoming release. As a tip: Do not fixate too much on frozen transforms in our API, you can ignore them more or less, the relevant methods are GetMg and GetMl.

      and... is this the real code of the Target Tag ?

      I am not quite sure how you mean that? You mean if the LookAtCamera::Execute example is identical to what the ::Execute of Ttargetexpression does internally? No really, the expression ~(op.GetUpMg() * op.GetFrozenMln()) pops up there, but Ttargetexpression also constructs the frame manually with the cross product, but there are more steps involved than in my simple example. But again, there is no real right or wrong here, you can do things differently if you want to.

      And before the question comes up, no, we unfortunately cannot share the code of the target expression. I would also point out again our Forum Rules, especially regarding the scope of support and the rules of conduct. We cannot teach you the math and you must implement your things yourself.

      Cheers,
      Ferdinand

      PS: If you want to explore what the frozen transform means (it is mostly smoke and mirrors for the API perspective, unless you want to specifically deconstruct a transform), I would recommend adding a Python tag to objects, adding this code, and then play around with the freeze transform feature.

      import c4d op: c4d.BaseTag def main() -> None: """ """ def PrettyMatrixString(m: c4d.Matrix): """_summary_ """ s: str = f"{m.__class__.__name__}(" l: int = len(s) for i, v in enumerate((m.off, m.v1, m.v2, m.v3)): s += f"{' ' * (l if i != 0 else 0)}({round(v.x, 3):>8}, {round(v.y, 3):>8}, {round(v.z, 3):>8}\n" return s[:-1] + ")" node: c4d.BaseObject = op.GetMain() if not isinstance(node, c4d.BaseObject): # Should technically never happen return for line in ( f"GetMg():\n{PrettyMatrixString(node.GetMg())}", f"GetMl():\n{PrettyMatrixString(node.GetMl())}", f"GetFrozenMln():\n{PrettyMatrixString(node.GetFrozenMln())}"): print (line)

      09c7c8b7-63d3-4020-8ef3-2881ff262003-image.png

    • indexofrefractionI

      Osubdivisionsurface ?

      Cinema 4D SDK
      • python • • indexofrefraction
      4
      0
      Votes
      4
      Posts
      665
      Views

      ferdinandF

      Hey @indexofrefraction,

      Well, that is because Mograph is one of the areas where the type symbols have not been exposed. So, to be clear: There is no cloner object symbol.

      But now that you brought this up again, I just realized that we (the SDK Team) never talked about fixing this and I do not see (fully) why. I have a suspicion why this might have been postponed or refuted in the past, but I will bring it up again. In the end we just must add a few defines to ge_prepass.h and then users do not have to jump through these hoops anymore. It will be difficult to catch all the missing symbols, but we could at least start with the ones we know. I will update the thread with the outcome of our discussion.

      Edit: So, we talked about this, and came to the obvious conclusion, that we should do what we should have done a long time ago, and fix this. I cannot give an ETA, but I will try to give it priority as I think this is a problem which impacts many users.

      Cheers,
      Ferdinand

    • indexofrefractionI

      Insert a shader into a shader hierarchy

      Cinema 4D SDK
      • python • • indexofrefraction
      17
      0
      Votes
      17
      Posts
      2.5k
      Views

      indexofrefractionI

      Thanks a lot kbar.. i'll watch and learn!
      still... the hurdles to compile a c++ plugin are extremely high nowadays. 😕
      it would be great if the sdk plugins would be downloadable ready compiled as well

    • indexofrefractionI

      Node Materials & Python ?

      Cinema 4D SDK
      • python • • indexofrefraction
      3
      0
      Votes
      3
      Posts
      499
      Views

      indexofrefractionI

      thanks ferdinand... something to study when this summer heat is over .-)

    • indexofrefractionI

      incorrect specular channel property ids

      Bugs
      • python • • indexofrefraction
      3
      0
      Votes
      3
      Posts
      725
      Views

      indexofrefractionI

      tx, i just wanted to report it...

    • indexofrefractionI

      How to Create and Populate a Layer Shader?

      Cinema 4D SDK
      • python • • indexofrefraction
      3
      0
      Votes
      3
      Posts
      932
      Views

      indexofrefractionI

      @ferdinand
      hey ferdinand , thanks for all of this information !
      i also noticed that definitions are missing in the python SDK
      (specifically the BlendModes)

    • indexofrefractionI

      Copy LayerShader to a new Material

      Cinema 4D SDK
      • python • • indexofrefraction
      11
      0
      Votes
      11
      Posts
      2.1k
      Views

      indexofrefractionI

      tx ferdinand,
      and yes intertwined threads .-)

    • indexofrefractionI

      Quicktab Radio UserData change results in 2 Messages (Mini-Bug?)

      Bugs
      • • • indexofrefraction
      3
      1
      Votes
      3
      Posts
      890
      Views

      ferdinandF

      Hello @indexofrefraction,

      without further questions or replies, we will consider this topic as solved by Thursday and flag it accordingly.

      Just for clarification: This does not mean that the bug is solved or that we won't track it, we simply do not want to keep the thread open until the bug has been fixed. The bug status is tracked with the to fix tag that has been added to the topic. We will report back here when the bug has been fixed.

      Thank you for your understanding,
      Ferdinand

    • indexofrefractionI

      GetSplineLength() is failing?

      General Talk
      • • • indexofrefraction
      5
      0
      Votes
      5
      Posts
      887
      Views

      ManuelM

      Hi,

      Spline Segment are explained in the Cinema 4D documentation

      About the initialisation, if you just move the point that should work but i would recommend to init again SplineLengthData.
      if you add a point, you need to initialize the SplineLengthData again.

      Cheers,
      Manuel

    • indexofrefractionI

      Find object / surface normal for given point in space

      General Talk
      • python • • indexofrefraction
      6
      0
      Votes
      6
      Posts
      1.2k
      Views

      ferdinandF

      Hello @indexofrefraction,

      without further questions or replies, we will consider this topic as solved by Thursday and flag it accordingly.

      Thank you for your understanding,
      Ferdinand

    • indexofrefractionI

      Pyhon Tag message for Generator Bit Change

      Cinema 4D SDK
      • • • indexofrefraction
      4
      0
      Votes
      4
      Posts
      612
      Views

      indexofrefractionI

      blush... not remembering my own threads, ouch! .-)
      thanks Maxime !

    • indexofrefractionI

      Request for LoggerInterface example for Python

      Cinema 4D SDK
      • • • indexofrefraction
      7
      0
      Votes
      7
      Posts
      871
      Views

      ferdinandF

      Hello @indexofrefraction,

      without any further questions or replies, we will consider this topic to be solved by Monday and flag it accordingly.

      Thank you for your understanding,
      Ferdinand

    • indexofrefractionI

      CommandData Plugin with Submenu

      Cinema 4D SDK
      • python • • indexofrefraction
      7
      1
      Votes
      7
      Posts
      1.3k
      Views

      a_blockA

      Thanks, Manuel

      I do not mean to stress anybody.
      But I'd say, this is quiet basic plugin functionality, which by now is not working for more than two years. So, i thought, I'd ask, if there's a chance for a fix.

    • indexofrefractionI

      CloseDocument ?

      Cinema 4D SDK
      • • • indexofrefraction
      2
      0
      Votes
      2
      Posts
      402
      Views

      CairynC

      Just check it manually:

      if currDoc.GetChanged() : c4d.gui.MessageDialog(c4d.plugins.GeLoadString(IDS_MSG_PROJECTCHANGED)) else : c4d.documents.KillDocument(currDoc) # works but ignores change status
    • indexofrefractionI

      GetUserDataContainer() and UserData Values

      Cinema 4D SDK
      • • • indexofrefraction
      9
      0
      Votes
      9
      Posts
      1.4k
      Views

      ManuelM

      hi,

      ha, i was not setting any value. So yes, they are in the BaseContainer at id c4d.ID_USERDATA (=700)

      to filter the groups or separator you just have to check the type in the descLevel and compare with DTYPE_SEPARATOR or DTYPE_GROUP or either use DescId.IsPartOf like:

      for descId, parameterBc in op.GetUserDataContainer(): print(c4d.DESCID_DYNAMICSUB.IsPartOf(descId)) # Will print True for all of them

      Cheers,
      Manuel

    • indexofrefractionI

      Dump/Restore UserDataContainer

      Cinema 4D SDK
      • • • indexofrefraction
      4
      0
      Votes
      4
      Posts
      619
      Views

      indexofrefractionI

      i finally succeeded in saving a BaseList2D userdata description (not the values)
      then loading and re-applying / cloning the full definition to a different BaseList2D,
      and finally copy over the values from the source to the target BaseList2D

      here is a similar topic for saving / loading the values (not the description) here:
      https://developers.maxon.net/forum/topic/11960/advice-for-saving-user-data/8
      I made a comment there about copying the userdata values

    • indexofrefractionI

      Invoke Dialog from Python Tag

      Cinema 4D SDK
      • • • indexofrefraction
      6
      0
      Votes
      6
      Posts
      992
      Views

      indexofrefractionI

      Hi Manuel,

      I just thought it must be possible to Message something to a CommandData plugin, too.
      The idea behind the CommandData was to combine some other functionality,
      but I guess i just get a new plugin ID and go the MessageData way...

      best, Index

      hm, somehow I cant find how to tag this as solved