Ice not taking in value from variable

Discussions about SOFTIMAGEs© Interactive Creative Environment©
ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Ice not taking in value from variable

Post by ChrB » 28 Jun 2012, 10:15

Hi,

I have a non-simulated icetree creating strands.

Each particle has a variable determing which index in a 3d vector array will be used for its position. I then want to use the indexes (in the same array) before and after to determine the orientation of the particle. But I can't get the variable to read for both the add and subtract node:

Image

Is this one of these weird instances of ICE "not thinking I'm being serious" or ? I tried also use the output from one get data node, with but same result.
Arnold for the masses!

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Ice not taking in value from variable

Post by Pancho » 28 Jun 2012, 11:52

Is particle position your custom attribute? Isn't that like pointPosition? Could it be that you try to use an already existing attribute as your own? Try it with customIndex or something like that to check whether that can be a problem. Just a guess....

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Ice not taking in value from variable

Post by Daniel Brassard » 28 Jun 2012, 12:37

Hi ChrB,

I suspect you are doing two different array evaluation, so the bottom self.ParticlePosition is starting at index 0 for each particle evaluation of the top node and not giving you the result you expect!

Try this, take the output from your top node self.ParticlePosition and feed the input of both your substract node as well as the add node.

Another way to do it is to take the output value from your add node and substract 2 then feed the bottom Select in Array node!

Be aware that, for particle index 0, you will have negative value index for your previous particle, you may need to address this case separately!

EDIT: And the last particle, your add will point to index(LAST)+1 so you will have to deal with that case as well.

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif

ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Re: Ice not taking in value from variable. Solved

Post by ChrB » 29 Jun 2012, 08:30

Thanks for your answers. much appreciated.

Turned out the problem was later down the tree. I basically orient the particle to the position before and after in the array and then mix the two results using a linear interpolate node. If the interpolate node has blend set to 0, the second value (the one reading 0 as a value) is not evaluated, and vice versa, with blend set to 1, the first value is not being evaluated. It makes perfectly sense I guess, just a question of ICE being optimized to not evaluate data that has no use.

@Daniel, thanks for the additional suggestions.
Arnold for the masses!