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
Set attributes per point cloud
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Re: Set attributes per point cloud
self.xxx will set per-object attributes. You just need to be in the right context.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
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Set attributes per point cloud
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. : )
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
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.
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.
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Re: Set attributes per point cloud
If you plug it into Execute on Emit, that's per point.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 the Simulation Root, that's per point.
If you plug it into a port on the ICETree, that's per object.

-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Set attributes per point cloud
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?
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?
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Re: Set attributes per point cloud
Nope. It will multiply each element of the set self._PP by self._PO, and the result will be a per-point set.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?
-
grahamef
- Posts: 281
- Joined: 23 Jun 2009, 19:01
Re: Set attributes per point cloud
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.
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
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!!
Cool!!