Set attributes per point cloud

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Set attributes per point cloud

Post by Pancho » 02 Nov 2012, 12:59

While the self.xxxxx way to change attributes will work on a per point basis, I want to have some values globally in the point cloud to save memory. But how do I do this if I don't want to use the actual name of the cloud, but a placeholder. Would I do this with this_model.xxxx or is there another way to do this from within the cloud?

Cheers

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: Set attributes per point cloud

Post by xsisupport » 02 Nov 2012, 13:22

Pancho wrote:While the self.xxxxx way to change attributes will work on a per point basis, I want to have some values globally in the point cloud to save memory. But how do I do this if I don't want to use the actual name of the cloud, but a placeholder. Would I do this with this_model.xxxx or is there another way to do this from within the cloud?

Cheers
self.xxx will set per-object attributes. You just need to be in the right context.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

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

Re: Set attributes per point cloud

Post by Pancho » 02 Nov 2012, 16:24

Sure, it's a matter of context, but how do I explain to the particle that self.mass is it's own mass, while this.massHuge is supposed to be the mass of its point cloud? While particles are in a cloud I retrieve all the info by self.mass, self.size, self.color, etc.

But how do I apply an attribute to the cloud itself? E.g. the cloud is called rain. While I want to write a compound which refers to this cloud as this. or self. (to avoid an explicit name for further usage), I can't imagine to bring together the self.mass from the particle with the massHuge. How does the particle realize that massHuge is not an unset attribute of itself, but the one of the point cloud?

The solution might be so easy that I can't see it right now. : )

grahamef
Posts: 281
Joined: 23 Jun 2009, 19:01

Re: Set attributes per point cloud

Post by grahamef » 02 Nov 2012, 16:44

Get Self.Mass --> Get Set Sum --> Set Self.TotalMass

Custom attributes default to the object context unless they are forced into another context, e.g., by being dependent on per-point data. In this case, Get Set Sum removes that dependency.

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: Set attributes per point cloud

Post by xsisupport » 02 Nov 2012, 16:49

Pancho wrote:Sure, it's a matter of context, but how do I explain to the particle that self.mass is it's own mass, while this.massHuge is supposed to be the mass of its point cloud? While particles are in a cloud I retrieve all the info by self.mass, self.size, self.color, etc.

But how do I apply an attribute to the cloud itself? E.g. the cloud is called rain. While I want to write a compound which refers to this cloud as this. or self. (to avoid an explicit name for further usage), I can't imagine to bring together the self.mass from the particle with the massHuge. How does the particle realize that massHuge is not an unset attribute of itself, but the one of the point cloud?

The solution might be so easy that I can't see it right now. : )
If you plug it into Execute on Emit, that's per point.
If you plug it into Execute on the Simulation Root, that's per point.
If you plug it into a port on the ICETree, that's per object.
Image
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

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

Re: Set attributes per point cloud

Post by Pancho » 02 Nov 2012, 17:13

Thanks to you both.

The mass thing was just an example. So there's no need to actually get the sum. At least not here. : )

Thanks so much for the ICE tree. That helped a lot. But one thing remains.

If I need to use self._PO (for example to multiply it with self._PP or self._PP1) during emission or simulation, do I refer to it by self._PO?

Won't ICE think (as we are are in the per point context) that this is an undefined per point attribute?

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: Set attributes per point cloud

Post by xsisupport » 02 Nov 2012, 17:32

Pancho wrote:Thanks to you both.

The mass thing was just an example. So there's no need to actually get the sum. At least not here. : )

Thanks so much for the ICE tree. That helped a lot. But one thing remains.

If I need to use self._PO (for example to multiply it with self._PP or self._PP1) during emission or simulation, do I refer to it by self._PO?

Won't ICE think (as we are are in the per point context) that this is an undefined per point attribute?
Nope. It will multiply each element of the set self._PP by self._PO, and the result will be a per-point set.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

grahamef
Posts: 281
Joined: 23 Jun 2009, 19:01

Re: Set attributes per point cloud

Post by grahamef » 02 Nov 2012, 17:33

Exactly, self.anything can be per object, per point, per polygon, per edge, per polynode, per subcurve, etc. It depends on the data itself.

You might be thinking of Houdini, which (I think) allows you to have attributes with the same name but different contexts. ICE won't allow that.

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

Re: Set attributes per point cloud

Post by Pancho » 02 Nov 2012, 17:40

O.k., thanks for the info. I thought that self in this case will turn into a per point context, although it's been created in a per object one.

Cool!!