On Sun, May 28, 2017, 8:12 PM Virbhadra Gupta <[email protected]> wrote:
> how i can pass python variable in mel??
> in my example mel_path in not giving what is supposed to give
> anims_path is giving proper path like "D:\del\malcolm_v109_malcolm.anim"
> but mel_path giving "d:/"
> please help me out.
>
> for obj in objs:
> object_name = renamer (obj)
> cmds.select (obj)
> anims_path = path_input+ platform_tester ()+ object_name +'.anim'
> mel_path = mel.eval ('$mel_path = python("anims_path")')
>
It could be an issue with the scope of the variable when calling python
from Mel.
You can really share variable between them in a native sense. Just
evaluating the values back and forth. Can you just string format the value
to pass it to Mel? (untested)
mel.eval ('$mel_path = "%s"' % anims_path)
> --
> 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/a81a312c-72eb-4313-acfa-12ae7de19937%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/a81a312c-72eb-4313-acfa-12ae7de19937%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/CAPGFgA0pUfF2%3DJWqUfXqAeRm4JLDYq9gM6v2L9ufk5n82%2BWp-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.