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. ajcav2
    3. Topics
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 4
    • Best 1
    • Controversial 0
    • Groups 0

    Topics created by ajcav2

    • A

      How can I modify the substance shader asset filepath for a material using C4DPy?

      Cinema 4D SDK
      • python • • ajcav2
      4
      0
      Votes
      4
      Posts
      509
      Views

      ferdinandF

      Dear community,

      this question has been answered by mail and is unfortunately not available for the public in its entirety. The core of the answer was:

      if node.GetName() == 'Base Color' and node.GetTypeName() == 'C4D Shader': # Import the new substance as an asset into the document. res, asset, _ = c4d.modules.substance.ImportSubstance( doc, substance_path, c4d.SUBSTANCE_IMPORT_COPY_NO, False, False, False) if res != c4d.SUBSTANCE_IMPORT_RESULT_SUCCESS: raise IOError(f"Could not load substance file: {substance_path}") # Create a shader for the substance asset. shader = c4d.modules.substance.CreateSubstanceShader(asset) if not isinstance(shader, c4d.BaseShader): raise MemoryError("Unable to allocate substance shader.") # Insert the new shader into the material and set the shader # as the shader of the C4D Shader node. material.InsertShader(shader) node[c4d.GV_REDSHIFT_BAKER_SHADER] = shader

      Cheers,
      Ferdinand

    • A

      Modify rounded edges radius via python script

      Cinema 4D SDK
      • python • • ajcav2
      3
      0
      Votes
      3
      Posts
      365
      Views

      A

      Hi Maxime. Sorry for the confusion, I was referring to a Redshift material node, and a specific node called "Round Edge". We know that we can edit the rounded edges node via the API in Xpresso materials already, but we were trying to not use Xpresso here. Turns out, we can actually edit the Round Edge node in Redshift materials when we use c4dpy instead of executing the script by placing a .pyp file in the plugins folder. This solution works for us, so I think this issue is resolved. Thanks!