def nameToNodePlug( attrName, nodeObject ): depNodeFn = OpenMaya.MFnDependencyNode( nodeObject ) attrObject = depNodeFn.attribute( attrName ) plug = OpenMaya.MPlug( MObject, attrName ) return plugnodeObject = MObject type
MDagPath를 MObject type으로 변환하려면 MDagPath.node() Function을 사용.
dagPath = OpenMaya.MDagPath() depFn = OpenMaya.MFnDependencyNode() dagIt = OpenMaya.MItDag(OpenMaya.MItDag.kBreadthFirst, OpenMaya.MFn.kSurface) while not dagIt.isDone(): dagIt.getPath(dagPath) depFn.setObject(dagPath.node()) arrtObject = depFn.attribute('intermediateObject') plug = OpenMaya.MPlug(dagPath.node(), arrtObject) print plug.asInt() dagIt.next()뭐 대충 으런식으로 object shape attribute을 가져온다.
댓글 없음:
댓글 쓰기