Shading for Inactive objects in viewport (wireframe)

Nice solution!
One thing, it not restore TEXTURED type after unchecking checkbox (or is it only me…)

UPD: found
line 111 - ignored_objects = get_boolean_objects(context)
need to relocate to line 100 after vis = context.visible_objects to get rid of
UnboundLocalError: local variable 'ignored_objects' referenced before assignment error

Yeah I saw that issue after I had already attached the file. I re-uploaded with the same name with the fix when I edited my post. :stuck_out_tongue:

I found another issue (with the way get_boolean_objects works) that I need to fix real quick. Will update with a new version in a few minutes.

Also going to add another improvement:
Only set the display_type if the object isn’t already using the new display_type so we don’t waste time setting it for objects that are already using the desired display_type. This should minimize the performance impact of the previously mentioned scenario to only happen when directly interacting with an object that has a boolean collection and not every time any object is interacted with.

That will be better than nothing, but the performance issue is still a Blender problem that we have no control over.

Give this a try:
Inactive_Shading_v_1_0_6.py (7.2 KB)

2 Likes

Hello,
it seems it has some bug, see video example.
I thought it’s me did some mess in code when implementing ignoring not textured display types.
So if objects in scene updates, first run make all wire (except ignorred)


Found:
something wrong with this

                    if obj not in ignored_objects:
                        if obj in sel and obj.display_type != 'TEXTURED':
                            obj.display_type = 'TEXTURED'

changed it to 1_0_4 version in my vision with predefined ignored collections

Ok, I made my vision where you define which collections to be ignored
IS_7

Here what I got

Inactive_Shading_v_1_0_7.py (13.0 KB)
Link for similar UIList if someone want to know how to make it.

5 Likes

More compact variant, default collapsed
1_0_8

Inactive_Shading_v_1_0_8.py (13.5 KB)

4 Likes

Wow, thats so cool. The only thing I find missing, is to set the style of wireframe extra. So its a different thing if all is wireframe, then only the background.
Anyway, no we need a unhide in isolate mode, when going into editing of the mesh. Big miss in Blender.

PS: The add on seem to have a bug. After reopening a scene, many items where set to display as wireframe, instead of textured. Well, that shouldn’t work that way.

Hi Did anyone find out if it is possible to have different colors for wireframes when shaded?
In the interface these work only in wireframes Viewport-mode but not in shaded mode with wireframes turned on…
Maybe there is a way to do that by coding, a way that is not exposed in the interface?

It’s not possible, but there was a patch: https://projects.blender.org/blender/blender/pulls/110097

Probably not gonna make it into 4.0 since there are disagreements over ui and strength of some effects, but maybe it will finished later.

1 Like