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

    Transfer user data from object to Null

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 197 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 13/05/2014 at 01:44, xxxxxxxx wrote:

      Say I have an object "Cube" and I have created userdata with an Xpresso Tag for it:

      Slider_01 - "scale"
      Slider_02 - "deform"

      Then I create a Null object with a Python Tag. How do I transfer the userdata from the cube to the null auto style so I can work the sliders from the null and the cube???

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

        On 13/05/2014 at 23:26, xxxxxxxx wrote:

        Ok I have figured it out if someone needs it  _<_img src="http://www.c4dcafe.com/ipb/public/style_emoticons/default/thisrocks.gif" border="0" alt=":thisrocks:" title=":thisrocks:" /_>_

        Here is the code:

        import c4d
        from c4d import gui

        def main() :
            
            target = doc.SearchObject("Null")          #The null I want to transfer the userdata to
            obj = doc.SearchObject("Controls")       #The userdata I want to transfer
                
            for id, bc in obj.GetUserDataContainer() :
              
              target.SetUserDataContainer(id, bc)

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