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

    CTrack backtracking

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 407 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 15/01/2014 at 17:53, xxxxxxxx wrote:

      So I have a track of an object using:

      object = doc.GetActiveObject()
        
      for track in object.GetCTracks() :
      	#do something
      

      What I would like to do is get the user data the track belongs to.

      for example Position Y the track is:

      <c4d.CTrack object called 'Position . Y/Track' with ID 5350 at 0x00000026E9C7D190>
      

      What I want to get:

      Cube[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Y]
      

      How do I get from CTrack to c4d.VECTOR_Y?

      Overall what I am trying to do is create a port in an XPresso node for the attribute that is creating that curve.

      Let me know if I am not being clear enough.

      Thanks

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

        On 16/01/2014 at 00:12, xxxxxxxx wrote:

        Hi Shawn,

        You can simply call CTrack.GetDescriptionID():

        import c4d
          
        def main() :
            for track in op.GetCTracks() :
                print track, track.GetDescriptionID()
                print op[track.GetDescriptionID()]
          
        if __name__=='__main__':
            main()
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 16/01/2014 at 09:08, xxxxxxxx wrote:

          Thanks for the reply Yannick,

          using GetDescriptionID() : I get (1001,19,23) which I am guessing is the ID for the attribute that is animated. 
          I am not familiar/still new to scripting, How do you use an ID once you have one?

          to create a node im using

          Node.AddPort(c4d.GV_PORT_OUTPUT,[c4d.ID_BASEOBJECT_POSITION])
          

          I am trying to get from the found track Position.Y to c4d.ID_BASEOBJECT_POSITION_Y .

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

            On 21/01/2014 at 09:21, xxxxxxxx wrote:

            Using

            track.GetDescriptionID()[1].id
            

            I was able to get just the id of Position.Y "1001"

            I then found out that this can replace c4d.ID_BASEOBJECT_POSITION like so:

            Node.AddPort(c4d.GV_PORT_OUTPUT,[1001])
            

            Thanks for getting me on the right track!

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

              On 21/01/2014 at 11:48, xxxxxxxx wrote:

              I lied,

              A more advanced setup was getting lost with just the ID you do need all 3 numbers. Honestly not sure how it was working with just a single ID.

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