The easiest way of doing (I think) what you're asking is to use PyMEL as it has a really convenient interface for this including the ability to pass the expected function parameters. First import PyMEL as follows:
import pymel.core as pm Then use PyMEL's "mel" object to execute the MEL command as follows: pm.mel.sphere(r=100) Maya's MEL commands are already provided in PyMEL but if you're trying to execute a function written by others (a third party or even yourself) just follow the syntax: pm.mel.your_command(params_if_any) For more info run: help(pm.mel) Hope that helps! On Thu, Jun 18, 2020 at 12:53 AM Vishal Kadam <vishalkadam...@gmail.com> wrote: > is there any way to convert mel commands to python in maya, I'm using > ezMel2Python but it converts into pymel something like pymel.core as pm, I > dont know much about mel and python scripting just exploring, so basically > what I do is I copy the commands which is generated with in maya keep all > in sequence and convert them with ezMel2Python sometimes it works and some > times it doesn't > > or > > is there any other script for maya like if I do any action it should > generate python rather than mel command. > > please let me know if there is anything like this or any solution where I > can get python for mel commands > > hope you understand what I'm looking for > > -- > 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 python_inside_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/96b4d8b2-4a9a-42aa-81f0-56d7ea603a19o%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/96b4d8b2-4a9a-42aa-81f0-56d7ea603a19o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- "God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell -- 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 python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAP_aC5aKAnM7nJi6%2BYdn5mZM2EtoNKSovV49bsYVjnsR1gj5iQ%40mail.gmail.com.