diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_datafiles.h | 63 | ||||
-rw-r--r-- | source/blender/editors/include/ED_gpencil.h | 188 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframes_draw.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 35 | ||||
-rw-r--r-- | source/blender/editors/include/UI_icons.h | 24 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 9 |
7 files changed, 252 insertions, 77 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 59a54f03e56..ae86e4a5fbf 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -197,6 +197,8 @@ typedef enum eAnim_ChannelType { ANIMTYPE_NLATRACK, ANIMTYPE_NLAACTION, + ANIMTYPE_PALETTE, + /* always as last item, the total number of channel types... */ ANIMTYPE_NUM_TYPES } eAnim_ChannelType; @@ -347,6 +349,9 @@ typedef enum eAnimFilter_Flags { /* Movie clip only */ #define EXPANDED_MCLIP(clip) (clip->flag & MCLIP_DATA_EXPAND) +/* Palette only */ +#define EXPANDED_PALETTE(palette) (palette->flag & PALETTE_DATA_EXPAND) + /* AnimData - NLA mostly... */ #define SEL_ANIMDATA(adt) (adt->flag & ADT_UI_SELECTED) diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h index 7d509d1243a..333e3d72615 100644 --- a/source/blender/editors/include/ED_datafiles.h +++ b/source/blender/editors/include/ED_datafiles.h @@ -42,6 +42,9 @@ extern char datatoc_preview_blend[]; extern int datatoc_preview_cycles_blend_size; extern char datatoc_preview_cycles_blend[]; +extern int datatoc_preview_grease_pencil_blend_size; +extern char datatoc_preview_grease_pencil_blend[]; + extern int datatoc_blender_icons16_png_size; extern char datatoc_blender_icons16_png[]; @@ -239,6 +242,66 @@ extern char datatoc_mc23_jpg[]; extern int datatoc_mc24_jpg_size; extern char datatoc_mc24_jpg[]; +/* grease pencil sculpt brushes files */ + +extern int datatoc_gp_brush_smooth_png_size; +extern char datatoc_gp_brush_smooth_png[]; + +extern int datatoc_gp_brush_thickness_png_size; +extern char datatoc_gp_brush_thickness_png[]; + +extern int datatoc_gp_brush_strength_png_size; +extern char datatoc_gp_brush_strength_png[]; + +extern int datatoc_gp_brush_grab_png_size; +extern char datatoc_gp_brush_grab_png[]; + +extern int datatoc_gp_brush_push_png_size; +extern char datatoc_gp_brush_push_png[]; + +extern int datatoc_gp_brush_twist_png_size; +extern char datatoc_gp_brush_twist_png[]; + +extern int datatoc_gp_brush_pinch_png_size; +extern char datatoc_gp_brush_pinch_png[]; + +extern int datatoc_gp_brush_randomize_png_size; +extern char datatoc_gp_brush_randomize_png[]; + +extern int datatoc_gp_brush_clone_png_size; +extern char datatoc_gp_brush_clone_png[]; + +extern int datatoc_gp_brush_weight_png_size; +extern char datatoc_gp_brush_weight_png[]; + +extern int datatoc_gp_brush_pencil_png_size; +extern char datatoc_gp_brush_pencil_png[]; + +extern int datatoc_gp_brush_pen_png_size; +extern char datatoc_gp_brush_pen_png[]; + +extern int datatoc_gp_brush_ink_png_size; +extern char datatoc_gp_brush_ink_png[]; + +extern int datatoc_gp_brush_inknoise_png_size; +extern char datatoc_gp_brush_inknoise_png[]; + +extern int datatoc_gp_brush_block_png_size; +extern char datatoc_gp_brush_block_png[]; + +extern int datatoc_gp_brush_marker_png_size; +extern char datatoc_gp_brush_marker_png[]; + +extern int datatoc_gp_brush_fill_png_size; +extern char datatoc_gp_brush_fill_png[]; + +extern int datatoc_gp_brush_erase_soft_png_size; +extern char datatoc_gp_brush_erase_soft_png[]; + +extern int datatoc_gp_brush_erase_hard_png_size; +extern char datatoc_gp_brush_erase_hard_png[]; +extern int datatoc_gp_brush_erase_stroke_png_size; +extern char datatoc_gp_brush_erase_stroke_png[]; #endif /* __ED_DATAFILES_H__ */ diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index f1f2ce29e7f..3013b455de4 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -30,64 +30,44 @@ #ifndef __ED_GPENCIL_H__ #define __ED_GPENCIL_H__ -#include "ED_numinput.h" - struct ID; struct ListBase; -struct bContext; -struct Depsgraph; -struct ScrArea; -struct ARegion; -struct View3D; -struct Object; +struct PointerRNA; +struct rcti; + struct bGPdata; struct bGPDlayer; struct bGPDframe; struct bGPDstroke; -struct bGPDpalette; -struct bGPDpalettecolor; -struct bAnimContext; -struct KeyframeEditData; -struct PointerRNA; +struct bGPDspoint; +struct Brush; + +struct Main; +struct bContext; +struct EvaluationContext; +struct Depsgraph; +struct ScrArea; +struct ARegion; +struct RegionView3D; struct Scene; +struct ToolSettings; struct ViewLayer; -struct wmWindowManager; -struct wmKeyConfig; - - -/* ------------- Grease-Pencil Helpers ---------------- */ -typedef struct tGPDinterpolate_layer { - struct tGPDinterpolate_layer *next, *prev; - - struct bGPDlayer *gpl; /* layer */ - struct bGPDframe *prevFrame; /* frame before current frame (interpolate-from) */ - struct bGPDframe *nextFrame; /* frame after current frame (interpolate-to) */ - struct bGPDframe *interFrame; /* interpolated frame */ - float factor; /* interpolate factor */ +struct View3D; -} tGPDinterpolate_layer; +struct Object; +struct Material; -/* Temporary interpolate operation data */ -typedef struct tGPDinterpolate { - struct Scene *scene; /* current scene from context */ - struct ScrArea *sa; /* area where painting originated */ - struct ARegion *ar; /* region where painting originated */ - struct bGPdata *gpd; /* current GP datablock */ +struct bAnimContext; +struct KeyframeEditData; - int cframe; /* current frame number */ - ListBase ilayers; /* (tGPDinterpolate_layer) layers to be interpolated */ - float shift; /* value for determining the displacement influence */ - float init_factor; /* initial interpolation factor for active layer */ - float low_limit; /* shift low limit (-100%) */ - float high_limit; /* shift upper limit (200%) */ - int flag; /* flag from toolsettings */ +struct wmKeyConfig; +struct wmOperator; +struct wmWindow; +struct wmWindowManager; - NumInput num; /* numeric input */ - void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */ - void *draw_handle_screen; /* handle for drawing strokes while operator is running screen stuff */ -} tGPDinterpolate; +/* ------------- Grease-Pencil Runtime Data ---------------- */ -/* Temporary 'Stroke Point' data +/* Temporary 'Stroke Point' data (2D / screen-space) * * Used as part of the 'stroke cache' used during drawing of new strokes */ @@ -96,27 +76,43 @@ typedef struct tGPspoint { float pressure; /* pressure of tablet at this point */ float strength; /* pressure of tablet at this point for alpha factor */ float time; /* Time relative to stroke start (used when converting to path) */ + float uv_fac; /* factor of uv along the stroke */ + float uv_rot; /* uv rotation for dor mode */ } tGPspoint; - -/* Check if 'sketching sessions' are enabled */ -#define GPENCIL_SKETCH_SESSIONS_ON(scene) ((scene)->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINTSESSIONS_ON) +/* used to sort by zdepth gpencil objects in viewport */ +/* TODO: this could be a system parameter in userprefs screen */ +#define GP_CACHE_BLOCK_SIZE 16 +typedef struct tGPencilSort { + struct Base *base; + float zdepth; +} tGPencilSort; /* ----------- Grease Pencil Tools/Context ------------- */ /* Context-dependent */ -struct bGPdata **ED_gpencil_data_get_pointers(const struct bContext *C, struct PointerRNA *ptr); +struct bGPdata **ED_gpencil_data_get_pointers(const struct bContext *C, struct PointerRNA *r_ptr); + struct bGPdata *ED_gpencil_data_get_active(const struct bContext *C); +struct bGPdata *ED_gpencil_data_get_active_evaluated(const struct bContext *C); /* Context independent (i.e. each required part is passed in instead) */ -struct bGPdata **ED_gpencil_data_get_pointers_direct(struct ID *screen_id, struct Scene *scene, - struct ScrArea *sa, struct Object *ob, - struct PointerRNA *ptr); -struct bGPdata *ED_gpencil_data_get_active_direct(struct ID *screen_id, struct Scene *scene, - struct ScrArea *sa, struct Object *ob); +struct bGPdata **ED_gpencil_data_get_pointers_direct( + struct ID *screen_id, + struct ScrArea *sa, + struct Scene *scene, + struct Object *ob, + struct PointerRNA *r_ptr); +struct bGPdata *ED_gpencil_data_get_active_direct( + struct ID *screen_id, + struct ScrArea *sa, + struct Scene *scene, + struct Object *ob); + +bool ED_gpencil_data_owner_is_annotation(struct PointerRNA *owner_ptr); /* 3D View */ -struct bGPdata *ED_gpencil_data_get_active_v3d(struct Scene *scene, struct ViewLayer *view_layer); +struct bGPdata *ED_gpencil_data_get_active_v3d(struct ViewLayer *view_layer); bool ED_gpencil_has_keyframe_v3d(struct Scene *scene, struct Object *ob, int cfra); @@ -124,13 +120,7 @@ bool ED_gpencil_has_keyframe_v3d(struct Scene *scene, struct Object *ob, int cfr bool ED_gpencil_stroke_can_use_direct(const struct ScrArea *sa, const struct bGPDstroke *gps); bool ED_gpencil_stroke_can_use(const struct bContext *C, const struct bGPDstroke *gps); -bool ED_gpencil_stroke_color_use(const struct bGPDlayer *gpl, const struct bGPDstroke *gps); - -struct bGPDpalettecolor *ED_gpencil_stroke_getcolor(struct bGPdata *gpd, struct bGPDstroke *gps); - -bool ED_gpencil_stroke_minmax( - const struct bGPDstroke *gps, const bool use_select, - float r_min[3], float r_max[3]); +bool ED_gpencil_stroke_color_use(struct Object *ob, const struct bGPDlayer *gpl, const struct bGPDstroke *gps); /* ----------- Grease Pencil Operators ----------------- */ @@ -150,16 +140,29 @@ void ED_gpencil_strokes_copybuf_free(void); void ED_gpencil_draw_2dimage(const struct bContext *C); void ED_gpencil_draw_view2d(const struct bContext *C, bool onlyv2d); -void ED_gpencil_draw_view3d(struct wmWindowManager *wm, - struct Scene *scene, - struct ViewLayer *view_layer, - struct Depsgraph *depsgraph, - struct View3D *v3d, - struct ARegion *ar, - bool only3d); -void ED_gpencil_draw_ex(struct Scene *scene, struct bGPdata *gpd, int winx, int winy, - const int cfra, const char spacetype); -void ED_gp_draw_interpolation(struct tGPDinterpolate *tgpi, const int type); +void ED_gpencil_draw_view3d( + struct wmWindowManager *wm, + struct Scene *scene, + struct ViewLayer *view_layer, + struct Depsgraph *depsgraph, + struct View3D *v3d, + struct ARegion *ar, + bool only3d); +void ED_gpencil_draw_view3d_annotations( + struct Scene *scene, struct Depsgraph *depsgraph, + struct View3D *v3d, struct ARegion *ar, + bool only3d); +void ED_gpencil_draw_view3d_object( + struct wmWindowManager *wm, + struct Scene *scene, + struct Depsgraph *depsgraph, + struct Object *ob, + struct View3D *v3d, + struct ARegion *ar, + bool only3d); +void ED_gpencil_draw_ex( + struct RegionView3D *rv3d, struct Scene *scene, struct bGPdata *gpd, int winx, int winy, + const int cfra, const char spacetype); /* ----------- Grease-Pencil AnimEdit API ------------------ */ bool ED_gplayer_frames_looper(struct bGPDlayer *gpl, struct Scene *scene, @@ -192,10 +195,45 @@ int ED_undo_gpencil_step(struct bContext *C, int step, const char *name); /* ------------ Transformation Utilities ------------ */ -/* get difference matrix using parent */ -void ED_gpencil_parent_location(struct bGPDlayer *gpl, float diff_mat[4][4]); +/* get difference matrix */ +void ED_gpencil_parent_location( + const struct Depsgraph *depsgraph, struct Object *obact, struct bGPdata *gpd, + struct bGPDlayer *gpl, float diff_mat[4][4]); /* reset parent matrix for all layers */ -void ED_gpencil_reset_layers_parent(struct bGPdata *gpd); +void ED_gpencil_reset_layers_parent(struct Depsgraph *depsgraph, struct Object *obact, struct bGPdata *gpd); + +/* cursor utilities */ +void ED_gpencil_brush_draw_eraser(struct Brush *brush, int x, int y); + +/* ----------- Add Primitive Utilities -------------- */ + +void ED_gpencil_create_monkey(struct bContext *C, float mat[4][4]); + +/* ------------ Object Utilities ------------ */ +struct Object *ED_add_gpencil_object(struct bContext *C, struct Scene *scene, const float loc[3]); +void ED_gpencil_add_defaults(struct bContext *C); +/* set object modes */ +void ED_gpencil_setup_modes(struct bContext *C, struct bGPdata *gpd, int newmode); + +void ED_gp_project_stroke_to_plane(struct Object *ob, struct RegionView3D *rv3d, struct bGPDstroke *gps, const float origin[3], const int axis); +void ED_gp_project_point_to_plane(struct Object *ob, struct RegionView3D *rv3d, const float origin[3], const int axis, struct bGPDspoint *pt); +void ED_gp_get_drawing_reference(struct View3D *v3d, struct Scene *scene, struct Object *ob, struct bGPDlayer *gpl, char align_flag, float vec[3]); + +/* set sculpt cursor */ +void ED_gpencil_toggle_brush_cursor(struct bContext *C, bool enable, void *customdata); + +/* vertex groups */ +void ED_gpencil_vgroup_assign(struct bContext *C, struct Object *ob, float weight); +void ED_gpencil_vgroup_remove(struct bContext *C, struct Object *ob); +void ED_gpencil_vgroup_select(struct bContext *C, struct Object *ob); +void ED_gpencil_vgroup_deselect(struct bContext *C, struct Object *ob); + +/* join objects */ +int ED_gpencil_join_objects_exec(struct bContext *C, struct wmOperator *op); +/* texture coordinate utilities */ +void ED_gpencil_tpoint_to_point(struct ARegion *ar, float origin[3], const struct tGPspoint *tpt, struct bGPDspoint *pt); +void ED_gpencil_calc_stroke_uv(struct Object *ob, struct bGPDstroke *gps); +void ED_gpencil_update_color_uv(struct Main *bmain, struct Material *mat); #endif /* __ED_GPENCIL_H__ */ diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 64dee410526..45a0680e0c1 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -42,6 +42,7 @@ struct bActionGroup; struct Object; struct ListBase; struct bGPDlayer; +struct Palette; struct MaskLayer; struct Scene; struct View2D; @@ -151,9 +152,11 @@ void scene_to_keylist(struct bDopeSheet *ads, struct Scene *sce, struct DLRBT_Tr /* DopeSheet Summary */ void summary_to_keylist(struct bAnimContext *ac, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks); /* Grease Pencil datablock summary */ -void gpencil_to_keylist(struct bDopeSheet *ads, struct bGPdata *gpd, struct DLRBT_Tree *keys); +void gpencil_to_keylist(struct bDopeSheet *ads, struct bGPdata *gpd, struct DLRBT_Tree *keys, const bool active); /* Grease Pencil Layer */ void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys); +/* Palette */ +void palette_to_keylist(struct bDopeSheet *ads, struct Palette *palette, struct DLRBT_Tree *keys, struct DLRBT_Tree *blocks); /* Mask */ void mask_to_keylist(struct bDopeSheet *UNUSED(ads), struct MaskLayer *masklay, struct DLRBT_Tree *keys); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 9fd5cc99073..a39523983ba 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -42,6 +42,7 @@ struct ID; struct Main; struct Menu; struct ModifierData; +struct ShaderFxData; struct Object; struct ReportList; struct Scene; @@ -261,6 +262,40 @@ bool ED_object_iter_other( bool ED_object_multires_update_totlevels_cb(struct Object *ob, void *totlevel_v); + +/* object_greasepencil_modifier.c */ +struct GpencilModifierData *ED_object_gpencil_modifier_add( + struct ReportList *reports, struct Main *bmain, struct Scene *scene, + struct Object *ob, const char *name, int type); +bool ED_object_gpencil_modifier_remove( + struct ReportList *reports, struct Main *bmain, + struct Object *ob, struct GpencilModifierData *md); +void ED_object_gpencil_modifier_clear( + struct Main *bmain, struct Object *ob); +int ED_object_gpencil_modifier_move_down( + struct ReportList *reports, struct Object *ob, struct GpencilModifierData *md); +int ED_object_gpencil_modifier_move_up( + struct ReportList *reports, struct Object *ob, struct GpencilModifierData *md); +int ED_object_gpencil_modifier_apply( + struct Main *bmain, struct ReportList *reports, struct Depsgraph *depsgraph, + struct Object *ob, struct GpencilModifierData *md, int mode); +int ED_object_gpencil_modifier_copy( + struct ReportList *reports, struct Object *ob, struct GpencilModifierData *md); + +/* object_shader_fx.c */ +struct ShaderFxData *ED_object_shaderfx_add( + struct ReportList *reports, struct Main *bmain, struct Scene *scene, + struct Object *ob, const char *name, int type); +bool ED_object_shaderfx_remove( + struct ReportList *reports, struct Main *bmain, + struct Object *ob, struct ShaderFxData *fx); +void ED_object_shaderfx_clear( + struct Main *bmain, struct Object *ob); +int ED_object_shaderfx_move_down( + struct ReportList *reports, struct Object *ob, struct ShaderFxData *fx); +int ED_object_shaderfx_move_up( + struct ReportList *reports, struct Object *ob, struct ShaderFxData *fx); + /* object_select.c */ void ED_object_select_linked_by_id(struct bContext *C, struct ID *id); diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index ec4c7dddd4c..dec02faf85c 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -1001,6 +1001,30 @@ DEF_ICON(MATCAP_22) DEF_ICON(MATCAP_23) DEF_ICON(MATCAP_24) +/* grease pencil sculpt */ +DEF_ICON(GPBRUSH_SMOOTH) +DEF_ICON(GPBRUSH_THICKNESS) +DEF_ICON(GPBRUSH_STRENGTH) +DEF_ICON(GPBRUSH_GRAB) +DEF_ICON(GPBRUSH_PUSH) +DEF_ICON(GPBRUSH_TWIST) +DEF_ICON(GPBRUSH_PINCH) +DEF_ICON(GPBRUSH_RANDOMIZE) +DEF_ICON(GPBRUSH_CLONE) +DEF_ICON(GPBRUSH_WEIGHT) + +DEF_ICON(GPBRUSH_PENCIL) +DEF_ICON(GPBRUSH_PEN) +DEF_ICON(GPBRUSH_INK) +DEF_ICON(GPBRUSH_INKNOISE) +DEF_ICON(GPBRUSH_BLOCK) +DEF_ICON(GPBRUSH_MARKER) +DEF_ICON(GPBRUSH_CUSTOM) +DEF_ICON(GPBRUSH_FILL) +DEF_ICON(GPBRUSH_ERASE_SOFT) +DEF_ICON(GPBRUSH_ERASE_HARD) +DEF_ICON(GPBRUSH_ERASE_STROKE) + /* vector icons, VICO_ prefix added */ DEF_VICO(SMALL_TRI_RIGHT_VEC) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b4756eaed0f..fc3dd3f9968 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1022,7 +1022,8 @@ uiLayout *uiLayoutRadial(uiLayout *layout); void uiTemplateHeader(uiLayout *layout, struct bContext *C); void uiTemplateID( uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, - const char *newop, const char *openop, const char *unlinkop, int filter); + const char *newop, const char *openop, const char *unlinkop, + int filter, const bool live_icon); void uiTemplateIDBrowse( uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter); @@ -1052,6 +1053,12 @@ void uiTemplatePathBuilder( uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *root_ptr, const char *text); uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); +uiLayout *uiTemplateGpencilModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); +void uiTemplateGpencilColorPreview( + uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, + int rows, int cols, float scale, int filter); + +uiLayout *uiTemplateShaderFx(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); void uiTemplateOperatorRedoProperties(uiLayout *layout, const struct bContext *C); |