just thinking out loud, here: is it possible to do create a command
outside of the context of a plugin? for example, is there a way to
make something like this work from any module:
import maya.cmds as cmds
import maya.OpenMayaMPx as mpx
# create a command
class scriptedCommand(mpx.MPxCommand):
def __init__(self):
print "scriptedCommand.__init__()"
mpx.MPxCommand.__init__(self)
def doIt(self, args):
print "doIt..."
def cmdCreator():
return mpx.asMPxPtr( scriptedCommand() )
# load a dummy plugin
cmds.loadPlugin( 'dummyPlugin' )
# get it's mobject and register the new command
mobject = getPluginObject( 'dummyPlugin' ) # can this be done???
mplugin = mpx.MFnPlugin(mobject)
mplugin.registerCommand( 'newCmd', cmdCreator )
or perhaps it's not even necessary to get a plugin mobject to register
a new command (wishful thinking) ?
-chad
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---