Fix T87926: Transform menu has operators guaranteed to not pass poll in certain modes

Reported for ops.transform.vertex_warp and ops.transform.vertex_random.
Polling will check with ED_transverts_check_obedit, if we know it will
fail e.g. for pose mode, we can do the same check in the UI already.

Maniphest Tasks: T87926

Differential Revision: https://developer.blender.org/D11128
This commit is contained in:
Philipp Oeser 2021-04-30 13:13:03 +02:00
parent 04905c5652
commit 29e5504331
Notes: blender-bot 2023-02-13 22:37:44 +01:00
Referenced by issue #87926, Edit Mode operators are in in Pose Mode menu?
1 changed files with 2 additions and 1 deletions

View File

@ -938,7 +938,8 @@ class VIEW3D_MT_transform_base:
layout.operator("transform.bend", text="Bend")
layout.operator("transform.push_pull", text="Push/Pull")
if context.mode != 'OBJECT':
if context.mode in {'EDIT_MESH', 'EDIT_ARMATURE', 'EDIT_SURFACE', 'EDIT_CURVE',
'EDIT_LATTICE', 'EDIT_METABALL'}:
layout.operator("transform.vertex_warp", text="Warp")
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("transform.vertex_random", text="Randomize").offset = 0.1