I'm having trouble adding the addChildAddedDagPathCallback on a newly 
created node.

Writing a simple node (.py) and want to register a callback when a child is 
parented under the node.
The node at the creation time is a shape node but I want to register the 
callback to its parent transform

def postConstructor(self):
nodeFn = OpenMaya.MFnDependencyNode(self.thisMObject())
nodeFn.setName("%sShape#" % self.typeName())

dpath = OpenMaya.MDagPath()
OpenMaya.MDagPath.getAPathTo(self.thisMObject(), dpath)

dpath.transform()
self._cbchild = OpenMaya.MDagMessage.addChildAddedDagPathCallback( dpath, 
self._childAdded, nodeFn )


The transform is not recognized at the time when the callback is created so 
the path is invalid.
Any workaround? Or am I doing it wrong?

Thanks!

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to