Blender  V3.3
anim_draw.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #include "BLI_sys_types.h"
9 
10 #include "DNA_anim_types.h"
11 #include "DNA_gpencil_types.h"
12 #include "DNA_mask_types.h"
13 #include "DNA_object_types.h"
14 #include "DNA_scene_types.h"
15 #include "DNA_screen_types.h"
16 #include "DNA_space_types.h"
17 #include "DNA_userdef_types.h"
18 
19 #include "BLI_dlrbTree.h"
20 #include "BLI_math.h"
21 #include "BLI_rect.h"
22 #include "BLI_timecode.h"
23 #include "BLI_utildefines.h"
24 
25 #include "BKE_context.h"
26 #include "BKE_curve.h"
27 #include "BKE_fcurve.h"
28 #include "BKE_global.h"
29 #include "BKE_mask.h"
30 #include "BKE_nla.h"
31 
32 #include "ED_anim_api.h"
33 #include "ED_keyframes_draw.h"
34 #include "ED_keyframes_edit.h"
35 #include "ED_keyframes_keylist.h"
36 
37 #include "RNA_access.h"
38 #include "RNA_path.h"
39 
40 #include "UI_interface.h"
41 #include "UI_resources.h"
42 #include "UI_view2d.h"
43 
44 #include "GPU_immediate.h"
45 #include "GPU_matrix.h"
46 #include "GPU_state.h"
47 
48 /* *************************************************** */
49 /* CURRENT FRAME DRAWING */
50 
51 void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
52 {
54 
55  const float time = scene->r.cfra + scene->r.subframe;
56  const float x = (float)(time * scene->r.framelen);
57 
58  GPU_line_width((flag & DRAWCFRA_WIDE) ? 3.0 : 2.0);
59 
62 
64 
65  /* Draw a light green line to indicate current frame */
67 
69  immVertex2f(pos, x, v2d->cur.ymin - 500.0f); /* XXX arbitrary... want it go to bottom */
70  immVertex2f(pos, x, v2d->cur.ymax);
71  immEnd();
73 }
74 
75 /* *************************************************** */
76 /* PREVIEW RANGE 'CURTAINS' */
77 /* NOTE: 'Preview Range' tools are defined in `anim_ops.c`. */
78 
79 void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
80 {
82 
83  /* only draw this if preview range is set */
84  if (PRVRANGEON) {
86 
89 
92  /* XXX: Fix this hardcoded color (anim_active) */
93  // immUniformColor4f(0.8f, 0.44f, 0.1f, 0.2f);
94 
95  /* only draw two separate 'curtains' if there's no overlap between them */
96  if (PSFRA < PEFRA + end_frame_width) {
97  immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax);
98  immRectf(pos, (float)(PEFRA + end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
99  }
100  else {
101  immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
102  }
103 
105 
107  }
108 }
109 
110 /* *************************************************** */
111 /* SCENE FRAME RANGE */
112 
114 {
115  /* draw darkened area outside of active timeline frame range */
117 
120 
123 
124  if (scene->r.sfra < scene->r.efra) {
125  immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)scene->r.sfra, v2d->cur.ymax);
126  immRectf(pos, (float)scene->r.efra, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
127  }
128  else {
129  immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
130  }
131 
133 
134  /* thin lines where the actual frames are */
136 
138 
139  immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymin);
140  immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymax);
141 
142  immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymin);
143  immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymax);
144 
145  immEnd();
147 }
148 
150  AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
151 {
152  if ((action->flag & ACT_FRAME_RANGE) == 0) {
153  return;
154  }
155 
156  /* Compute the dimensions. */
157  CLAMP_MIN(ymin, v2d->cur.ymin);
158  CLAMP_MAX(ymax, v2d->cur.ymax);
159 
160  if (ymin > ymax) {
161  return;
162  }
163 
164  const float sfra = BKE_nla_tweakedit_remap(adt, action->frame_start, NLATIME_CONVERT_MAP);
165  const float efra = BKE_nla_tweakedit_remap(adt, action->frame_end, NLATIME_CONVERT_MAP);
166 
167  /* Diagonal stripe filled area outside of the frame range. */
169 
172 
174 
175  float color[4];
177 
178  immUniform4f("color1", color[0], color[1], color[2], color[3]);
179  immUniform4f("color2", 0.0f, 0.0f, 0.0f, 0.0f);
180  immUniform1i("size1", 2 * U.dpi_fac);
181  immUniform1i("size2", 4 * U.dpi_fac);
182 
183  if (sfra < efra) {
184  immRectf(pos, v2d->cur.xmin, ymin, sfra, ymax);
185  immRectf(pos, efra, ymin, v2d->cur.xmax, ymax);
186  }
187  else {
188  immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax, ymax);
189  }
190 
192 
194 
195  /* Thin lines where the actual frames are. */
198 
199  GPU_line_width(1.0f);
200 
202 
203  immVertex2f(pos, sfra, ymin);
204  immVertex2f(pos, sfra, ymax);
205 
206  immVertex2f(pos, efra, ymin);
207  immVertex2f(pos, efra, ymax);
208 
209  immEnd();
211 }
212 
213 /* *************************************************** */
214 /* NLA-MAPPING UTILITIES (required for drawing and also editing keyframes). */
215 
217 {
218  /* sanity checks */
219  if (ac == NULL) {
220  return NULL;
221  }
222 
223  /* abort if rendering - we may get some race condition issues... */
224  if (G.is_rendering) {
225  return NULL;
226  }
227 
228  /* apart from strictly keyframe-related contexts, this shouldn't even happen */
229  /* XXX: nla and channel here may not be necessary... */
230  if (ELEM(ac->datatype,
235  ANIMCONT_NLA,
236  ANIMCONT_CHANNEL)) {
237  /* handling depends on the type of animation-context we've got */
238  if (ale) {
239  /* NLA Control Curves occur on NLA strips,
240  * and shouldn't be subjected to this kind of mapping. */
241  if (ale->type != ANIMTYPE_NLACURVE) {
242  return ale->adt;
243  }
244  }
245  }
246 
247  /* cannot handle... */
248  return NULL;
249 }
250 
251 /* ------------------- */
252 
253 /* Helper function for ANIM_nla_mapping_apply_fcurve() -> "restore",
254  * i.e. mapping points back to action-time. */
256 {
257  /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
258  AnimData *adt = (AnimData *)ked->data;
259  short only_keys = (short)ked->i1;
260 
261  /* adjust BezTriple handles only if allowed to */
262  if (only_keys == 0) {
263  bezt->vec[0][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_UNMAP);
264  bezt->vec[2][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_UNMAP);
265  }
266 
267  bezt->vec[1][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_UNMAP);
268 
269  return 0;
270 }
271 
272 /* helper function for ANIM_nla_mapping_apply_fcurve() -> "apply",
273  * i.e. mapping points to NLA-mapped global time */
275 {
276  /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
277  AnimData *adt = (AnimData *)ked->data;
278  short only_keys = (short)ked->i1;
279 
280  /* adjust BezTriple handles only if allowed to */
281  if (only_keys == 0) {
282  bezt->vec[0][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_MAP);
283  bezt->vec[2][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_MAP);
284  }
285 
286  bezt->vec[1][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_MAP);
287 
288  return 0;
289 }
290 
291 void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
292 {
293  KeyframeEditData ked = {{NULL}};
294  KeyframeEditFunc map_cb;
295 
296  /* init edit data
297  * - AnimData is stored in 'data'
298  * - only_keys is stored in 'i1'
299  */
300  ked.data = (void *)adt;
301  ked.i1 = (int)only_keys;
302 
303  /* get editing callback */
304  if (restore) {
305  map_cb = bezt_nlamapping_restore;
306  }
307  else {
308  map_cb = bezt_nlamapping_apply;
309  }
310 
311  /* apply to F-Curve */
312  ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, map_cb, NULL);
313 }
314 
315 /* *************************************************** */
316 /* UNITS CONVERSION MAPPING (required for drawing and editing keyframes) */
317 
319 {
320  if (ac->sl->spacetype == SPACE_GRAPH) {
321  SpaceGraph *sipo = (SpaceGraph *)ac->sl;
322  bool use_normalization = (sipo->flag & SIPO_NORMALIZE) != 0;
323  bool freeze_normalization = (sipo->flag & SIPO_NORMALIZE_FREEZE) != 0;
324  return use_normalization ? (ANIM_UNITCONV_NORMALIZE |
325  (freeze_normalization ? ANIM_UNITCONV_NORMALIZE_FREEZE : 0)) :
326  0;
327  }
328 
329  return 0;
330 }
331 
332 static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, float *r_offset)
333 {
334  float factor = 1.0f, offset = 0.0f;
335 
336  if (flag & ANIM_UNITCONV_RESTORE) {
337  if (r_offset) {
338  *r_offset = fcu->prev_offset;
339  }
340 
341  return 1.0f / fcu->prev_norm_factor;
342  }
343 
344  if (flag & ANIM_UNITCONV_NORMALIZE_FREEZE) {
345  if (r_offset) {
346  *r_offset = fcu->prev_offset;
347  }
348  if (fcu->prev_norm_factor == 0.0f) {
349  /* Happens when Auto Normalize was disabled before
350  * any curves were displayed.
351  */
352  return 1.0f;
353  }
354  return fcu->prev_norm_factor;
355  }
356 
357  if (G.moving & G_TRANSFORM_FCURVES) {
358  if (r_offset) {
359  *r_offset = fcu->prev_offset;
360  }
361  if (fcu->prev_norm_factor == 0.0f) {
362  /* Same as above. */
363  return 1.0f;
364  }
365  return fcu->prev_norm_factor;
366  }
367 
368  fcu->prev_norm_factor = 1.0f;
369  if (fcu->bezt) {
370  const bool use_preview_only = PRVRANGEON;
371  const BezTriple *bezt;
372  int i;
373  float max_coord = -FLT_MAX;
374  float min_coord = FLT_MAX;
375  float range;
376 
377  if (fcu->totvert < 1) {
378  return 1.0f;
379  }
380 
381  for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
382  if (use_preview_only && !IN_RANGE_INCL(bezt->vec[1][0], scene->r.psfra, scene->r.pefra)) {
383  continue;
384  }
385 
386  if (i == 0) {
387  /* We ignore extrapolation flags and handle here, and use the
388  * control point position only. so we normalize "interesting"
389  * part of the curve.
390  *
391  * Here we handle left extrapolation.
392  */
393  max_coord = max_ff(max_coord, bezt->vec[1][1]);
394 
395  min_coord = min_ff(min_coord, bezt->vec[1][1]);
396  }
397  else {
398  const BezTriple *prev_bezt = bezt - 1;
399  if (!ELEM(prev_bezt->ipo, BEZT_IPO_BEZ, BEZT_IPO_BACK, BEZT_IPO_ELASTIC)) {
400  /* The points on the curve will lie inside the start and end points.
401  * Calculate min/max using both previous and current CV.
402  */
403  max_coord = max_ff(max_coord, bezt->vec[1][1]);
404  min_coord = min_ff(min_coord, bezt->vec[1][1]);
405  max_coord = max_ff(max_coord, prev_bezt->vec[1][1]);
406  min_coord = min_ff(min_coord, prev_bezt->vec[1][1]);
407  }
408  else {
409  const int resol = fcu->driver ?
410  32 :
411  min_ii((int)(5.0f * len_v2v2(bezt->vec[1], prev_bezt->vec[1])),
412  32);
413  if (resol < 2) {
414  max_coord = max_ff(max_coord, prev_bezt->vec[1][1]);
415  min_coord = min_ff(min_coord, prev_bezt->vec[1][1]);
416  }
417  else {
418  if (!ELEM(prev_bezt->ipo, BEZT_IPO_BACK, BEZT_IPO_ELASTIC)) {
419  /* Calculate min/max using bezier forward differencing. */
420  float data[120];
421  float v1[2], v2[2], v3[2], v4[2];
422 
423  v1[0] = prev_bezt->vec[1][0];
424  v1[1] = prev_bezt->vec[1][1];
425  v2[0] = prev_bezt->vec[2][0];
426  v2[1] = prev_bezt->vec[2][1];
427 
428  v3[0] = bezt->vec[0][0];
429  v3[1] = bezt->vec[0][1];
430  v4[0] = bezt->vec[1][0];
431  v4[1] = bezt->vec[1][1];
432 
433  BKE_fcurve_correct_bezpart(v1, v2, v3, v4);
434 
436  v1[0], v2[0], v3[0], v4[0], data, resol, sizeof(float[3]));
438  v1[1], v2[1], v3[1], v4[1], data + 1, resol, sizeof(float[3]));
439 
440  for (int j = 0; j <= resol; ++j) {
441  const float *fp = &data[j * 3];
442  max_coord = max_ff(max_coord, fp[1]);
443  min_coord = min_ff(min_coord, fp[1]);
444  }
445  }
446  else {
447  /* Calculate min/max using full fcurve evaluation.
448  * [slower than bezier forward differencing but evaluates Back/Elastic interpolation
449  * as well]. */
450  float step_size = (bezt->vec[1][0] - prev_bezt->vec[1][0]) / resol;
451  for (int j = 0; j <= resol; j++) {
452  float eval_time = prev_bezt->vec[1][0] + step_size * j;
453  float eval_value = evaluate_fcurve_only_curve(fcu, eval_time);
454  max_coord = max_ff(max_coord, eval_value);
455  min_coord = min_ff(min_coord, eval_value);
456  }
457  }
458  }
459  }
460  }
461  }
462 
463  if (max_coord > min_coord) {
464  range = max_coord - min_coord;
465  if (range > FLT_EPSILON) {
466  factor = 2.0f / range;
467  }
468  offset = -min_coord - range / 2.0f;
469  }
470  else if (max_coord == min_coord) {
471  factor = 1.0f;
472  offset = -min_coord;
473  }
474  }
475  BLI_assert(factor != 0.0f);
476  if (r_offset) {
477  *r_offset = offset;
478  }
479 
480  fcu->prev_norm_factor = factor;
481  fcu->prev_offset = offset;
482  return factor;
483 }
484 
485 float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
486 {
487  if (flag & ANIM_UNITCONV_NORMALIZE) {
488  return normalization_factor_get(scene, fcu, flag, r_offset);
489  }
490 
491  if (r_offset) {
492  *r_offset = 0.0f;
493  }
494 
495  /* sanity checks */
496  if (id && fcu && fcu->rna_path) {
497  PointerRNA ptr, id_ptr;
498  PropertyRNA *prop;
499 
500  /* get RNA property that F-Curve affects */
501  RNA_id_pointer_create(id, &id_ptr);
502  if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
503  /* rotations: radians <-> degrees? */
505  /* if the radians flag is not set, default to using degrees which need conversions */
506  if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) {
507  if (flag & ANIM_UNITCONV_RESTORE) {
508  return DEG2RADF(1.0f); /* degrees to radians */
509  }
510  return RAD2DEGF(1.0f); /* radians to degrees */
511  }
512  }
513 
514  /* TODO: other rotation types here as necessary */
515  }
516  }
517 
518  /* no mapping needs to occur... */
519  return 1.0f;
520 }
521 
522 static bool find_prev_next_keyframes(struct bContext *C, int *r_nextfra, int *r_prevfra)
523 {
527  bDopeSheet ads = {NULL};
528  struct AnimKeylist *keylist = ED_keylist_create();
529  const ActKeyColumn *aknext, *akprev;
530  float cfranext, cfraprev;
531  bool donenext = false, doneprev = false;
532  int nextcount = 0, prevcount = 0;
533 
534  cfranext = cfraprev = (float)(scene->r.cfra);
535 
536  /* seed up dummy dopesheet context with flags to perform necessary filtering */
537  if ((scene->flag & SCE_KEYS_NO_SELONLY) == 0) {
538  /* only selected channels are included */
540  }
541 
542  /* populate tree with keyframe nodes */
543  scene_to_keylist(&ads, scene, keylist, 0);
544  gpencil_to_keylist(&ads, scene->gpd, keylist, false);
545 
546  if (ob) {
547  ob_to_keylist(&ads, ob, keylist, 0);
548  gpencil_to_keylist(&ads, ob->data, keylist, false);
549  }
550 
551  if (mask) {
553  mask_to_keylist(&ads, masklay, keylist);
554  }
556 
557  /* TODO(jbakker): Keylists are ordered, no need to do any searching at all. */
558  /* find matching keyframe in the right direction */
559  do {
560  aknext = ED_keylist_find_next(keylist, cfranext);
561 
562  if (aknext) {
563  if (scene->r.cfra == (int)aknext->cfra) {
564  /* make this the new starting point for the search and ignore */
565  cfranext = aknext->cfra;
566  }
567  else {
568  /* this changes the frame, so set the frame and we're done */
569  if (++nextcount == U.view_frame_keyframes) {
570  donenext = true;
571  }
572  }
573  cfranext = aknext->cfra;
574  }
575  } while ((aknext != NULL) && (donenext == false));
576 
577  do {
578  akprev = ED_keylist_find_prev(keylist, cfraprev);
579 
580  if (akprev) {
581  if (scene->r.cfra == (int)akprev->cfra) {
582  /* make this the new starting point for the search */
583  }
584  else {
585  /* this changes the frame, so set the frame and we're done */
586  if (++prevcount == U.view_frame_keyframes) {
587  doneprev = true;
588  }
589  }
590  cfraprev = akprev->cfra;
591  }
592  } while ((akprev != NULL) && (doneprev == false));
593 
594  /* free temp stuff */
595  ED_keylist_free(keylist);
596 
597  /* any success? */
598  if (doneprev || donenext) {
599  if (doneprev) {
600  *r_prevfra = cfraprev;
601  }
602  else {
603  *r_prevfra = scene->r.cfra - (cfranext - scene->r.cfra);
604  }
605 
606  if (donenext) {
607  *r_nextfra = cfranext;
608  }
609  else {
610  *r_nextfra = scene->r.cfra + (scene->r.cfra - cfraprev);
611  }
612 
613  return true;
614  }
615 
616  return false;
617 }
618 
619 void ANIM_center_frame(struct bContext *C, int smooth_viewtx)
620 {
621  ARegion *region = CTX_wm_region(C);
623  float w = BLI_rctf_size_x(&region->v2d.cur);
624  rctf newrct;
625  int nextfra, prevfra;
626 
627  switch (U.view_frame_type) {
629  const float fps = FPS;
630  newrct.xmax = scene->r.cfra + U.view_frame_seconds * fps + 1;
631  newrct.xmin = scene->r.cfra - U.view_frame_seconds * fps - 1;
632  newrct.ymax = region->v2d.cur.ymax;
633  newrct.ymin = region->v2d.cur.ymin;
634  break;
635  }
636 
637  /* hardest case of all, look for all keyframes around frame and display those */
639  if (find_prev_next_keyframes(C, &nextfra, &prevfra)) {
640  newrct.xmax = nextfra;
641  newrct.xmin = prevfra;
642  newrct.ymax = region->v2d.cur.ymax;
643  newrct.ymin = region->v2d.cur.ymin;
644  break;
645  }
646  /* else drop through, keep range instead */
648 
650  default:
651  newrct.xmax = scene->r.cfra + (w / 2);
652  newrct.xmin = scene->r.cfra - (w / 2);
653  newrct.ymax = region->v2d.cur.ymax;
654  newrct.ymin = region->v2d.cur.ymin;
655  break;
656  }
657 
658  UI_view2d_smooth_view(C, region, &newrct, smooth_viewtx);
659 }
660 /* *************************************************** */
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct Mask * CTX_data_edit_mask(const bContext *C)
Definition: context.c:1390
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
Definition: curve.cc:1717
float evaluate_fcurve_only_curve(struct FCurve *fcu, float evaltime)
Definition: fcurve.c:2142
void BKE_fcurve_correct_bezpart(const float v1[2], float v2[2], float v3[2], const float v4[2])
Definition: fcurve.c:1410
@ G_TRANSFORM_FCURVES
Definition: BKE_global.h:250
struct MaskLayer * BKE_mask_layer_active(struct Mask *mask)
Definition: mask.c:361
@ NLATIME_CONVERT_MAP
Definition: BKE_nla.h:360
@ NLATIME_CONVERT_UNMAP
Definition: BKE_nla.h:357
float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode)
Definition: nla.c:642
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define ATTR_FALLTHROUGH
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
#define DEG2RADF(_deg)
#define RAD2DEGF(_rad)
MINLINE float len_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
unsigned int uint
Definition: BLI_sys_types.h:67
#define CLAMP_MAX(a, c)
#define ELEM(...)
#define IN_RANGE_INCL(a, b, c)
#define CLAMP_MIN(a, b)
@ ADS_FILTER_ONLYSEL
@ ACT_FRAME_RANGE
@ BEZT_IPO_ELASTIC
@ BEZT_IPO_BACK
@ BEZT_IPO_BEZ
Object is a sort of wrapper for general info.
#define PSFRA
#define SCE_KEYS_NO_SELONLY
#define USER_UNIT_ROT_RADIANS
#define FPS
#define PRVRANGEON
#define PEFRA
@ SPACE_GRAPH
@ SIPO_NORMALIZE_FREEZE
@ SIPO_NORMALIZE
@ ZOOM_FRAME_MODE_SECONDS
@ ZOOM_FRAME_MODE_KEYFRAMES
@ ZOOM_FRAME_MODE_KEEP_RANGE
@ ANIMTYPE_NLACURVE
Definition: ED_anim_api.h:202
@ ANIMCONT_FCURVES
Definition: ED_anim_api.h:108
@ ANIMCONT_NLA
Definition: ED_anim_api.h:110
@ ANIMCONT_SHAPEKEY
Definition: ED_anim_api.h:105
@ ANIMCONT_DOPESHEET
Definition: ED_anim_api.h:107
@ ANIMCONT_ACTION
Definition: ED_anim_api.h:104
@ ANIMCONT_CHANNEL
Definition: ED_anim_api.h:111
@ DRAWCFRA_WIDE
Definition: ED_anim_api.h:742
@ ANIM_UNITCONV_NORMALIZE
Definition: ED_anim_api.h:941
@ ANIM_UNITCONV_NORMALIZE_FREEZE
Definition: ED_anim_api.h:946
@ ANIM_UNITCONV_RESTORE
Definition: ED_anim_api.h:932
short(* KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt)
void immUniform4f(const char *name, float x, float y, float z, float w)
void immUniformThemeColorShadeAlpha(int color_id, int color_offset, int alpha_offset)
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immUniformThemeColor(int color_id)
void immUniformThemeColorShade(int color_id, int offset)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immUniform1i(const char *name, int x)
GPUVertFormat * immVertexFormat(void)
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
_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 v1
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
@ GPU_SHADER_2D_DIAG_STRIPES
Definition: GPU_shader.h:222
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:62
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_line_width(float width)
Definition: gpu_state.cc:158
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ PROP_UNIT_ROTATION
Definition: RNA_types.h:75
#define RNA_SUBTYPE_UNIT(subtype)
Definition: RNA_types.h:111
#define C
Definition: RandGen.cpp:25
@ TH_BACK
Definition: UI_resources.h:39
@ TH_CFRAME
Definition: UI_resources.h:97
@ TH_ANIM_PREVIEW_RANGE
Definition: UI_resources.h:268
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
Definition: resources.c:1259
void UI_view2d_smooth_view(const struct bContext *C, struct ARegion *region, const struct rctf *cur, int smooth_viewtx)
static bool find_prev_next_keyframes(struct bContext *C, int *r_nextfra, int *r_prevfra)
Definition: anim_draw.c:522
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
Definition: anim_draw.c:216
static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
Definition: anim_draw.c:274
void ANIM_draw_action_framerange(AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
Definition: anim_draw.c:149
static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, float *r_offset)
Definition: anim_draw.c:332
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition: anim_draw.c:51
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
Definition: anim_draw.c:291
void ANIM_center_frame(struct bContext *C, int smooth_viewtx)
Definition: anim_draw.c:619
void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
Definition: anim_draw.c:79
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
Definition: anim_draw.c:485
static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
Definition: anim_draw.c:255
short ANIM_get_normalization_flags(bAnimContext *ac)
Definition: anim_draw.c:318
void ANIM_draw_framerange(Scene *scene, View2D *v2d)
Definition: anim_draw.c:113
ATTR_WARN_UNUSED_RESULT const BMVert * v2
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
double time
Scene scene
uint pos
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
AnimKeylist * ED_keylist_create()
void scene_to_keylist(bDopeSheet *ads, Scene *sce, AnimKeylist *keylist, const int saction_flag)
void mask_to_keylist(bDopeSheet *UNUSED(ads), MaskLayer *masklay, AnimKeylist *keylist)
void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, AnimKeylist *keylist, const bool active)
void ob_to_keylist(bDopeSheet *ads, Object *ob, AnimKeylist *keylist, const int saction_flag)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
const ActKeyColumn * ED_keylist_find_next(const AnimKeylist *keylist, const float cfra)
void ED_keylist_free(AnimKeylist *keylist)
const ActKeyColumn * ED_keylist_find_prev(const AnimKeylist *keylist, const float cfra)
format
Definition: logImageCore.h:38
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
#define G(x, y, z)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:112
PropertySubType RNA_property_subtype(PropertyRNA *prop)
Definition: rna_access.c:1015
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
Definition: rna_path.cc:531
float vec[3][3]
char * rna_path
ChannelDriver * driver
BezTriple * bezt
float prev_norm_factor
float prev_offset
unsigned int totvert
Definition: DNA_ID.h:368
void * data
short flag
struct bGPdata * gpd
struct RenderData r
struct UnitSettings unit
float frame_start
float frame_end
short datatype
Definition: ED_anim_api.h:62
struct SpaceLink * sl
Definition: ED_anim_api.h:74
struct AnimData * adt
Definition: ED_anim_api.h:162
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
PointerRNA * ptr
Definition: wm_files.c:3480