Transfer user data from object to Null

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???

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)