Anyone know how to properly work this? Any examples or links to documentation would be appreciated.
I'm trying to return a string from my command plugin, though I'm not even sure it's possible. The string is the name of a camera that I've created.
I'd like to be able to do this:
camera = cmds.my_command()
Here's my initialize function:
def initializePlugin(mobject):
mplugin = omMPx.MFnPlugin(mobject, author, version, 'Any')
try:
cam = mplugin.registerCommand(kPluginCmdName, cmdCreator, syntaxCreator)
log.info("Successfully registered plugin: {0}".format(kPluginCmdName))
if cam:
return cam
except Exception as e:
log.critical("Failed to register command: {0}".format(kPluginCmdName))
log.critical(traceback.format_exc(e))
raise
My doIt function:
def doIt(self, args):
""" Command execution. """
arg_data = om.MArgDatabase(self.syntax(), args)
... flags parsing
# Run the turntable code here.
cam = main(...)
return cam
Am I missing something here?