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

    itstanthony

    @itstanthony

    0
    Reputation
    5
    Profile views
    17
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    itstanthony Unfollow Follow

    Latest 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