CGHOLIC(US)
hi, i have bunch of polygon meshes which have got converted from pfx strocks.
i want random colors on each meshes. is it possible through soup nodes.
and i am going to renders those meshes in arnold.
the meshes are <twigs and leaf> which are placed on branches.
Reply 0 0
pshipkov
I don't think you need SOuP for this.
Just a simple script to slap the vertex colors in a loop.
Are you familiar with mel or python ?
Reply 0 0
CGHOLIC(US)
Hey pshipkov thank for your reply.
can you please elaborate how can I proceed. Yes I am looking somthing like transfer vertex color to geometry.
I have seen some example in which they used color set 1 and then in aiusercolordata they wrote colorset1 but I am not clear how they transfer vertex color .
And also I seen some example for tree populate with soup scatter node. So how can I give random color on instances. My tree has own shaded but I want random ramp or some color date top on that.
Hope you understand my queries.
Thank you for prisious time.
Reply 0 0
pshipkov
If you have your geometry in place already as individual objects you can do just this:

1. select the objects
1.1 (optional) seed(12345); // to get the same random pattern, if needed
2. run this mel command
for($n in `ls -sl -o`) polyColorPerVertex -r (rand(1)) -g (rand(1)) -b (rand(1)) -a 1 -cdo $n;

Reply 0 0
noizfactory
Since you're using pfx, make sure that the vertex colors option is on when you convert the pfx to mesh. Pfx already provides color randomisation per tube so you can directly use that (and even see it in the viewport). The vertex colors are stored in a color set which you can access from the color set editor in the modeling menu. The colorSet1 is simply the default name of a new color set. You can change the name from the color set editor and provide the same name to userDataColor mode. You could add another colorSet on top of this which uses Peter's method and blend between 2 userDataColor nodes to get more variation at render time. During all of this make sure your export vertex colors option are turned ON on the pfx mesh shape node's Arnold section.
Reply 0 0
David l
If you want to do this through soupnodes I made a setup a while ago for this, it's in this thread if you need it :)

http://soup-dev.websitetoolbox.com/post/shell-node-6353778?highlight=random+colors&pid=1278119839
Reply 0 0
Reply