Page MenuHome

Prevent changing modes on objects with linked obdata
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Apr 13 2021, 11:43 AM.

Details

Summary

When linking e.g. a mesh, a local object using that linked obdata was
still presented with the options to change modes. It was only later when
actually trying to change to a mode that the user was presented with
e.g. following error:

"Unable to execute 'Toggle Edit Mode', error changing modes"

Now catch this early so that the mode_set dropdown or pie menus are
already greyed out.

Issue came up in T87435.

Diff Detail

Repository
rB Blender
Branch
T87435_a (branched from master)
Build Status
Buildable 14031
Build 14031: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Apr 13 2021, 11:43 AM
Philipp Oeser (lichtwerk) created this revision.
Campbell Barton (campbellbarton) requested changes to this revision.EditedApr 13 2021, 1:51 PM

I don't think ED_operator_object_active_editable should be checking the object as operators that only access object-data also use this, e.g. OBJECT_OT_constraint_add, FLUID_OT_bake_guides.

We already have ED_operator_object_active_editable_mesh, ED_operator_object_active_editable_font. we could have.

ED_operator_object_active_editable_data - that checks any object data.

This revision now requires changes to proceed.Apr 13 2021, 1:51 PM

Just noticed that this will actually break going into posemode on a local object which uses a linked armature [which should actually be allowed].

So ED_operator_object_active_editable_data would actually be too strict.
Think I will just abandon for now...