View Full Version : Accessing artPuttyCtx functionality in batch mode


Zac256
08 August 2007, 11:05 PM
Greetings.

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,

-Zac

//==============================================================
/*!
\brief

\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;
setToolTo($ctx);

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

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

select -r $sel;
setToolTo($currentCtx);
}

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.


1