Can we see an example of how you are defining your MSyntax? Are you use
addArg()? If so you probably want to switch to using the object list
instead

http://help.autodesk.com/cloudhelp/2016/ENU/Maya-SDK/cpp_ref/class_m_syntax.html#a299f2c91c864387f1b4208e99a72631d

Justin

On Mon, Mar 6, 2017, 7:52 PM Michael Boon <[email protected]> wrote:

> Hi all, I have yet another question about arguments to Maya C++ plugins.
>
> I have a plugin that accepts flags and objects using an MSyntax and
> MArgDatabase, and everything works as expected when I call it from MEL,
> like this:
> myExportCmd -f "c:/temp" -verbose "pCube3";
>
> Calling it from Python like this works:
> maya.cmds.myExportCmd('-f', 'c:/temp', '-verbose', 'pCube3')
>
> But calling it the expected way doesn't:
> maya.cmds.myExportCmd('pCube3', f='c:/temp', verbose=True)
>
> If I do it like the last example above, the plugin gets the "pCube3"
> object string, but doesn't get any flag arguments at all.
>
> Is that expected? I've seen tutorials on writing plugins in Python that
> work correctly (like the last example above), but I can't find mention
> online of C++ plugins that do. I thought there would be mention of it not
> working, though.
>
> Thanks again!
>
> --
> 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/8efe0c53-8bfd-4c53-9cf1-7ba90939f72d%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/8efe0c53-8bfd-4c53-9cf1-7ba90939f72d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA30aHWivWEQw%2B1yPKtXyF3%2BKwnkVPeeaw6BGQ-TChzH7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to