Hi there!
I am running this code, and when I run the last line, the locator B desapeared from outliner… how can parent the locator B to the world?
import maya.api.OpenMaya as new_om
def getMObject(node):
selList = new_om.MSelectionList()
selList.add(node)
return selList.getDependNode(0)
cmds.spaceLocator(name="A")
cmds.spaceLocator(name="B")
A_MObj = getMObject("A")
B_MObj = getMObject("B")
parentNode_B_to_A = new_om.MFnDagNode(A_MObj)
parentNode_B_to_A.addChild(B_MObj)
parentNode_B_to_A.removeChild(B_MObj)
thanks a lot!