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. datamilch
    3. Topics
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 23
    • Posts 53
    • Best 3
    • Controversial 0
    • Groups 0

    Topics created by datamilch

    • D

      GetRad() / GetMp() update issue

      Cinema 4D SDK
      • windows python 2025 • • datamilch
      2
      0
      Votes
      2
      Posts
      96
      Views

      ferdinandF

      Hey @datamilch,

      Thank you for reaching out to us. GetRad and GetMp express the locally aligned bounding box of an object. I.e., the bounding box in the coordinate system of the object. For a world space aligned bounding box we once had this thread, the Cinema API does not offer this out of the box.

      So, transforming an object will never change its bounding box. What will change the bounding box of an object, is changing its size or changing the parameters of a generator object. When you change the parameters of a generator or when your instantiate a new object, you will have to execute the passes (BaseDocument.ExecutePasses) on a document that contains the object to see the correct bounding box - or wait for the next scene update.

      PS: Your script is also running illegal code. You cannot modify the active document off-main-thread. I assume the is a script for a Python generator object. Its main function runs off-main-thread and you call there your csto which in turn calls SendModelingCommand on the active document. This will all sooner or later crash.

      https://developers.maxon.net/docs/py/2025_3_1/manuals/manual_threading.html#threading-information

      Cheers,
      Ferdinand

    • D

      Knowing if a font exists

      Cinema 4D SDK
      • windows python 2025 • • datamilch
      4
      0
      Votes
      4
      Posts
      146
      Views

      D

      for my use case i will probably have a fallback solution with web-save or system fonts like this:

      import platform system_name = platform.system() if system_name == "Windows": font_name = "Consolas" elif system_name == "Darwin": font_name = "Menlo" elif system_name == "Linux": font_name = "DejaVu Sans Mono"
    • D

      save/keep cache of generator plugin

      Cinema 4D SDK
      • 2025 python windows • • datamilch
      5
      1
      Votes
      5
      Posts
      498
      Views

      P

      Could you provide an snipped where you show how to cache it in a plugin?

    • D

      SAVEDOCUMENTFLAGS_AUTOSAVE still added to the recent file list?

      Cinema 4D SDK
      • windows python 2025 • • datamilch
      3
      0
      Votes
      3
      Posts
      582
      Views

      D

      @ferdinand said in SAVEDOCUMENTFLAGS_AUTOSAVE still added to the recent file list?:

      But please provide instructions on how to use your code when required in the future.

      oh shit, i'm so sorry. you're right. completly missed this one. 😬
      ...
      and of cause thanks for the explaination / clarification.

    • D

      Docked Dialog Problem with width of CUSTOMGUI_FILENAME

      Cinema 4D SDK
      • windows python 2025 • • datamilch
      6
      0
      Votes
      6
      Posts
      857
      Views

      i_mazlovI

      Hi Sebastian,

      correct, it hasn't been included into 2025.2.0. The next minor release will likely have it fixed though.

      Cheers,
      Ilia

    • D

      Message from Object or Tag to CommandData/GeDialog Plugin

      Cinema 4D SDK
      • windows 2023 python • • datamilch
      3
      0
      Votes
      3
      Posts
      620
      Views

      i_mazlovI

      Hi @datamilch,

      you can use the EVMSG_CHANGE message as a trigger to check your objects for changes. The timer approach might seem imprecise from the first glance, but can actually be used, I don't think there're any significant reasons against it. Additionally, the recent change was made to make BaseList2D being hashable. This effectively means you can operate with your objects in a dict.

      The python tag approach is the least efficient, although would still work, yes.

      You're saying your GeDialog plugin uses "mostly the ideantical userdata". If it was "identical", you could potentially use c4d.gui.DescriptionCustomGui with the SetObject function to make it point to your object. This way you can avoid hassling around all the data sync, because it is all handled as a built-in functionality of this class. This is how the attribute manager effectively works, or the Active Object Dialog as well.

      For your further postings please follow our guidelines on How to Ask Questions, namely:

      Please consolidate your questions into a singular posting by editing your last posting

      Cheers,
      Ilia

    • D

      MCOMMAND_SELECTALL and MCOMMAND_SELECTINVERSE not working?

      Cinema 4D SDK
      • python 2024 windows • • datamilch
      3
      0
      Votes
      3
      Posts
      579
      Views

      D

      @i_mazlov Thanks!
      makes sens. seems i only used the forgiving commands until now.

      the code is run in a python generator. so by returning the object, it will be inserted into the scene.

    • D

      use thicken generator inside a python generator

      Bugs
      • windows 2024 python • • datamilch
      4
      0
      Votes
      4
      Posts
      1.3k
      Views

      D

      hi @i_mazlov,
      ok, good to know.
      i also tried to insert the thicken generator into a temp_doc, activating the selections and executing passes. but that didn't work either.

    • D

      issue with inserting fieldlayers in r2024

      Bugs
      • windows python 2024 • • datamilch
      4
      0
      Votes
      4
      Posts
      1.4k
      Views

      M

      Hey thanks for the report, I indeed fix one issue with the InsertLayer but in your case it was another one, sadly there is no workaround for you (except the one you found).

      The fix will be provided in the next release.
      Cheers,
      Maxime.

    • D

      fieldlayer with variable tag

      Cinema 4D SDK
      • windows python 2023 • • datamilch
      2
      0
      Votes
      2
      Posts
      403
      Views

      D

      found the solution ... the corresponding type is called: FLweight

    • D

      Create folder in Volume Builder

      Cinema 4D SDK
      • windows python 2023 • • datamilch
      3
      0
      Votes
      3
      Posts
      572
      Views

      D

      hi @i_mazlov,
      thanks for the answer. good to know about this status / limitation.
      for my current case I found a solution without folders..

    • D

      Accessing Parameters of Filters in a Volume Builder

      Cinema 4D SDK
      • windows python 2023 • • datamilch
      3
      0
      Votes
      3
      Posts
      535
      Views

      ferdinandF

      Hey @datamilch,

      Thank you for reaching out to us and answering your own question. In general we prefer it when topics do not get deleted, so that other users can benefit from a topic. You should also not be able to delete this topic anymore since more than three hours have passed since you posted and because your topic has replies.

      Cheers,
      Ferdinand

    • D

      Set value of a fieldlayer parameter

      Cinema 4D SDK
      • windows python 2023 • • datamilch
      3
      0
      Votes
      3
      Posts
      531
      Views

      D

      hi @ferdinand,
      this solved it, thanks! I suspected, that I would have to write back the data, as in many other cases. but I didn't know how exactly.

      As for the executable code: will do so, next time!
      cheers Sebastian

    • D

      Prevent material preview update

      Cinema 4D SDK
      • windows python 2023 • • datamilch
      3
      0
      Votes
      3
      Posts
      793
      Views

      D

      hi @ferdinand,
      thanks for the information.
      found a workaround, that is good enough so far. I use the 3d-gradient in texture space and transform the texture tag matrix as I need it. the change in color will not occur that often.

    • D

      Calling BaseDocument.SetMode twice in a row leads to freezes

      Bugs
      • windows python 2024 2023 • • datamilch
      4
      0
      Votes
      4
      Posts
      1.1k
      Views

      ferdinandF

      @datamilch said in Calling BaseDocument.SetMode twice in a row leads to freezes:

      always had the feeling, that i could print feedback while it is running

      That is a misconception many users have. This is because most code usually runs very fast, so you do not realize it. Note that I also wrote Script Manager script. While it technically applies to all Python Scripting scene elements, the execution of the Python VM is there always blocking, it is much more prominent for a Script Manager script. Because there the module is only executed once and it is also okay to run scripts here which take seconds to execute. But it also applies for example to a Python Programming tag, the execution of the module is there also blocking. But because the module of a Python Programming tag is called many times - on each scene update at least once, and you are anyway in a world of hurt when your Python Programming tag module takes more than ~100 ms to run, it is not that obvious there.

      Syntax errors are evaluated before the VM actually runs because then the compilation of your code into byte code fails (which is then later interpreted by the VM). But the error is here also displayed only after the VM stopped (just as a RuntimeError which is raised by the VM and not by the compiler), but syntax errors prevent the VM from running your code in the first place.

      Cheers,
      Ferdinand

      import time def main() -> None: """Run as a Python Script Manager script to see that the execution of a scope in the Python VM is blocking. This will not print five 'A's with a stride of one second, but five 'A's after five seconds. """ for _ in range(5): print('A') time. Sleep(1) if __name__ == '__main__': main()
    • D

      Type Error when inserting geometry from a loaded file

      Cinema 4D SDK
      • python 2023 windows • • datamilch
      3
      0
      Votes
      3
      Posts
      509
      Views

      D

      @i_mazlov thanks ilia!!!

      ok that was truly obvious 😬

      actually had to use 'c4d.documents.GetActiveDocument()' to make it work in my case ...

    • D

      delete vertex from quad-poly delets the poly

      Cinema 4D SDK
      • • • datamilch
      6
      0
      Votes
      6
      Posts
      1.1k
      Views

      D

      @ferdinand thanks for your explanation and sorry for the ambiguouty!

      the second image showed what currently happens, but not what i wanted.

      so converting a quad to tri is more like reordering the verticies and leaving one out. makes sens. hope i find the time to test it next weekend ...

      finding the points is already done, but thanks for the hint. most of the time i use a little trick: select all points, shrink selection, grow selection. then points, that were only connectet to two border-verticies will not be reselectet, you can invert the selection and have the points. but border-points of n-gons will be selectet too. for these i do have a script that makes use of the neighbor function.

      1.2.2. yes i'm aware of the right-angled quad cases, and luckily they don't matter in my case. but thanks for pointing it out. i find it super cool how alert you are! appreciate it alot.

    • D

      Undo for commanddata plugin principle

      Cinema 4D SDK
      • python • • datamilch
      6
      0
      Votes
      6
      Posts
      1.1k
      Views

      J

      Hello @datamilch ,

      without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly.

      Thank you for your understanding,
      Maxon SDK Group

    • D

      set only the value of a dialog gadget

      Cinema 4D SDK
      • python • • datamilch
      6
      0
      Votes
      6
      Posts
      979
      Views

      D

      huge thanks again @m_adam!

      the trick with storing the data in a dictionary was super helpful.
      now i can jump between documents and the dialog updates properly. 😳

      cheers,
      sebastian

    • D

      how to track if the document has changed?

      Cinema 4D SDK
      • python • • datamilch
      4
      1
      Votes
      4
      Posts
      813
      Views

      M

      Hi correct, if you look at my code I do

      oldDoc = self.activeDoc

      This means oldDoc will call the activeDoc property getter. And within it I already check for IsAlive and return None if the saved document is not alive.

      @property def activeDoc(self): doc = getattr(self, '_activeDoc', None) if doc is None: return None if not doc.IsAlive(): return None return doc

      So for my use case it's fine enough, but you are right, if you store somewhere this oldDoc variable and use it latter then yes you need to check for IsAlive.

      Cheers,
      Maxime.