Message 1 of 3
Script using "polyColorPerVertex"?

Not applicable
03-07-2011
07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I came up with the following Code to allow me to Select Objects in the scene and colour them in the same fashion as 3ds Max - but it is not working correctly.
It only works if I manually select the objects with the mouse and then run the script.
I added the following line at the start of the script:
When run on its' own, the above line does select everything in the scene but when added into the script at the top it does not work at all!!!
I'm closer but not there yet!!!
Any help with this would be greatly appreciated.
Later...
//put selected objects into array
string $IF_Object[] = `ls - sl`;
//Loop through each object selected and colour it
for ($x=0; $x<size($IF_Object); $x++)
{
select $IF_Object;
polyColorPerVertex -rgb `rand 0 1` `rand 0 1` `rand 0 1` -cdo ;
}
It only works if I manually select the objects with the mouse and then run the script.
I added the following line at the start of the script:
select -all;
When run on its' own, the above line does select everything in the scene but when added into the script at the top it does not work at all!!!
I'm closer but not there yet!!!
Any help with this would be greatly appreciated.
Later...