u may try official format write like:

>>> import pymel.tools.mel2py as mel2py
>>> print mel2py.mel2pyStr('paneLayout -e -configuration "top3" test;')
from pymel.all import *
paneLayout('test',configuration="top3",e=1)

---- this is mel2pyStr, the mel2py likeness, maybe u write "import
pymel.tools.mel2py as mel2py" not "from pymel.all import * " that can
be fix your problem

2011/7/20  <[email protected]>:
>   Today's Topic Summary
>
> Group: http://groups.google.com/group/python_inside_maya/topics
>
> how to change this mel code to python?HELP [5 Updates]
>
>  Topic: how to change this mel code to python?HELP
>
> Ted Charlton <[email protected]> Jul 18 10:37PM -0700 ^
>
> mel2py does this:
> --
> # script created by pymel.tools.mel2py from mel file:
> # d:\usr\maya\projects\r\scenes\delete.mel
>
> from pymel.all import *
> createNode('transform',name="camera1") more...
>
> Ted Charlton <[email protected]> Jul 18 10:49PM -0700 ^
>
> Using ancient 2008 maya...
>
> more...
>
> 张宇 <[email protected]> Jul 19 10:08PM +0800 ^
>
> there is a tool convert mel to python? unbelievable ah!but there is also
> error with the last code
>
>> line 134, in wrappedCmd
>
>> # res = new_cmd(*new_args, **new_kwargs)
>
>> # RuntimeError: more...
>
> Ted Charlton <[email protected]> Jul 19 07:51AM -0700 ^
>
> Is it possible Maya 2012 behaves differently than 2008 because I cannot
> reproduce the error. Sorry.
> Attached is a screen grab of what I get running the last section. Good luck.
>
> more...
>
> Ted Charlton <[email protected]> Jul 19 12:41PM -0700 ^
>
> In maya 2012: the more expected syntax works.
> --
> from pymel.all import *
>
> createNode('transform',name="camera1")
>
> createNode('snapshotShape',name="snapshotShape1",parent="camera1")
> more...
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to