fileObject = MFileObject() fileObject.setRawFullName(filename) fileObject.resolvedFullName()
filename을 상대경로로 입력하면 FullPathName을 출력한다.
def nameToNodePlug( attrName, nodeObject ): depNodeFn = OpenMaya.MFnDependencyNode( nodeObject ) attrObject = depNodeFn.attribute( attrName ) plug = OpenMaya.MPlug( MObject, attrName ) return plugnodeObject = MObject type
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을 가져온다.
# Initialize the script plug-in def initializePlugin(mobject): mplugin = OpenMayaMPx.MFnPlugin(mobject) try: mplugin.registerCommand( kPluginCmdName, cmdCreator ) except: sys.stderr.write( "Failed to register command: %s\n" % kPluginCmdName ) raise