Collection Visibility

Is it possible to set Collection with Links Object (with children) only as bounds without showing children?

I have no idea how to do that, sorry.
Linked collection is like instance of the mesh, you can’t disable visibility in mesh except manually hide faces or vertices of them, in blender case you can only manually disable viewport visibility in original collection for children to not show them in Linked Collection.

Maybe someone have an idea how to implement this…

1 Like

hi,

in 3.0 when i try change collection visibility in edit mode i have this error:

Python: Traceback (most recent call last):
  File "C:\Users\radi0n\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\Collection_Visibility.py", line 79, in execute
    ops.object.select_grouped(extend=True, type='COLLECTION')                        
  File "C:\Blender\Blender3.0\3.0\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.select_grouped.poll() failed, context is incorrect

location: <unknown location>:-1


Hi,
I will check it out.

Try this quick fix (remove old script via blender and install this one):
Collection_Visibility_0_3_0.py (5.3 KB)

1 Like

Thx for the quick fix!

1 Like

That’s nice, I’m gonna install it.
I actually plan to use this as toggles as well (for keyboard shortcuts). Could you add support for these two toggles both for selected objects and for collections?

  • Bounds/ textured
  • Wires/ textured

Sometimes I would only need to change the current selection’s display mode, that’s why :wink:

I will try to implement this feature.

Thank you!

for selected objects it’s understandable - toggle if wire then textured.
What about collection? Toggle by active object(1) or independent(2)?
For example:
(1) you select objects in two collections and the active selected object have display type wire - then change all objects in this collections to textured OR
(2) switch display type from wire to textured and if textured to wire independently for each object

or for selected objects also use the active selected display type?

Let’s think out loud here, suppose I have a couple of nested collections for which I select at least one object each.

(1) You toggle the active object > all other objects are toggled to the same state as the active object is.

The result is predictable, you toggle all objects in one go, so single step procedure.

(2a). If I toggle all to the same display mode, you could have (A) all to wire or (B) all to textured.

Worst case scenario, there is no way to get all objects to the same type. It goes both ways and is unpredictable with lots of collections/ objects.

(2b). Toggle all objects from Wire to Textured first, if all objects are Textured, toggle to Wire.

Worst case scenario, two step procedure.

(3) Toggle all selected objects to use the active selection display type

If they are all the same type, this wouldn’t do anything.

Understood.
I change it to use active object display type.

@APEC Actually, it is fine the way you had it I think. Let me test first before you do all the work.
I found some issues as well.

Ok.
sorry, found a bug, moment
this is not accounting active object selected

for 3d view and for outliner need to add entries for keymap object.visibility_toggle

Added:
when you said it would be running from outliner it become a little complicated

1 Like

Some background info, I personally use

3d view
F2: toggle Wireframe > Solid shading for objects:
F3: Toggle X-ray > Solid shading
F4: Toggle Solid shading > Rendered

Prelim keymap for testing
F11: Toggle Bounds/ Textured
F12: Toggle Wire/ Textured

Outliner
I would then use the same logic F1 = course > F4 = detailed
F1: Bounds
F2: Wire
F4: Textured

——

By the way, it won’t change modes if I select the collection, hit the hotkey and decided I want to change modes.

By default Blender uses toggles for Wireframe/ solid, so I think I’ve gotten used to those. Both F1 and F2 would be toggles in my config between Bounds/ Textured and Wire/ Textured.

The only thing I would expect is that if I hit the F11/ F12 toggle is that all objects would go to the same mode.

For the rest, I only have to manually place the keymaps for the shortcuts, so you don’t really need to worry about that.

Conclusion
So I think, contrary to what I first said before I tested it, that because I toggle the state with a hotkey, I expect the button to determine the state of all the objects/ collections. Sorry for the confusing initial response. :sweat_smile:
And it would be most consistent the way Blender does visibility toggles (the F2,3,4 story).

The objects start with:
Cube = bounds
Monkey = wire
Sphere = textured

So in this one, you can see the collections change both directions, which is not what I would expect.

You can see it happen here too (now with pop-up panel to see what I am doing).

By the way, when using toggles, the redo last panel won’t make sense, change it back to the other mode and it will not switch to the other mode, because it is a toggle. So I would suggest not using the redo last for the toggles.

E: Overall, I really like the experience! Just a matter of making sure the toggles work consistently. :grinning:

Wire toggle
If selection/ collection contains non-wire, switch those objects/ collections to wire.
Else, switch to Textured.

Bounds toggle
If selection/ collection contains non-bounds, switch those objects/ collections to bounds.
Else, switch to Textured.

E2: Decided to move the toggles to number keys, 1 & 2 toggle object bounds and wire respectively, 3 & 4 toggle collection bounds and wire respectively. This solves the F2 conflict as well.

1 Like

@Hologram
Try this one:

old

Collection_Visibility_0_3_0.py (8.2 KB)

for keymaps in outliner:
object.collection_wire_toggle - switch all objects in collections by active to wire/textured
object.collection_bounds_toggle - the same but to bounds/textured

if it’s ok, then another 2 operators for only selections

Note!
the same object.collection_wire_toggle and object.collection_bounds_toggle need to add to 3D View keymap, if you want to work it in 3dView also.

1 Like

@APEC
It works like a charm, perfect this way!

The only thing I cannot do is change the mode by selecting just the collection in the outliner, see:

oh, I see, it support only with selecting objects right now.
I’ll check for collection selected.

Added: Cant figure it out how to make it toggle if only collection/s is selected…

1 Like

Can you select one of the items within the collection first before performing the display mode changes? And maybe deselect when done? Perhaps by reading the collection name from the current selection?
E: for nested collections that may prove more difficult.

If not, then so be it :upside_down_face:
I already like it as is, especially with object + collection support :slight_smile:

I can get collections name but I can’t make them active and highlighted in outliner (when I select all collection objects switch them and after I need to select collections again for toggle), also I need to check if it only objects selected or only collections.
Maybe someone with a more skills will help me in the future.
But for now only objects can toggle.

Collection_Visibility_0_3_0.py (10.3 KB)
object.collection_wire_toggle
object.collection_bounds_toggle
object.wire_toggle
object.bounds_toggle

And one more thing about collection, it have no display_type parameter for checking first state to toggle.

1 Like