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

    GvNode parameters

    Cinema 4D SDK
    python
    2
    5
    909
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Aeoll
      last edited by Manuel

      Hi,

      I'd like to retrieve parameter information from Redshift Shader nodes.

      So far I've gota BaseContainer and then accessed IDs and values with GvNode.GetIndexId() and GvNode.Get DataId()

      1. The returned IDs are numbers e.g 10047. How can I retrieve it's corresponding variable name e.g c4d.REDSHIFT_SHADER_MATERIAL_SHADOW_OPACITY

      2. How can I retrieve further information about the parameter (It's Description?) to find it's default value, min/max values, label etc?

      Thanks

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by Manuel

        Hello and thanks for the question,

        First, for your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here.

        • Q&A New Functionality.
        • How to Post Questions especially the tagging part.

        I've added the tags and marked this thread as a question so when you considered it as solved, please change the state 🙂


        Thanks to @m_adam you can have a look at this github repository where you will find some useful information.

        Let's answer the second question first because that maybe answer the first.
        Once you have your GvNode you can retrieve the description of that node using

            desc =    node.GetDescription(c4d.DESCFLAGS_DESC_NONE)
            for bc, paramid, groupid in  desc:
                print bc[c4d.DESC_DEFAULT], bc[c4d.DESC_NAME], bc[c4d.DESC_IDENT], paramid, groupid
        

        In the BaseContainer you can have information using DESC_xxxx ids

        Sometimes it can be strange to retrieve the min/max value (it's often the min max value of the data type, so you have to use DESC_MINSLIDER)

        DESC_IDENT, DESC_IDENT_ORIGIN can be interesting to answer your question 1 because it stores the resource identifier.

        Another trick can be to retrieve all Symbol that have REDSHIFT in his name with something like this

        rsSym = filter(lambda x: "REDSHIFT" in x , dir(c4d))
        print rsSym
        

        Cheers
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        A 1 Reply Last reply Reply Quote 1
        • A
          Aeoll @Manuel
          last edited by

          @m_magalhaes Thank you, this is very helpful and does what I was looking for!

          I can't seem to find GetDescription() in the API docs for GvNode or BaseList2D. Would there be a reason for this?

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            it's coming from C4DAtom

            I've sent an email to Redshift to ask them if we can be sure that every Symbol have "redshift" in the name.
            I'll come back if i have more information.

            Remember to mark this thread as solved once you are sure it's solved 🙂

            Cheers
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • ManuelM
              Manuel
              last edited by

              hello,

              I've got some feedback,

              You can't rely on the fact that all resource name contain Redshift. (most but not all).
              As Some parts are generated dynamically this could break your tools.

              May I ask you what are you trying to implement ?

              Cheers
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • First post
                Last post