Page 1 of 1

A small script to batch change the octane geometry type

Posted: Fri Aug 19, 2016 12:18 pm
by vegansushi
Hi all,

Here you can find a little script that can be useful.
If you assign it to a button on the Octane shelf, you can use it to batch change the geometry type parameter.

Just select all the geometry you want to be Movable Proxy and click the button you created, it will be converted to Movable Proxy.
Hope it will be useful.

Ciao!
Eugenio

Code: Select all

string $obj[]= `ls -sl`; 
string $dagnodes[] = `listRelatives -s -path $obj`; 

print("\nnumber of selected objects:"+size($dagnodes)+"\n");

int $i;
int $count =0; 
int $err=0;

for($i=0;$i<size($dagnodes);$i++){
 if (`attributeExists "octGeomType" $dagnodes[$i]`) {      
	eval("setAttr "+$dagnodes[$i] +".octGeomType 0");
	$count++;
   } else {      
	$err++;
   }
}
print ("attributes of "+$count+" Objects changed\n");
print ($err + " Objects of selection list were from different type and have not been changed\n\n\n");

Re: A small script to batch change the octane geometry type

Posted: Fri Aug 19, 2016 1:05 pm
by calus
Thanks for the script
but you can also just change the attribute in the channel box, it applies to all selected object. ;)

Re: A small script to batch change the octane geometry type

Posted: Fri Aug 19, 2016 1:41 pm
by vegansushi
calus wrote:Thanks for the script
but you can also just change the attribute in the channel box, it applies to all selected object. ;)
Really? For some reason, it doesn't work for me. It only changes the attribute to the last selected object. Any idea why?

Re: A small script to batch change the octane geometry type

Posted: Mon Aug 22, 2016 8:16 am
by calus
vegansushi wrote: For some reason, it doesn't work for me. It only changes the attribute to the last selected object. Any idea why?
I guess you use Maya 2016.5 (aka 2016Ext2 ) ?

Multi-selection attribute editing in channel box seems broken in 2016.5,
maybe it was corrected with 2016.5 SP1, I didn't check.

In Maya 2017 it works, as long as you edit attributes the classical way (either changing the value with keyboard or selecting the channel and MMB sliding in viewport)
but doesn't work with the new way ( direct sliding in the field ).

And of course multi-selection edit works beautifully in maya 2016, main reason why I stick to this version.

Re: A small script to batch change the octane geometry type

Posted: Thu Aug 25, 2016 11:07 am
by Jolbertoquini
here a simple way, just use the window "Atribute Spread Sheet"

select your meshs and at Shape keyable tab all octane options are there.

0 for Global, 1 for Scatter, 2 for Movable and 3 for reshapable...

faster and easy.

here a screen:

Re: A small script to batch change the octane geometry type

Posted: Thu Aug 25, 2016 12:40 pm
by vegansushi
Yes, I use Maya 2016.5. How lucky I am! Lol

Thanks to everyone for the support! :)