Hi Guys,
      this is probably one of those questions that has been asked a
million times but meh, dynamic expressions as we all know are written
in maya, as mel expressions, and to use these in python we simply
write it as MEL in brackets and all is dandy. except how do we edit
the contents of these expressions? can we even do so ? as they are MEL
scripts i am unsure. i thought the MEL.EVAL might be of help but am
unsure.

Example:....

mc.dynExpression('%s'%spriteOutParticleName,s="spriteScaleXPP=rand
(0.5,1.8);\r\nspriteScaleYPP=spriteScaleXPP;\r\nspriteSpin=rand
(-90-45);\r\nspriteTwistPP=rand(-90,90);",c=1)

basically how can i edit the values inside the  " ", inserting
variables etc. HELP !


so i surrender this to the PYTHON gods, how do we edit MEL dynamic
expresssions, through python ?

       As an offering to the said gods i present the solution to
another python/Mel problem

if you need the outliner in your GUI, which is quite useful, and need
a command to be executed whenever the user clicks on an element with
in the outliner... you can t. it will only execute mel commands. weird
no? after a few hours of pointlessly playing i ve solved this issue by
using a mel wrapper. this is just one example but the principle is the
same

import maya.cmds as cmds
import maya.mel as mel

def tester():
print "hello"

mel.eval( " global proc wrapper() { python( \"tester()\" ); } " )

cmds.window()
cmds.frameLayout( labelVisible=False )
panel = cmds.outlinerPanel()
outliner = cmds.outlinerPanel(panel, query=True,outlinerEditor=True)
cmds.outlinerEditor( outliner, edit=True, sec="wrapper()")
cmds.showWindow()

just thought i d share it
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to