PDA

View Full Version : Expression Nodes realtime evaluation


wajdyf
05-01-2006, 01:25 PM
Hello,

I am facing a problem with expression node evaluation .
a simple expression like pSphere1.tx=pCube1.tx; will evaluate real time (no problem)
bearing in mind that the "Evalution" drop down menu is set to "Always".

but an expression like :

float $x1[]=`xform -q -ws -t curve1.cv[6]`;
float $x2[]=`xform -q -ws -t curve2.cv[6]`;

float $xf[];
$xf[0]=($x1[0]-$x2[0])*0.5+$x2[0];
$xf[1]=($x1[1]-$x2[1])*0.5+$x2[1];
$xf[2]=($x1[2]-$x2[2])*0.5+$x2[2];


pSphere1.translateX=$xf[0];
pSphere1.translateY=$xf[1];
pSphere1.translateZ=$xf[2];


which is also not that complex , and is connected to an attribute or in this case multiple attrs, will not evaluate untill the time have changed , (scrubing).

MY Question: How do I make my expression nodes evaluate realtime, regardless of their content.
something a bit more stable than scriptJob.

Thank You

rokandic
05-01-2006, 01:35 PM
This might help:
http://forums.cgsociety.org/showthread.php?t=297118

-rok

wajdyf
05-01-2006, 02:21 PM
COMPONENT LEVEL

Yes, that makes sense , BUT how do you force evaluation on component level as in my example , I need the expression to be evaluated when the component moves (the curve CV)

Thanks

wajdyf
05-01-2006, 02:40 PM
IT WORKS !
YOU ROCK !

// force evaluation
pSphere1.translateX=curveShape1.controlPoints[6].xValue;
pSphere1.translateY=curveShape1.controlPoints[6].yValue;
pSphere1.translateZ=curveShape1.controlPoints[6].zValue;

pSphere1.translateX=curveShape2.controlPoints[6].xValue;
pSphere1.translateY=curveShape2.controlPoints[6].yValue;
pSphere1.translateZ=curveShape2.controlPoints[6].zValue;

float $x1[]=`xform -q -ws -t curve1.cv[6]`;
float $x2[]=`xform -q -ws -t curve2.cv[6]`;

float $xf[];
$xf[0]=($x1[0]-$x2[0])*0.5+$x2[0];
$xf[1]=($x1[1]-$x2[1])*0.5+$x2[1];
$xf[2]=($x1[2]-$x2[2])*0.5+$x2[2];


pSphere1.translateX=$xf[0];
pSphere1.translateY=$xf[1];
pSphere1.translateZ=$xf[2];

rokandic
05-01-2006, 06:10 PM
Glad to see it worked out :)

-rok

CGTalk Moderation
05-01-2006, 06:10 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.