Currently the user can do a bunch of tasks, copy the MEL commands from the history, and reuse them in anyway the user see's fit. That's nice but I would like to see something that automates the process of parameterizing the history. So for instance lets say I had the history
CreatePolygonCube;
setToolTo CreatePolyCubeCtx;
polyCube -ch on -o on -w 7.844204 -h 2.939679 -d 8.100816 -cuv 4 ;
// pCube1 polyCube1 //
setKeyframe "pCube1.tx";
setKeyframe "pCube1.ty";
setKeyframe "pCube1.tz";
// 1 //
currentTime 14 ;
move -r -ls -wd 0 0 -15.275024 ;
autoKeyframe;
// 1 //
currentTime 24 ;
move -r 5.878567 -9.505526 1.250578 ;
autoKeyframe;
and I wanted to turn into a function, it would look like
proc MakeSimpleAnimation(float $width, float $height, float $depth, int $positions[], int $keyframeTimes[])
{
CreatePolygonCube;
setToolTo CreatePolyCubeCtx;
polyCube -ch on -o on -w $width -h $height -d $depth -cuv 4 ;
setKeyframe "pCube1.tx";
setKeyframe "pCube1.ty";
setKeyframe "pCube1.tz";
currentTime $keyframeTimes[0] ;
move -r -ls -wd $positions[0] $positions[1] $positions[2] ;
autoKeyframe;
currentTime $keyframeTimes[1] ;
move -r $positions[3] $positions[4] $positions[5] ;
autoKeyframe;
}
give or take some of parameters.
Essentially I am applying Martin Fowler's Extract Method refactoring. Also if a default GUI could be built for entering in the paramters and calling the command, that would be ideal.