58#define SEL_F1 (1 << 0)
59#define SEL_F2 (1 << 1)
60#define SEL_F3 (1 << 2)
61#define SEL_ALL ((1 << 0) | (1 << 1) | (1 << 2))
95 const bool is_multiedit,
96 const bool use_multiframe_falloff,
97 const bool is_prop_edit,
98 const bool is_prop_edit_connected,
99 const bool is_scale_thickness)
101#define SEL_F1 (1 << 0)
102#define SEL_F2 (1 << 1)
103#define SEL_F3 (1 << 2)
114 uint32_t tot_curve_points = 0, tot_sel_curve_points = 0, tot_points = 0, tot_sel_points = 0;
121 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
132 if (gps->editcurve ==
nullptr) {
144 const bool hide_handles = !(
145 handle_all_visible ||
159 tot_sel_curve_points++;
178 if (((is_prop_edit && !is_prop_edit_connected) ? tot_curve_points : tot_sel_points) == 0) {
187 data_len_pt = tot_curve_points;
191 data_len_pt = tot_sel_curve_points;
209 const int cfra = (gpl->flag &
GP_LAYER_FRAMELOCK) ? gpl->actframe->framenum : cfra_scene;
213 float diff_mat[4][4], mtx[3][3];
220 if (use_multiframe_falloff) {
224 if ((gpf->
framenum != cfra) && (!is_multiedit)) {
229 if (gpf ==
nullptr) {
242 for (gpf = init_gpf; gpf; gpf = gpf->
next) {
245 float falloff = 1.0f;
246 if ((is_multiedit) && (use_multiframe_falloff)) {
263 if (gps->editcurve ==
nullptr) {
269 gps->runtime.multi_frame_falloff = falloff;
270 bool need_handle_recalc =
false;
282 bool bezt_use =
false;
283 const bool hide_handles = !(
284 handle_all_visible ||
288 for (
int j = 0; j < 3; j++) {
289 bool is_ctrl_point = (j == 1);
290 bool sel = sel_flag & (1 << j);
292 if (is_prop_edit || sel) {
294 td->loc = bezt->
vec[j];
295 bool rotate_around_ctrl = hide_handles ||
298 copy_v3_v3(td->center, bezt->
vec[rotate_around_ctrl ? 1 : j]);
300 if (hide_handles || is_ctrl_point) {
308 else if (!hide_handles) {
321 if (is_scale_thickness) {
336 if (hdata ==
nullptr) {
337 if (is_ctrl_point && ((sel_flag &
SEL_F1 &
SEL_F3) == 0)) {
340 else if (!is_ctrl_point) {
365 use_around_origins_for_handles_test);
366 need_handle_recalc =
true;
370 if (is_prop_edit && (head != tail)) {
374 if (need_handle_recalc) {
398 const int cfra_scene,
399 const bool is_multiedit,
400 const bool use_multiframe_falloff,
401 const bool is_prop_edit,
402 const bool is_prop_edit_connected,
403 const bool is_scale_thickness)
407 float mtx[3][3], smtx[3][3];
428 for (gpf = init_gpf; gpf; gpf = gpf->
next) {
442 if (is_prop_edit_connected) {
459 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
493 const int cfra = (gpl->flag &
GP_LAYER_FRAMELOCK) ? gpl->actframe->framenum : cfra_scene;
495 float diff_mat[3][3];
496 float inverse_diff_mat[3][3];
504 if (use_multiframe_falloff) {
510 float diff_mat_tmp[4][4];
524 if ((gpf->
framenum != cfra) && (!is_multiedit)) {
529 if (gpf ==
nullptr) {
538 for (gpf = init_gpf; gpf; gpf = gpf->
next) {
542 float falloff = 1.0f;
543 if ((is_multiedit) && (use_multiframe_falloff)) {
565 if (is_prop_edit_connected) {
580 if (stroke_ok && gps->totpoints) {
585 gps->
runtime.multi_frame_falloff = falloff;
592 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
632 if (is_scale_thickness) {
674 if (is_prop_edit && (head != tail)) {
703 const int cfra_scene = scene->r.cfra;
721 if (gpd ==
nullptr) {
734 use_multiframe_falloff,
736 is_prop_edit_connected,
748 use_multiframe_falloff,
750 is_prop_edit_connected,
763 for (
int i = 0; i < tc->
data_len; i++, td++) {
768 if (is_curve_edit && gps->
editcurve !=
nullptr) {
Functions to insert, delete or modify keyframes.
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
@ NURB_HANDLE_TEST_KNOT_OR_EACH
@ NURB_HANDLE_TEST_KNOT_ONLY
void BKE_nurb_bezt_handle_test(BezTriple *bezt, eBezTriple_Flag__Alias sel_flag, const eNurbHandleTest_Mode handle_mode, bool use_around_local)
void BKE_gpencil_editcurve_recalculate_handles(struct bGPDstroke *gps)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
float BKE_gpencil_multiframe_falloff_calc(struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff)
struct bGPDframe * BKE_gpencil_frame_addcopy(struct bGPDlayer *gpl, int cframe)
bool BKE_gpencil_layer_is_editable(const struct bGPDlayer *gpl)
void BKE_gpencil_frame_range_selected(struct bGPDlayer *gpl, int *r_initframe, int *r_endframe)
void BKE_gpencil_layer_transform_matrix_get(const struct Depsgraph *depsgraph, struct Object *obact, struct bGPDlayer *gpl, float diff_mat[4][4])
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
#define LISTBASE_FOREACH(type, var, list)
void pseudoinverse_m3_m3(float inverse[3][3], const float mat[3][3], float epsilon)
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void unit_m3(float m[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
#define PSEUDOINVERSE_EPSILON
void invert_m3_m3_safe_ortho(float inverse[3][3], const float mat[3][3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
@ GP_STROKE_NEEDS_CURVE_UPDATE
#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd)
#define GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)
@ GP_SCULPT_SETT_FLAG_FRAME_FALLOFF
@ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS
@ V3D_AROUND_LOCAL_ORIGINS
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
static bool is_cyclic(const Nurb *nu)
bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps)
bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps)
void *(* MEM_callocN)(size_t len, const char *str)
bool is_autokey_on(const Scene *scene)
struct CurveMapping * cur_falloff
bGPDcurve_point * curve_points
bGPDspoint_Runtime runtime
struct bGPDcurve * editcurve