On 18/11/2014 at 06:52, xxxxxxxx wrote:
Hi,
I'm working on a python script.
I want to make some expresso nodes with it.
Adding the node and a position-output port works fine, but when I try to add an object-output port it does nothing.
No errors, but no port as well.
Here is the code I use:
import c4d
from c4d import gui
#Welcome to the world of Python
def main() :
doc = c4d.documents.GetActiveDocument()
pointobject = doc.GetActiveObject()
xpressotag = c4d.BaseTag(c4d.Texpresso)
xpressotag.SetName("PointLock XPresso")
op.InsertTag(xpressotag)
nodemaster = xpressotag.GetNodeMaster()
basenode = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None, 100, 100)
basenodeobjectoutput = basenode.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_OBJECT_OPERATOR_OBJECT_OUT)
basenodepositionoutput = basenode.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_REL_POSITION)
c4d.modules.graphview.RedrawMaster(nodemaster)
c4d.EventAdd()
if __name__=='__main__':
main()
I think there isn't anything wrong with my code, and I found "GV_OBJECT_OPERATOR_OBJECT_OUT inside Applications -> CINEMA 4D R16 -> resource -> modules -> expression tag -> description -> gvobject.res
What I want is the port to be added.
Thanks in advance for your help and time!
Greetings,
Casimir