Using PPass and PPassAB appropriately
How to only affect specific particles
Changing material properties of single particles
Different generator types and their uses
Using PPass and PPassAB appropriately
PPass and PPassAB are used to access particles during their lifetime. They are basicaly iterators that will deliver all particles of the set group one after the other, or in case of PPassAB all pairs of particles created by two groups.
PPassAB must be used if you want to make particles interact with one another. Two PPass nodes won't work for this, since they are independent iterators.
This short piece of pseudocode should give you an idea on how PPass and PPassAB differ.
PPass works like this:
for n = 1 to particlecount
do something with n
next n
PPassAB works like this:
for n= 1 to groupAparticlecount
for i= 1 to groupBparticlecount
do something with n and i
next i
next n
A mixture of two PPass nodes has no relation. They are completely seperate so you will never be able to iterate through every A/B particle pair.
How to only affect specific particles
To single out particles for special attention you will need to know how they are different. Is it becaus of a property (velocity, position, age etc.) or because of their relation to something other (distance to object, distance to other particle etc.).
In both cases you should be able to create some Xpresso setup that determines if the specific condition is given or not so in the end you get a boolean value that says yes, this is the particle i want to single out or no it isn't.
The main problem is often to make up your mind on this condition.
Once you have determind if the condition is matched this boolean value is used to enable/trigger the wanted action.
Let's have a look at the possible information sources we have to base our decision on.
The very first is the particle group. This is either determined beforehand by using a PPass node with only a specific group, or by reading the group with a PGetData node and comparing it to one or more groups.
Most options to identify a particle are based on one or more of it's properties beeing read via PGetData and comparison to some other data. However there are a few things for which there are special options.
PPassAB offers a way to determine beforhand if two particles (one from group A and one from group B) are within a given distance and will only output those particles that are matching the description. this is faster and easier then using two PGetData nodes to get the positions and compare them explicitly.
Another option is PAge. Depending on the particle beeing in a certain age range or beeing born etc. you will get a boolean.
Sometimes you might like to base the decision on the number of particles within a group, this information is given by the PPass node itself. It will also give you the index of the currently active particle so you can for example change the particles group once the number of particles in a group reaches a set number.
Changing material properties of single particles
It's not possible to directly use animated materials. The only option to do this is by animating the assignment within the texture tag. To use this create two or more materials and animate their usage in the texture tag of the particle. CINEMA will morph between these materials over the particles livetime.
Different generator types and their uses
Generators are used to create new particles. They are either part of an emitter or they are emitter themselves.
Typicle examples for generators that are parts of emitters are PBorn and PStorm, where PBorn is the most simple generator. You will find examples on how to use PBorn for your own special emitter here.
While PBorn is the most flexible generator it also requires you to do all the work of placing the particle and determining it's properties. Other generators will make specific uses easier.
PStorm: This generator resembles very much the emitter known from the CINEMA 4D standard particle system. Particles will be created at a point or within an ellipse and move along the z-axis. You only need to provide a point and an alignment to make this work.
PDraw: This generator allows you to paint clouds of particles in 3D space and time. Like with PBorn you will have to take care of the most properties by yourself.
PFragment: This is a spawing generator. From one particle it will create a number of new particles which inherit parts of the geometry of the original particle. It can be used to break up structures (exploding items, dissolving bodies etc.).
PMatterwaves: This generator will create particles based on textures and light. Most properties can be set using either light or textures or both.
PBlurp: This generator is rather specific and more of a one trick pony. It does not interact well with other TP setups but it is very usefull when it comes to morphing one shape into another by disassembling an object in parts and reassembling those parts into a different object. To make this effect visualy believable you will need to use a good number of particles, since the particles themself don't morph. They are exchanged with new particles that will form the new object. PBlurb works very much like PFragment.