Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Dynamics / Emit particles from particle color?
  RSS 2.0 ATOM  

Emit particles from particle color?
Rate this thread
 
44099
 
Permlink of this thread  
avatar
  • varomix
  • Posted: 08 June 2010 11:31 AM
  • Location: Mexico / USA
  • Total Posts: 3
  • Joined: 22 August 2006 09:50 AM

Hi

I’m trying to emit particles from particles, that’s easy right, but I only wanna emit from certain particles that are colored red as an example, so if I have my first particle stream going from white to red I only wanna emit from the red particles, I think that’s clear :D

thank for the help



Replies: 0
avatar
  • THNKR
  • Posted: 08 June 2010 02:37 PM

You could use an expression like this

$rgb particleShape1.rgbPP;

$hsv = `rgb_to_hsv($rgb)`;

if 
(($hsv.x) 0.1 || ($hsv.x) 0.9) {
 
print "particle is red\n";
 
// do something
}
else {
 
print "particle is some other color\n";
}


Replies: 1
/userdata/avatar/avatar_2338.jpg

Thanks Michiel
that works great
This is what I did if anyone else needs this
added per-point emision rates then

$rgb nParticleShape1.rgbPP;

$hsv = `rgb_to_hsv($rgb)`;

if 
(($hsv.x) 0.5) {
 
//print "particle is red\n";
 //do something
 
nParticleShape1.emitter2RatePP 50;
}
else {
 
//print "particle is some other color\n";
 
nParticleShape1.emitter2RatePP 0;
}
Author: varomix

Replied: 09 June 2010 05:40 AM