Notifications
Clear all

[Closed] How can I get the current value of a button/list?

I’ve just started making my own simple scripts but I haven’t been able to find a good explanation on how to get a value of something such as a toggle or list.

Just for context what I’m trying to do right now is a script which selects all cameras in scene and locks their rotation/position/scale.

What I currently have is:

setSelectFilter 5 --set selection filter to cameras
max select all --Select all (Cameras)
setTransformLockFlags selection #all --Lock all link info
setSelectFilter 1 -- go back to select filter on all

What I’d like to add to it is to first get the select filter value, so then I can go back to it and more importantly to check if the cameras are hidden from Hide by Category (Ctrl+C), because the script won’t work if they’re hidden.

Thanks for your time!

1 Reply

Use this:

(
	allCamsArr = cameras as array
	for c in allCamsArr where not c.isHidden do setTransformLockFlags c #all
)

Avoid selecting objects if is possible.