diff options
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_intern.h')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_intern.h | 71 |
1 files changed, 67 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 290935a06cf..368da618a1d 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -44,6 +44,10 @@ struct ARegion; struct View2D; struct wmOperatorType; +struct PointerRNA; +struct PropertyRNA; +struct EnumPropertyItem; + /* ***************************************************** */ /* Internal API */ @@ -96,12 +100,54 @@ void gp_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc); void gp_point_to_xy(GP_SpaceConversion *settings, struct bGPDstroke *gps, struct bGPDspoint *pt, int *r_x, int *r_y); +/** + * Convert a screenspace point to a 3D Grease Pencil coordinate. + * + * For use with editing tools where it is easier to perform the operations in 2D, + * and then later convert the transformed points back to 3D. + * + * \param screeN_co The screenspace 2D coordinates to convert to + * \param[out] r_out The resulting 3D coordinates of the input point + */ +bool gp_point_xy_to_3d(GP_SpaceConversion *gsc, struct Scene *scene, const float screen_co[2], float r_out[3]); + /* Poll Callbacks ------------------------------------ */ /* gpencil_utils.c */ int gp_add_poll(struct bContext *C); int gp_active_layer_poll(struct bContext *C); +/* Copy/Paste Buffer --------------------------------- */ +/* gpencil_edit.c */ + +extern ListBase gp_strokes_copypastebuf; + +/* Stroke Editing ------------------------------------ */ + +void gp_stroke_delete_tagged_points(bGPDframe *gpf, bGPDstroke *gps, bGPDstroke *next_stroke, int tag_flags); + + +/** + * Apply smooth to stroke point + * \param gps Stroke to smooth + * \param i Point index + * \param inf Amount of smoothing to apply + * \param affect_pressure Apply smoothing to pressure values too? + */ +bool gp_smooth_stroke(bGPDstroke *gps, int i, float inf, bool affect_pressure); + +/** + * Subdivide a stroke once, by adding points at the midpoint between each pair of points + * \param gps Stroke data + * \param new_totpoints Total number of points (after subdividing) + */ +void gp_subdivide_stroke(bGPDstroke *gps, const int new_totpoints); + +/* Layers Enums -------------------------------------- */ + +struct EnumPropertyItem *ED_gpencil_layers_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free); +struct EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free); + /* ***************************************************** */ /* Operator Defines */ @@ -119,6 +165,8 @@ typedef enum eGPencil_PaintModes { /* stroke editing ----- */ +void GPENCIL_OT_editmode_toggle(struct wmOperatorType *ot); + void GPENCIL_OT_select(struct wmOperatorType *ot); void GPENCIL_OT_select_all(struct wmOperatorType *ot); void GPENCIL_OT_select_circle(struct wmOperatorType *ot); @@ -126,6 +174,7 @@ void GPENCIL_OT_select_border(struct wmOperatorType *ot); void GPENCIL_OT_select_lasso(struct wmOperatorType *ot); void GPENCIL_OT_select_linked(struct wmOperatorType *ot); +void GPENCIL_OT_select_grouped(struct wmOperatorType *ot); void GPENCIL_OT_select_more(struct wmOperatorType *ot); void GPENCIL_OT_select_less(struct wmOperatorType *ot); @@ -135,6 +184,19 @@ void GPENCIL_OT_dissolve(struct wmOperatorType *ot); void GPENCIL_OT_copy(struct wmOperatorType *ot); void GPENCIL_OT_paste(struct wmOperatorType *ot); +void GPENCIL_OT_move_to_layer(struct wmOperatorType *ot); +void GPENCIL_OT_layer_change(struct wmOperatorType *ot); + +void GPENCIL_OT_snap_to_grid(struct wmOperatorType *ot); +void GPENCIL_OT_snap_to_cursor(struct wmOperatorType *ot); +void GPENCIL_OT_snap_cursor_to_selected(struct wmOperatorType *ot); +void GPENCIL_OT_snap_cursor_to_center(struct wmOperatorType *ot); + + +/* stroke sculpting -- */ + +void GPENCIL_OT_brush_paint(struct wmOperatorType *ot); + /* buttons editing --- */ void GPENCIL_OT_data_add(struct wmOperatorType *ot); @@ -148,6 +210,11 @@ void GPENCIL_OT_layer_duplicate(struct wmOperatorType *ot); void GPENCIL_OT_hide(struct wmOperatorType *ot); void GPENCIL_OT_reveal(struct wmOperatorType *ot); +void GPENCIL_OT_lock_all(struct wmOperatorType *ot); +void GPENCIL_OT_unlock_all(struct wmOperatorType *ot); + +void GPENCIL_OT_layer_isolate(struct wmOperatorType *ot); + void GPENCIL_OT_active_frame_delete(struct wmOperatorType *ot); void GPENCIL_OT_convert(struct wmOperatorType *ot); @@ -203,8 +270,4 @@ typedef enum ACTCONT_TYPES { ACTCONT_GPENCIL } ACTCONT_TYPES; - - - #endif /* __GPENCIL_INTERN_H__ */ - |