A place to talk about CG particles...
login.php?sid=8ade0dc09d957f12754dd5e690f6b5d8 profile.php?mode=register&sid=8ade0dc09d957f12754dd5e690f6b5d8 faq.php?sid=8ade0dc09d957f12754dd5e690f6b5d8 memberlist.php?sid=8ade0dc09d957f12754dd5e690f6b5d8 search.php?sid=8ade0dc09d957f12754dd5e690f6b5d8 index.php?sid=8ade0dc09d957f12754dd5e690f6b5d8

Orbaz Technologies Forum Index » Particle Flow Tools: Box#3 » Object's wirecolor to vertex color
Post new topic  Reply to topic View previous topic :: View next topic 
Object's wirecolor to vertex color
PostPosted: Thu Jan 16, 2014 3:58 am Reply with quote
henning
Joined: 14 Feb 2012
Posts: 4
Location: Mainz, Germany




Hi!

Is it possible to read a nearest object's wirecolor to color the particles accordingly?
I have many baked objects that I use as particles with the Birth Group operator and I'd the particles like to have their wirecolor.
View user's profile Send private message
PostPosted: Fri Jan 17, 2014 2:48 am Reply with quote
nickolay411
Joined: 12 Jan 2009
Posts: 296
Location: LA




you can query objects point color (diffuse slot) or the objects vertex color. Then feed that into the particles vertex color channel.

No way to query wireframe color. You can write a maxscript that converts an object's wire color to its diffuse color pretty easily though.

Cheers,
Nick
View user's profile Send private message AIM Address
PostPosted: Fri Jan 17, 2014 3:38 am Reply with quote
henning
Joined: 14 Feb 2012
Posts: 4
Location: Mainz, Germany




thanks nick!

I solved it with a combination of box#3 and a script operator.
In the data operator I get the inode handle from the nearest object and save it to the script integer.
In a subsequent script operator I then read the wirecolor of the object and put it to the vertex color channel (inspired by an example from Bobo):

Code:

on ChannelsUsed pCont do
(
   pCont.useAge = true
   pCont.useInteger = true
   pCont.useVector = true
   pCont.useMapping = true
)

on Init pCont do ()

on Proceed pCont do
(
   count = pCont.NumParticles()
   
   for i in 1 to count do
   (
      if  pCont.particleAge == 0 do
      (
            pCont.particleIndex = i
            try ( pCont.setParticleMapping i 0 ( (maxOps.getNodeByHandle pCont.particleInteger).wirecolor as point3 / 255.0) ) catch()
      )
   )
)

on Release pCont do ()



Screenshot - 17.01.2014 , 09_33_14.png
 Description:
 Filesize:  4.78 KB
 Viewed:  2757 Time(s)

Screenshot - 17.01.2014 , 09_33_14.png


View user's profile Send private message
PostPosted: Fri Jan 17, 2014 3:43 am Reply with quote
nickolay411
Joined: 12 Jan 2009
Posts: 296
Location: LA




that's awesome!

-N
View user's profile Send private message AIM Address
Object's wirecolor to vertex color
Orbaz Technologies Forum Index » Particle Flow Tools: Box#3
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Copyrightę 2004-2005 Orbaz Technologies, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group
phpBB Style by Vjacheslav Trushkin