Blender  V2.93
ED_keyframes_draw.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) (C) 2009 Blender Foundation, Joshua Leung
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct AnimData;
31 struct CacheFile;
32 struct DLRBT_Tree;
33 struct FCurve;
34 struct ListBase;
35 struct MaskLayer;
36 struct Object;
37 struct Scene;
38 struct View2D;
39 struct bAction;
40 struct bActionGroup;
41 struct bAnimContext;
42 struct bDopeSheet;
43 struct bGPDlayer;
44 
45 /* ****************************** Base Structs ****************************** */
46 
47 /* Information about the stretch of time from current to the next column */
48 typedef struct ActKeyBlockInfo {
49  /* Combination of flags from all curves. */
50  short flag;
51  /* Mask of flags that differ between curves. */
52  short conflict;
53 
54  /* Selection flag. */
55  char sel;
57 
58 /* Keyframe Column Struct */
59 typedef struct ActKeyColumn {
60  /* ListBase linkage */
61  struct ActKeyColumn *next, *prev;
62 
63  /* sorting-tree linkage */
65  struct ActKeyColumn *left, *right;
69  char tree_col;
70 
71  /* keyframe info */
73  char key_type;
78  short sel;
79  float cfra;
80 
81  /* key-block info */
83 
84  /* number of curves and keys in this column */
87 
88 /* ActKeyBlockInfo - Flag */
89 typedef enum eActKeyBlock_Hold {
90  /* Key block represents a moving hold */
92  /* Key block represents a static hold */
94  /* Key block represents any kind of hold */
96  /* The curve segment uses non-bezier interpolation */
98  /* The block is grease pencil */
101 
102 /* *********************** Keyframe Drawing ****************************** */
103 
104 /* options for keyframe shape drawing */
106  /* only the border */
108  /* only the inside filling */
110  /* the whole thing */
113 
114 /* Handle type. */
116  /* Don't draw */
118  /* Various marks in order of increasing display priority. */
125 
126 /* Extreme type. */
129  /* Minimum/maximum present. */
132  /* Grouped keys have different states. */
134  /* Both neighbors are equal to this key. */
137 
138 /* draw simple diamond-shape keyframe */
139 /* caller should set up vertex format, bind GPU_SHADER_KEYFRAME_DIAMOND,
140  * immBegin(GPU_PRIM_POINTS, n), then call this n times */
141 void draw_keyframe_shape(float x,
142  float y,
143  float size,
144  bool sel,
145  short key_type,
146  short mode,
147  float alpha,
148  unsigned int pos_id,
149  unsigned int size_id,
150  unsigned int color_id,
151  unsigned int outline_color_id,
152  unsigned int flags_id,
153  short handle_type,
154  short extreme_type);
155 
156 /* ******************************* Methods ****************************** */
157 
158 /* Channel Drawing ------------------ */
159 /* F-Curve */
160 void draw_fcurve_channel(struct View2D *v2d,
161  struct AnimData *adt,
162  struct FCurve *fcu,
163  float ypos,
164  float yscale_fac,
165  int saction_flag);
166 /* Action Group Summary */
167 void draw_agroup_channel(struct View2D *v2d,
168  struct AnimData *adt,
169  struct bActionGroup *agrp,
170  float ypos,
171  float yscale_fac,
172  int saction_flag);
173 /* Action Summary */
174 void draw_action_channel(struct View2D *v2d,
175  struct AnimData *adt,
176  struct bAction *act,
177  float ypos,
178  float yscale_fac,
179  int saction_flag);
180 /* Object Summary */
181 void draw_object_channel(struct View2D *v2d,
182  struct bDopeSheet *ads,
183  struct Object *ob,
184  float ypos,
185  float yscale_fac,
186  int saction_flag);
187 /* Scene Summary */
188 void draw_scene_channel(struct View2D *v2d,
189  struct bDopeSheet *ads,
190  struct Scene *sce,
191  float ypos,
192  float yscale_fac,
193  int saction_flag);
194 /* DopeSheet Summary */
196  struct View2D *v2d, struct bAnimContext *ac, float ypos, float yscale_fac, int saction_flag);
197 /* Grease Pencil datablock summary */
198 void draw_gpencil_channel(struct View2D *v2d,
199  struct bDopeSheet *ads,
200  struct bGPdata *gpd,
201  float ypos,
202  float yscale_fac,
203  int saction_flag);
204 /* Grease Pencil Layer */
205 void draw_gpl_channel(struct View2D *v2d,
206  struct bDopeSheet *ads,
207  struct bGPDlayer *gpl,
208  float ypos,
209  float yscale_fac,
210  int saction_flag);
211 /* Mask Layer */
212 void draw_masklay_channel(struct View2D *v2d,
213  struct bDopeSheet *ads,
214  struct MaskLayer *masklay,
215  float ypos,
216  float yscale_fac,
217  int saction_flag);
218 
219 /* Keydata Generation --------------- */
220 /* F-Curve */
221 void fcurve_to_keylist(struct AnimData *adt,
222  struct FCurve *fcu,
223  struct DLRBT_Tree *keys,
224  int saction_flag);
225 /* Action Group */
226 void agroup_to_keylist(struct AnimData *adt,
227  struct bActionGroup *agrp,
228  struct DLRBT_Tree *keys,
229  int saction_flag);
230 /* Action */
231 void action_to_keylist(struct AnimData *adt,
232  struct bAction *act,
233  struct DLRBT_Tree *keys,
234  int saction_flag);
235 /* Object */
236 void ob_to_keylist(struct bDopeSheet *ads,
237  struct Object *ob,
238  struct DLRBT_Tree *keys,
239  int saction_flag);
240 /* Cache File */
241 void cachefile_to_keylist(struct bDopeSheet *ads,
242  struct CacheFile *cache_file,
243  struct DLRBT_Tree *keys,
244  int saction_flag);
245 /* Scene */
246 void scene_to_keylist(struct bDopeSheet *ads,
247  struct Scene *sce,
248  struct DLRBT_Tree *keys,
249  int saction_flag);
250 /* DopeSheet Summary */
251 void summary_to_keylist(struct bAnimContext *ac, struct DLRBT_Tree *keys, int saction_flag);
252 /* Grease Pencil datablock summary */
253 void gpencil_to_keylist(struct bDopeSheet *ads,
254  struct bGPdata *gpd,
255  struct DLRBT_Tree *keys,
256  const bool active);
257 /* Grease Pencil Layer */
258 void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys);
259 /* Mask */
260 void mask_to_keylist(struct bDopeSheet *ads, struct MaskLayer *masklay, struct DLRBT_Tree *keys);
261 
262 /* ActKeyColumn API ---------------- */
263 /* Comparator callback used for ActKeyColumns and cframe float-value pointer */
264 short compare_ak_cfraPtr(void *node, void *data);
265 
266 /* Checks if ActKeyColumn has any block data */
268 
269 /* Checks if ActKeyColumn can be used as a block (i.e. drawn/used to detect "holds") */
271 
272 #ifdef __cplusplus
273 }
274 #endif
void draw_summary_channel(struct View2D *v2d, struct bAnimContext *ac, float ypos, float yscale_fac, int saction_flag)
void action_to_keylist(struct AnimData *adt, struct bAction *act, struct DLRBT_Tree *keys, int saction_flag)
void fcurve_to_keylist(struct AnimData *adt, struct FCurve *fcu, struct DLRBT_Tree *keys, int saction_flag)
eActKeyBlock_Hold
@ ACTKEYBLOCK_FLAG_ANY_HOLD
@ ACTKEYBLOCK_FLAG_MOVING_HOLD
@ ACTKEYBLOCK_FLAG_GPENCIL
@ ACTKEYBLOCK_FLAG_NON_BEZIER
@ ACTKEYBLOCK_FLAG_STATIC_HOLD
void draw_keyframe_shape(float x, float y, float size, bool sel, short key_type, short mode, float alpha, unsigned int pos_id, unsigned int size_id, unsigned int color_id, unsigned int outline_color_id, unsigned int flags_id, short handle_type, short extreme_type)
void ob_to_keylist(struct bDopeSheet *ads, struct Object *ob, struct DLRBT_Tree *keys, int saction_flag)
void draw_fcurve_channel(struct View2D *v2d, struct AnimData *adt, struct FCurve *fcu, float ypos, float yscale_fac, int saction_flag)
enum eActKeyBlock_Hold eActKeyBlock_Flag
bool actkeyblock_is_valid(ActKeyColumn *ac)
void draw_gpl_channel(struct View2D *v2d, struct bDopeSheet *ads, struct bGPDlayer *gpl, float ypos, float yscale_fac, int saction_flag)
void mask_to_keylist(struct bDopeSheet *ads, struct MaskLayer *masklay, struct DLRBT_Tree *keys)
eKeyframeShapeDrawOpts
@ KEYFRAME_SHAPE_INSIDE
@ KEYFRAME_SHAPE_BOTH
@ KEYFRAME_SHAPE_FRAME
void gpencil_to_keylist(struct bDopeSheet *ads, struct bGPdata *gpd, struct DLRBT_Tree *keys, const bool active)
void draw_object_channel(struct View2D *v2d, struct bDopeSheet *ads, struct Object *ob, float ypos, float yscale_fac, int saction_flag)
eKeyframeHandleDrawOpts
@ KEYFRAME_HANDLE_VECTOR
@ KEYFRAME_HANDLE_FREE
@ KEYFRAME_HANDLE_AUTO_CLAMP
@ KEYFRAME_HANDLE_NONE
@ KEYFRAME_HANDLE_AUTO
@ KEYFRAME_HANDLE_ALIGNED
short compare_ak_cfraPtr(void *node, void *data)
void scene_to_keylist(struct bDopeSheet *ads, struct Scene *sce, struct DLRBT_Tree *keys, int saction_flag)
struct ActKeyColumn ActKeyColumn
void draw_masklay_channel(struct View2D *v2d, struct bDopeSheet *ads, struct MaskLayer *masklay, float ypos, float yscale_fac, int saction_flag)
int actkeyblock_get_valid_hold(ActKeyColumn *ac)
void agroup_to_keylist(struct AnimData *adt, struct bActionGroup *agrp, struct DLRBT_Tree *keys, int saction_flag)
void draw_gpencil_channel(struct View2D *v2d, struct bDopeSheet *ads, struct bGPdata *gpd, float ypos, float yscale_fac, int saction_flag)
void draw_agroup_channel(struct View2D *v2d, struct AnimData *adt, struct bActionGroup *agrp, float ypos, float yscale_fac, int saction_flag)
struct ActKeyBlockInfo ActKeyBlockInfo
void cachefile_to_keylist(struct bDopeSheet *ads, struct CacheFile *cache_file, struct DLRBT_Tree *keys, int saction_flag)
void draw_scene_channel(struct View2D *v2d, struct bDopeSheet *ads, struct Scene *sce, float ypos, float yscale_fac, int saction_flag)
eKeyframeExtremeDrawOpts
@ KEYFRAME_EXTREME_MAX
@ KEYFRAME_EXTREME_MIXED
@ KEYFRAME_EXTREME_NONE
@ KEYFRAME_EXTREME_FLAT
@ KEYFRAME_EXTREME_MIN
void draw_action_channel(struct View2D *v2d, struct AnimData *adt, struct bAction *act, float ypos, float yscale_fac, int saction_flag)
void summary_to_keylist(struct bAnimContext *ac, struct DLRBT_Tree *keys, int saction_flag)
void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, struct DLRBT_Tree *keys)
_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 y
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
OperationNode * node
static CCL_NAMESPACE_BEGIN const double alpha
bool active
all scheduled work for the GPU.
struct ActKeyColumn * parent
struct ActKeyColumn * left
struct ActKeyColumn * right
ActKeyBlockInfo block
struct ActKeyColumn * next
struct ActKeyColumn * prev