60 import maya.OpenMaya
as OpenMaya
61 import maya.OpenMayaMPx
as OpenMayaMPx
64 kNodeName =
"spBasicObjectSet"
65 kCmdName =
"spBasicObjectSetTest"
69 class BasicObjectSet(OpenMayaMPx.MPxObjectSet):
71 OpenMayaMPx.MPxObjectSet.__init__(self)
74 class BasicObjectSetTest(OpenMayaMPx.MPxCommand):
76 OpenMayaMPx.MPxCommand.__init__(self)
83 setNode = self.__fDGMod.createNode(kNodeId)
92 setFn.addMembers(selList)
95 OpenMayaMPx.MPxCommand.setResult(depNodeFn.name())
103 return OpenMayaMPx.asMPxPtr(BasicObjectSet())
107 def nodeInitializer():
113 return OpenMayaMPx.asMPxPtr(BasicObjectSetTest())
116 def cmdSyntaxCreator():
121 def initializePlugin(mobject):
122 mplugin = OpenMayaMPx.MFnPlugin(mobject,
"Autodesk",
"1.0",
"Any")
124 mplugin.registerCommand(kCmdName, cmdCreator, cmdSyntaxCreator)
126 sys.stderr.write(
"Failed to register command: %s" % kCmdName)
130 mplugin.registerNode(kNodeName, kNodeId, nodeCreator, nodeInitializer, OpenMayaMPx.MPxNode.kObjectSet)
132 sys.stderr.write(
"Failed to register node: %s" % kNodeName)
137 def uninitializePlugin(mobject):
138 mplugin = OpenMayaMPx.MFnPlugin(mobject)
140 mplugin.deregisterCommand(kCmdName)
142 sys.stderr.write(
"Failed to deregister command: %s" % kCmdName)
146 mplugin.deregisterNode(kNodeId)
148 sys.stderr.write(
"Failed to deregister node: %s" % kNodeName)