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. itstanthony
    3. Posts
    I
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 17
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by itstanthony

    • RE: Connect existing PBR outputs to StoreColorToAOV

      Hey Ferdinand,

      Thanks for the quick reply, that already helps clarify things.
      Looking forward to your more detailed answer next week, whenever you get a chance.

      Thanks again for your support!

      Cheers,
      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • RE: Connect existing PBR outputs to StoreColorToAOV

      Hey Ferdinand,

      Thanks again for your help, and apologies if my initial message was unclear.

      The goal is to reproduce the setup shown on the right, starting from the existing material on the left.

      The script I shared earlier builds the whole setup from scratch. What I’m actually trying to do is extend an existing Standard Material graph by generating a Store Color To AOV node that reuses the existing PBR outputs.

      Conceptually it makes sense, but I’m unsure how to best access and reuse those existing PBR outputs on a selected material using the 2025 Nodes API.

      Really appreciate your time and support!

      Cheers,
      Anthony

      2025-06-03 08_23_50-Node Editor.jpg

      posted in Cinema 4D SDK
      I
      itstanthony
    • Connect existing PBR outputs to StoreColorToAOV

      Hi everyone,

      I am writing a script that scans a Standard Material with existing PBR connections (Base Color, Roughness, etc.) and connects those outputs to a new Store Color To AOV node, based on AOVs already present in the scene.

      The goal is to mirror the current PBR setup to AOV outputs without altering the original material.

      What I am currently unsure about is how to reliably trace the existing PBR connections and wire them to the appropriate input ports of the Store Color To AOV node.

      What would be the recommended approach for this using the 2025 Nodes API?

      Below is a minimal example where everything is created from scratch:

      import c4d
      import maxon
      
      def main() -> None:
          graph: maxon.NodesGraphModelRef = maxon.GraphDescription.GetGraph(
              name="Simple PBR Material", nodeSpaceId=maxon.NodeSpaceIdentifiers.RedshiftMaterial)
      
          maxon.GraphDescription.ApplyDescription(graph,
              [
                  {
                      "$type": "Color",
                      "Basic/Name": "Base Color",
                      "Inputs/Color": maxon.Vector(1, 1, 1),
                      "$id": "base_color"
                  },
                  {
                      "$type": "Color",
                      "Basic/Name": "Metallic",
                      "Inputs/Color": maxon.Vector(0.0, 0.0, 0.0),
                      "$id": "metallic_color"
                  },
                  {
                      "$type": "Color",
                      "Basic/Name": "Roughness",
                      "Inputs/Color": maxon.Vector(0.5, 0.5, 0.5),
                      "$id": "roughness_color"
                  },
                  {
                      "$type": "Color",
                      "Basic/Name": "Normal",
                      "Inputs/Color": maxon.Vector(0.5, 0.5, 1),
                      "$id": "normal_color"
                  },
                  {
                      "$type": "Color",
                      "Basic/Name": "AO",
                      "Inputs/Color": maxon.Vector(1, 1, 1),
                      "$id": "ao_color"
                  },
                  {
                      "$type": "Color",
                      "Basic/Name": "Emissive",
                      "Inputs/Color": maxon.Vector(0, 0, 0),
                      "$id": "emissive_color"
                  },
                  {
                  "$type": "Output",
                  "Surface": {
                      "$type": "Store Color To AOV",
      
                      "AOV Input 0": "#base_color",
                      "AOV Name 0": "BaseColor",
      
                      "AOV Input 1": "#metallic_color",
                      "AOV Name 1": "Metallic",
      
                      "AOV Input 2": "#roughness_color",
                      "AOV Name 2": "Roughness",
      
                      "AOV Input 3": "#normal_color",
                      "AOV Name 3": "Normal",
      
                      "AOV Input 4": "#ao_color",
                      "AOV Name 4": "AO",
      
                      "AOV Input 5": "#emissive_color",
                      "AOV Name 5": "Emissive",
      
                      "Beauty Input": {
                          "$type": "Standard Material",
      
                          "Base/Color": "#base_color",
                          "Base/Metalness": "#metallic_color",
                          "Reflection/Roughness": "#roughness_color",
                          "Geometry/Bump Map": "#normal_color",
                          "Geometry/Overall Tint": "#ao_color",
                          "Emission/Color": "#emissive_color",
                      }
                  }
              }
              ]
          )
      
      if __name__ == '__main__':
          main()
      
      

      On the left is an existing material, and on the right is the result I’m trying to achieve:
      0af0590b-05bd-4301-8ae2-083a544636ed-image.png
      Cheers,
      Anthony

      posted in Cinema 4D SDK windows python 2025
      I
      itstanthony
    • RE: Link StoreColorToAOV to Existing AOV (Python)

      Thank you very much for pointing this out.
      I knew that Cinema 4D’s UI includes a “Linear Numeric Values” button to switch between color spaces, but I wasn’t aware of how to properly handle this conversion in code until you showed me.

      Your reference to the open_color_io_2025_2.py example is really helpful for better understanding how to manage color spaces in scripts.

      Thanks again for the great insight!

      posted in Cinema 4D SDK
      I
      itstanthony
    • RE: Link StoreColorToAOV to Existing AOV (Python)

      Hey @ferdinand

      Thanks a lot for the clear explanation, it really helped. Your tip about partial descriptions completely fixed the issue.

      Also, the clarification on that confusing error message makes a lot more sense now. It’s great that it’ll be improved in a future Cinema 4D update. I really appreciate your transparency and all the work you’re doing to make this easier.

      Thanks again for your help and for taking the time to explain everything so clearly!

      Cheers,
      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • RE: Link StoreColorToAOV to Existing AOV (Python)

      Thanks @Dunhou for the pointers to redshift_id.py; it really helped me identify the ports properly.
      Also, thanks to @ferdinand for the earlier script and support—that was extremely helpful.

      I can connect standard PBR ports to storeColorToAOV without issues, but EmissionColor and OverallTint don’t connect in my test.

      However, connecting these textures directly to the material works fine.
      Could the order of connections affect their recognition? Or do these ports need to be exposed (made visible/available) before they can be connected via storeColorToAOV?

      Thanks again for your help!

      Here is a minimal example reproducing the issue:

      import c4d
      import maxon
      
      REDSHIFT_NODE_SPACE_ID = "com.redshift3d.redshift4c4d.class.nodespace"
      
      def main() -> None:
          graph: maxon.NodesGraphModelRef = maxon.GraphDescription.GetGraph(
              name="Simple PBR Material", nodeSpaceId=maxon.NodeSpaceIdentifiers.RedshiftMaterial)
      
          maxon.GraphDescription.ApplyDescription(graph,
              {
                  "$type": "Output",
                  "Surface": {
                      "$type": "Store Color To AOV",
      
                      "AOV Input 0": {
                          "$type": "Color",
                          "Inputs/Color": maxon.Vector(1, 1, 1),
                          "$id": "BaseColorNode"
                      },
                      "AOV Name 0": "BaseColor",
      
                      "AOV Input 1": {
                          "$type": "Color",
                          "Inputs/Color": maxon.Vector(0.0, 0.0, 0.0),
                          "$id": "MetallicNode"
                      },
                      "AOV Name 1": "Metallic",
      
                      "AOV Input 2": {
                          "$type": "Color",
                          "Inputs/Color": maxon.Vector(0.5, 0.5, 0.5),
                          "$id": "RoughnessNode"
                      },
                      "AOV Name 2": "Roughness",
      
                      "AOV Input 3": {
                          "$type": "Color",
                          "Inputs/Color": maxon.Vector(0.5, 0.5, 1),
                          "$id": "NormalMapNode"
                      },
                      "AOV Name 3": "Normal",
      
                      "AOV Input 4": {
                          "$type": "Color",
                          "Inputs/Color": maxon.Vector(1, 1, 1),
                          "$id": "AOColorNode"
                      },
                      "AOV Name 4": "AO",
      
                      "AOV Input 5": {
                          "$type": "Color",
                          "Inputs/Color": maxon.Vector(0, 0, 0),
                          "$id": "EmissiveColorNode"
                      },
                      "AOV Name 5": "Emissive",
      
                      "Beauty Input":  {
                          "$type": "Standard Material",
      
                          "Base/Color": "#BaseColorNode",
                          "Base/Metalness": "#MetallicNode",
                          "Reflection/Roughness": "#RoughnessNode",
                          "Geometry/Bump Map": "#NormalMapNode",
                          "Geometry/Overall Tint": "#AOColorNode",
                          "Emission/Color": "#EmissiveColorNode",
                      }
                  }
              }
          )
      
      if __name__ == '__main__':
          main()
      

      The error message:

      Traceback (most recent call last):
        File "D:\C4D Setup\scripts\PBRtoAOV\PBRtoAOV_Final.py", line 73, in <module>
          print("Matériau PBR avec AOV créé avec succès!")
          ^^^^^^
        File "D:\C4D Setup\scripts\PBRtoAOV\PBRtoAOV_Final.py", line 10, in main
          maxon.GraphDescription.ApplyDescription(graph,
        File "C:\Program Files\Maxon Cinema 4D 2025\resource\modules\python\libs\python311\maxon\frameworks\nodes.py", line 548, in ApplyDescription
          res: DataDictionary = GraphDescription._ApplyDescription(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\Maxon Cinema 4D 2025\resource\modules\python\libs\python311\maxon\decorators.py", line 495, in Auto
          ExecStaticMethod(*args)
      Exception: The input port reference 'Geometry/Overall Tint' has a value which resolves to more than one node. In:
      { <- Error in this scope ->
         $type: Standard Material
         Base/Color: #BaseColorNode
         Base/Metalness: #MetallicNode
         Reflection/Roughness: #RoughnessNode
         Geometry/Bump Map: #NormalMapNode
         Geometry/Overall Tint: #AOColorNode
         Emission/Color: #EmissiveColorNode
      }
      
      # Result with these lines commented:   
      # Geometry/Overall Tint: #AOColorNode
      # Emission/Color: #EmissiveColorNode
      

      83a21098-e6f5-4893-8c34-3ca4ced84c87-image.png

      posted in Cinema 4D SDK
      I
      itstanthony
    • RE: Link StoreColorToAOV to Existing AOV (Python)

      Hi @ferdinand,

      Thanks a lot for the clarification and fair enough about the snippet I posted earlier, I get that it might’ve caused some confusion.

      I really appreciate you taking the time to share both code examples. That gives me a much clearer starting point, and I’ll take the time to go through them and explore the API more carefully.

      Thanks again for your help!

      Cheers,
      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • RE: Link StoreColorToAOV to Existing AOV (Python)

      Hi @DunHou,

      Thanks again for your insights and for sharing your experience with the Redshift module!

      Just to clarify, I’m trying to understand how to retrieve the list of available AOVs already preconfigured in the AOV Manager, find one named “BaseColor” for example, and set it as the value for the “AOV Name 0” parameter in a Store Color To AOV node.

      I know full script solutions aren’t expected here, but if you could point me to relevant Maxon IDs or documentation to manipulate these parameters, it would be greatly appreciated.

      Thanks again for your help!
      Cheers,
      Anthony

      2025-05-21 08_02_39-Script Manager.png

      posted in Cinema 4D SDK
      I
      itstanthony
    • Link StoreColorToAOV to Existing AOV (Python)

      Cinema 4D: 2025.2.1
      Redshift: 2025.4.2

      Hi,

      In my script, I dynamically create a Store Color To AOV node and connect shader outputs to it. Everything works well except one key part:

      I'm trying to assign a custom AOV (defined in the Redshift AOV Manager)—for example, "BaseColor"—to the AOV Name field (e.g. AOV Name 0) of the node via Python.

      I'm currently using:

      aov_node.SetValue(c4d.DescID(c4d.DescLevel(1000 + index)), "BaseColor")
      

      The name appears in the dropdown UI, but it’s not actually linked dynamically to the AOV name of the Store Color To AOV node.

      Question:
      How can I properly assign dynamically a custom AOV name from the AOV Manager to the StoreColorToAOV node so it is correctly recognized during rendering?

      Thanks a lot in advance for your help!
      2025-05-20 20_24_35-Node Editor _.png

      posted in Cinema 4D SDK windows 2025
      I
      itstanthony
    • RE: C4D Python: Redshift IPR Start/Stop Control

      Hi @m_adam
      Thanks a lot for your help!

      Unfortunately, c4d.CallCommand(1040239) didn’t work on my setup (last version of C4D+Redshift)
      However, your suggestion to use the Script Log was spot on — it led me to the correct command ID for toggling the Redshift IPR:

      c4d.CallCommand(1040205)
      

      Appreciate the guidance!
      2025-04-30 21_27_32-Script Log.png

      Cheers,
      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • C4D Python: Redshift IPR Start/Stop Control

      Hi,

      I'm trying to control the Redshift IPR with Python in the latest Cinema 4D and Redshift.
      I've tried using command IDs like 1038653/1038655, 1038695/1038696, but they aren't working as expected. I know command ID 1038666 opens the IPR window, but there doesn't seem to be a way to get the window's instance to check if it's open.
      Could someone provide the correct command IDs or reliable methods to start/stop the Redshift IPR via Python?
      A working example would be very helpful!

      Thanks in advance!

      Anthony

      posted in Cinema 4D SDK python windows 2025
      I
      itstanthony
    • RE: Enables or disables all Emission in the scene

      Hi Ferdinand,

      Thanks a lot for the clear explanation and for taking the time to share the code. The part about accessing BaseVideoPost and using REDSHIFT_RENDERER_EMISSION_ENABLE was spot on. Exactly what I needed. Works perfectly!

      Really appreciate it.

      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • Enables or disables all Emission in the scene

      Hi everyone,

      I’m looking for a way to globally enable or disable all emission in a Cinema 4D scene using Redshift — ideally without having to iterate through each material. I’d like to control this via Python.

      Is there a way to access the global emission toggle through Redshift’s render overrides? (C4D+RS latest versions)

      Any pointers would be much appreciated

      Thanks in advance!

      2025-04-16 14_50_46-Cinema 4D 2025.2.0 - [Untitled 1 _] - Main.png

      posted in Cinema 4D SDK python 2025 windows
      I
      itstanthony
    • RE: Access the Output Folder path from a RS BakeSet

      Hi Ilia,

      Thanks a lot for the quick and clear reply!

      That makes sense. I had a feeling it might be a limitation of the current API. I’ll definitely follow up with the Redshift team on their forum to confirm whether there’s any workaround or future support planned for accessing those fields.

      Appreciate your help and the reference to the related thread!

      Cheers,
      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • Access the Output Folder path from a RS BakeSet

      Hi everyone,

      I'm currently working on a Python script for Cinema 4D using Redshift, and I'm trying to retrieve the Output Folder path from a RS Bakeset.

      I've tried several approaches to get the parameter ID, but so far, no luck. I haven’t been able to find the correct constant or method to access that field via Python.

      For context, I'm using the latest versions of both Cinema 4D and Redshift.

      Does anyone know how to access the Output Folder path from the Bakeset object? A parameter ID, code snippet, or even just a hint in the right direction would be greatly appreciated.

      Thanks in advance for your help!

      posted in Cinema 4D SDK 2025 python windows
      I
      itstanthony
    • RE: Automating ColorSpace Change for Textures in Redshift

      Hi Maxime,

      Thank you very much for your response and for sharing your script. I wanted to let you know that I had already given it a try by saving the colorspaces (keyed by ID) into a JSON file. It worked, but that approach wasn’t really optimized or completely effective.

      Thanks to your reply, I tested your script and only had to make a small modification to fix an error I had on my machine (the issue with “DictType” not being defined). I replaced that with the standard Dict from Python’s typing module, and now the script works like a charm!

      I really appreciate you taking the time to provide your insights and the script. It’s been extremely helpful and has moved my project forward considerably!

      Best regards,
      Anthony

      posted in Cinema 4D SDK
      I
      itstanthony
    • Automating ColorSpace Change for Textures in Redshift

      Hello everyone,
      I’m looking to automate the following process in Redshift using a Python script: change the ColorSpace of all textures in a C4D project (for example, from RAW to sRGB) with a single click. Additionally, I’d like to store the current ColorSpace values to be able to revert back to their original state, similar to how it's done in the RS Asset Manager.

      As I’m not an expert in Python, I would greatly appreciate any guidance or code examples that could help me achieve this.

      Thank you so much for your help and expertise, it’s really appreciated!

      posted in Cinema 4D SDK 2025 python windows
      I
      itstanthony