Thanks again @zipit
To make things a bit clearer, here is what I am trying to do:
Use a Python Generator to:
- Create a Connector object
- Create an Xpresso tag and assign it to the Connector object
- Create a Deformer object (eg Bend) that is a child of the Connector object
- Create a Node in the GV for the Connector Object
- Create output ports for all of the Connector object's User Data.
- Connect these ports to attributes of the Deformer object.
I'm afraid I've got so confused with trying to get this right, that my code has become really messy with lots of things commented out as I try to figure what is working and what isn't.
So I've created a new Python Generator with this code which is pretty much where I'm up to:
def main():
# Create Connector Object and insert an Xpresso tag to it
connector_obj = c4d.BaseObject(c4d.Oconnector)
tag_xpresso = c4d.BaseTag(c4d.Texpresso)
connector_obj.InsertTag(tag_xpresso)
# Get the node master and the root noode of that graphview.
gvNode_master = tag_xpresso.GetNodeMaster()
gvNode_root = gvNode_master.GetRoot()
# Create a GV Node in the node Master
gvNode_controller = gvNode_master.CreateNode(gvNode_root, c4d.ID_OPERATOR_OBJECT)
# Add port to GV Node
USERDATA_NUMBER = 1
gvNode_controller.AddPort(c4d.GV_PORT_OUTPUT, c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA, c4d.DTYPE_SUBCONTAINER, 0), c4d.DescLevel(USERDATA_NUMBER)), message=True)
return connector_obj