Gizmo: de-duplicate poll logic
Checking the active tool or operator was a common way to check if the gizmo was still in use.
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "BKE_editmesh.h"
|
||||
|
||||
#include "ED_gizmo_library.h"
|
||||
#include "ED_gizmo_utils.h"
|
||||
#include "ED_mesh.h"
|
||||
#include "ED_object.h"
|
||||
#include "ED_screen.h"
|
||||
@@ -199,12 +200,7 @@ static void gizmo_placement_prop_matrix_set(
|
||||
|
||||
static bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *gzgt)
|
||||
{
|
||||
wmOperator *op = WM_operator_last_redo(C);
|
||||
if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_gizmo")) {
|
||||
WM_gizmo_group_type_unlink_delayed_ptr(gzgt);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return ED_gizmo_poll_or_unlink_delayed_from_operator(C, gzgt, "MESH_OT_primitive_cube_add_gizmo");
|
||||
}
|
||||
|
||||
static void gizmo_mesh_placement_modal_from_setup(
|
||||
|
||||
Reference in New Issue
Block a user