ScriptSpot

Forum topic · General Scripting

Select by visibility

By quantic · 2020-08-12

Description

i have a scene that contains millions of objects, some of them are Visibility 0 in object properties
i only see them when i go Wireframe view, i have to select them all and delete
is there any script or code for do that?

note:they're not visibility box checked or not. its visibility 0.0

Comments (4)

.

miauu · 2020-08-31

Yep. I forgot about this and tested only with objects with Visiblity set to arbitrary value.

This will work with all objects:


(	
	select (for o in objects where (getVisController o) != undefined and o.visibility.controller.value == 0.0 collect o)
)

(	
	delete (for o in objects where (getVisController o) != undefined and o.visibility.controller.value == 0.0 collect o)
)

.

miauu · 2020-08-30

This will select all objects with visibility = 0.


(
	select (for o in objects where o.visibility.controller.value == 0.0 collect o)
)

This will delete all objects with visibility = 0.


(
	delete (for o in objects where o.visibility.controller.value == 0.0 collect o)
)

~

jahman · 2020-08-30


mxs reference:
By default, there is no controller assigned to the visibility track. Accessing the .controller property of the visibility track will throw an error.

.

miauu · 2020-08-31

Yep. I forgot about this and tested only with objects with :)