PDA

View Full Version : expression help



gaetan
02-21-2007, 09:00 AM
how to scale my obj depending the itself y position
i need something it can be cloned
thanks

dpont
02-21-2007, 09:28 AM
Graphic Editor -> expression tab,
If you apply this to the scale channel of your object
min(Sphere_01.wpos(Time).y, 1)
object is scaled to zero for y world position = 0

Denis.

dpont
02-21-2007, 10:09 AM
Of course you need to replace Sphere_01 by your object name.

Denis.

gaetan
02-21-2007, 10:30 AM
Thanks
But if I clone this object 300 times and their position are different ??
i need a expression base to self!
thanks

gaetan
02-21-2007, 10:32 AM
And my objects are driven by ParticleFX Link!

dpont
02-21-2007, 10:47 AM
Have not tried it but may be with a sub-expression
and a single "Value" line, and replace the
Sphere_01.wpos(Time).y
by the sub-expression?
In this case a Motion Node Editor could be interesting...

Denis.

dpont
02-21-2007, 11:04 AM
Sub-expression doesn't work with clones,
only Relativity use "SELF" for Picking Item.

Denis.

gaetan
02-21-2007, 11:35 AM
Yes only Relativity use "SELF", but I don't know Relativity and i can't get nothing with Relativity ???

dpont
02-21-2007, 11:58 AM
Me too, a lscript Item Motion will work,


//
// ScaleByY
//



@version 2.3
@warnings
@script motion
@name ScaleByY



create
{
setdesc("ScaleByY");

}

newtime: frame, time
{

}

process: ma, frame, time
{
obj = ma.objID; // use new IA motion object member variable

// Get positions
pos = obj.getPosition(time);

ma.set(SCALING,<pos.y,pos.y,pos.y>);

}



destroy
{
}

load: what, io
{

}

save: what, io
{

}


options
{

}

//End of Script

Denis.

gaetan
02-21-2007, 12:58 PM
Ho thanks i will try !