14 #define DEPTH_INVALID 1.0f
286 const float diff_mat[4][4],
334 const float screen_co[2],
461 #define GP_STROKE_BUFFER_CHUNK 2048
688 #define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) \
690 struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}}; \
691 Depsgraph *depsgraph_ = CTX_data_ensure_evaluated_depsgraph(C); \
692 Object *obact_ = CTX_data_active_object(C); \
693 bGPdata *gpd_ = CTX_data_gpencil_data(C); \
694 const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
695 CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { \
696 bGPDframe *init_gpf_ = (is_multiedit_) ? gpl->frames.first : gpl->actframe; \
697 for (bGPDframe *gpf_ = init_gpf_; gpf_; gpf_ = gpf_->next) { \
698 if ((gpf_ == gpl->actframe) || ((gpf_->flag & GP_FRAME_SELECT) && is_multiedit_)) { \
699 BKE_gpencil_layer_transform_matrix_get( \
700 depsgraph_, obact_, gpl, gpstroke_iter.diff_mat); \
701 invert_m4_m4(gpstroke_iter.inverse_diff_mat, gpstroke_iter.diff_mat); \
704 for (bGPDstroke *gps = gpf_->strokes.first; gps; gps = gpsn_) { \
707 if (ED_gpencil_stroke_can_use(C, gps) == false) { \
711 if (ED_gpencil_stroke_material_editable(obact_, gpl, gps) == false) { \
716 #define GP_EDITABLE_STROKES_END(gpstroke_iter) \
719 if (!is_multiedit_) { \
740 #define GP_EDITABLE_CURVES_BEGIN(gpstroke_iter, C, gpl, gps, gpc) \
742 struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}}; \
743 Depsgraph *depsgraph_ = CTX_data_ensure_evaluated_depsgraph(C); \
744 Object *obact_ = CTX_data_active_object(C); \
745 bGPdata *gpd_ = CTX_data_gpencil_data(C); \
746 const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
747 CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { \
748 bGPDframe *init_gpf_ = (is_multiedit_) ? gpl->frames.first : gpl->actframe; \
749 for (bGPDframe *gpf_ = init_gpf_; gpf_; gpf_ = gpf_->next) { \
750 if ((gpf_ == gpl->actframe) || ((gpf_->flag & GP_FRAME_SELECT) && is_multiedit_)) { \
751 BKE_gpencil_layer_transform_matrix_get( \
752 depsgraph_, obact_, gpl, gpstroke_iter.diff_mat); \
753 invert_m4_m4(gpstroke_iter.inverse_diff_mat, gpstroke_iter.diff_mat); \
756 for (bGPDstroke *gps = gpf_->strokes.first; gps; gps = gpsn_) { \
759 if (ED_gpencil_stroke_can_use(C, gps) == false) \
761 if (gps->editcurve == NULL) \
763 bGPDcurve *gpc = gps->editcurve; \
766 #define GP_EDITABLE_CURVES_END(gpstroke_iter) \
769 if (!is_multiedit_) { \
788 #define GP_EVALUATED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) \
790 struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}}; \
791 Depsgraph *depsgraph_ = CTX_data_ensure_evaluated_depsgraph(C); \
792 Object *obact_ = CTX_data_active_object(C); \
793 Object *ob_eval_ = (Object *)DEG_get_evaluated_id(depsgraph_, &obact_->id); \
794 bGPdata *gpd_ = (bGPdata *)ob_eval_->data; \
795 const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
796 LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd_->layers) { \
797 if (BKE_gpencil_layer_is_editable(gpl)) { \
798 bGPDframe *init_gpf_ = (is_multiedit_) ? gpl->frames.first : gpl->actframe; \
799 for (bGPDframe *gpf_ = init_gpf_; gpf_; gpf_ = gpf_->next) { \
800 if ((gpf_ == gpl->actframe) || ((gpf_->flag & GP_FRAME_SELECT) && is_multiedit_)) { \
801 BKE_gpencil_layer_transform_matrix_get( \
802 depsgraph_, obact_, gpl, gpstroke_iter.diff_mat); \
804 mul_m4_m4m4(gpstroke_iter.diff_mat, gpstroke_iter.diff_mat, gpl->layer_invmat); \
806 LISTBASE_FOREACH (bGPDstroke *, gps, &gpf_->strokes) { \
808 if (ED_gpencil_stroke_can_use(C, gps) == false) { \
812 if (ED_gpencil_stroke_material_editable(obact_, gpl, gps) == false) { \
817 #define GP_EVALUATED_STROKES_END(gpstroke_iter) \
820 if (!is_multiedit_) { \
struct Depsgraph Depsgraph
_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 y1
const Depsgraph * depsgraph
void GPENCIL_OT_select_vertex_color(struct wmOperatorType *ot)
void GPENCIL_OT_layer_annotation_move(struct wmOperatorType *ot)
void GPENCIL_OT_annotate(struct wmOperatorType *ot)
void gpencil_undo_init(struct bGPdata *gpd)
void GPENCIL_OT_material_isolate(struct wmOperatorType *ot)
void GPENCIL_OT_brush_reset(struct wmOperatorType *ot)
void GPENCIL_OT_interpolate(struct wmOperatorType *ot)
void GPENCIL_OT_select_lasso(struct wmOperatorType *ot)
void GPENCIL_OT_bake_grease_pencil_animation(struct wmOperatorType *ot)
void GPENCIL_OT_weightmode_toggle(struct wmOperatorType *ot)
struct tGPDprimitive tGPDprimitive
void GPENCIL_OT_weight_paint(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_smooth(struct wmOperatorType *ot)
void GPENCIL_OT_select_more(struct wmOperatorType *ot)
void GPENCIL_OT_unlock_all(struct wmOperatorType *ot)
void GPENCIL_OT_lock_layer(struct wmOperatorType *ot)
void GPENCIL_OT_frame_clean_loose(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_enter_editcurve_mode(struct wmOperatorType *ot)
void GPENCIL_OT_select_random(struct wmOperatorType *ot)
struct GP_SpaceConversion GP_SpaceConversion
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc)
void GPENCIL_OT_layer_mask_move(struct wmOperatorType *ot)
const struct EnumPropertyItem * ED_gpencil_material_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
void GPENCIL_OT_stroke_join(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_invert(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_apply_thickness(struct wmOperatorType *ot)
void GPENCIL_OT_move_to_layer(struct wmOperatorType *ot)
void GPENCIL_OT_layer_active(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_sample(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_merge(struct wmOperatorType *ot)
void GPENCIL_OT_snap_to_grid(struct wmOperatorType *ot)
void GPENCIL_OT_sculpt_paint(struct wmOperatorType *ot)
const EnumPropertyItem rna_gpencil_reproject_type_items[]
void GPENCIL_OT_stroke_cutter(struct wmOperatorType *ot)
void GPENCIL_OT_selectmode_toggle(struct wmOperatorType *ot)
void GPENCIL_OT_material_to_vertex_color(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_arrange(struct wmOperatorType *ot)
void GPENCIL_OT_frame_clean_duplicate(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_smooth(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_reset_vertex_color(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_normalize(struct wmOperatorType *ot)
void GPENCIL_OT_layer_add(struct wmOperatorType *ot)
void ED_gpencil_draw_fill(struct tGPDdraw *tgpw)
@ GP_PAINTMODE_DRAW_STRAIGHT
void GPENCIL_OT_annotation_active_frame_delete(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_normalize(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_deselect(struct wmOperatorType *ot)
void GPENCIL_OT_reset_transform_fill(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_curve(struct wmOperatorType *ot)
void gpencil_point_3d_to_xy(const GP_SpaceConversion *gsc, short flag, const float pt[3], float xy[2])
void GPENCIL_OT_blank_frame_add(struct wmOperatorType *ot)
void GPENCIL_OT_snap_to_cursor(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_editcurve_set_handle_type(struct wmOperatorType *ot)
void GPENCIL_OT_transform_fill(struct wmOperatorType *ot)
void GPENCIL_OT_editmode_toggle(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_cyclical_set(struct wmOperatorType *ot)
void GPENCIL_OT_select_first(struct wmOperatorType *ot)
void GPENCIL_OT_layer_remove(struct wmOperatorType *ot)
void gpencil_point_to_parent_space(const bGPDspoint *pt, const float diff_mat[4][4], bGPDspoint *r_pt)
void GPENCIL_OT_primitive_circle(struct wmOperatorType *ot)
bool gpencil_brush_create_presets_poll(bContext *C)
void GPENCIL_OT_image_to_grease_pencil(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_box(struct wmOperatorType *ot)
void GPENCIL_OT_material_unlock_all(struct wmOperatorType *ot)
void GPENCIL_OT_reproject(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_merge_by_distance(struct wmOperatorType *ot)
void GPENCIL_OT_layer_mask_remove(struct wmOperatorType *ot)
void GPENCIL_OT_active_frame_delete(struct wmOperatorType *ot)
void GPENCIL_OT_frame_clean_fill(struct wmOperatorType *ot)
void GPENCIL_OT_annotation_add(struct wmOperatorType *ot)
void gpencil_apply_parent_point(struct Depsgraph *depsgraph, struct Object *obact, bGPDlayer *gpl, bGPDspoint *pt)
void GPENCIL_OT_stroke_simplify(struct wmOperatorType *ot)
void GPENCIL_OT_material_hide(struct wmOperatorType *ot)
void GPENCIL_OT_snap_cursor_to_selected(struct wmOperatorType *ot)
int gpencil_delete_selected_point_wrap(bContext *C)
void GPENCIL_OT_select(struct wmOperatorType *ot)
struct GHash * gpencil_copybuf_validate_colormap(struct bContext *C)
void GPENCIL_OT_vertex_color_hsv(struct wmOperatorType *ot)
void GPENCIL_OT_select_linked(struct wmOperatorType *ot)
void GPENCIL_OT_select_grouped(struct wmOperatorType *ot)
void GPENCIL_OT_copy(struct wmOperatorType *ot)
void GPENCIL_OT_layer_duplicate(struct wmOperatorType *ot)
bool gpencil_active_brush_poll(struct bContext *C)
void GPENCIL_OT_brush_reset_all(struct wmOperatorType *ot)
void GPENCIL_OT_trace_image(struct wmOperatorType *ot)
void GPENCIL_OT_layer_move(struct wmOperatorType *ot)
void gpencil_undo_push(struct bGPdata *gpd)
void GPENCIL_OT_stroke_split(struct wmOperatorType *ot)
void GPENCIL_OT_sculptmode_toggle(struct wmOperatorType *ot)
void GPENCIL_OT_draw(struct wmOperatorType *ot)
void GPENCIL_OT_guide_rotate(struct wmOperatorType *ot)
void GPENCIL_OT_set_active_material(struct wmOperatorType *ot)
void GPENCIL_OT_layer_duplicate_object(struct wmOperatorType *ot)
void GPENCIL_OT_vertexmode_toggle(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_assign(struct wmOperatorType *ot)
const struct EnumPropertyItem * ED_gpencil_layers_with_new_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
void GPENCIL_OT_primitive_polyline(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_select(struct wmOperatorType *ot)
void GPENCIL_OT_delete(struct wmOperatorType *ot)
void GPENCIL_OT_data_unlink(struct wmOperatorType *ot)
bool gpencil_point_xy_to_3d(const GP_SpaceConversion *gsc, struct Scene *scene, const float screen_co[2], float r_out[3])
void GPENCIL_OT_extrude(struct wmOperatorType *ot)
const struct EnumPropertyItem * ED_gpencil_layers_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
void GPENCIL_OT_select_box(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_levels(struct wmOperatorType *ot)
void GPENCIL_OT_layer_merge(struct wmOperatorType *ot)
bool gpencil_active_layer_poll(struct bContext *C)
void GPENCIL_OT_interpolate_sequence(struct wmOperatorType *ot)
void GPENCIL_OT_duplicate(struct wmOperatorType *ot)
void GPENCIL_OT_layer_change(struct wmOperatorType *ot)
void GPENCIL_OT_bake_mesh_animation(struct wmOperatorType *ot)
void GPENCIL_OT_layer_mask_add(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_change_color(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_set(struct wmOperatorType *ot)
void GPENCIL_OT_generate_weights(struct wmOperatorType *ot)
void gpencil_undo_finish(void)
ListBase gpencil_strokes_copypastebuf
void GPENCIL_OT_convert(struct wmOperatorType *ot)
void GPENCIL_OT_interpolate_reverse(struct wmOperatorType *ot)
void GPENCIL_OT_lock_all(struct wmOperatorType *ot)
void GPENCIL_OT_extract_palette_vertex(struct wmOperatorType *ot)
void GPENCIL_OT_layer_isolate(struct wmOperatorType *ot)
void GPENCIL_OT_material_lock_unused(struct wmOperatorType *ot)
void gpencil_point_to_xy_fl(const GP_SpaceConversion *gsc, const bGPDstroke *gps, const bGPDspoint *pt, float *r_x, float *r_y)
void GPENCIL_OT_layer_annotation_add(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_brightness_contrast(struct wmOperatorType *ot)
void gpencil_stroke_convertcoords_tpoint(struct Scene *scene, struct ARegion *region, struct Object *ob, const struct tGPspoint *point2D, float *depth, float r_out[3])
void GPENCIL_OT_convert_old_files(struct wmOperatorType *ot)
void GPENCIL_OT_material_set(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_merge_material(struct wmOperatorType *ot)
void GPENCIL_OT_select_circle(struct wmOperatorType *ot)
void gpencil_apply_parent(struct Depsgraph *depsgraph, struct Object *obact, bGPDlayer *gpl, bGPDstroke *gps)
void GPENCIL_OT_paintmode_toggle(struct wmOperatorType *ot)
void GPENCIL_OT_material_lock_all(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_simplify_fixed(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_paint(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_caps_set(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_normalize_all(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_separate(struct wmOperatorType *ot)
void GPENCIL_OT_selection_opacity_toggle(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_group_remove_from(struct wmOperatorType *ot)
void GPENCIL_OT_select_alternate(struct wmOperatorType *ot)
void GPENCIL_OT_recalc_geometry(struct wmOperatorType *ot)
struct GpRandomSettings GpRandomSettings
void GPENCIL_OT_hide(struct wmOperatorType *ot)
bool gpencil_stroke_inside_circle(const float mval[2], int rad, int x0, int y0, int x1, int y1)
void GPENCIL_OT_frame_duplicate(struct wmOperatorType *ot)
void GPENCIL_OT_active_frames_delete_all(struct wmOperatorType *ot)
void GPENCIL_OT_select_last(struct wmOperatorType *ot)
void GPENCIL_OT_dissolve(struct wmOperatorType *ot)
void GPENCIL_OT_material_reveal(struct wmOperatorType *ot)
void gpencil_subdivide_stroke(bGPdata *gpd, bGPDstroke *gps, int subdivide)
void GPENCIL_OT_fill(struct wmOperatorType *ot)
void GPENCIL_OT_materials_copy_to_object(struct wmOperatorType *ot)
bool gpencil_add_poll(struct bContext *C)
void GPENCIL_OT_reveal(struct wmOperatorType *ot)
void GPENCIL_OT_paste(struct wmOperatorType *ot)
void gpencil_point_to_xy(const GP_SpaceConversion *gsc, const struct bGPDstroke *gps, const struct bGPDspoint *pt, int *r_x, int *r_y)
void GPENCIL_OT_select_less(struct wmOperatorType *ot)
void GPENCIL_OT_layer_annotation_remove(struct wmOperatorType *ot)
void GPENCIL_OT_select_all(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_trim(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_subdivide(struct wmOperatorType *ot)
void GPENCIL_OT_primitive_line(struct wmOperatorType *ot)
void GPENCIL_OT_material_select(struct wmOperatorType *ot)
void GPENCIL_OT_vertex_color_invert(struct wmOperatorType *ot)
void GPENCIL_OT_stroke_flip(struct wmOperatorType *ot)
float inverse_diff_mat[4][4]
struct Depsgraph * depsgraph
struct RegionView3D * rv3d
struct ViewDepths * depths
struct Depsgraph * depsgraph
GpRandomSettings random_settings
struct Material * material
struct RegionView3D * rv3d