onehope
12-06-2010, 04:30 PM
Hi I'm new to python in maya and I have a problem:
I have this variable:
grouped = ['locator1', 'locator2', 'locator3']
and I want to get the top parent of grouped [0], as far as I know commands like "rootOf" or "firstParentOf" do not exist in python so I have to call them from mel like that:
from maya import mel as mm
mm.eval("rootOf(\"locator1\");")
but instead of "locator1 "If I want to use a value from a python variable like :
from maya import mel as mm
mm.eval("rootOf(grouped [0]);")
obviously I get a runtime error so
.....how can I do that??
Is there any other way to do it?
thanks
D
I have this variable:
grouped = ['locator1', 'locator2', 'locator3']
and I want to get the top parent of grouped [0], as far as I know commands like "rootOf" or "firstParentOf" do not exist in python so I have to call them from mel like that:
from maya import mel as mm
mm.eval("rootOf(\"locator1\");")
but instead of "locator1 "If I want to use a value from a python variable like :
from maya import mel as mm
mm.eval("rootOf(grouped [0]);")
obviously I get a runtime error so
.....how can I do that??
Is there any other way to do it?
thanks
D
