40 import maya.OpenMaya
as OpenMaya
41 import maya.OpenMayaMPx
as OpenMayaMPx
45 class WhatIsCmd(OpenMayaMPx.MPxCommand):
46 kPluginCmdName =
"spWhatIs"
49 OpenMayaMPx.MPxCommand.__init__(self)
53 return OpenMayaMPx.asMPxPtr( WhatIsCmd() )
65 while (iter.isDone() == 0):
66 iter.getDependNode( node )
74 print(
"Name: %s" % name)
75 print(
"Type: %s" % node.apiTypeStr())
76 sys.stdout.write(
"Function Sets: " )
77 sys.stdout.write(
", ".join(types) +
'\n')
83 def initializePlugin(plugin):
84 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
86 pluginFn.registerCommand(
87 WhatIsCmd.kPluginCmdName, WhatIsCmd.cmdCreator
91 "Failed to register command: %s\n" % WhatIsCmd.kPluginCmdName
96 def uninitializePlugin(plugin):
97 pluginFn = OpenMayaMPx.MFnPlugin(plugin)
99 pluginFn.deregisterCommand(WhatIsCmd.kPluginCmdName)
102 "Failed to unregister command: %s\n" % WhatIsCmd.kPluginCmdName