40 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
54 #define SEL_F1 (1 << 0)
55 #define SEL_F2 (1 << 1)
56 #define SEL_F3 (1 << 2)
57 #define SEL_ALL ((1 << 0) | (1 << 1) | (1 << 2))
61 if (handles_visible) {
89 const bool is_multiedit,
90 const bool use_multiframe_falloff,
91 const bool is_prop_edit,
92 const bool is_prop_edit_connected,
93 const bool is_scale_thickness)
95 #define SEL_F1 (1 << 0)
96 #define SEL_F2 (1 << 1)
97 #define SEL_F3 (1 << 2)
108 uint32_t tot_curve_points = 0, tot_sel_curve_points = 0, tot_points = 0, tot_sel_points = 0;
112 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
114 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
125 if (gps->editcurve ==
NULL) {
137 const bool handles_visible = (handle_all_visible ||
138 (handle_only_selected_visible &&
152 tot_sel_curve_points++;
171 if (((is_prop_edit && !is_prop_edit_connected) ? tot_curve_points : tot_sel_points) == 0) {
180 data_len_pt = tot_curve_points;
184 data_len_pt = tot_sel_curve_points;
202 const int cfra = (gpl->flag &
GP_LAYER_FRAMELOCK) ? gpl->actframe->framenum : cfra_scene;
204 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
205 float diff_mat[4][4], mtx[3][3];
212 if (use_multiframe_falloff) {
216 if ((gpf->framenum != cfra) && (!is_multiedit)) {
234 for (gpf = init_gpf; gpf; gpf = gpf->next) {
235 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
237 float falloff = 1.0f;
238 if ((is_multiedit) && (use_multiframe_falloff)) {
255 if (gps->editcurve ==
NULL) {
261 gps->runtime.multi_frame_falloff = falloff;
262 bool need_handle_recalc =
false;
274 bool bezt_use =
false;
275 const bool handles_visible = (handle_all_visible ||
276 (handle_only_selected_visible &&
280 for (
int j = 0; j < 3; j++) {
281 bool is_ctrl_point = (j == 1);
282 bool sel = sel_flag & (1 << j);
284 if (is_prop_edit || sel) {
286 td->loc = bezt->
vec[j];
287 bool rotate_around_ctrl = !handles_visible ||
290 copy_v3_v3(td->center, bezt->
vec[rotate_around_ctrl ? 1 : j]);
292 if (!handles_visible || is_ctrl_point) {
300 else if (handles_visible) {
313 if (is_scale_thickness) {
329 if (is_ctrl_point && ((sel_flag &
SEL_F1 &
SEL_F3) == 0)) {
332 else if (!is_ctrl_point) {
354 bezt,
SELECT, handles_visible, use_around_origins_for_handles_test);
355 need_handle_recalc =
true;
359 if (is_prop_edit && (head != tail)) {
363 if (need_handle_recalc) {
387 const int cfra_scene,
388 const bool is_multiedit,
389 const bool use_multiframe_falloff,
390 const bool is_prop_edit,
391 const bool is_prop_edit_connected,
392 const bool is_scale_thickness)
396 float mtx[3][3], smtx[3][3];
415 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
417 for (gpf = init_gpf; gpf; gpf = gpf->
next) {
431 if (is_prop_edit_connected) {
448 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
481 const int cfra = (gpl->flag &
GP_LAYER_FRAMELOCK) ? gpl->actframe->framenum : cfra_scene;
483 float diff_mat[3][3];
484 float inverse_diff_mat[3][3];
486 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
491 if (use_multiframe_falloff) {
497 float diff_mat_tmp[4][4];
511 if ((gpf->framenum != cfra) && (!is_multiedit)) {
525 for (gpf = init_gpf; gpf; gpf = gpf->next) {
526 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
529 float falloff = 1.0f;
530 if ((is_multiedit) && (use_multiframe_falloff)) {
552 if (is_prop_edit_connected) {
567 if (stroke_ok && gps->totpoints) {
572 gps->
runtime.multi_frame_falloff = falloff;
579 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
619 if (is_scale_thickness) {
660 if (is_prop_edit && (head != tail)) {
677 if (
t->data_container_len == 0) {
719 use_multiframe_falloff,
721 is_prop_edit_connected,
733 use_multiframe_falloff,
735 is_prop_edit_connected,
748 for (
int i = 0; i < tc->
data_len; i++, td++) {
struct Scene * CTX_data_scene(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
void BKE_nurb_bezt_handle_test(struct BezTriple *bezt, eBezTriple_Flag__Alias sel_flag, bool use_handle, bool use_around_local)
struct bGPDframe * BKE_gpencil_frame_addcopy(struct bGPDlayer *gpl, int cframe)
float BKE_gpencil_multiframe_falloff_calc(struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff)
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_gpencil_editcurve_recalculate_handles(struct bGPDstroke *gps)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define LISTBASE_FOREACH(type, var, list)
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 Ainv[3][3], const float A[3][3])
void pseudoinverse_m3_m3(float Ainv[3][3], const float A[3][3], float epsilon)
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])
struct Depsgraph Depsgraph
@ 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
#define OBACT(_view_layer)
@ V3D_AROUND_LOCAL_ORIGINS
#define IS_AUTOKEY_ON(scene)
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
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)
struct CurveMapping * cur_falloff
struct ToolSettings * toolsettings
bGPDcurve_point * curve_points
bGPDspoint_Runtime runtime
struct bGPDcurve * editcurve