A small script to batch change the octane geometry type

Autodesk Maya (Plugin developed by JimStar)

Moderator: JimStar

Post Reply
vegansushi
Licensed Customer
Posts: 15
Joined: Tue Jun 01, 2010 1:06 am

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");
calus
Licensed Customer
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

Thanks for the script
but you can also just change the attribute in the channel box, it applies to all selected object. ;)
Pascal ANDRE
vegansushi
Licensed Customer
Posts: 15
Joined: Tue Jun 01, 2010 1:06 am

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?
calus
Licensed Customer
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

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.
Pascal ANDRE
User avatar
Jolbertoquini
Licensed Customer
Posts: 1067
Joined: Sun Aug 31, 2014 7:08 am
Location: London
Contact:

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:
Attachments
How to open:
How to open:
the windows:
the windows:
Octane Render for Maya.
https://vimeo.com/jocg/videos
https://www.linkedin.com/in/jocgtd
http://www.hmxmedia.com/
--------------------
Join MAYA OCTANE USERS Skype discussion here :
https://join.skype.com/LXEQaqqfN15w
vegansushi
Licensed Customer
Posts: 15
Joined: Tue Jun 01, 2010 1:06 am

Yes, I use Maya 2016.5. How lucky I am! Lol

Thanks to everyone for the support! :)
Post Reply

Return to “Autodesk Maya”