Hi, I am using pymel to build this window. in my Apply button I am
using lambda in the command flag:
applyButton = pm.button( height=buttonHeight, label='Apply',
command=lambda *args: _windowApply(window, False) )
In the aply function, I grab values from the window and use these
values to call another command ... my randomize command:
# get translate values
if trEnable:
trRelative = pm.radioButtonGrp('TranslateRelAbsRadio', q=True,
select=True)
trX = pm.floatSliderGrp('TranslateXslider', q=True, value=True)
trY = pm.floatSliderGrp('TranslateYslider', q=True, value=True)
trZ = pm.floatSliderGrp('TranslateZslider', q=True, value=True)
# call the randomize command
avRandom.randomTranslate((trX,trY,trZ), trRelative)
this randomize command loops the selection and apply a random value in
translate, rotate or scale.
here is the catch:
When running the randomize command on a few object, then do undo, all
the translate on all objects are undo-ed in one go.
When I run the _windowsApply() by itself (for debuging purpose), the
undo works... it undos all the translate of all the objects in one go.
BUT
When I run it by pressing my apply button (i.e the _windowsApply() is
called through the lambda function ... then the undo undo each object
one after the other instead of all of them in one go....
Anyone have any idea why that is?
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---