How to get DescIDs [SOLVED]



  • 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.



  • 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))]
    


  • 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_>_



  • 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



  • 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:

    best wishes,
    Sebastian



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

    Hello CreamyGiraffe,

    was your question answered?

    Best wishes,
    Sebastian



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

    Yes Sebastian!
    Thanks for prompt replies!!



  • 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)


Log in to reply