These articles will help you with creating scripts that take advantage of animBot tools and features to automate your tasks and speed up your workflow even more!


Please note that those are PYTHON commands.


Mimicking Clicks


You can add to your scripts pretty much any animBot button you can click. For example, this is the command to Nudge Right:


from animBot._api.core import CORE as ANIMBOT_CORE; ANIMBOT_CORE.trigger.nudge_nudgeRight();


In order to find those commands, click on animBot search button and look for "print command output" and click on the checkbox. 


Once you do that, animBot will print the commands in Script Editor when you use animBot tools. You can combine these commands with any other python commands. For example, the code below will select the hand control and apply Nudge Right:


from maya import cmds
from animBot._api.core import CORE as ANIMBOT_CORE;

cmds.select("batman:hand_ctrl")
ANIMBOT_CORE.trigger.nudge_nudgeRight();



Deferring commands


Commands that mimic clicks will execute with a certain delay. If you combine them with other Maya commands and rely on the execution order to be accurate, you may need to use cmds.evaldeferred, so that other commands are also executed with a delay. Please see the example below:



cmds.select("batman:hand_ctrl") #immediate
ANIMBOT_CORE.trigger.nudge_nudgeRight(); #delayed
cmds.select("spiderman:hand_ctrl") #immediate
ANIMBOT_CORE.trigger.nudge_nudgeRight(); #delayed


The command above would be executed in the following order:
select batman control, select spiderman control, nudge right, nudge right. As you can see, in this example the spiderman control would have been nudged twice, while batman's none.


Instead, you can do the following:


cmds.select("batman:hand_ctrl") #immediate
ANIMBOT_CORE.trigger.nudge_nudgeRight(); #delayed
cmds.evalDeferred(lambda: cmds.select("spiderman:hand_ctrl")) #delayed
ANIMBOT_CORE.trigger.nudge_nudgeRight(); #delayed


The command above would be executed in the following order:
select batman control, nudge right, select spiderman control, nudge right. 

By adding evalDeferred to selecting spiderman control, it gives time for batman's control to be nudged. 


If there's many commands, sometimes you might need to double or tripple defer, like so:


cmds.evalDeferred(lambda: cmds.evalDeferred(lambda: cmds.select("spiderman:hand_ctrl")))


cmds.evalDeferred(lambda: cmds.evalDeferred(lambda: cmds.evalDeferred(lambda: cmds.select("spiderman:hand_ctrl"))))

Advanced API


Starting on version 1.5.0, Ongoing releases provide a few api calls that you can pass arguments, which allow you to create Time Bookmarks, create Temp Controls, apply any slider to any custom value and more.


Please refer to the API documentation for examples.