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?
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/da684b50-5c6d-425c-a87b-e9f902ec0414%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.