And how apply these new gradients styles to the selection of Objects ? :)
I know for apply them as random mode but with these new gradients in normal mode?
(by Michael)
script: /* Assign random styles to solids */ var styles = moi.geometryDatabase.getObjectStyles(); var breps = moi.geometryDatabase.getObjects().getBReps(); for ( var i = 0; i < breps.length; ++i ) { var brep = breps.item(i); var style_index = Math.floor(Math.random() * styles.length); brep.styleIndex = style_index; }
Surely trivial but...
works only if number of objects <= numbers of styles
how make if numbers of object are bigger than the gradients and wanted cyclic result?
(of course i can reselect the no color objects and relaunch the script but... :)
something like this ? modification of the script above :)
script: /* Assign styles to solids */ var styles = moi.geometryDatabase.getObjectStyles(); var breps = moi.geometryDatabase.getObjects().getBReps(); for ( var i = 0; i < breps.length; ++i ) { var brep = breps.item(i); var style_index = i; brep.styleIndex = style_index; }
here nice result for the gradients'style!
![](http://img19.mediafire.com/23fe482ba8e748fea70f92a02676e95ba3940989ee0a716fa220200f0b8c4dea4g.jpg) ![](http://img30.mediafire.com/dea9e98097c06b5b82ac8640e88fe366bb9ce9e7755c5cc943f01922822c0a304g.jpg)
|