PeelSolve: Scripting

The core solver is implemented as a Mel command, “peelSolve”.  This command can be written into your own scripts. 

To get the latest Mel options, run “peelSolve -h”.

To get information about the status of the license, and the locations of where the license file is looked for, run  “peelSolve -lic”

Here are the arguments:

-s|skel stringSpecify a root node (may be used more than once)
-d|debugOutput debugging data
-ns|nosolveDo not solve, just parse the scene
-lc|listChannelsList channels that the solve writes to
-lt|listTransformsList transforms the solver affects
-la|listActiveList active transform nodes
-lp|listPassiveList passive transform nodes
-i|iter intSet number of iterations
-v|versionShow version then exit
-st|start floatSet start frame
-en|end floatSet end frame
-in|inc floatSet increment amount
-r|reverseSolve backwards
-stat|statisticsShow solve statistics
-m|method int0: Matrix/Fast, 1: Scecant/Regular, 2: Descent/Slow
-ct|calibType int1: Constant, 2: Angle, 3: Iteration, 4: Angle/Iteration
-cal|calibrateDo a calibration solve (enable calib dof and disable len/trans dofs)
-c|cacheCache results
-scale|solveScale floatScale translations by a value
-f|file stringWrite solve data to file for offline solving.  Must be one -f for every -s flag if used
-rd|readDirectRead fcurve data directly, rather than evaluating the scenegraph
-ref|refineRead keys  and resolve from existing keyframe for improvement
-gs|gradientSamples intNumber of samples to take during gradient estimation; 1, 2, 4.

Mel Examples

// Solve a single frame and don't write keys
peelSolve -s joint1

// Return list of active joints – always use eval, not ...
string $jointList = eval("peelSolve -s joint1 -nosolve -la");

// Solve a frame range
peelSolve -s joint1 -st 1 -en 100 -in 1

// Solve to a file for offline solving
peelSolve -s joint1 -st 1 -en 100 -inc 1 -f "c:\joint1_solve.xml"

// Select all passive joints using the roots specified by the
// Options node
string $roots[] = getAttr("peelSolveOptions.rootNodes");
if(size($roots)==0) error("No skeleton top node defined");
string $ret = "";
for($i=0 ; $i< size($roots); $i++) $ret += "-s " + $roots[$i];
string $jointList[] = eval("peelSolve -lp " + $ret);
select $jointList;