Per Particle Attribute Maya


#1

Hi Friends,Good day to everybody,I was very New to Maya MEL Scripting. I am Creating an ground explosion with the help of instancer, all the particles is exploding with so uniform because of no mass, Iam using a Uniform field with a good direction speed. I already defined a rand value to the objects by giving an expression like float.$scale = rand (0.3,0.8)particleshape1.$scale = <<rand($scale),rand($scale),rand($scale)>> I need to define mass for the each objects to push the small size objects to much higher than the big size. but somehow i could not able to reach the correct expression, could someone please help me on this " How to define mass in per particle attributes" what is the relationship with mass with the Size of object " your help would be appreciatedThanks , Mansoor


#2

Hi Mansoor,

if you are using nParticles there are internal ramps to control radius and mass depending on radius. In the particle Size rollout select randomized id as scale input and adjust the ramp. It is a multiplier for the radius attribute above on per paricle basis. Subsequently in the dynamic properties rollout select radiusPP as input and adjust the ramp. It is a multiplier as well. This way you would need no coding.

For your expression add a general dynamic attribute (vector / per particle) to the particles, in this case with your chosen name “scale”.
In your expression the correct syntax then would be:
float $uniformScale = rand (0.3,0.8);
scale = <<$uniformScale, $uniformScale, $uniformScale>> ;
Choose “scale” in the instancer section from the scale dropdown menu.

I hope that helps.
Cheers