View Full Version : Accessing artPuttyCtx functionality in batch mode

08 August 2007, 11:05 PM

I need to access the smooth flood functionality in the artPuttyCtx in batch mode. This sample code works well in UI mode, but does nothing in batch mode.

Note that one of the local procedures is missing. The actual functionality here is not related to the question.

A solution relating to either getting a ctx to work in batch mode or accessing the functionality of smooth in artPuttyCtx will be accepted. Thanks,



\author Zachary Burns
proc _relax(string $vtx[])
// Save info
string $sel[] = `ls -sl`;
string $currentCtx = currentCtx();

// Setup smoothing
select -r $vtx;
string $ctx = artPuttyCtx();
artPuttyCtx -e -autosmooth 1 $ctx;
artPuttyCtx -e -mouldtypemouse "smooth" $ctx;

// Get position
float $xyz[] = `xform -q -ws -t $vtx`;
float $lastXYZ[] = $xyz;

// Flood smooth until the mesh basically stops moving
$lastXYZ = $xyz;
artPuttyCtx -e -clear $ctx;
$xyz = `xform -q -ws -t ($vtx)`;
while(.05 < _fDifferenceSum($xyz, $lastXYZ));

select -r $sel;

CGTalk Moderation
08 August 2007, 11:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.