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 a Joint Object from a tag

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 234 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 25/03/2014 at 09:18, xxxxxxxx wrote:

      So I am coding a python tag plugin and I have a text box that I can drag a joint object to, but how do I pull that data from the text box in code.  What type of object should I use to get that data?  This is the code I have in the python file

      SOURCE_LINK = 1001
      FINAL_LINK = 1002

      def Execute(self, tag, doc, op, bt, priority, flags) :
            tag = op.GetFirstTag()
            data = tag.GetDataInstance()
            pos = op.GetAbsPos()
            self.source_cd = c4d.modules.character.CAJointObject()
            self.final_cd = c4d.modules.character.CAJointObject()
            self.source_cd = data.GetData(SOURCE_LINK)
            self.final_cd = data.GetData(FINAL_LINK)

      My plan is to take the y value of the source joint and apply it to the final joint, Is this the correct way to get that Joint object?

      Any thoughts would be greatly appreciated.
      Jimmy

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

        On 25/03/2014 at 13:36, xxxxxxxx wrote:

        So it looks as if I've found the solution in the following code.

        self.source_cd = c4d.modules.character.CAJointObject()            
               self.final_cd = c4d.modules.character.CAJointObject()

        self.source_cd = data.GetData(SOURCE_LINK)
              self.final_cd = data.GetData(FINAL_LINK)
             
              myMatrix = c4d.Matrix()
              myMatrix,len = self.source_cd.GetBone()

        Now off to learn about the Matrix object 🙂

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