Setting data on a particle based off data from another particle in the same cloud

142 views
Skip to first unread message

Alan Fregtman

unread,
Jul 16, 2013, 8:54:10 PM7/16/13
to XSI Mailing List
Hey guys,

Scratching my head over this...

So, I have two sets of particles. One is emitted then a second particle is born (via Clone Point) and this one gets some strand stuff. This one follows the original's motion.

I wanna align the first particle to the strands' tangent from the second particle. I got this working when it was all with one set of particle, but now that I separated them, I'm a little lost with the context.

Getting self.StrandPosition to work out the tangents sets the context to per-point and so if I set any data it does it to that original point I read the StrandPosition from, therefore I end up affecting my strandy particles, not the original.

Any idea how I can get the StrandPosition from the strandy particles and have it so when I set the Orientation I do so on the original first set of particles?

Any help appreciated.
Cheers,

   -- Alan

Ciaran Moloney

unread,
Jul 16, 2013, 9:27:22 PM7/16/13
to soft...@listproc.autodesk.com
Point ID to location >> get strand positions >> do stuff >> Set Self.Orientation



Ciaran

Alan Fregtman

unread,
Jul 16, 2013, 9:34:28 PM7/16/13
to XSI Mailing List
I thought that too, but it's not cutting it. :(

The "do stuff" part doesn't get any StrandPosition data for the points without strands. (Tried both ID to Location & Point Index to Location.)

Julian Johnson

unread,
Jul 17, 2013, 4:37:22 AM7/17/13
to soft...@listproc.autodesk.com
Hi Alan,

https://dl.dropboxusercontent.com/u/69741069/cross_querying.rar

Not sure if this is what you're after but it establishes a relationship
between the parent and the clone which enables the parent to later query
the clone's attributes and set data on itself. It's quite hacky in that
the only way I could quickly get a parent to know which particles it had
cloned was via Get Closest Points on instantiation of the clones. In
this scene the parent looks up the second strand position in the clone
and shows you the resulting vector. I tried to figure out the ID
allocation (making assumptions, for example, that the cloned particle
would have the next ID along from its parent but that didn't seem to
work) and it would be interesting to understand better how ICE allocates
IDs to clones.

On the other hand, I think it would be more elegant to do your stuff the
other way round - it's always much easier to give a clone the id of its
parent since it can directly inherit a custom attribute based on the
original particles ID and then always find it again using ID to
Location. So, in your case, maybe have the strand on the original
particle and querying that from the cloned one (using the easier ID to
Location stuff)?

Julian

Ciaran Moloney

unread,
Jul 17, 2013, 6:02:53 AM7/17/13
to soft...@listproc.autodesk.com
Maybe you're not getting the right ID to look up the strandpoints on?

Leonard Koch

unread,
Jul 17, 2013, 8:05:45 AM7/17/13
to soft...@listproc.autodesk.com
Oh, almost forgot.
Here is a picture of the ICETree.


On Wed, Jul 17, 2013 at 1:59 PM, Leonard Koch <leonard...@gmail.com> wrote:
Hey Alan,

here is a scene which implements what you're asking for.
The trick is to turn the per point stuff into arrays, use a lot of find in array nodes and to calculate the direction vector on the strand particles instead of trying to get the strand data from them and then calculating it on the other particles.
Hope this helps.
SeparatingStrandAndParticlesForAlan.jpg

Christian Keller

unread,
Jul 17, 2013, 8:07:23 AM7/17/13
to soft...@listproc.autodesk.com
If you clone the points clone the id into a new attribute, then you know which particle is the parent. And add a attribute that it's a clone. You can use that later to decide not to put orientation values on.
Build a set from you tangent, whatever values and then you can select the corresponding value from that set.

I'm not in front of a computer right now, but I'll have a quick look at it if you don't get it working.

Chris


-- 
christian keller
visual effects|direction

m +49 179 69 36 248

gesendet von meinem iDing

Leonard Koch

unread,
Jul 17, 2013, 8:29:56 AM7/17/13
to soft...@listproc.autodesk.com
Hm somehow my first email didn't get through.
The trick is to turn the per point data into arrays, use a lot of find in array nodes and to calculate the direction vector on the strand particles instead of trying to get the strand data from them and then calculating it on the other particles.
Hope this helps.
And here is the image of the ice tree used in the scene:
Inline image 1
SeparatingStrandAndParticlesForAlan.jpg

Ciaran Moloney

unread,
Jul 17, 2013, 9:28:33 AM7/17/13
to soft...@listproc.autodesk.com
I guess I don't understand the problem....why not do just ID to Location >> strand positions ? It's quick and gives you the array you need right away.


On Wed, Jul 17, 2013 at 1:29 PM, Leonard Koch <leonard...@gmail.com> wrote:
Hm somehow my first email didn't get through.
The trick is to turn the per point data into arrays, use a lot of find in array nodes and to calculate the direction vector on the strand particles instead of trying to get the strand data from them and then calculating it on the other particles.
Hope this helps.
And here is the image of the ice tree used in the scene
 

Alan Fregtman

unread,
Jul 17, 2013, 9:45:08 AM7/17/13
to XSI Mailing List
@ Julian & Leonard,
Thank you guys. I will check your scenes and explanations when I get home later.

@Ciaran,
It does, but only so for the particles with strands. Particles without strands get filtered out of the logic. So even though I can work out the orientation I need from the location StrandPosition's, when I set self.Orientation, it only sets it for the strandy particles, not the others. That's my main problem. How do I force my set on self.Orientation to be on the original particle IDs?


Grahame Fuller

unread,
Jul 17, 2013, 12:03:21 PM7/17/13
to soft...@listproc.autodesk.com
It would be easier to do this with two separate clouds. If you clone the first cloud's points on emission, then the creation order and therefore the point indices will be the same so you can use Switch Context. You can set the cloned particles' size to 0 if you want to hide them and then "trigger" them some time after emission.

Otherwise...

1. Store the ID as a custom attribute, say ParentID, before cloning. This will get cloned and establishes a correspondence between parent and child.

2. Clone.

3. Use Build Array from Set to put ParentID into an array. Find the parent's ParentID in the array. You should get an array with two indices, the one that isn't the parent is the cloned child (safe to say it will be the second one).

4. . Use Build Array from Set again to put the tangents into an array. Use the child's index to get the tangent you want.

gray

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Alan Fregtman
Sent: Wednesday, July 17, 2013 9:45 AM
To: XSI Mailing List
Subject: Re: Setting data on a particle based off data from another particle in the same cloud

@ Julian & Leonard,
Thank you guys. I will check your scenes and explanations when I get home later.

@Ciaran,
It does, but only so for the particles with strands. Particles without strands get filtered out of the logic. So even though I can work out the orientation I need from the location StrandPosition's, when I set self.Orientation, it only sets it for the strandy particles, not the others. That's my main problem. How do I force my set on self.Orientation to be on the original particle IDs?



On Wed, Jul 17, 2013 at 9:28 AM, Ciaran Moloney <moloney...@gmail.com<mailto:moloney...@gmail.com>> wrote:
I guess I don't understand the problem....why not do just ID to Location >> strand positions ? It's quick and gives you the array you need right away.

On Wed, Jul 17, 2013 at 1:29 PM, Leonard Koch <leonard...@gmail.com<mailto:leonard...@gmail.com>> wrote:
Hm somehow my first email didn't get through.
The trick is to turn the per point data into arrays, use a lot of find in array nodes and to calculate the direction vector on the strand particles instead of trying to get the strand data from them and then calculating it on the other particles.
Hope this helps.
Here you can download the scene: https://leonard-koch.squarespace.com/s/SeparatingStrandsAndParticlesForAlan.scn
And here is the image of the ice tree used in the scene


On Wed, Jul 17, 2013 at 2:07 PM, Christian Keller <chri...@me.com<mailto:chri...@me.com>> wrote:
If you clone the points clone the id into a new attribute, then you know which particle is the parent. And add a attribute that it's a clone. You can use that later to decide not to put orientation values on.
Build a set from you tangent, whatever values and then you can select the corresponding value from that set.

I'm not in front of a computer right now, but I'll have a quick look at it if you don't get it working.

Chris

--
christian keller
visual effects|direction

m +49 179 69 36 248<tel:%2B49%20179%2069%2036%20248>
f +49 40 386 835 33<tel:%2B49%2040%20386%20835%2033>
chri...@me.com<mailto:chri...@me.com>

gesendet von meinem iDing

Am 17.07.2013 um 12:02 schrieb Ciaran Moloney <moloney...@gmail.com<mailto:moloney...@gmail.com>>:
Maybe you're not getting the right ID to look up the strandpoints on?

On Wed, Jul 17, 2013 at 2:34 AM, Alan Fregtman <alan.f...@gmail.com<mailto:alan.f...@gmail.com>> wrote:
I thought that too, but it's not cutting it. :(

The "do stuff" part doesn't get any StrandPosition data for the points without strands. (Tried both ID to Location & Point Index to Location.)


On Tue, Jul 16, 2013 at 9:27 PM, Ciaran Moloney <moloney...@gmail.com<mailto:moloney...@gmail.com>> wrote:
Point ID to location >> get strand positions >> do stuff >> Set Self.Orientation



Ciaran

winmail.dat

Julian Johnson

unread,
Jul 18, 2013, 12:49:49 AM7/18/13
to soft...@listproc.autodesk.com
On 17/07/2013 17:03, Grahame Fuller wrote:

3. Use Build Array from Set to put ParentID into an array. Find the parent’s ParentID in the array. You should get an array with two indices, the one that isn’t the parent is the cloned child (safe to say it will be the second one).

That step is genius, gray. Works both ways - children to parent, parent to children - and couldn't be more direct, simple or unambiguous. Definitely one for the cookbook.

Alan Fregtman

unread,
Jul 22, 2013, 1:53:55 AM7/22/13
to XSI Mailing List
Hey guys,

Thank you all who responded first of all. I had a crazy week and didn't get a chance to stop and attempt to understand your suggestions until today, which is why I didn't reply sooner.

I concur with Julian; great tip Grahame! Thanks for that.

And thank you Julian and Leonard for sending wonderful example scenes that both worked great. :D
Love this list,

   -- Alan


ps: I owe you all beers if we meet happen to meet at a future Siggraph! (or if you don't drink, an alternative beverage of your choosing.)

pingo van der brinkloev

unread,
Sep 10, 2013, 5:17:10 AM9/10/13
to soft...@listproc.autodesk.com
This should be so simple.

I need to create several packshots with only Material, but different textures - so I only have to make corrections one place - Clients, pffh. Anyway

I create a custom attribute on my object by making an ICE Tree (under modeling) with a Set Data node(Self.Texture)

I connect an Integer to the Value 1 (and already here it fails)

In my material I have a Color Multi Switch with all my textures controlled by an Integer_Attribute, where I can select mu Texture attribute.

Why wont this work?

My problem is somehow setting the data. The Set Data node stays red no matter what I do.

What's the trick?

Cheers!

Sandy Sutherland

unread,
Sep 10, 2013, 5:19:53 AM9/10/13
to soft...@listproc.autodesk.com
I should think the Texture in Self.Texture is a reserved name - so you
should use something else - Self.SS_texture - and use that in the render
tree.

S.

pingo van der brinkloev

unread,
Sep 10, 2013, 5:36:10 AM9/10/13
to soft...@listproc.autodesk.com
Hey, thanks, but it doesn't matter what I call it. Still wont work.

I really did read the docs.. Looks so easy.

...

pingo van der brinkloev

unread,
Sep 10, 2013, 5:57:49 AM9/10/13
to soft...@listproc.autodesk.com
And now it works. Really well!

Carry on!

Ognjen Vukovic

unread,
Sep 10, 2013, 6:48:46 AM9/10/13
to softimage
Could you not just apply the texture through the  property>texture map>texture map on a per object basis.
Assign one shader too all the objects and use a texture map lookup node, and use it to regulate the texture used in your shader on a per object basis.

Ogi.

Ognjen Vukovic

unread,
Sep 10, 2013, 6:51:21 AM9/10/13
to softimage
Sorry, Color_Map_Lookup node.
Reply all
Reply to author
Forward
0 new messages