WIP: uv-simple-select #1

Closed
Chris Blackbourn wants to merge 182 commits from uv-simple-select into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 27 additions and 1 deletions
Showing only changes of commit e1e157565b - Show all commits

View File

@ -2997,7 +2997,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
_defs_edit_curve.curve_vertex_randomize, _defs_edit_curve.curve_vertex_randomize,
], ],
'EDIT_CURVES': [ 'EDIT_CURVES': [
*_tools_select, *_tools_default,
], ],
'EDIT_SURFACE': [ 'EDIT_SURFACE': [
*_tools_default, *_tools_default,

View File

@ -30,7 +30,9 @@
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_armature.h" #include "BKE_armature.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_crazyspace.hh"
#include "BKE_curve.h" #include "BKE_curve.h"
#include "BKE_curves.hh"
#include "BKE_editmesh.h" #include "BKE_editmesh.h"
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_gpencil.h" #include "BKE_gpencil.h"
@ -47,6 +49,7 @@
#include "WM_types.h" #include "WM_types.h"
#include "ED_armature.h" #include "ED_armature.h"
#include "ED_curves.h"
#include "ED_gizmo_library.h" #include "ED_gizmo_library.h"
#include "ED_gizmo_utils.h" #include "ED_gizmo_utils.h"
#include "ED_gpencil.h" #include "ED_gpencil.h"
@ -623,6 +626,7 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
const TransformCalcParams *params, const TransformCalcParams *params,
TransformBounds *tbounds) TransformBounds *tbounds)
{ {
using namespace blender;
ScrArea *area = CTX_wm_area(C); ScrArea *area = CTX_wm_area(C);
ARegion *region = CTX_wm_region(C); ARegion *region = CTX_wm_region(C);
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
@ -929,6 +933,28 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
} }
FOREACH_EDIT_OBJECT_END(); FOREACH_EDIT_OBJECT_END();
} }
else if (obedit->type == OB_CURVES) {
FOREACH_EDIT_OBJECT_BEGIN (ob_iter, use_mat_local) {
const Curves &curves_id = *static_cast<Curves *>(ob_iter->data);
const bke::CurvesGeometry &curves = curves_id.geometry.wrap();
const bke::crazyspace::GeometryDeformation deformation =
bke::crazyspace::get_evaluated_curves_deformation(*depsgraph, *ob);
float4x4 mat_local;
if (use_mat_local) {
mat_local = float4x4(obedit->world_to_object) * float4x4(ob_iter->object_to_world);
}
Vector<int64_t> indices;
const IndexMask selected_points = ed::curves::retrieve_selected_points(curves, indices);
const Span<float3> positions = deformation.positions;
totsel += selected_points.size();
for (const int point_i : selected_points) {
calc_tw_center_with_matrix(tbounds, positions[point_i], use_mat_local, mat_local.ptr());
}
}
FOREACH_EDIT_OBJECT_END();
}
#undef FOREACH_EDIT_OBJECT_BEGIN #undef FOREACH_EDIT_OBJECT_BEGIN
#undef FOREACH_EDIT_OBJECT_END #undef FOREACH_EDIT_OBJECT_END