56 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
70 #define SEL_F1 (1 << 0)
71 #define SEL_F2 (1 << 1)
72 #define SEL_F3 (1 << 2)
73 #define SEL_ALL ((1 << 0) | (1 << 1) | (1 << 2))
77 if (handles_visible) {
104 const int cfra_scene,
105 const bool is_multiedit,
106 const bool use_multiframe_falloff,
107 const bool is_prop_edit,
108 const bool is_prop_edit_connected,
109 const bool is_scale_thickness)
111 #define SEL_F1 (1 << 0)
112 #define SEL_F2 (1 << 1)
113 #define SEL_F3 (1 << 2)
124 uint32_t tot_curve_points = 0, tot_sel_curve_points = 0, tot_points = 0, tot_sel_points = 0;
128 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
130 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
141 if (gps->editcurve ==
NULL) {
153 const bool handles_visible = (handle_all_visible ||
154 (handle_only_selected_visible &&
168 tot_sel_curve_points++;
187 if (((is_prop_edit && !is_prop_edit_connected) ? tot_curve_points : tot_sel_points) == 0) {
196 data_len_pt = tot_curve_points;
200 data_len_pt = tot_sel_curve_points;
218 const int cfra = (gpl->flag &
GP_LAYER_FRAMELOCK) ? gpl->actframe->framenum : cfra_scene;
220 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
221 float diff_mat[4][4], mtx[3][3];
228 if (use_multiframe_falloff) {
232 if ((gpf->framenum != cfra) && (!is_multiedit)) {
250 for (gpf = init_gpf; gpf; gpf = gpf->next) {
251 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
253 float falloff = 1.0f;
254 if ((is_multiedit) && (use_multiframe_falloff)) {
271 if (gps->editcurve ==
NULL) {
277 gps->runtime.multi_frame_falloff = falloff;
278 bool need_handle_recalc =
false;
290 bool bezt_use =
false;
291 const bool handles_visible = (handle_all_visible ||
292 (handle_only_selected_visible &&
296 for (
int j = 0; j < 3; j++) {
297 bool is_ctrl_point = (j == 1);
298 bool sel = sel_flag & (1 << j);
300 if (is_prop_edit || sel) {
302 td->loc = bezt->
vec[j];
303 bool rotate_around_ctrl = !handles_visible ||
306 copy_v3_v3(td->center, bezt->
vec[rotate_around_ctrl ? 1 : j]);
308 if (!handles_visible || is_ctrl_point) {
316 else if (handles_visible) {
329 if (is_scale_thickness) {
345 if (is_ctrl_point && ((sel_flag &
SEL_F1 &
SEL_F3) == 0)) {
348 else if (!is_ctrl_point) {
370 bezt,
SELECT, handles_visible, use_around_origins_for_handles_test);
371 need_handle_recalc =
true;
375 if (is_prop_edit && (head != tail)) {
379 if (need_handle_recalc) {
403 const int cfra_scene,
404 const bool is_multiedit,
405 const bool use_multiframe_falloff,
406 const bool is_prop_edit,
407 const bool is_prop_edit_connected,
408 const bool is_scale_thickness)
412 float mtx[3][3], smtx[3][3];
431 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
433 for (gpf = init_gpf; gpf; gpf = gpf->
next) {
447 if (is_prop_edit_connected) {
464 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
497 const int cfra = (gpl->flag &
GP_LAYER_FRAMELOCK) ? gpl->actframe->framenum : cfra_scene;
499 float diff_mat[4][4];
500 float inverse_diff_mat[4][4];
502 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
507 if (use_multiframe_falloff) {
522 if ((gpf->framenum != cfra) && (!is_multiedit)) {
536 for (gpf = init_gpf; gpf; gpf = gpf->next) {
537 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
540 float falloff = 1.0f;
541 if ((is_multiedit) && (use_multiframe_falloff)) {
563 if (is_prop_edit_connected) {
578 if (stroke_ok && gps->totpoints) {
583 gps->
runtime.multi_frame_falloff = falloff;
590 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
630 if (is_scale_thickness) {
671 if (is_prop_edit && (head != tail)) {
688 if (
t->data_container_len == 0) {
699 const int cfra_scene =
CFRA;
730 use_multiframe_falloff,
732 is_prop_edit_connected,
744 use_multiframe_falloff,
746 is_prop_edit_connected,
760 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, const eBezTriple_Flag__Alias sel_flag, const bool use_handle, const 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(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
bool invert_m4_m4(float R[4][4], const float A[4][4])
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
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