2014. 2. 14. 10:20

Particles in Dynamics Attributes



A particle system is first and foremost driven by attributes. Here are some of the attributes understood by the solvers.

The attributes are listed with the @ style prefix to give the full type. No prefix means float.

There are two suggested methods for creating attributes: POP VOP and POP Wrangle.

In a POP VOP, you can use a Bind Export VOP to write out your desired attribute.

In a POP Wrangle you can use a prototype to specify the attribute and default.

        int @id = -1;
        point @orient = {0, 0, 0, 1};

Note

The expression after the equals must be a simple constant expression.



State

@age

Time in seconds since the particle was born. To get the relative time, useful for fading effects, use @nage.

@nage

@age/@life. Implicit attribute, you cannot write to this.

@life

Time in seconds the particle is allowed to live. When @age>@life, the particle will be marked dead.

i@id

Default is -1.

A unique id for the particle that remains the same throughout a single simulation. Always use @id rather than @ptnum to avoid things changing when particles are deleted. Use findattribval() to look up the point number that corresponds with an id.



Linear Physics

v@v

Speed of the particle.

v@force

Forces on the particle for this frame.

@mass

Default is 1.

Inertia of the particle.

@spinshape

Default is 1, 1, 1.

This is multiplied by the pscale to determine the rough shape of the particle for the purpose of rotational inertia.

@drag

Default is 1.

How much the particle is dragged by any wind effects.

@dragexp

Default comes from solver parameter.

A value from 1..2. An exponent of 1 means that a particle is dragged to the wind velocity by an amount proportional to the difference in speeds. A value of 2 makes it the square of the speeds. The latter causes fast moving particles to be crushed faster, and has less influence on particles already near the wind speed.

This is used for both angular and linear drag.

@dragshape

Default is 1, 1, 1.

How much the particle is dragged in each of its local axes. Should be proportional to the cross section of the particle as seen down each axis.

@dragcenter

Default is 0, 0, 0.

If specified, drag forces will also generate torques on the particle based on the difference between the center of drag and the center of mass. The center of mass is always taking to be the particle position. This provides a local offset to the particle.

v@targetv

The local wind speed. Thought of as the goal, or target, velocity for the particle.

@airresist

How important it is to match the wind speed. This differs from the drag in that it is measuring a property of your wind force, which likely varies by space, rather than a property of the particle which remains the same as the particle moves.

@speedmin, @speedmax

Limit of the speed, in units per second, that a particle can move.

Note

Particles can temporarily exceed this due collision effects, this acts as a hard clamp every timestep after force computation.



Angular Physics

p@orient

Default is 0,0,0,1.

The orientation of the particle. This is used for stamping onto particles and for figuring out “local” forces.

Note

A particle with an orient attribute no longer is considered to be facing in the direction it is traveling. This is a quaternion.

v@w

Angular speed of the particle. This can be thought of as a vector giving the rotation axis with its magnitude being the spin rate. Spin rate is in radians per second.

v@torque

The equivalent of force for spins.

Note

No inertial tensor (the equivalent of mass) is currently supported.

v@targetw

The goal spin direction and speed for this particle.

@spinresist

How important it is to match the targetw.

@spinmin, @spinmax

Limits on the speed in radians per second that a particle can spin.



State

i@dead

A dead particle is deleted in the Reaping stage. This is done as the final stage of the solver and after the post-solve nodes, so you normally do not see any dead particles unless you turn off Reaping. @dead>0 is a way to group all dead particles. @dead==0 will group the live ones.

i@stopped

A stopped particle. It preserves its velocity, but no longer integrates its position, velocity, orientation, or angular velocity. Note that direct changes to these can still be performed - such as a Look At POP altering the orientation.

i@stuck

A stuck particle will be teleported to the position path every frame. It will inherit the velocity of the surface it is stuck to.

i@sliding

A sliding particle is allowed some motion, but it then tries to re-project itself to its position path object. It can’t transfer between objects, but it can change which primitive/uv coordinates it is on in this process.

s@pospath

This string stores a path to the object that the particle is interested in. It is the path to a file on disk or an absolute op: path.

Note

op: paths can support references to DOP objects.

i@posprim

Default is -1.

Which primitive in the path geometry whose position we wish to refer to.

v@posuv

Where on the primitive. This is NOT texture uvs, but parametric uvs. The primuv VEX command can be used to look up attributes using this.

Note

This is a vector as some primitives (such as polysoups, tetrahedrons, volumes) may store three coordinates.



Collisions

i@has_pprevious

Tracks if the stored pprevious attribute contains valid values.

v@pprevious

Stores the position of the particle on the previous frame. This is used in collision detection to ensure collisions can be registered regardless of how the particle moves.

i@hitnum

The number of times the particle collided in the last POP Collision Detect. @hitnum>0 can group all the particles that hit once. Only the first hit is stored in the attributes.

s@hitpath

The path to the object that was hit. A path to a file on disk or an op: path.

i@hitprim

Default is -1.

The primitive hit. This could be -1 if it the collision detector couldn’t figure out which primitive owns the collision. The POP Solver tries to recover from this with xyzdist.

v@hituv

The position on the primitive. NOT texture uvs, but parameteric uvs.

v@hitpos

Where the hit actually occurred. Usually a primuv on P will give you this, but if the colliding object was moving it won't.

v@hitnml

The normal of the surface at the time of the collision.

@hittime

When the collision occurred, that could be within a frame.

@hitimpulse

If collision response was done, the magnitude of the impulse imparted.

Note

This varies with timestep.

@bounce

Default is from POP Object.

When particles bounce off another object, this controls how much energy they keep in the normal direction. It is multiplied with the bounce value of the other object.

A value of 1 will keep all the energy, a value of 0 will come to a stop.

@bounceforward

Default is from POP Object.

When particles bounce off another object, this controls how much energy they keep in the tangential direction. It is multiplied by the bounce forward value ofthe other object.

A value of 1 will cause the particle to keep moving tangentially, ie, a perfect bounce. A value of 0 will bring the particles to a stop relative to the collision object in the tangential direction. A value of -1 will cause the particles to retro-reflect. A value of 2 will cause them to gain energy with every collision.

@friction

Default is from POP Object.

When particles bounce off other objects, they are slowed down in the tangential direction proportional to how hard they hit the object. This is multiplied by the friction of the other object.

A value of 0 will bounce off with no momentum transfer. Higher values will increase how much the particles will stick to the collision object’s speed.

@collisionignore

Default is “”.

Objects that match this pattern will not be collided during the POP Solver collision stage. This does not affect the POP Collision Detect, just the implicit collisions during solve. Both object names and object ids can be matched by the expression. Therefore, 0 torus* will avoid colliding with the first DOP object and all DOP objects whose names start with torus.



Misc

v@Cd

Default is 1, 1, 1.

Color of the particle.

s@instancepath

Geometry to copy onto each particle. A path to a file on disk or a op: path. If it is a file path, you can use the Mantra Point Instancing to render it. If it has op: paths, use the Instance SOP to first harden all the op: paths. File paths will remain references.

i@nearest

Default is -1.

@id of the closest particle. Could also be @ptnum if the id attribute was missing. Created by the Proximity POP. Value of -1 if nothing within the search range.

f@nearestdist

Default is -1.

Distance to the nearest particle. -1 if nothing in range. Created by the Proximity POP.

i@numproximity

Default is 0.

Number of particles within the specified range. Created by the Proximity POP.


'CGI > Houdini' 카테고리의 다른 글

Houdini 12.5 VDB Crack Tool Tutorial  (0) 2014.03.03
Creating a Gradient Ramp  (0) 2014.02.28
VEX function  (0) 2014.02.11
Houdini off the Shelf | Ocean Waves  (0) 2014.01.24
【Cloth】realistic air field by pyroFX  (0) 2014.01.07
Posted by innie