Open All groups (and sub-groups)

Hi everybody!

I need to create a script to simplify my work. I need to open all groups in the scene, but it means all sub-groups too (groups inside antoher group). Something like a loop in the command "Select All" and "Group Open", until open all groups, that's what I'm doing manually.
To close is simple, one time command, but to open...
I don't know script, my only experience are recording actions and create scripts with it. Very, very, very basic...

Can anyone help me?

Regards,

Caetano Brasil

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swordslayer's picture

This should do the trick: fn

This should do the trick:

fn ungroupAll objs =
(
	group_arr = for o in objs where isValidNode o AND isGroupHead o collect o
 
	with redraw off
	(
		for o in group_arr do
		(
			setGroupOpen o false
			ungroup o
		)
	)
)
 
ungroupAll objects

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.