2 To use, make sure that whatIsCmd.py is in your MAYA_PLUG_IN_PATH (and the C++
3 version is not) then do the following:
6 maya.cmds.loadPlugin("whatIsCmd.py")
11 import maya.OpenMaya
as OpenMaya
12 import maya.OpenMayaMPx
as OpenMayaMPx
16 class WhatIsCmd(OpenMayaMPx.MPxCommand):
17 kPluginCmdName =
"spWhatIs"
20 OpenMayaMPx.MPxCommand.__init__(self)
24 return OpenMayaMPx.asMPxPtr( WhatIsCmd() )
27 selectList = OpenMaya.MSelectionList()
29 OpenMaya.MGlobal.getActiveSelectionList( selectList )
31 node = OpenMaya.MObject()
32 depFn = OpenMaya.MFnDependencyNode()
34 iter = OpenMaya.MItSelectionList(selectList)
36 while (iter.isDone() == 0):
37 iter.getDependNode( node )
43 OpenMaya.MGlobal.getFunctionSetList( node, types )
45 print "Name: %s" % name
46 print "Type: %s" % node.apiTypeStr()
47 sys.stdout.write(
"Function Sets: " )
48 sys.stdout.write(
", ".join(types) +
'\n')
54 def initializePlugin(plugin):
55 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
57 pluginFn.registerCommand(
58 WhatIsCmd.kPluginCmdName, WhatIsCmd.cmdCreator
62 "Failed to register command: %s\n" % WhatIsCmd.kPluginCmdName
67 def uninitializePlugin(plugin):
68 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
70 pluginFn.deregisterCommand(WhatIsCmd.kPluginCmdName)
73 "Failed to unregister command: %s\n" % WhatIsCmd.kPluginCmdName