Page MenuHome

Workbench: Darken inactive objects
Needs RevisionPublic

Authored by Pablo Dobarro (pablodp606) on Apr 24 2020, 7:48 PM.
Tags
None
Tokens
"Burninate" token, awarded by n-pigeon."Love" token, awarded by lopoIsaac."Love" token, awarded by Shimoon."Love" token, awarded by franMarz."Like" token, awarded by hitrpr."Love" token, awarded by Brandon777."Love" token, awarded by johnsyed."Like" token, awarded by rpserge."Love" token, awarded by amonpaike."Love" token, awarded by HooglyBoogly."Love" token, awarded by andruxa696."Love" token, awarded by JulienKaspar."Like" token, awarded by knightknight."Party Time" token, awarded by CobraA."Party Time" token, awarded by Frozen_Death_Knight."Love" token, awarded by Alrob."Like" token, awarded by xrg."Like" token, awarded by billreynish."Like" token, awarded by MetinSeven."Like" token, awarded by Zuorion."Like" token, awarded by TheRedWaxPolice.

Details

Summary

This patch darkens the color of all objects that do not have the same
mode enabled of the active object. This works only in single color mode
to avoid affecting the color perception when working with textures or
vertex colors. Options to disable and control the ammount of the effect
can also be added.
When used combined with D7510 it looks like this:

Diff Detail

Repository
rB Blender
Branch
wb-dark-inactive-obects (branched from master)
Build Status
Buildable 7797
Build 7797: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Apr 24 2020, 7:48 PM
Pablo Dobarro (pablodp606) created this revision.

This needs to be thought out better. It doesn't make sense in object or multi-object edit mode, the test to compare with the active object mode is not valid in general.

@Brecht Van Lommel (brecht) I think it works as intended. In object mode no object is darkened. In multi object edit mode, all objects that are not in edit mode are darkened.

I don't see why this is necessary for mesh edit mode. For sculpt mode maybe, because there's no other indication which object is active.

But for mesh edit mode the wireframe is drawn, so there's no confusion and this just feels like extra noise.

@Hans Goudey (HooglyBoogly) I also think this is redundant for Edit Mode (I think sculpt mode is the only mode where this make sense, as the other paint modes have to deal with colors and then single color mode won't be used), but I don't have any strong opinion on that.

Even for Edit Mode, it gives extra clarity. It especially helps when multiple objects are being edited, to help identify *which* ones are edited. But if it doesn't support multi-edit mode, of course it should do that.

I love this feature in ZBrush, it helps a lot. And yes, this is perfect for sculpt mode. Not sure about the other modes.

Options to disable and control the ammount of the effect can also be added.

Yes please.

EDIT: I didn't read the patch description properly. In just single color mode this sounds fine.

...It especially helps when multiple objects are being edited, to help identify *which* ones are edited...

Not sure I agree with that. The wireframe drawing is all I need to know which objects are in edit mode. I've never heard of people being confused which objects they have in mesh edit mode. Let's not try to find a problem for this solution.

And furthermore I think this is actually harmful for edit mode. Objects can have complex relationships defined with modifiers, so editing the mesh of one object can affect the shape of a deselected object. Here I am editing this object which is acting as a boolean for a mirrored object. I'm looking to see how my changes are affecting the other object. If the other object is darkened I can't see those changes as well.

@Hans Goudey (HooglyBoogly) I also think this is redundant for Edit Mode (I think sculpt mode is the only mode where this make sense...

Great, agreed! I can absolutely think of times this could be helpful in sculpt mode.

@Brecht Van Lommel (brecht) I think it works as intended. In object mode no object is darkened. In multi object edit mode, all objects that are not in edit mode are darkened.

The check is probably close but not quite correct. See base_is_in_mode in layer.c for the test used in other places, the object type must match and mode must be treated as a bitmask. Objects in an instanced collections also should not be considered to be in a mode I think, those are identified with ob->base_flag & BASE_FROM_DUPLI.

To me it seems this should also apply to Random color and maybe Material color as well. If it's for Single color only it's quite hidden.

For pose mode this should not be activated. It may be useful to darken everything but the character being animated in some cases, but detecting what the character is would be hard as those mesh objects are not in pose mode.

I would prefer if this was added as an overlay, which would make this work in all shading modes, and could then be easy to disable if needed. That could also make it support other modes, like Edit Mode, Pose Mode and all the paint modes.

@William Reynish (billreynish) I can add an option in the shading menu to disable it or control the effect, but this can't be implemented as an overlay. That will require to redraw the mesh 3 times in sculpt mode (base mesh, face sets + mask, darken overlay).

There could be confusion.
Masks are using darkening, too.
A user could wonder if he is looking to loose parts of a mesh with a mask of low intensity.
I would probably not choose a different option for myself. But maybe people would like to be able to use a tint for one of the two features, instead.

The same way, people can be confused with random color of face sets and random colors for objects.
But this distinction between active object and inactive ones should solve that.

If this is added should be optional (slider users can tweak for example).

  • Review Update
  • Add Options to control the darkening effect
Jeroen Bakker (jbakker) requested changes to this revision.Apr 30 2020, 8:31 AM

IMO this should follow the architecture and be implemented as an overlay. There are some exceptions to add these kind of hacks to the workbench, but not sure this is one of them.

You mention that you do this due to performance. What are the alternatives that you tried? Have you tried a screen space shader where you only mask out the background and the active/selected objects. Here you only need to redraw a buffer that is still active on the GPU.
IIRC we use similar effects in the bone selection overlay.

On UI level, I am not sure if we want to use darken or use themable colors instead. @William Reynish (billreynish) what do you think?

This revision now requires changes to proceed.Apr 30 2020, 8:31 AM

I would prefer it as an overlay, preferably in a way that doesn't add overhead by having to draw everything twice. Even if it's technically not an overlay in that sense but just an option that darkens the non-edited objects, for a user perspective it is an overlay I think. Adding it to the Overlays popover gives us a place to add a toggle and a slider to increase the darkening, and we could add this to all the edit modes (ie all but object mode).