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
    • Recent
    • Tags
    • Users
    • Login

    How to get DescIDs [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 736 Views
    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.
    • H Offline
      Helper
      last edited by

      On 16/06/2015 at 00:52, xxxxxxxx wrote:

      Hi!
      I'm finding it way too difficult to get DescIds of some parameters. Even if we drag that parameter we dont know what data type it is. How the hell should i know that VISIBILITY_IN_EDITOR takes Float or Long?
      If there is any reference to it pls tell.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 16/06/2015 at 00:54, xxxxxxxx wrote:

        To read the parameter, even if you want to create a DescID instead of just plain using the integer ID
        of the parameter, you don't need to know the datatype.

        value = op[c4d.VISIBILITY_IN_EDITOR]
        value = op[c4d.DescID(c4d.DescLevel(c4d.VISIBILITY_IN_EDITOR, 0, 0))]
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 16/06/2015 at 00:58, xxxxxxxx wrote:

          No. i dont want to read it. i want to use it to create animation  tracks. I am trying to copy parameters of one animation tracks to another empty track. So i need complete DescID.
          Like for position track we use:
          1
          2
          3
          4
          5
          6
          7
          8
          9
          10
          11
          12
          |
          trackX ``= c4d.CTrack(op,
                              ``c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION,c4d.DTYPE_VECTOR,``0``),
                                         ``c4d.DescLevel(c4d.VECTOR_X,c4d.DTYPE_REAL,``0``)))
          trackY ``= c4d.CTrack(op,
                              ``c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION,c4d.DTYPE_VECTOR,``0``),
                                         ``c4d.DescLevel(c4d.VECTOR_Y,c4d.DTYPE_REAL,``0``)))
          trackZ ``= c4d.CTrack(op,
                              ``c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION,c4d.DTYPE_VECTOR,``0``),
                                         ``c4d.DescLevel(c4d.VECTOR_Z,c4d.DTYPE_REAL,``0``)))
          op.InsertTrackSorted(trackX)
          op.InsertTrackSorted(trackY)
          op.InsertTrackSorted(trackZ)

          ---|---
          _<_t_>_

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 16/06/2015 at 02:31, xxxxxxxx wrote:

            Hi,
            this should help to identify a desclevel id and the corresponding dtype:

              
              tracks = op.GetCTracks()  
              print tracks  
              for t in tracks:  
                  tr =  t.GetDescriptionID()  
                  print tr, "desc id"  
                  print tr[0],"first desc level"  
                  print tr[0].dtype  
                  print tr[0].id  
                  print tr[1],"second desc level"  
                  print tr[1].dtype  
                  print tr[1].id  
            

            Best wishes
            Martin

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 16/06/2015 at 06:40, xxxxxxxx wrote:

              Hello,

              GUI elements in Cinema 4D are often defined in resource files. These resource files are located in the "resource" folder of your installation and include both the ID of a parameter and its type. So if you are in doubt about a parameter type the corresponding resource file would tell you. Some more information on this can be found in the documentations:

              • Descriptions in Cinema 4D
              • Introduction into the GUI of Cinema 4D
              • Description Resource
              • Plugin Directory Structure

              best wishes,
              Sebastian

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 03/07/2015 at 09:32, xxxxxxxx wrote:

                Hello CreamyGiraffe,

                was your question answered?

                Best wishes,
                Sebastian

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 03/07/2015 at 10:48, xxxxxxxx wrote:

                  Yes Sebastian!
                  Thanks for prompt replies!!

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    On 10/12/2015 at 09:08, xxxxxxxx wrote:

                    Hey, I stumbled upon this post myself trying to figure out how to copy animation from one object to another with python. Could you just use GetClone to make a copy of the track instead of making a new one? I guess it is not as specific so might not be of use but just wanted to put it up.

                    tracks = objectA.GetCTracks()
                    for track in tracks:
                         clonedTrack = track.GetClone() 
                         objectB.InsertTrackSorted(clonedTrack)

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