def do_bake(self, selections):
...
...
cmds.bakeResults(
(sel_attrs if attr_names else selections),
hierarchy="both",
preserveOutsideKeys=True,
simulation=True,
time=(init_start, frame_range[1])
)
# I tried to do the following
amount = 0
for sel in selections:
if cmds.progressWindow( query=True, isCancelled=True ) :
break
# Check if end condition has been reached
if cmds.progressWindow( query=True, progress=True ) >= 100 :
break
amount = amount + 1
status_msg = "Processing: {0}".format(amount)
cmds.progressWindow(edit=True, progress=amount, status=status_msg)
cmds.progressWindow(endProgress=1)
def main():
cmds.progressWindow(
title='My Test Window',
progress=amount,
status='Processing: 0%',
isInterruptable=True
)
selections = self.check_current_selections()
parent_constrains = self.do_parent_constrain(selections)
animation_bake = self.do_bake(selections)