THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/12/2012 at 06:14, xxxxxxxx wrote:
So I tried to use the .GetChildren() and the other GeListNode stuff, but instead of getting the one node that is in there, I get an empty list or just a None. Figured i would post my code so maybe it will make it easier. I am currently testing it with just a cube at the top of the Object Manager with the said xpresso tag with the object operator inside already set up, along with a couple of spheres below to test the list function. Thanks for the help.
import c4d
from c4d import gui
_
_
_
_
def main() :
_ _
_ op = doc.GetFirstObject()_
_ tag = op.GetFirstTag()_
_ nodeMaster = tag.GetNodeMaster()_
_ selected = doc.GetActiveObjects(0)_
_ bc = c4d.BaseContainer_
_ for sel in selected:_
_ _
_ l=100 * selected.index(sel)_
_ _
_ controllerNode = nodeMaster.GetChildren()_
_ pointNode = nodeMaster.CreateNode(nodeMaster.GetRoot(), c4d.ID_OPERATOR_POINT, insert=None, x=300, y=l)_
_ objNode = nodeMaster.CreateNode(nodeMaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, insert=None, x=500, y=l)_
_ objNode[c4d.GV_OBJECT_OBJECT_ID] = sel_
_ objNode.AddPort(c4d.GV_PORT_INPUT, c4d.ID_BASEOBJECT_GLOBAL_POSITION)_
_ _
_ _
_ CPport = controllerNode[0].GetOutPort(0)_
_ OPport = pointNode.GetInPort(0)_
_ PPport = pointNode.GetOutPort(1)_
_ GPport = objNode.GetInPort(0)_
_ _
_ CPport.Connect(OPport)_
_ PPport.Connect(GPport)_
_ _
_ nodeMaster.Message(c4d.MSG_UPDATE)_
_ c4d.EventAdd()_
_if _name__=='_main__':
_ main()