Checking what controllers uses pre/post infinity

12 views
Skip to first unread message

likage

unread,
May 24, 2019, 7:03:00 PM5/24/19
to Python Programming for Autodesk Maya
What is the best way that I can check if (a) controllers are using pre/post (cycle) infinity?

Currently I am using the following:
# Get the first frame used in all controllers
first_frame = cmds.findKeyframe(controller_selections, which="first")
# Get the last frame used in all controllers
last_frame = cmds.findKeyframe(controller_selections, which="last")

# Execute my method to set key towards all controllers (see below for the cmds.bakeResults)
anim_bakeout(controller_selections, (first_frame, last_frame))

as a way to enforce all controllers within a rig are keyed at all frames.
for ctrl in controller_selections:
    cmds.bakeResults(
        ctrl,
        hierarchy="both",
        preserveOutsideKeys=True,
        simulation=True,
        time=(first_frame, last_frame)
    )


This is done so that it does not messed up the `cmds.bakeResults` should I should be baking a certain frame range.

However, while doing the above pre-checking, if my rig in scene does have a lot of controllers (eg. a creature rig which has about 300+ controllers), the process can be slow?

Reply all
Reply to author
Forward
0 new messages