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
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. pyr
    3. Topics
    P
    Offline
    • Profile
    • Following 1
    • Followers 0
    • Topics 24
    • Posts 57
    • Groups 0

    Topics

    • P

      Setting Preferences via script

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python 2025 2026
      5
      0 Votes
      5 Posts
      153 Views
      ferdinandF
      Hello @CJtheTiger, I am not quite sure how your question is meant, and generally new questions should constitute new topics. When you are asking, if when there is an ID_FOO: int = 12345 in V1, if we then just silently switch out the numeric value to ID_FOO: int = 54321 in V2, then the answer is sort of yesn't. We try to keep identifiers persistent. And for things like plugin IDs this is true without ifs and buts. I.e., once Ocube: int = 5159 has been defined, it will stay like this. But parameter values, e.g., PRIM_CUBE_LEN: int = 1100, can technically change. The goal is also to keep them persistent but in ABI breaking releases we sometimes have to modify descriptions. That is why we recommend that you always use symbols and not numbers. Cheers, Ferdinand
    • P

      How to create a Track on a Vector Userdata?

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      3
      0 Votes
      3 Posts
      305 Views
      P
      Works! Thank you!
    • P

      Negative Vertex Map values

      Watching Ignoring Scheduled Pinned Locked Moved General Talk python r25
      3
      0 Votes
      3 Posts
      988 Views
      P
      hey, found the error. works exactly as i had planned. my code was correct, but i forgot to switch off use fields on the new vertex i mapped. thanks for the help anyway! [image: 1717679020556-4761c896-9141-42d3-8872-df429c5441df-grafik.png]
    • P

      MergeDocument under a selected Null

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      2
      0 Votes
      2 Posts
      531 Views
      ferdinandF
      Hey @pyr, Thank you for reaching out to us. The sentence 'if i do the whole thing via obj.InsertUnder(null) i miss the material' is a bit ambiguous, how do you mean that? I assume you mean that when you load two documents A and B and then start copying objects over by either cloning them or removing them from A and inserting them into B, that you then miss material references. Because the call you show us will load both objects and materials found at f into doc. A straightforward way to do what you want to do, parent everything that has been imported to a null, is to track the state of the top-level objects before and after the import. The difference between the states then tells you what to move where. In practice, there are some technical hoops to jump through, primarily the problem that you might run into dead references when you try to store objects references over the import process. Cheers, Ferdinand Result: moomoo.mp4 Code: """Demonstrates how to parent the objects merged into a document to a null object. Must be run as a script manager script and will import the contents of #FILE into the active document. """ import c4d doc: c4d.documents.BaseDocument # The active document. FILE: str = r"file:///e:/test.c4d" # The document to import. def main() -> None: """ """ # Get the UUID markers of all top level objects. We get the markers and not the object # references because importing a document bears a good chance that these references will be # dead (C4DAtom.IsAlive() == False) when we access them again. uuidCollection: list[bytes] = [] op: c4d.BaseObject = doc.GetFirstObject() while op: uuidCollection.append(bytes(op.FindUniqueID(c4d.MAXON_CREATOR_ID))) op = op.GetNext() # Now we import our document. c4d.documents.MergeDocument(doc, FILE, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_MERGESCENE) # We create our null object to parent the imported stuff to. We also add its UUID to # #uuidCollection, so that we do not attempt to parent #null to itself ;) null: c4d.BaseObject = c4d.BaseObject(c4d.Onull) null.SetName(FILE) doc.InsertObject(null) c4d.EventAdd() uuidCollection.append(bytes(null.FindUniqueID(c4d.MAXON_CREATOR_ID))) # Now we iterate again over all top level objects and parent everything that does not appear in # #uuidCollection to #null. op: c4d.BaseObject = doc.GetFirstObject() # We have to do this on two steps, because when we would already move #op in the first step # where we find the things to move, we would sabotage our own loop here (because as soon as # we move the first op to the null, op.GetNext() would be None). move: list[c4d.BaseObject] = [] while op: if bytes(op.FindUniqueID(c4d.MAXON_CREATOR_ID)) not in uuidCollection: move.append(op) op = op.GetNext() # Actually move the items. for op in move: op.InsertUnderLast(null) c4d.EventAdd() if __name__ == "__main__": main()
    • P

      Encouraging evaluation when a document is opened

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      3
      0 Votes
      3 Posts
      600 Views
      ferdinandF
      Hello @pyr, without any further replies or questions, we will consider this thread as solved by Thursday and flag it accordingly. Thank you for your understanding, Ferdinand
    • P

      CENTER AN OBJECT IN THE VIEW AND MAXIMIZE ITS SIZE

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      3
      1
      0 Votes
      3 Posts
      696 Views
      ferdinandF
      Hello @pyr, without any further questions or replies, we will consider this topic as solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
    • P

      How to remove generator childs when converting via "c"

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python r20 r21 s22 r23
      6
      0 Votes
      6 Posts
      1k Views
      P
      forget about it. i removed the c4d.OBJECT_INPUT flag during development and forgot to add it back.
    • P

      How to change the EXR compression method via python

      Watching Ignoring Scheduled Pinned Locked Moved Cineware SDK
      7
      0 Votes
      7 Posts
      3k Views
      M
      Thanks a lot for the update and yes maxon.InternedId should be used instead of maxon.Id. I will take care of updating the example in Github. Cheers, Maxime.
    • P

      Plugin is evaluated for all frames

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK r21 s22 r23 r20 python
      2
      0 Votes
      2 Posts
      451 Views
      ferdinandF
      Hi @pyr, thank you for reaching out to us. I am afraid we will need a little bit more than that, as otherwise it will be very hard to answer your question What kind of plugin do you implement? What does it do or what would you consider as running? On a very abstract level you cannot really prevent plugins from running other than not registering them at the start of the application. But you can of course modify their output depending on basically everything, including render events and at what time offset some given document is. Cheers, Ferdinand
    • P

      Combine UV and worldposition while shader rendering

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      4
      2
      0 Votes
      4 Posts
      809 Views
      ManuelM
      hi, I had a look but as @zipit said, there's not way in python. Cheers, Manuel
    • P

      bc lost stored mesh

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      6
      0 Votes
      6 Posts
      1k Views
      P
      After taking a deep dive into the documentation again i figure out that im thinking way to complicated. I use the Cache provided by cinema and write a custom check around it. This avoid using a cached mesh in a baseContainer and also removing a cinema4d breaking memoryleak in my plugin i just found. So thank you.
    • P

      Splinefield radius reset to 0 when using takes

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK r20 r21
      3
      0 Votes
      3 Posts
      487 Views
      M
      Hi @pyr I don't think there is anything related to the SDK and its a Cinema 4D bug so I invite you to post it on https://support.maxon.net/open.php On the contrary, if you experience this bug only via a script please post your script here so we can help you. Cheers, Maxime.
    • P

      Avoid creating new field object as child from plugin

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK r21 r20 python
      6
      0 Votes
      6 Posts
      979 Views
      P
      Ah sorry.
    • P

      FieldList.GetCount Bug

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK r21 r20 r19 python
      2
      0 Votes
      2 Posts
      577 Views
      M
      Hi @pyr, I've just reached the development team about it. So for them, this is not a bug since FieldList store only baseLink. In Python, we don't have BaseLink, but if you are not aware of what it is, please read BaseLink Manual. But since there is no BaseLink in Python, if a link points to a destructed object (like in your case, Python simply returns None) So I guess your workaround is ok. Cheers, Maxime
    • P

      UNIT METER SCALE ISSUE

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK
      4
      0 Votes
      4 Posts
      718 Views
      r_giganteR
      Hi pyr, thanks for reaching out us. Consider that the Scale modifier operates on the transformation matrix of the object when in Object Mode, whilst it operates on the parameters specified as lengths when in Model Mode. Finally, as pointed out by @zipit, providing more context will be definitively beneficial since with a very simple example I'm not able to replicate the issue as well. Best, R
    • P

      FIELDLIST SIZE DON'T FIT IN UI

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      7
      1
      0 Votes
      7 Posts
      1k Views
      M
      While the bug is still there I set the topic as solved. I will bump the topic once the fix is in a release. Cheers, Maxime
    • P

      Howto add a Field input to a python plugin

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python r19 r20 r21
      3
      0 Votes
      3 Posts
      586 Views
      P
      @s_bach said in Howto add a Field input to a python plugin: FIELDLIST works fine - i think i got an strange error before and trying CUSTOMFIELDLIST etc. solved
    • P

      GetContour and GetVirtualObjects in one Plugin

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      4
      0 Votes
      4 Posts
      970 Views
      P
      @rsodre works flawless!
    • P

      Generator Plugin update while under Fracture Object

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK r20 python
      4
      0 Votes
      4 Posts
      793 Views
      ManuelM
      Hello, Sorry for the delay. The bugs have been confirmed and will be fixed on a futur release. Cheers Manuel
    • P

      GeGetModata inside Python Generator returns none

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK r20 python
      3
      0 Votes
      3 Posts
      710 Views
      P
      to be honest - i don't know where my fault was. Unhappily i didn't commit the not working version. In my plugin i already used a virtual doc for some other calculations. thank you! vd.ExecutePasses(c4d.threading.GeGetCurrentThread(), True, True, True, c4d.BUILDFLAGS_NONE) md = c4d.modules.mograph.GeGetMoData(matrix) for m in md.GetArray(c4d.MODATA_MATRIX): rdPoints.append(m.off) works like a sharm.