Adverti horiz upsell

ezMel2Python 1.0.0 for Maya (maya script)

Translate MEL 2 Python

License
Button download
3,093 Downloads

Compatibility

  • 2016, 2015, 2014, 2013

Operating Systems

  • Windows

History

Created:07/10/2016
Last Modified:08/25/2016
File Size: 1.4 KB

Keywords

translation

Feature Request

I have revised the program UI.

Status:pending
Date:08/27/2016
Submitted by:liu bin liu bin
# -*- coding: utf-8 -*- import os import pymel.core as pm import pymel.tools.mel2py as mel2py import maya.cmds as cmds def em2pConvMel2Py(): melCmd = pm.cmdScrollFieldExecuter( 'mel2py_mel', q=1,text=1 ) pyCmd = mel2py.mel2pyStr(melCmd,pymelNamespace='pm') pyFixed = pyCmd.replace("pymel.all","pymel.core") pm.cmdScrollFieldExecuter( 'mel2py_py', e=1,text=pyFixed ) pm.tabLayout('mel2pyTab',e=1,sti=2) def mel2pyRefreshConvertButton(): if pm.tabLayout('mel2pyTab',q=1,sti=1) == 2: pm.button('mel2pyConvert',en=0,e=1) else: pm.button('mel2pyConvert',en=1,e=1) def py2melWindow(): if pm.window('mel2pyWindowUI',exists=1): pm.deleteUI('mel2pyWindowUI') pm.window('mel2pyWindowUI',s=1,mxb=1,t="mel2python") formLayoutMain=str(pm.formLayout(nd=100)) tabLayout=str(pm.tabLayout('mel2pyTab',innerMarginHeight=5,innerMarginWidth=5,cc='mel2pyRefreshConvertButton()')) pm.formLayout(formLayoutMain, e=1,af=[(tabLayout, "top", 5), (tabLayout, "left", 5), (tabLayout, "right", 5), (tabLayout, "bottom", 50)]) fLayout=str(pm.formLayout(nd=100)) object_mel=str(pm.cmdScrollFieldExecuter('mel2py_mel',sln=True,sth=0,clr=1,exa=1)) pm.formLayout(fLayout, e=1,af=[(object_mel, "top", 5), (object_mel, "left", 5), (object_mel, "right", 5), (object_mel, "bottom", 5)]) pm.setParent('..') fLayout1=str(pm.formLayout(nd=100)) object_py=str(pm.cmdScrollFieldExecuter('mel2py_py',sln=True,sth=0,sourceType='python',clr=1,exa=1)) pm.formLayout(fLayout1, e=1,af=[(object_py, "top", 5), (object_py, "left", 5), (object_py, "right", 5), (object_py, "bottom", 5)]) pm.setParent('..') pm.tabLayout(tabLayout, tl=[(fLayout, "MEL"), (fLayout1, "PYTHON")],e=1) objb1=str(pm.button("mel2pyConvert",p=formLayoutMain,c='em2pConvMel2Py()',l=">> Convert <<",w=315)) pm.formLayout(formLayoutMain, ac=(objb1, "top", 5, tabLayout),e=1, af=[(objb1, "bottom", 5), (objb1, "left", 300)]) objb2=str(pm.button(p=formLayoutMain,c='clearAlltext()',l=">> Clear All <<",w=315)) pm.formLayout(formLayoutMain, ac=[(objb2, "left", 50, objb1), (objb2, "top", 5, tabLayout)],e=1, af=[(objb2, "bottom", 5)]) pm.showWindow('mel2pyWindowUI') pm.window('mel2pyWindowUI',e=1,wh=(1280, 900)) def clearAlltext(): pm.cmdScrollFieldExecuter('mel2py_mel',e=1,clr=1) pm.cmdScrollFieldExecuter('mel2py_py',e=1,clr=1) py2melWindow()

Post a comment: