Mash change individual instanced object color based on its scale

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  4 Weeks Ago
Mash change individual instanced object color based on its scale

hi, im into a problem when i animate many cylinders with a noise texture , scaling them randomly in Y from small to tall... i would like when they are small they are red... when taller they are blue... with some red to blue mix transition for each individual cylinder...
its possible with mash control this kind of thing??
thx!
__________________
some of my works
http://vimeo.com/marckury

and website
http://thisismarc.com

and photography website
http://albums.thisismarc.com

Last edited by marckury : 4 Weeks Ago at 03:46 AM.
 
  4 Weeks Ago
maybe the color node does help...

__________________
ArtStation
 
  4 Weeks Ago
thx for the reply! but what i need its kind of link of the scale to a different shader or color , not kind of random , and i dont see any possible connection like that in that color node... kind of set driven key style , but well will keep trying!
thx
__________________
some of my works
http://vimeo.com/marckury

and website
http://thisismarc.com

and photography website
http://albums.thisismarc.com
 
  4 Weeks Ago
Depends on how many instances you have. If there not that many maybe you can use the breakout node. This lets you drive other attributes with MASH values. 
 
  2 Weeks Ago
You could use the Python node to do this easily...
Just copy and paste the below script into the Python editor, then turn on Colour Per Vertex on the Repro node and you'll have a Colour Set that can be used by a shader (e.g. aiUserColorData).
Best,
Ian



import openMASH

#initialise the MASH network data
md = openMASH.MASHData(thisNode)

#this is how to get the frame number
frame = md.getFrame()
#and this gets the number of objects in the network
count = md.count()

#set the colour based on scale 
for i in range(count):
    mult = 1.0/3.0*md.scale[i].x
    md.outColor[i].x=mult
    md.outColor[i].z=1.0-mult

#tell MASH to write the network data
md.setData()


__________________
Maya Motion Graphics Tutorials
 
  1 Week Ago
yes! exactly like that , magic of simple coding thx very much 
__________________
some of my works
http://vimeo.com/marckury

and website
http://thisismarc.com

and photography website
http://albums.thisismarc.com
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:52 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.