Randomize size of instanced Particles?

Randomize size of instanced Particles?

litote
Advocate Advocate
4,942 Views
12 Replies
Message 1 of 13

Randomize size of instanced Particles?

litote
Advocate
Advocate

Is there a way to randomize the size of nParticles that use instanced geometry?

 

Also, is it possible to make instanced nParticles rotate continuously without using a collision-based system like self-collsions?

0 Likes
Accepted solutions (1)
4,943 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable

If your instances are set up already, there should be a instancer tab in your attribute editor.

There you can assign Per Particle values for scale and rotation. You can add attributes and pick those to drive your scale or rotation as well. So anything should be possible with the scale or rotation per instance.

0 Likes
Message 3 of 13

litote
Advocate
Advocate

@Anonymous

 

Yes I know about the PP parameters, but I could not find one for scale and nothing that rotates particles without a colliding force to start the process.

 

I need specifics.

0 Likes
Message 4 of 13

Anonymous
Not applicable

So the way it works is you can pick any per particle attribute as in input for the instancer settings.

If none of then suit your needs you can write a new one and use that.

To write one for a random scale for example you can click the add attribute button.

Then name it something like randomScale and check per particle.

You can then right click in the field next to the new attribute and select add/edit expression.

On the creation expression you can write something like:

(name of the attribute(you can see the name in a text field above the big text field)) = rand(0.5,1);

 

Then you need to select this new attribute for scale in your instancer tab.

Rotation can get a bit more difficult what do you want to happen exactly?

Message 5 of 13

litote
Advocate
Advocate

@Anonymous

 

Hello,

 

I'm not sure how making up a name for an attribute links it to scale? Surely you have to pick a scale related item from the particle tab? Otherwise how does Maya know what you are affecting? I see nothing obvious to select for scale of instanced particles.

 

For example, if using sprites, there is a SpriteScaleX item you can select.

 

For rotation, as I said I just want to make the instanced particles rotate randomly on all axes without the need to use collisions to start the rotations.

0 Likes
Message 6 of 13

Anonymous
Not applicable

Can you tell me what part didn't work or you didn't understand about the instructions I gave about the scale. Do they have to keep spinning?

0 Likes
Message 7 of 13

litote
Advocate
Advocate

@Anonymous

 

I was very clear on what didn't make sense. You are just telling me to create an arbitrary attribute and then not explaining how to link it to the instanced particles' scale. The random expression you gave won't have any affect if Maya doesn't know what it is supposed to be affecting (particle scale). Can you post an example scene so I can see what you do exactly, or be more precise in how to set it up?

 

Yes, the particles need to keep rotating.

0 Likes
Message 8 of 13

Anonymous
Not applicable

Well I got the scale thing sorted out. The rotations are a bit complicated, I couldn't get a proper result sorry.

I attached a scene.

The thing I forgot to mention earlier was this checkbox for allow all data types. You need to check that in order to pick a non vector value in the scale dropdown in the instancer tab.

Message 9 of 13

litote
Advocate
Advocate

@Anonymous

 

Thanks for going to the trouble, however I can't open the scene file in Maya 2016 or 2017. Perhaps it is corrupt?

 

Could you give instructions step by step.

 

Thanks

0 Likes
Message 10 of 13

Anonymous
Not applicable
Accepted solution

I made it in maya 2018 so that's probably why it doesn't work.

I can give you the step by step process for the scale since the rotation didn't really work for me as well:

-Make the the extra attribute for randomScale PP (assuming that part was clear from the previous post)

-In the instance tab check allow all data types.

-Pick the newly made attribute from the dropdownmenu next to scale in the instancer tab.

0 Likes
Message 11 of 13

litote
Advocate
Advocate

@Anonymous

 

Thank you! It sunk in finally.

0 Likes
Message 12 of 13

Anonymous
Not applicable

You're welcome,

let me know if you figure out the rotation thing.

One more thing I can add that might help is that you don't have to use uniform values for the three axis.

You can make a vector variable with <<value,value,value>>

This works for rotation, scale, rgb etc..

I found some examples for you here:

https://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=GUID-BC18AA8A-5737-4091-90F0-A988958165F8

 

 

0 Likes
Message 13 of 13

litote
Advocate
Advocate

@Anonymous

 

I wasn't able to get particles to continue rotating in a way that really worked using the instancer parameters.

 

I came up with an alternative solution of grouping the instanced object and instancing the group. That way I can manually set rotation keyframes on the child item to rotate it as I please on all 3 axes. I can set random start rotations for the instances with a simple expression (like you did with Scale), so they aren't all perfectly aligned by rotation.