Hey guys, I was wondering if I could get some help on doing a script in a way I can select all the joints on the scene and bake the simulation all in the script. I tried to grab the function in Maya but whenever I select by type it doesn't appear any commands on the expression editor.
Anyone have a guess how could I put these on a script?
Replies
Mel script to select the hierarchy is small and simple : -
baking the animation will be a 1 line script also ( depending on your requirements, this may change ) : -
BakeSimulation will be based on the defaults you have set up inside your EDIT > KEYS > BAKE SIMULATION options dialog, hierarchy must be selected as is, then whatever YOUR particular requirements are : -
so, in effect, the entire script would be ( manually select root bone first ) : -
However, ivars is correct also, to select every bone in a scene ( multiple characters ), the command
works perfectly, I guess you need to do a little testing, been some time since I did any animation related work.
EDIT : QUICK TEST, seems to work fine here, just tested two characters seperately animated in the same scene ( no manual preselection needed ) : -
based on this setup in my bake simulation options dialog : -
i use this for example mostly for exporting animations
global proc dm_bakeANI4export ()
{
// select Bones which will be baked
select -r -hierarchy |Bone_ROOT;
// bake job
doBakeSimulationArgList 3 { "1","0","10","1","0","1","1","1","0","0","animatio4nList","0" };
// select stuff which will be deleted for export
select -r TOPCTRL;
// delete that stuff, here ya go
doDelete;
performCleanUpSceneForEverything;
select -cl ;
select -r `ls -type geometryShape`;
doDelete;
}