Blender V4.3
anim_draw.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "BLI_sys_types.h"
10
11#include "DNA_anim_types.h"
12#include "DNA_object_types.h"
13#include "DNA_scene_types.h"
14#include "DNA_screen_types.h"
15#include "DNA_space_types.h"
16#include "DNA_userdef_types.h"
17
18#include "BLI_math_rotation.h"
19#include "BLI_rect.h"
20#include "BLI_utildefines.h"
21
22#include "BKE_context.hh"
23#include "BKE_curve.hh"
24#include "BKE_fcurve.hh"
25#include "BKE_global.hh"
26#include "BKE_mask.h"
27#include "BKE_nla.hh"
28
29#include "ED_anim_api.hh"
30#include "ED_keyframes_edit.hh"
32
33#include "RNA_access.hh"
34#include "RNA_path.hh"
35
36#include "UI_resources.hh"
37#include "UI_view2d.hh"
38
39#include "GPU_immediate.hh"
40#include "GPU_state.hh"
41
42/* *************************************************** */
43/* CURRENT FRAME DRAWING */
44
45void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
46{
47 Scene *scene = CTX_data_scene(C);
48
49 const float time = scene->r.cfra + scene->r.subframe;
50 const float x = float(time * scene->r.framelen);
51
52 GPU_line_width((flag & DRAWCFRA_WIDE) ? 3.0 : 2.0);
53
56
58
59 /* Draw a light green line to indicate current frame */
61
63 immVertex2f(pos, x, v2d->cur.ymin - 500.0f); /* XXX arbitrary... want it go to bottom */
64 immVertex2f(pos, x, v2d->cur.ymax);
65 immEnd();
67}
68
69/* *************************************************** */
70/* PREVIEW RANGE 'CURTAINS' */
71/* NOTE: 'Preview Range' tools are defined in `anim_ops.cc`. */
72
73void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
74{
75 Scene *scene = CTX_data_scene(C);
76
77 /* only draw this if preview range is set */
78 if (PRVRANGEON) {
80
83
86 /* XXX: Fix this hardcoded color (anim_active) */
87 // immUniformColor4f(0.8f, 0.44f, 0.1f, 0.2f);
88
89 /* only draw two separate 'curtains' if there's no overlap between them */
90 if (PSFRA < PEFRA + end_frame_width) {
91 immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, float(PSFRA), v2d->cur.ymax);
92 immRectf(pos, float(PEFRA + end_frame_width), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
93 }
94 else {
95 immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
96 }
97
99
101 }
102}
103
104/* *************************************************** */
105/* SCENE FRAME RANGE */
106
108{
109 /* draw darkened area outside of active timeline frame range */
111
114
117
118 if (scene->r.sfra < scene->r.efra) {
119 immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, float(scene->r.sfra), v2d->cur.ymax);
120 immRectf(pos, float(scene->r.efra), v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
121 }
122 else {
123 immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
124 }
125
127
128 /* thin lines where the actual frames are */
130
132
133 immVertex2f(pos, float(scene->r.sfra), v2d->cur.ymin);
134 immVertex2f(pos, float(scene->r.sfra), v2d->cur.ymax);
135
136 immVertex2f(pos, float(scene->r.efra), v2d->cur.ymin);
137 immVertex2f(pos, float(scene->r.efra), v2d->cur.ymax);
138
139 immEnd();
141}
142
144 AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
145{
146 if ((action->flag & ACT_FRAME_RANGE) == 0) {
147 return;
148 }
149
150 /* Compute the dimensions. */
151 CLAMP_MIN(ymin, v2d->cur.ymin);
152 CLAMP_MAX(ymax, v2d->cur.ymax);
153
154 if (ymin > ymax) {
155 return;
156 }
157
158 const float sfra = BKE_nla_tweakedit_remap(adt, action->frame_start, NLATIME_CONVERT_MAP);
159 const float efra = BKE_nla_tweakedit_remap(adt, action->frame_end, NLATIME_CONVERT_MAP);
160
161 /* Diagonal stripe filled area outside of the frame range. */
163
166
168
169 float color[4];
170 UI_GetThemeColorShadeAlpha4fv(TH_BACK, -40, -50, color);
171
172 immUniform4f("color1", color[0], color[1], color[2], color[3]);
173 immUniform4f("color2", 0.0f, 0.0f, 0.0f, 0.0f);
174 immUniform1i("size1", 2 * UI_SCALE_FAC);
175 immUniform1i("size2", 4 * UI_SCALE_FAC);
176
177 if (sfra < efra) {
178 immRectf(pos, v2d->cur.xmin, ymin, sfra, ymax);
179 immRectf(pos, efra, ymin, v2d->cur.xmax, ymax);
180 }
181 else {
182 immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax, ymax);
183 }
184
186
188
189 /* Thin lines where the actual frames are. */
192
193 GPU_line_width(1.0f);
194
196
197 immVertex2f(pos, sfra, ymin);
198 immVertex2f(pos, sfra, ymax);
199
200 immVertex2f(pos, efra, ymin);
201 immVertex2f(pos, efra, ymax);
202
203 immEnd();
205}
206
207/* *************************************************** */
208/* NLA-MAPPING UTILITIES (required for drawing and also editing keyframes). */
209
211{
212 /* sanity checks */
213 if (ac == nullptr) {
214 return nullptr;
215 }
216
217 /* abort if rendering - we may get some race condition issues... */
218 if (G.is_rendering) {
219 return nullptr;
220 }
221
222 /* apart from strictly keyframe-related contexts, this shouldn't even happen */
223 /* XXX: nla and channel here may not be necessary... */
224 if (!ELEM(ac->datatype,
232 {
233 return nullptr;
234 }
235
236 /* handling depends on the type of animation-context we've got */
237 if (!ale) {
238 return nullptr;
239 }
240
241 /* NLA Control Curves occur on NLA strips,
242 * and shouldn't be subjected to this kind of mapping. */
243 if (ale->type == ANIMTYPE_NLACURVE) {
244 return nullptr;
245 }
246
247 return ale->adt;
248}
249
250/* ------------------- */
251
252/* Helper function for ANIM_nla_mapping_apply_fcurve() -> "restore",
253 * i.e. mapping points back to action-time. */
255{
256 /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
257 AnimData *adt = (AnimData *)ked->data;
258 short only_keys = short(ked->i1);
259
260 /* adjust BezTriple handles only if allowed to */
261 if (only_keys == 0) {
262 bezt->vec[0][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_UNMAP);
263 bezt->vec[2][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_UNMAP);
264 }
265
266 bezt->vec[1][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_UNMAP);
267
268 return 0;
269}
270
271/* helper function for ANIM_nla_mapping_apply_fcurve() -> "apply",
272 * i.e. mapping points to NLA-mapped global time */
274{
275 /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
276 AnimData *adt = (AnimData *)ked->data;
277 short only_keys = short(ked->i1);
278
279 /* adjust BezTriple handles only if allowed to */
280 if (only_keys == 0) {
281 bezt->vec[0][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_MAP);
282 bezt->vec[2][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_MAP);
283 }
284
285 bezt->vec[1][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_MAP);
286
287 return 0;
288}
289
290void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
291{
292 if (adt == nullptr || BLI_listbase_is_empty(&adt->nla_tracks)) {
293 return;
294 }
295 KeyframeEditData ked = {{nullptr}};
296 KeyframeEditFunc map_cb;
297
298 /* init edit data
299 * - AnimData is stored in 'data'
300 * - only_keys is stored in 'i1'
301 */
302 ked.data = (void *)adt;
303 ked.i1 = int(only_keys);
304
305 /* get editing callback */
306 if (restore) {
308 }
309 else {
310 map_cb = bezt_nlamapping_apply;
311 }
312
313 /* apply to F-Curve */
314 ANIM_fcurve_keyframes_loop(&ked, fcu, nullptr, map_cb, nullptr);
315}
316
317/* *************************************************** */
318/* UNITS CONVERSION MAPPING (required for drawing and editing keyframes) */
319
321{
322 if (space_link->spacetype == SPACE_GRAPH) {
323 SpaceGraph *sipo = (SpaceGraph *)space_link;
324 bool use_normalization = (sipo->flag & SIPO_NORMALIZE) != 0;
325 bool freeze_normalization = (sipo->flag & SIPO_NORMALIZE_FREEZE) != 0;
326 return use_normalization ? (ANIM_UNITCONV_NORMALIZE |
327 (freeze_normalization ? ANIM_UNITCONV_NORMALIZE_FREEZE : 0)) :
328 0;
329 }
330
331 return 0;
332}
333
335 const FCurve *fcu,
336 float *r_min_coord,
337 float *r_max_coord)
338{
339 float min_coord = FLT_MAX;
340 float max_coord = -FLT_MAX;
341 const bool use_preview_only = PRVRANGEON;
342
343 if (fcu->bezt || fcu->fpt) {
344 int start = 0;
345 int end = fcu->totvert;
346
347 if (use_preview_only) {
348 if (fcu->bezt) {
349 /* Preview frame ranges need to be converted to bezt array indices. */
350 bool replace = false;
352 fcu->bezt, scene->r.psfra, fcu->totvert, &replace);
353
355 fcu->bezt, scene->r.pefra + 1, fcu->totvert, &replace);
356 }
357 else if (fcu->fpt) {
358 const int unclamped_start = int(scene->r.psfra - fcu->fpt[0].vec[0]);
359 start = max_ii(unclamped_start, 0);
360 end = min_ii(unclamped_start + (scene->r.pefra - scene->r.psfra) + 1, fcu->totvert);
361 }
362 }
363
364 if (fcu->bezt) {
365 const BezTriple *bezt = fcu->bezt + start;
366 for (int i = start; i < end; i++, bezt++) {
367
368 if (i == 0) {
369 /* We ignore extrapolation flags and handle here, and use the
370 * control point position only. so we normalize "interesting"
371 * part of the curve.
372 *
373 * Here we handle left extrapolation.
374 */
375 max_coord = max_ff(max_coord, bezt->vec[1][1]);
376 min_coord = min_ff(min_coord, bezt->vec[1][1]);
377 }
378 else {
379 const BezTriple *prev_bezt = bezt - 1;
380 if (!ELEM(prev_bezt->ipo, BEZT_IPO_BEZ, BEZT_IPO_BACK, BEZT_IPO_ELASTIC)) {
381 /* The points on the curve will lie inside the start and end points.
382 * Calculate min/max using both previous and current CV.
383 */
384 max_coord = max_ff(max_coord, bezt->vec[1][1]);
385 min_coord = min_ff(min_coord, bezt->vec[1][1]);
386 max_coord = max_ff(max_coord, prev_bezt->vec[1][1]);
387 min_coord = min_ff(min_coord, prev_bezt->vec[1][1]);
388 }
389 else {
390 const int resol = fcu->driver ?
391 32 :
392 min_ii(int(5.0f * len_v2v2(bezt->vec[1], prev_bezt->vec[1])),
393 32);
394 if (resol < 2) {
395 max_coord = max_ff(max_coord, prev_bezt->vec[1][1]);
396 min_coord = min_ff(min_coord, prev_bezt->vec[1][1]);
397 }
398 else {
399 if (!ELEM(prev_bezt->ipo, BEZT_IPO_BACK, BEZT_IPO_ELASTIC)) {
400 /* Calculate min/max using bezier forward differencing. */
401 float data[120];
402 float v1[2], v2[2], v3[2], v4[2];
403
404 v1[0] = prev_bezt->vec[1][0];
405 v1[1] = prev_bezt->vec[1][1];
406 v2[0] = prev_bezt->vec[2][0];
407 v2[1] = prev_bezt->vec[2][1];
408
409 v3[0] = bezt->vec[0][0];
410 v3[1] = bezt->vec[0][1];
411 v4[0] = bezt->vec[1][0];
412 v4[1] = bezt->vec[1][1];
413
414 BKE_fcurve_correct_bezpart(v1, v2, v3, v4);
415
417 v1[0], v2[0], v3[0], v4[0], data, resol, sizeof(float[3]));
419 v1[1], v2[1], v3[1], v4[1], data + 1, resol, sizeof(float[3]));
420
421 for (int j = 0; j <= resol; ++j) {
422 const float *fp = &data[j * 3];
423 max_coord = max_ff(max_coord, fp[1]);
424 min_coord = min_ff(min_coord, fp[1]);
425 }
426 }
427 else {
428 /* Calculate min/max using full fcurve evaluation.
429 * [slower than bezier forward differencing but evaluates Back/Elastic
430 * interpolation as well]. */
431 float step_size = (bezt->vec[1][0] - prev_bezt->vec[1][0]) / resol;
432 for (int j = 0; j <= resol; j++) {
433 float eval_time = prev_bezt->vec[1][0] + step_size * j;
434 float eval_value = evaluate_fcurve_only_curve(fcu, eval_time);
435 max_coord = max_ff(max_coord, eval_value);
436 min_coord = min_ff(min_coord, eval_value);
437 }
438 }
439 }
440 }
441 }
442 }
443 }
444 else if (fcu->fpt) {
445 const FPoint *fpt = fcu->fpt + start;
446 for (int i = start; i < end; ++i, ++fpt) {
447 min_coord = min_ff(min_coord, fpt->vec[1]);
448 max_coord = max_ff(max_coord, fpt->vec[1]);
449 }
450 }
451 }
452
453 if (r_min_coord) {
454 *r_min_coord = min_coord;
455 }
456 if (r_max_coord) {
457 *r_max_coord = max_coord;
458 }
459}
460
461static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, float *r_offset)
462{
463 float factor = 1.0f, offset = 0.0f;
464
466 if (r_offset) {
467 *r_offset = fcu->prev_offset;
468 }
469
470 return 1.0f / fcu->prev_norm_factor;
471 }
472
474 if (r_offset) {
475 *r_offset = fcu->prev_offset;
476 }
477 if (fcu->prev_norm_factor == 0.0f) {
478 /* Happens when Auto Normalize was disabled before
479 * any curves were displayed.
480 */
481 return 1.0f;
482 }
483 return fcu->prev_norm_factor;
484 }
485
486 if (G.moving & G_TRANSFORM_FCURVES) {
487 if (r_offset) {
488 *r_offset = fcu->prev_offset;
489 }
490 if (fcu->prev_norm_factor == 0.0f) {
491 /* Same as above. */
492 return 1.0f;
493 }
494 return fcu->prev_norm_factor;
495 }
496
497 fcu->prev_norm_factor = 1.0f;
498
499 float max_coord = -FLT_MAX;
500 float min_coord = FLT_MAX;
501 fcurve_scene_coord_range_get(scene, fcu, &min_coord, &max_coord);
502
503 /* We use an ULPS-based floating point comparison here, with the
504 * rationale that if there are too few possible values between
505 * `min_coord` and `max_coord`, then after display normalization it
506 * will certainly be a weird quantized experience for the user anyway. */
507 if (min_coord < max_coord && ulp_diff_ff(min_coord, max_coord) > 256) {
508 /* Normalize. */
509 const float range = max_coord - min_coord;
510 factor = 2.0f / range;
511 offset = -min_coord - range / 2.0f;
512 }
513 else {
514 /* Skip normalization. */
515 factor = 1.0f;
516 offset = -min_coord;
517 }
518
519 BLI_assert(factor != 0.0f);
520 if (r_offset) {
521 *r_offset = offset;
522 }
523
524 fcu->prev_norm_factor = factor;
525 fcu->prev_offset = offset;
526 return factor;
527}
528
529float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
530{
532 return normalization_factor_get(scene, fcu, flag, r_offset);
533 }
534
535 if (r_offset) {
536 *r_offset = 0.0f;
537 }
538
539 /* sanity checks */
540 if (id && fcu && fcu->rna_path) {
542 PropertyRNA *prop;
543
544 /* get RNA property that F-Curve affects */
546 if (RNA_path_resolve_property(&id_ptr, fcu->rna_path, &ptr, &prop)) {
547 /* rotations: radians <-> degrees? */
549 /* if the radians flag is not set, default to using degrees which need conversions */
550 if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) {
552 return DEG2RADF(1.0f); /* degrees to radians */
553 }
554 return RAD2DEGF(1.0f); /* radians to degrees */
555 }
556 }
557
558 /* TODO: other rotation types here as necessary */
559 }
560 }
561
562 /* no mapping needs to occur... */
563 return 1.0f;
564}
565
566static bool find_prev_next_keyframes(bContext *C, int *r_nextfra, int *r_prevfra)
567{
568 Scene *scene = CTX_data_scene(C);
570 Mask *mask = CTX_data_edit_mask(C);
571 bDopeSheet ads = {nullptr};
572 AnimKeylist *keylist = ED_keylist_create();
573 const ActKeyColumn *aknext, *akprev;
574 float cfranext, cfraprev;
575 bool donenext = false, doneprev = false;
576 int nextcount = 0, prevcount = 0;
577
578 cfranext = cfraprev = float(scene->r.cfra);
579
580 /* seed up dummy dopesheet context with flags to perform necessary filtering */
581 if ((scene->flag & SCE_KEYS_NO_SELONLY) == 0) {
582 /* only selected channels are included */
584 }
585
586 /* populate tree with keyframe nodes */
587 scene_to_keylist(&ads, scene, keylist, 0, {-FLT_MAX, FLT_MAX});
588 gpencil_to_keylist(&ads, scene->gpd, keylist, false);
589
590 if (ob) {
591 ob_to_keylist(&ads, ob, keylist, 0, {-FLT_MAX, FLT_MAX});
592 gpencil_to_keylist(&ads, static_cast<bGPdata *>(ob->data), keylist, false);
593 }
594
595 if (mask) {
596 MaskLayer *masklay = BKE_mask_layer_active(mask);
597 mask_to_keylist(&ads, masklay, keylist);
598 }
600
601 /* TODO(jbakker): Keylists are ordered, no need to do any searching at all. */
602 /* find matching keyframe in the right direction */
603 do {
604 aknext = ED_keylist_find_next(keylist, cfranext);
605
606 if (aknext) {
607 if (scene->r.cfra == int(aknext->cfra)) {
608 /* make this the new starting point for the search and ignore */
609 cfranext = aknext->cfra;
610 }
611 else {
612 /* this changes the frame, so set the frame and we're done */
613 if (++nextcount == U.view_frame_keyframes) {
614 donenext = true;
615 }
616 }
617 cfranext = aknext->cfra;
618 }
619 } while ((aknext != nullptr) && (donenext == false));
620
621 do {
622 akprev = ED_keylist_find_prev(keylist, cfraprev);
623
624 if (akprev) {
625 if (scene->r.cfra == int(akprev->cfra)) {
626 /* make this the new starting point for the search */
627 }
628 else {
629 /* this changes the frame, so set the frame and we're done */
630 if (++prevcount == U.view_frame_keyframes) {
631 doneprev = true;
632 }
633 }
634 cfraprev = akprev->cfra;
635 }
636 } while ((akprev != nullptr) && (doneprev == false));
637
638 /* free temp stuff */
639 ED_keylist_free(keylist);
640
641 /* any success? */
642 if (doneprev || donenext) {
643 if (doneprev) {
644 *r_prevfra = cfraprev;
645 }
646 else {
647 *r_prevfra = scene->r.cfra - (cfranext - scene->r.cfra);
648 }
649
650 if (donenext) {
651 *r_nextfra = cfranext;
652 }
653 else {
654 *r_nextfra = scene->r.cfra + (scene->r.cfra - cfraprev);
655 }
656
657 return true;
658 }
659
660 return false;
661}
662
663void ANIM_center_frame(bContext *C, int smooth_viewtx)
664{
665 ARegion *region = CTX_wm_region(C);
666 Scene *scene = CTX_data_scene(C);
667 float w = BLI_rctf_size_x(&region->v2d.cur);
668 rctf newrct;
669 int nextfra, prevfra;
670
671 switch (U.view_frame_type) {
673 const float fps = FPS;
674 newrct.xmax = scene->r.cfra + U.view_frame_seconds * fps + 1;
675 newrct.xmin = scene->r.cfra - U.view_frame_seconds * fps - 1;
676 newrct.ymax = region->v2d.cur.ymax;
677 newrct.ymin = region->v2d.cur.ymin;
678 break;
679 }
680
681 /* hardest case of all, look for all keyframes around frame and display those */
683 if (find_prev_next_keyframes(C, &nextfra, &prevfra)) {
684 newrct.xmax = nextfra;
685 newrct.xmin = prevfra;
686 newrct.ymax = region->v2d.cur.ymax;
687 newrct.ymin = region->v2d.cur.ymin;
688 break;
689 }
690 /* else drop through, keep range instead */
692
694 default:
695 newrct.xmax = scene->r.cfra + (w / 2);
696 newrct.xmin = scene->r.cfra - (w / 2);
697 newrct.ymax = region->v2d.cur.ymax;
698 newrct.ymin = region->v2d.cur.ymin;
699 break;
700 }
701
702 UI_view2d_smooth_view(C, region, &newrct, smooth_viewtx);
703}
704/* *************************************************** */
705
706rctf ANIM_frame_range_view2d_add_xmargin(const View2D &view_2d, const rctf view_rect)
707{
708 /* Keyframe diamonds seem to be drawn at 10 pixels wide, multiplied by the UI scale. */
709 const float keyframe_size = 10 * UI_SCALE_FAC;
710 const float margin_in_px = 4 * keyframe_size;
711
712 /* This cannot use UI_view2d_scale_get_x(view_2d) because that would use the
713 * current scale of the view, and not the one we'd get once `view_rect` is
714 * applied. And this function should not assume that view_2d.cur == view_rect.
715 *
716 * As an added bonus, the division is inverted (compared to
717 * UI_view2d_scale_get_x()) so that we can multiply with the result instead of
718 * doing yet another division. */
719 const float target_scale = BLI_rctf_size_x(&view_rect) / BLI_rcti_size_x(&view_2d.mask);
720 const float margin_in_frames = margin_in_px * target_scale;
721
722 /* Limit the margin to a maximum of 12.5% of the available size. This will
723 * make the margins smaller when the view gets smaller, but for large views
724 * still retain the fixed size calculated above */
725 const float margin_max = 0.125f * BLI_rctf_size_x(&view_rect);
726 const float margin = std::min(margin_in_frames, margin_max);
727
728 rctf rect_with_margin = view_rect;
729 rect_with_margin.xmin -= margin;
730 rect_with_margin.xmax += margin;
731
732 return rect_with_margin;
733}
Mask * CTX_data_edit_mask(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
Definition curve.cc:1663
int BKE_fcurve_bezt_binarysearch_index(const BezTriple array[], float frame, int arraylen, bool *r_replace)
float evaluate_fcurve_only_curve(const FCurve *fcu, float evaltime)
void BKE_fcurve_correct_bezpart(const float v1[2], float v2[2], float v3[2], const float v4[2])
@ G_TRANSFORM_FCURVES
struct MaskLayer * BKE_mask_layer_active(struct Mask *mask)
float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
@ NLATIME_CONVERT_MAP
Definition BKE_nla.hh:516
@ NLATIME_CONVERT_UNMAP
Definition BKE_nla.hh:513
#define BLI_assert(a)
Definition BLI_assert.h:50
#define ATTR_FALLTHROUGH
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE uint ulp_diff_ff(float a, float b)
#define DEG2RADF(_deg)
#define RAD2DEGF(_rad)
MINLINE float len_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:197
unsigned int uint
#define CLAMP_MAX(a, c)
#define ELEM(...)
#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.
@ USER_UNIT_ROT_RADIANS
#define PSFRA
@ SCE_KEYS_NO_SELONLY
#define FPS
#define PRVRANGEON
#define PEFRA
@ SPACE_GRAPH
@ SIPO_NORMALIZE_FREEZE
@ SIPO_NORMALIZE
#define UI_SCALE_FAC
@ ZOOM_FRAME_MODE_SECONDS
@ ZOOM_FRAME_MODE_KEYFRAMES
@ ZOOM_FRAME_MODE_KEEP_RANGE
@ ANIMTYPE_NLACURVE
@ ANIMCONT_FCURVES
@ ANIMCONT_NLA
@ ANIMCONT_SHAPEKEY
@ ANIMCONT_TIMELINE
@ ANIMCONT_DOPESHEET
@ ANIMCONT_ACTION
@ ANIMCONT_CHANNEL
@ DRAWCFRA_WIDE
@ ANIM_UNITCONV_NORMALIZE
@ ANIM_UNITCONV_NORMALIZE_FREEZE
@ ANIM_UNITCONV_RESTORE
short(*)(KeyframeEditData *ked, BezTriple *bezt) KeyframeEditFunc
void immUniform4f(const char *name, float x, float y, float z, float w)
void immEnd()
void immUnbindProgram()
void immUniformThemeColorShadeAlpha(int color_id, int color_offset, int alpha_offset)
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 immBegin(GPUPrimType, uint vertex_len)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
@ GPU_PRIM_LINES
@ GPU_SHADER_2D_DIAG_STRIPES
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_BLEND_NONE
Definition GPU_state.hh:85
@ GPU_BLEND_ALPHA
Definition GPU_state.hh:87
void GPU_blend(eGPUBlend blend)
Definition gpu_state.cc:42
void GPU_line_width(float width)
Definition gpu_state.cc:161
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ PROP_UNIT_ROTATION
Definition RNA_types.hh:81
#define RNA_SUBTYPE_UNIT(subtype)
Definition RNA_types.hh:121
@ TH_BACK
@ TH_CFRAME
@ TH_ANIM_PREVIEW_RANGE
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
void UI_view2d_smooth_view(const bContext *C, ARegion *region, const rctf *cur, int smooth_viewtx)
short ANIM_get_normalization_flags(SpaceLink *space_link)
Definition anim_draw.cc:320
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
Definition anim_draw.cc:210
static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
Definition anim_draw.cc:273
static bool find_prev_next_keyframes(bContext *C, int *r_nextfra, int *r_prevfra)
Definition anim_draw.cc:566
void ANIM_draw_action_framerange(AnimData *adt, bAction *action, View2D *v2d, float ymin, float ymax)
Definition anim_draw.cc:143
static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, float *r_offset)
Definition anim_draw.cc:461
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition anim_draw.cc:45
void ANIM_center_frame(bContext *C, int smooth_viewtx)
Definition anim_draw.cc:663
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
Definition anim_draw.cc:290
void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
Definition anim_draw.cc:73
static void fcurve_scene_coord_range_get(Scene *scene, const FCurve *fcu, float *r_min_coord, float *r_max_coord)
Definition anim_draw.cc:334
rctf ANIM_frame_range_view2d_add_xmargin(const View2D &view_2d, const rctf view_rect)
Definition anim_draw.cc:706
float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short flag, float *r_offset)
Definition anim_draw.cc:529
static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
Definition anim_draw.cc:254
void ANIM_draw_framerange(Scene *scene, View2D *v2d)
Definition anim_draw.cc:107
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
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
IndexRange range
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
void mask_to_keylist(bDopeSheet *, MaskLayer *masklay, AnimKeylist *keylist)
const ActKeyColumn * ED_keylist_find_prev(const AnimKeylist *keylist, const float cfra)
void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, AnimKeylist *keylist, const bool active)
void scene_to_keylist(bDopeSheet *ads, Scene *sce, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void ob_to_keylist(bDopeSheet *ads, Object *ob, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
AnimKeylist * ED_keylist_create()
void ED_keylist_free(AnimKeylist *keylist)
const ActKeyColumn * ED_keylist_find_next(const AnimKeylist *keylist, const float cfra)
format
#define G(x, y, z)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
PointerRNA RNA_id_pointer_create(ID *id)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
Definition rna_path.cc:553
#define FLT_MAX
Definition stdcycles.h:14
ListBase nla_tracks
float vec[3][3]
char * rna_path
FPoint * fpt
ChannelDriver * driver
BezTriple * bezt
float prev_norm_factor
float prev_offset
unsigned int totvert
float vec[2]
Definition DNA_ID.h:413
float frame_start
eAnimCont_Types datatype
AnimData * adt
eAnim_ChannelType type
float xmax
float xmin
float ymax
float ymin
PointerRNA * ptr
Definition wm_files.cc:4126
uint8_t flag
Definition wm_window.cc:138