Page MenuHome

Fix T94334: Area close operator crash in 3D view menu
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Dec 23 2021, 5:45 PM.

Details

Summary

This fixes the crash by removing the do_view3d_header_buttons handler.
The code can work at a higher level here, using the operator for setting
the select mode, which makes this patch a cleanup as well.

The only thing that's lost is the custom tooltips for the buttons.
However, I found that clrl-click didn't work as described anyway, and
the shift-select behavior is a common pattern in Blender's UI that
doesn't need special description here, in my opinion. The operator
could get a description callback too, but that might not work as well
when it's called from a button in "exec" context that wouldn't use the
shift key modifier.

Diff Detail

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Dec 23 2021, 5:45 PM
Hans Goudey (HooglyBoogly) created this revision.

Nice!

But is there an argument for just putting my simpler fix into 3.0 corrective release while putting this improved code into 3.1?

Yeah, probably. There probably wouldn't be a corrective release until January though.

Higher chances of this getting reviewed if it fixes a bug, haha
But I'll accept your fix too

Campbell Barton (campbellbarton) requested changes to this revision.Feb 1 2022, 10:44 AM

This seems fine, although I think it's reasonable for the operators tooltips to be included as part of this patch.

The behavior for Ctrl is working here, what wasn't working for you?

This revision now requires changes to proceed.Feb 1 2022, 10:44 AM

This seems fine, although I think it's reasonable for the operators tooltips to be included as part of this patch.

Sure, will do.

The behavior for Ctrl is working here, what wasn't working for you?

Oops, I think I misunderstood the description. I thought it meant the selection of selection modes, but it's actually referring to the selection of mesh elements, that makes more sense.

Add "invoke" descriptions to set select mode operator

This revision is now accepted and ready to land.Feb 4 2022, 12:32 AM

Note that uiTemplateEditModeSelection could even be removed now (since AFAICS there is no longer a need for a custom template), but that could be done separately.