Curves: Add cursor snapping support #104967
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "BLI_task.hh"
|
||||
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "ED_curves.h"
|
||||
#include "ED_transverts.h"
|
||||
|
||||
|
@ -23,8 +25,8 @@ void transverts_from_curves_positions_create(bke::CurvesGeometry &curves, TransV
|
|||
threading::parallel_for(selection.index_range(), 1024, [&](const IndexRange selection_range) {
|
||||
for (const int point_i : selection_range) {
|
||||
|
||||
TransVert &tv = tvs->transverts[point_i];
|
||||
Hans Goudey
commented
Might be better to use Might be better to use `SELECT` for now, since that's how the other object types do it
|
||||
tv.loc = reinterpret_cast<float *>(&positions[selection[point_i]]);
|
||||
tv.flag = true;
|
||||
tv.loc = positions[selection[point_i]];
|
||||
tv.flag = SELECT;
|
||||
copy_v3_v3(tv.oldloc, tv.loc);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -65,7 +65,7 @@ void ensure_surface_deformation_node_exists(bContext &C, Object &curves_ob);
|
|||
/**
|
||||
* Allocate an array of `TransVert` for cursor/selection snapping (See
|
||||
* `ED_transverts_create_from_obedit` in `view3d_snap.c`).
|
||||
* Note: the `TransVert` elements in \a tvs are expected to write to the positions of \a curves.
|
||||
* \note: the `TransVert` elements in \a tvs are expected to write to the positions of \a curves.
|
||||
Hans Goudey
commented
`* Note:` -> `* \note:`
|
||||
*/
|
||||
void transverts_from_curves_positions_create(bke::CurvesGeometry &curves, TransVertStore *tvs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Just
tv.loc = positions[selection[point_i]];
worked okay for me.