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

    Topics created by DavidWeidemann

    • D

      Get Description IDs for all ports (exposed, unexposed) of a GvNode

      Cinema 4D SDK
      • r25 python windows • • DavidWeidemann
      3
      0
      Votes
      3
      Posts
      675
      Views

      D

      Thank you ferdidand,

      Sorry for not giving more contextual code...

      Yeah "potential ports" is what I would be interested in. Thanks for confirming that there is nothing in the API that would help me though!

    • D

      Attribute Error when accessing Redshift parameters

      Cinema 4D SDK
      • r25 python windows • • DavidWeidemann
      3
      0
      Votes
      3
      Posts
      940
      Views

      ferdinandF

      Hello @davidweidemann,

      Thank you for reaching out to us and solving your own question :). To give a bit of background information, parameters can be composed in Cinema 4D. The simplest example is a parameter of type c4d.Vector. You can access the relative position of an object like this:

      >>> Cube[c4d.ID_BASEOBJECT_REL_POSITION] Vector(0, 0, 0)

      But as users might want to access and animate the components of that vector individually, the vector is dealt with and represented as a parameter actually as a set of sub-channels, one for each of its components.

      >>> Cube[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_X] 0.0 >>> Cube[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Y] 0.0 >>> Cube[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Z] 0.0 >>>

      This is why DescId are composed out of up to three DescLevel. To access the component of a vector you need two DescLevel, e.g., c4d.ID_BASEOBJECT_REL_POSITION and c4d.VECTOR_X.

      And while you might not be able to deal with the enclosing parameter, you might be able to deal with its subchannels. The input and output ports of an RSColorAbs Redshift node are of type RsColorAlpha, a parameter type that is composed of a Vector and a float, so it is effectively a four-component vector. This parameter type is not exposed to the Python API, so the API has no clue what to do with it. But it can deal with the subchannels.

      # Python has no clue about that parameter type at REDSHIFT_SHADER_RSMATHABSCOLOR_INPUT. >>> RSColorAbs[c4d.REDSHIFT_SHADER_RSMATHABSCOLOR_INPUT] Traceback (most recent call last): File "console", line 1, in <module> AttributeError: Parameter value not accessible (object unknown in Python) # But we can access the subchannels which are standard types. This is a two DescLevel access >>> RSColorAbs[c4d.REDSHIFT_SHADER_RSMATHABSCOLOR_INPUT,c4d.REDSHIFT_COLORALPHA_COLOR] Vector(0, 0, 0) # We can even reach into the subchannels of a subchannel, here for example to access the red # component of the RGBA vector tuple that is represented by the type RsColorAlpha. >>> RSColorAbs[c4d.REDSHIFT_SHADER_RSMATHABSCOLOR_INPUT,c4d.REDSHIFT_COLORALPHA_COLOR, c4d.VECTOR_X] 0.0

      Cheers,
      Ferdinand

    • D

      animation disregarded after toolplugin

      Cinema 4D SDK
      • python r20 • • DavidWeidemann
      8
      0
      Votes
      8
      Posts
      1.1k
      Views

      D

      ⛅
      But I appreciate that you where trying to make things more streamlined 😊