PDA

View Full Version : rgbPP colours with in a hue for sand explosion


HokageMegatron
05-16-2007, 03:16 AM
Hi everyone,

I am having difficulty with the colouring of a multi point particle dynamic. I’ll give you a run down of what I have done and what its for so your get an idea of where its been going.

My idea is to have a sand dune with objects bursting out of the sand. I have gotten the simulation down nicely, but getting the colours I want is proving more difficult. The particles were made from a grid of particles and then shaped accordingly via fields over a base ‘sand dune’ mesh. After that I used the initial state solver so they would start at frame one like that.

As for the colouring I have an rgbPP on the particles with a ramp; the ramp has a 'mountain' 2d Texture node connected to one of two colour values in the ramp.
To get the randomness in the particle colours I have made an expression for the rgbUPP -
particleShape1.rgbUPP= rand(0,1);

From this I have the colours I want and everything looks good, but when I render the colours seem to flicker.
I am guessing that this is because of my rgbUPP expression is a 'runtime before dynamics' expression rather than a 'Creation’ expression.

But when I use a Creation expression it doesn’t affect the particles as they are already born in the scene.

Can anyone help shed light on to my problem? Or suggest a different method of get the same effect?
It doesn’t sound like a hard thing to ask from particles; I am basically trying to find a way to control the colours of the rgbPP so that they are random with in a hue of sand colours.


Thanks

DavidLessel
05-16-2007, 12:16 PM
try to put this workaround in the runtime rules:



int $startFrame = 1;

if(frame == $startFrame)
{
particleShape1.rgbUPP= rand(0,1);
}

mandark1011
05-16-2007, 03:27 PM
I would also check to see how you are using your ramp to colour your particles. If you have the ramp working off particle lifespan the colours will change as they grow older, if this is the case try instead to assign it to mass or a customPP att that has a range from 0 to 1 that doesnt change over lifespan

HokageMegatron
05-16-2007, 11:42 PM
Thanks guys!

With both your help i was able to fix it!
thanks David Lessél for that script really helped me out, i am kind of new to the dynamics side of Maya.
Thanks to mandark1011 i checked those settings and i think you were right so changed them too!

Cheers

Dan!

CGTalk Moderation
05-16-2007, 11:42 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.