Hi all,
I am using Maya 2017, scripting up a code that will perform mass animation baking via from a list of controllers.
The process is as follows:
This is the code portion for my `bakeResults` command (Only targetting at translate and rotation channels):
cmds.bakeResults( (selAttrs if attr_names else selection), # This will returns <controller name>.translateX etc. hierarchy='both', preserveOutsideKeys=True, simulation=True, time=(frame_range[0], frame_range[1]), )
My selections amounts to about 165 controllers, each with varying visible attributes (translate, rotate, or custom attributes) and it takes about 20 seconds in the baking process.
I have tried using the following:
current_eval_mode = cmds.evaluationManager(query=True, mode=True)[0] if not current_eval_mode == "off": cmds.evaluationManager(mode="off") cmds.refresh(suspend=True) panelFocus = cmds.getPanel(withFocus=True) visPanels = cmds.getPanel(visiblePanels=True) modelPanels = cmds.getPanel(type="modelPanel") if modelPanels: for pan in modelPanels: finder = pan in visPanels if finder: activePanel = pan cmds.setFocus(activePanel) cmds.scriptedPanel("referenceEditorPanel1", edit=True, replacePanel=activePanel)
In which it does not seems to have help much in any speed gain.
Wondering if anyone has any other tricks on their sleeves for me to try out with? Or is this the supposed Maya action