diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 52 | ||||
-rw-r--r-- | source/blender/editors/include/ED_clip.h | 14 | ||||
-rw-r--r-- | source/blender/editors/include/ED_gpencil.h | 23 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframes_draw.h | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mask.h | 74 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 1 | ||||
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 1 | ||||
-rw-r--r-- | source/blender/editors/include/ED_transform.h | 7 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 | ||||
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 19 |
11 files changed, 165 insertions, 37 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 6ababe2becb..7afa9fe8bc5 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -89,15 +89,16 @@ typedef struct bAnimContext { /* Main Data container types */ typedef enum eAnimCont_Types { - ANIMCONT_NONE = 0, /* invalid or no data */ - ANIMCONT_ACTION, /* action (bAction) */ - ANIMCONT_SHAPEKEY, /* shapekey (Key) */ - ANIMCONT_GPENCIL, /* grease pencil (screen) */ - ANIMCONT_DOPESHEET, /* dopesheet (bDopesheet) */ - ANIMCONT_FCURVES, /* animation F-Curves (bDopesheet) */ - ANIMCONT_DRIVERS, /* drivers (bDopesheet) */ - ANIMCONT_NLA, /* nla (bDopesheet) */ - ANIMCONT_CHANNEL /* animation channel (bAnimListElem) */ + ANIMCONT_NONE = 0, /* invalid or no data */ + ANIMCONT_ACTION = 1, /* action (bAction) */ + ANIMCONT_SHAPEKEY = 2, /* shapekey (Key) */ + ANIMCONT_GPENCIL = 3, /* grease pencil (screen) */ + ANIMCONT_DOPESHEET = 4, /* dopesheet (bDopesheet) */ + ANIMCONT_FCURVES = 5, /* animation F-Curves (bDopesheet) */ + ANIMCONT_DRIVERS = 6, /* drivers (bDopesheet) */ + ANIMCONT_NLA = 7, /* nla (bDopesheet) */ + ANIMCONT_CHANNEL = 8, /* animation channel (bAnimListElem) */ + ANIMCONT_MASK = 9 /* mask dopesheet */ } eAnimCont_Types; /* --------------- Channels -------------------- */ @@ -161,6 +162,9 @@ typedef enum eAnim_ChannelType { ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, + + ANIMTYPE_MASKDATABLOCK, + ANIMTYPE_MASKLAYER, ANIMTYPE_NLATRACK, ANIMTYPE_NLAACTION, @@ -174,6 +178,7 @@ typedef enum eAnim_KeyType { ALE_NONE = 0, /* no keyframe data */ ALE_FCURVE, /* F-Curve */ ALE_GPFRAME, /* Grease Pencil Frames */ + ALE_MASKLAY, /* Mask */ ALE_NLASTRIP, /* NLA Strips */ ALE_ALL, /* All channels summary */ @@ -281,6 +286,15 @@ typedef enum eAnimFilter_Flags { #define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED) == 0) #define SEL_GPL(gpl) (gpl->flag & GP_LAYER_SELECT) +/* Mask Only */ +/* Grease Pencil datablock settings */ +#define EXPANDED_MASK(mask) (mask->flag & MASK_ANIMF_EXPAND) +/* Grease Pencil Layer settings */ +#define EDITABLE_MASK(masklay) ((masklay->flag & MASK_LAYERFLAG_LOCKED) == 0) +#define SEL_MASKLAY(masklay) (masklay->flag & SELECT) + + + /* NLA only */ #define SEL_NLT(nlt) (nlt->flag & NLATRACK_SELECTED) #define EDITABLE_NLT(nlt) ((nlt->flag & NLATRACK_PROTECTED) == 0) @@ -343,20 +357,20 @@ short ANIM_animdata_context_getdata(bAnimContext *ac); /* flag-setting behavior */ typedef enum eAnimChannels_SetFlag { - ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */ - ACHANNEL_SETFLAG_ADD, /* turn on */ - ACHANNEL_SETFLAG_INVERT, /* on->off, off->on */ - ACHANNEL_SETFLAG_TOGGLE /* some on -> all off // all on */ + ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */ + ACHANNEL_SETFLAG_ADD = 1, /* turn on */ + ACHANNEL_SETFLAG_INVERT = 2, /* on->off, off->on */ + ACHANNEL_SETFLAG_TOGGLE = 3 /* some on -> all off // all on */ } eAnimChannels_SetFlag; /* types of settings for AnimChannels */ typedef enum eAnimChannel_Settings { - ACHANNEL_SETTING_SELECT = 0, - ACHANNEL_SETTING_PROTECT, // warning: for drawing UI's, need to check if this is off (maybe inverse this later) - ACHANNEL_SETTING_MUTE, - ACHANNEL_SETTING_EXPAND, - ACHANNEL_SETTING_VISIBLE, /* only for Graph Editor */ - ACHANNEL_SETTING_SOLO /* only for NLA Tracks */ + ACHANNEL_SETTING_SELECT = 0, + ACHANNEL_SETTING_PROTECT = 1, /* warning: for drawing UI's, need to check if this is off (maybe inverse this later) */ + ACHANNEL_SETTING_MUTE = 2, + ACHANNEL_SETTING_EXPAND = 3, + ACHANNEL_SETTING_VISIBLE = 4, /* only for Graph Editor */ + ACHANNEL_SETTING_SOLO = 5 /* only for NLA Tracks */ } eAnimChannel_Settings; diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 7943a17c377..1d42954a416 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -36,6 +36,7 @@ struct bContext; struct bScreen; struct ImBuf; struct Main; +struct Mask; struct MovieClip; struct SpaceClip; struct wmEvent; @@ -46,14 +47,21 @@ int ED_space_clip_poll(struct bContext *C); int ED_space_clip_view_clip_poll(struct bContext *C); int ED_space_clip_tracking_poll(struct bContext *C); -int ED_space_clip_tracking_size_poll(struct bContext *C); -int ED_space_clip_tracking_frame_poll(struct bContext *C); +int ED_space_clip_maskedit_poll(struct bContext *C); +int ED_space_clip_maskedit_mask_poll(bContext *C); void ED_space_clip_set(struct bContext *C, struct bScreen *screen, struct SpaceClip *sc, struct MovieClip *clip); struct MovieClip *ED_space_clip(struct SpaceClip *sc); +struct Mask *ED_space_clip_mask(struct SpaceClip *sc); void ED_space_clip_size(struct SpaceClip *sc, int *width, int *height); void ED_space_clip_zoom(struct SpaceClip *sc, ARegion *ar, float *zoomx, float *zoomy); void ED_space_clip_aspect(struct SpaceClip *sc, float *aspx, float *aspy); +void ED_space_clip_aspect_dimension_aware(struct SpaceClip *sc, float *aspx, float *aspy); + +int ED_space_clip_clip_framenr(struct SpaceClip *sc); + +void ED_space_clip_mask_size(struct SpaceClip *sc, int *width, int *height); +void ED_space_clip_mask_aspect(struct SpaceClip *sc, float *aspx, float *aspy); struct ImBuf *ED_space_clip_get_buffer(struct SpaceClip *sc); struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle); @@ -72,6 +80,8 @@ void ED_space_clip_unload_movieclip_buffer(struct SpaceClip *sc); void ED_space_clip_free_texture_buffer(struct SpaceClip *sc); int ED_space_clip_show_trackedit(struct SpaceClip *sc); +int ED_space_clip_show_maskedit(struct SpaceClip *sc); +void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mask *mask); /* clip_ops.c */ void ED_operatormacros_clip(void); diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index bd3e4371a79..32eb63a26d5 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -76,31 +76,34 @@ void ED_operatortypes_gpencil(void); /* ------------ Grease-Pencil Drawing API ------------------ */ /* drawgpencil.c */ -void draw_gpencil_2dimage(struct bContext *C, struct ImBuf *ibuf); +void draw_gpencil_2dimage(struct bContext *C /* , struct ImBuf *ibuf */); void draw_gpencil_view2d(struct bContext *C, short onlyv2d); void draw_gpencil_view3d(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, short only3d); void gpencil_panel_standard(const struct bContext *C, struct Panel *pa); /* ----------- Grease-Pencil AnimEdit API ------------------ */ -short gplayer_frames_looper(struct bGPDlayer *gpl, struct Scene *scene, short (*gpf_cb)(struct bGPDframe *, struct Scene *)); -void gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel); +short ED_gplayer_frames_looper(struct bGPDlayer *gpl, struct Scene *scene, + short (*gpf_cb)(struct bGPDframe *, struct Scene *)); +void ED_gplayer_make_cfra_list(struct bGPDlayer *gpl, ListBase *elems, short onlysel); -short is_gplayer_frame_selected(struct bGPDlayer *gpl); -void set_gplayer_frame_selection(struct bGPDlayer *gpl, short mode); -void select_gpencil_frames(struct bGPDlayer *gpl, short select_mode); -void select_gpencil_frame(struct bGPDlayer *gpl, int selx, short select_mode); -void borderselect_gplayer_frames(struct bGPDlayer *gpl, float min, float max, short select_mode); +short ED_gplayer_frame_select_check(struct bGPDlayer *gpl); +void ED_gplayer_frame_select_set(struct bGPDlayer *gpl, short mode); +void ED_gplayer_frames_select_border(struct bGPDlayer *gpl, float min, float max, short select_mode); +void ED_gpencil_select_frames(struct bGPDlayer *gpl, short select_mode); +void ED_gpencil_select_frame(struct bGPDlayer *gpl, int selx, short select_mode); -void delete_gplayer_frames(struct bGPDlayer *gpl); -void duplicate_gplayer_frames(struct bGPDlayer *gpd); +void ED_gplayer_frames_delete(struct bGPDlayer *gpl); +void ED_gplayer_frames_duplicate(struct bGPDlayer *gpl); +#if 0 void free_gpcopybuf(void); void copy_gpdata(void); void paste_gpdata(void); void snap_gplayer_frames(struct bGPDlayer *gpl, short mode); void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode); +#endif /* ------------ Grease-Pencil Undo System ------------------ */ int ED_gpencil_session_active(void); diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index cd64427de78..8a65699f404 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 MaskLayer; struct Scene; struct View2D; struct DLRBT_Tree; @@ -122,6 +123,8 @@ void draw_summary_channel(struct View2D *v2d, struct bAnimContext *ac, float ypo /* Grease Pencil Layer */ // XXX not restored void draw_gpl_channel(struct View2D *v2d, struct bDopeSheet *ads, struct bGPDlayer *gpl, float ypos); +/* Mask Layer */ +void draw_masklay_channel(struct View2D *v2d, struct bDopeSheet *ads, struct MaskLayer *masklay, float ypos); /* Keydata Generation --------------- */ /* F-Curve */ @@ -139,6 +142,9 @@ void summary_to_keylist(struct bAnimContext *ac, struct DLRBT_Tree *keys, struct /* Grease Pencil Layer */ // XXX not restored void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys); +/* Mask */ +// XXX not restored +void mask_to_keylist(struct bDopeSheet *UNUSED(ads), struct MaskLayer *masklay, struct DLRBT_Tree *keys); /* ActKeyColumn API ---------------- */ /* Comparator callback used for ActKeyColumns and cframe float-value pointer */ diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h new file mode 100644 index 00000000000..773da04bc7b --- /dev/null +++ b/source/blender/editors/include/ED_mask.h @@ -0,0 +1,74 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2012 Blender Foundation. + * All rights reserved. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file ED_mask.h + * \ingroup editors + */ + +#ifndef __ED_MASK_H__ +#define __ED_MASK_H__ + +struct wmKeyConfig; +struct MaskLayer; +struct MaskLayerShape; + +/* mask_editor.c */ +void ED_operatortypes_mask(void); +void ED_keymap_mask(struct wmKeyConfig *keyconf); +void ED_operatormacros_mask(void); + +/* mask_draw.c */ +void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type); + +/* mask_shapekey.c */ +void ED_mask_layer_shape_auto_key(struct MaskLayer *masklay, const int frame); +int ED_mask_layer_shape_auto_key_all(struct Mask *mask, const int frame); +int ED_mask_layer_shape_auto_key_select(struct Mask *mask, const int frame); + +/* ----------- Mask AnimEdit API ------------------ */ +short ED_masklayer_frames_looper(struct MaskLayer *masklay, struct Scene *scene, + short (*masklay_shape_cb)(struct MaskLayerShape *, struct Scene *)); +void ED_masklayer_make_cfra_list(struct MaskLayer *masklay, ListBase *elems, short onlysel); + +short ED_masklayer_frame_select_check(struct MaskLayer *masklay); +void ED_masklayer_frame_select_set(struct MaskLayer *masklay, short mode); +void ED_masklayer_frames_select_border(struct MaskLayer *masklay, float min, float max, short select_mode); +void ED_mask_select_frames(struct MaskLayer *masklay, short select_mode); +void ED_mask_select_frame(struct MaskLayer *masklay, int selx, short select_mode); + +void ED_masklayer_frames_delete(struct MaskLayer *masklay); +void ED_masklayer_frames_duplicate(struct MaskLayer *masklay); + +#if 0 +void free_gpcopybuf(void); +void copy_gpdata(void); +void paste_gpdata(void); + + void snap_masklayer_frames(struct MaskLayer *masklay, short mode); + void mirror_masklayer_frames(struct MaskLayer *masklay, short mode); +#endif + +#endif /* __ED_MASK_H__ */ diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 8dc83df2977..9c10a270ef8 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -90,6 +90,7 @@ struct Base *ED_object_scene_link(struct Scene *scene, struct Object *ob); void ED_keymap_proportional_cycle(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap); void ED_keymap_proportional_obmode(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap); +void ED_keymap_proportional_maskmode(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap); void ED_keymap_proportional_editmode(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, const short do_connected); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 464f2db30a2..4faf82eec36 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -170,6 +170,7 @@ int ED_operator_editmball(struct bContext *C); int ED_operator_uvedit(struct bContext *C); int ED_operator_uvmap(struct bContext *C); int ED_operator_posemode(struct bContext *C); +int ED_operator_mask(struct bContext *C); /* default keymaps, bitflags */ diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 3bef1f56655..608df8dd9b3 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -71,6 +71,7 @@ enum { TFM_BONESIZE, TFM_BONE_ENVELOPE, TFM_CURVE_SHRINKFATTEN, + TFM_MASK_SHRINKFATTEN, TFM_BONE_ROLL, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE, @@ -96,12 +97,13 @@ enum { #define CTX_BMESH 64 #define CTX_NDOF 128 #define CTX_MOVIECLIP 256 +#define CTX_MASK 512 /* Standalone call to get the transformation center corresponding to the current situation * returns 1 if successful, 0 otherwise (usually means there's no selection) * (if 0 is returns, *vec is unmodified) * */ -int calculateTransformCenter(struct bContext *C, int centerMode, float *cent3d, int *cent2d); +int calculateTransformCenter(struct bContext *C, int centerMode, float cent3d[3], int cent2d[2]); struct TransInfo; struct ScrArea; @@ -166,8 +168,7 @@ typedef struct DepthPeel { struct ListBase; -typedef enum SnapMode -{ +typedef enum SnapMode { SNAP_ALL = 0, SNAP_NOT_SELECTED = 1, SNAP_NOT_OBEDIT = 2 diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 55210080e01..34892fb3c27 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -282,7 +282,7 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active); int ED_view3d_context_activate(struct bContext *C); void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, - int winx, int winy, float viewmat[][4], float winmat[][4], int draw_background); + int winx, int winy, float viewmat[][4], float winmat[][4], int do_bgpic); struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, int draw_background, char err_out[256]); struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, int draw_background, char err_out[256]); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b82a0c5e480..bb6f9fad771 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -195,7 +195,8 @@ typedef struct uiLayout uiLayout; /*#define FUN 192*/ /*UNUSED*/ #define BIT 256 -#define BUTPOIN (128 + 64 + 32) +/* button reqyires a pointer */ +#define BUTPOIN (FLO | SHO | CHA) #define BUT (1 << 9) #define ROW (2 << 9) diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index ca19a8092d0..ac59d2a6983 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -151,6 +151,7 @@ enum { TH_SEQ_MOVIE, TH_SEQ_MOVIECLIP, + TH_SEQ_MASK, TH_SEQ_IMAGE, TH_SEQ_SCENE, TH_SEQ_AUDIO, @@ -203,7 +204,20 @@ enum { TH_MATCH, /* highlight color for search matches */ TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */ - TH_SKIN_ROOT + TH_SKIN_ROOT, + + TH_ANIM_ACTIVE, /* active action */ + TH_ANIM_INACTIVE, /* no active action */ + + TH_NLA_TWEAK, /* 'tweaking' track in NLA */ + TH_NLA_TWEAK_DUPLI, /* error/warning flag for other strips referencing dupli strip */ + + TH_NLA_TRANSITION, + TH_NLA_TRANSITION_SEL, + TH_NLA_META, + TH_NLA_META_SEL, + TH_NLA_SOUND, + TH_NLA_SOUND_SEL }; /* XXX WARNING: previous is saved in file, so do not change order! */ @@ -242,6 +256,9 @@ void UI_GetThemeColor3fv(int colorid, float col[3]); void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]); void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]); +// get four color values, scaled to 0.0-1.0 range +void UI_GetThemeColor4fv(int colorid, float col[4]); + // get the 3 or 4 byte values void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]); void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]); |