Tool System: per space/mode tool support
[blender.git] / source / blender / editors / mesh / editmesh_extrude.c
index 2e3d0a9c6759898b7061bb61464479fa4bdc66f0..67596ef5c8a4c2b9203e14a8d876d52f346759db 100644 (file)
@@ -420,7 +420,10 @@ static void manipulator_mesh_extrude_orientation_matrix_set(
 static bool manipulator_mesh_extrude_poll(const bContext *C, wmManipulatorGroupType *wgt)
 {
        WorkSpace *workspace = CTX_wm_workspace(C);
-       if (!STREQ(workspace->tool.manipulator_group, "MESH_WGT_extrude") ||
+       const bToolKey tkey = { .space_type = SPACE_VIEW3D, .mode = OB_MODE_EDIT};
+       bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_find(workspace, &tkey);
+       if ((tref_rt == NULL) ||
+           !STREQ(wgt->idname, tref_rt->manipulator_group) ||
            !ED_operator_editmesh_view3d((bContext *)C))
        {
                WM_manipulator_group_type_unlink_delayed_ptr(wgt);