anna1
09-25-2012, 08:57 AM
Hey,
I am currently trying to put a Xpresso tag on an object and then creating a node of the object with x,y and z position output. I figured out how to create the tag, put it on my controller and create the node. But I am not really getting how to add the port. I looked it up in the SDK and I also found some examples, but it is not really working. The port ist simply not appearing.
This is my code:
xp_tag = c4d.BaseTag(c4d.Texpresso)
nodemaster = xp_tag.CreateNodeMaster()
node1 = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None,100,100)
until here everything is working fine. Then I read, that I have to use the DescID to get my position x:
pos_x = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_ABS_POSITION), c4d.DescLevel(c4d.VECTOR_X)
and then adding the port:
node1.AddPort(c4d.GV_PORT_OUTPUT, pos_x)
I am not getting any error message but the port does not appear either. Do I maybe have to add a flag? I tried it, but could not make it work. So if anyone of you could help me, it would be great and thank you so much
Anna
I am currently trying to put a Xpresso tag on an object and then creating a node of the object with x,y and z position output. I figured out how to create the tag, put it on my controller and create the node. But I am not really getting how to add the port. I looked it up in the SDK and I also found some examples, but it is not really working. The port ist simply not appearing.
This is my code:
xp_tag = c4d.BaseTag(c4d.Texpresso)
nodemaster = xp_tag.CreateNodeMaster()
node1 = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None,100,100)
until here everything is working fine. Then I read, that I have to use the DescID to get my position x:
pos_x = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_ABS_POSITION), c4d.DescLevel(c4d.VECTOR_X)
and then adding the port:
node1.AddPort(c4d.GV_PORT_OUTPUT, pos_x)
I am not getting any error message but the port does not appear either. Do I maybe have to add a flag? I tried it, but could not make it work. So if anyone of you could help me, it would be great and thank you so much
Anna
