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
    • Register
    • Login
    1. Home
    2. BigRoy
    • Profile
    • Following 0
    • Followers 1
    • Topics 7
    • Posts 14
    • Best 0
    • Controversial 0
    • Groups 0

    BigRoy

    @BigRoy

    Technical Director at Colorbleed animation studios.

    0
    Reputation
    38
    Profile views
    14
    Posts
    1
    Followers
    0
    Following
    Joined Last Online
    Website www.colorbleed.nl Location Utrecht, The Netherlands Age 35

    BigRoy Unfollow Follow

    Latest posts made by BigRoy

    • Managing render settings and getting list of expected output files.

      Hi everyone,

      Consider me a newbie, so these might be stupid beginner questions but I'm hoping all of you can point me into the right direction. My Cinema4D knowledge is rather limited but I'm looking to get more knowledge on how to manage render settings from Cinema4D with Python.

      I need to query each file that would be written out if a render completes. E.g. each render pass, render take, camera, etc. that would get written out to a separate file on disk, including knowing their colorspace. In my case, knowing what a render on Deadline would spit out at the end.
      I assume that'd essentially be just all 'enabled' takes and the output filenames specified with the tokens. Does Cinema4D provide any good API to get access to this? How renderer-specific are those save filepaths? e.g. does the same logic share between Redshift and other renderers, or would it quickly become e.g. renderer specific?

      For example I think I can do:

      import c4d
      import redshift
      
      doc = c4d.documents.GetActiveDocument()
      renderdata = doc.GetActiveRenderData()
      
      # Get the Redshift videoPost and render settings
      vprs = redshift.FindAddVideoPost(renderdata, redshift.VPrsrenderer)
      existing_aovs = redshift.RendererGetAOVs(vpRS)
      

      But I'd essentially be writing logic that seems related to Redshift alone, and I'd need to then write similar code for each renderer down the line. E.g. each redshift AOV can have color processing enabled/disabled on its own in Redshift. So getting the colorspace of the AOV images for example would easily get very specific to Redshift too? Any ideas?

      Just to compare, the USD API for example has "Render Products" with "Render Vars" logic that is all shared between each renderer, and thus from the USD data alone I can detect all the output files that would be written. Preferably I can get to similar single API from a C4D scene alone.

      What I need:

      • I need to know the expected output files that would be rendered from the current scene. What's the best way to get that?
      • How do I query the takes that would be rendered?
      • Preferably I can also set the render output filepath in a managed way in the pipeline too.
      • Get the output colorspace of each image.

      Preferably all of this, without actually needing render things - so I can validate certain outputs in advance, etc.


      Just adding these links for my own future reference:

      • Getting takes data from a plug-in, do not use get active document
      posted in Cinema 4D SDK python 2025 windows
      BigRoyB
      BigRoy
    • RE: Cinema4D 2025 get user data value parameter not accessible?

      Just to confirm - skipping the unwanted entries worked absolutely fine for my needs. And I was able to reproduce the behavior in Cinema4D 2023 too if I created such user data manually and tried to access it. So - no bug or regression, just my limited knowledge.

      posted in Cinema 4D SDK
      BigRoyB
      BigRoy
    • RE: Cinema4D 2025 get user data value parameter not accessible?

      Thanks so much - of course, it may very well be that something in Cinema4D may just be generating more user data than I expected to live there. As such, I'll just perfectly ignore any values that couldn't be parsed since in my case I only care about those that I put there from Python to begin with.

      Thanks for the quick and thorough reply.

      posted in Cinema 4D SDK
      BigRoyB
      BigRoy
    • Cinema4D 2025 get user data value parameter not accessible?

      It seems that triggering this logic in Cinema4D 2025 fails:

          for description_id, base_container in obj.GetUserDataContainer():
              key = base_container[c4d.DESC_NAME]
              value = obj[description_id]
      

      Which did not error in Cinema4D 2023 and 2024.
      With an error along the lines of:

          value = obj[description_id]
                  ~~~^^^^^^^^^^^^^^^^
      AttributeError: Parameter value not accessible (object unknown in Python)
      

      Source issue reported here
      Even though this same logic worked in Cinema4D 2023 and 2024.
      Is this a regression, or does my code need updating?

      Could it be failing on trying to get a value from a Group, e.g. as one created here:

                  # Create the group
                  group_bc = c4d.GetCustomDatatypeDefault(c4d.DTYPE_GROUP)
                  group_bc[c4d.DESC_NAME] = group
                  group_bc[c4d.DESC_SHORT_NAME] = group
                  group_bc[c4d.DESC_TITLEBAR] = True
                  group_bc[c4d.DESC_GUIOPEN] = False
                  group_id = node.AddUserData(group_bc)
      

      If so, how would I detect correctly which user data should be allowed to retrieve the values from?

      posted in Cinema 4D SDK 2025 python
      BigRoyB
      BigRoy
    • RE: Alembic Export Options Not Working

      Just want to confirm here that I'm facing this same issue - only setting the negative state first and then the positive state after seems to make this work. So, thanks for the workaround.

      Here's the reported bug on our pipeline: https://github.com/ynput/ayon-cinema4d/issues/6
      And this is what fixed it: https://github.com/ynput/ayon-cinema4d/pull/8

      Looking at 'what' fixes it this most definitely sounds like a bug.
      (I tested in Cinema4D 2023.2.2 on Windows 10)

      posted in Cinema 4D SDK
      BigRoyB
      BigRoy
    • RE: Import and managing 'merged' Alembic

      Hi Ilia, this is great - thanks so much. I was able to get what I needed using the LoadDocument it seems. Am I correct in understand that the document it 'opens' is only temporary and I do not have to ensure proper deletion (in memory) of the loaded document once I'm done with it?

      Other than that - part of my code is currently here. It's more of a "spare time" open-source pipeline development because I don't use Cinema4D myself but am hoping it can become useful for others - so thanks for the details!

      posted in Cinema 4D SDK
      BigRoyB
      BigRoy
    • Merged Alembic Generator object, how to check if it is a camera?

      When importing an Alembic it turns the objects into Alembic Generators. How can I, without making the objects editable detect whether the object is a camera or not?

      print(op.GetTypeName())
      

      Prints: Alembic Generator.

      posted in Cinema 4D SDK python
      BigRoyB
      BigRoy
    • RE: Register event callbacks for "new file", "open file", "save file" (hooks?)

      @m_adam said in Register event callbacks for "new file", "open file", "save file" (hooks?):

      Regarding new document, sadly there is no way to hook into that and the best way would be to have a MessageData, list all doc by calling c4d.documents.GetFirstDocument and then iterating them by calling BaseList2D.GetNext(). Since a document is a BaseList2D you can hash them and therefor know if there is a new document.

      So that would just be running on a timer then, with the hope that I 'trigger' on it swiftly enough? Doesn't fit my needs so dedicated SceneHooks I can register application wide would be a mad helper for this!


      Aside of that - was there still a way to 'add' the python generator object into the scene without it maybe serializing into the saved file? Like have a flag that says "Do not serialize"? (Also, Scene Hooks would still be better)

      posted in Cinema 4D SDK
      BigRoyB
      BigRoy
    • Update Xref filepath without user interaction

      I'm looking to update filepath of an Xref via Python without user interaction requiring the "Yes" on a popup dialog.

      This works:

      xref.SetParameter(
          c4d.ID_CA_XREF_FILE,
          filepath,
          c4d.DESCFLAGS_SET_USERINTERACTION,
      )
      

      But that basically means I will get this pop-up dialog:
      c0a78c0f-923a-4b74-87fc-d4536cfac6f5-image.png

      However I want to do this without any user interaction in-between. How can I force the update without requiring the c4d.DESCFLAGS_SET_USERINTERACTION flag.

      How can I update the filepath without the pop-up dialog?


      This has come up often before, see here:

      • http://developers.maxon.net/forum//post/63608
      • https://developers.maxon.net/forum/topic/14319/does-xref-or-xref-simple-are-now-accessible-with-python
      • http://developers.maxon.net/forum//post/63554

      But from back in 2020 through 2022 these remained lingering with "impossible". But hey, the future is bright and now. How do we do this? (From Python)

      posted in Cinema 4D SDK python 2023 windows
      BigRoyB
      BigRoy
    • RE: Register event callbacks for "new file", "open file", "save file" (hooks?)

      And of course just after I find this Python API: Document Events topic which seems to hit close to this.

      However - it seems it requires me to create an ACTUAL object in the scene if I understand correctly - which seems odd. Is there any way that I can make this work - inside the scene file within the pipeline, but have the Cinema4D file itself remain free of this when saved and shared with someone else? (Maybe we can exclude the node from persisting with the scene on saves, or alike?)

      Also, that does not allow me to respond to a "new" document being created?

      posted in Cinema 4D SDK
      BigRoyB
      BigRoy