PDA

View Full Version : connect to field on a per particle basis


thomwickes
08-28-2007, 05:46 PM
can i connect particles to a field on a per particle basis?

so a particle is only affected by a gravity if its velocity > 1

darktding
08-28-2007, 05:52 PM
sounds silly, but here is what I would do...
make two particleshapes, and when the velocity is 1, kill and transfer (emit command) that point to the other particleshape.
now you use different fields on the two particlesShapes.

Also here is another silly idea, since gravity is consistent, you keep subtracting that from the velocity of the point and when you get beyond a certain factor then skip the subtraction...

those are my quick suggestions, let me read the docs and I might get more...

thomwickes
08-28-2007, 06:04 PM
thanks for the response

yeah, i thought about just subtracting in a runtime expression - i'm currently trying to just animate some fields to get a decent look - if i cant get it looking smooth i'll try those ideas.

Thanks again!

thomwickes
08-28-2007, 06:12 PM
i'm starting to get pretty good results with:

if (magVelPP>0){
velocity += <<0,-3,0>>;
}
;

i'm just trial and erroring the number subtracted - getting there...

darktding
08-28-2007, 06:36 PM
this is me taking a wild guess, but it looks to me you might need to play with the mass and use a uniform field rather than gravity...

thomwickes
08-28-2007, 08:56 PM
i'm not using any fields anymore - just bringing the particles back down again with that runtime expression i posted. seems to be working fine now.

cheers

pascal
08-29-2007, 08:51 AM
Hello,

You can set the various field parameters, per particle.
This is taken from the docs (they will explain it better than me :)):

Work with per-particle field attributes

You can manipulate field attributes on a per-particle level. This functionality works for the case where particleShape is used as the source of the field, as well as the case where the particleShape is affected by a field. In the case where the attribute is affected by both, the value from the particleShape acting as the source of the field will take precedence.

If the particleShape is acting as the source of the field, this feature allows each field to behave its own way. If the particleShape is simply affected by a field, this feature allows each particle to be affected by a unique set of field attributes.

For more information, see particleShape node.

To apply per-particle field attributes



Apply a field to a set of particles.
In the particleShape Attribute Editor, expand the Add Dynamic Attributes section, if necessary.
Click the General button. The Add Attribute dialog box is displayed.
Create a per-particle attribute of float or vector type on the particleShape with the name fieldName_attributeLongNameOnTheField or fieldName_attributeShortNameOnTheField. The type for the per-particle attribute you use must match the attribute type on the field.
For example, create airField1_magnitude to control the magnitude on airField1.


Write an expression to control this attribute.
In the field’s Attribute Editor, go to the Special Effects tab, and turn on Apply Per Vertex.
So you could just have one attribute for the magnitude of the gravity, and change it as you wish...

Pascal.

Sagroth
08-31-2007, 02:37 PM
pascal, thanks for the tip! :thumbsup:

CGTalk Moderation
08-31-2007, 02:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.