I have created a test case:
names = ['A01', 'A02', 'B01', 'B02']
def test_bakeResults(test_grp):
if test_grp == 'A':
loc01_name = names[0]
loc02_name = names[1]
else:
loc01_name = names[2]
loc02_name = names[3]
loc01 = cmds.spaceLocator(name=loc01_name)
cmds.setKeyframe(loc01)
loc02 = cmds.spaceLocator(name=loc02_name)
cmds.parentConstraint(loc02, loc01)
cmds.currentTime(1)
cmds.setKeyframe('{0}.translateZ'.format(loc02_name))
cmds.currentTime(10)
cmds.move(5, z=True)
cmds.setKeyframe('{0}.translateZ'.format(loc02_name))
if test_grp == 'A':
cmds.bakeResults(
'|{0}'.format(loc01_name),
simulation=True,
time=(3, 5),
preserveOutsideKeys=True
)
cmds.group(loc02_name, loc01_name, name='python')
else:
from maya import mel
mel.eval('bakeResults -t (3+ ":" + 5) -sm true -hi both -at tz {0}'.
format(loc01_name))
cmds.group(loc02_name, loc01_name, name='mel')
test_bakeResults('A')
test_bakeResults('B')
In the above test case, check out both `A01` and `B01` and I am trying to
get `B01` scenario.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/3771970a-ad20-44c5-b111-4961f777c884%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.