Blender V5.3
nla_tracks.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors, Joshua Leung. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdio>
10#include <cstdlib>
11#include <cstring>
12
13#include "DNA_anim_types.h"
14#include "DNA_object_types.h"
15#include "DNA_scene_types.h"
16
17#include "BLI_listbase.hh"
18
19#include "BKE_anim_data.hh"
20#include "BKE_context.hh"
21#include "BKE_global.hh"
22#include "BKE_layer.hh"
23#include "BKE_nla.hh"
24#include "BKE_report.hh"
25
26#include "ANIM_action.hh"
27
28#include "ED_anim_api.hh"
29#include "ED_keyframes_edit.hh"
30#include "ED_object.hh"
31#include "ED_screen.hh"
32
33#include "RNA_access.hh"
34#include "RNA_define.hh"
35
36#include "WM_api.hh"
37#include "WM_types.hh"
38
39#include "DEG_depsgraph.hh"
41
42#include "UI_view2d.hh"
43
44#include "nla_intern.hh" /* own include */
45
46namespace blender {
47
48/* *********************************************** */
49/* Operators for NLA track-list which need to be different
50 * from the standard Animation Editor ones */
51
52/* ******************** Mouse-Click Operator *********************** */
53/* Depending on the track that was clicked on, the mouse click will activate whichever
54 * part of the track is relevant.
55 *
56 * NOTE: eventually,
57 * this should probably be phased out when many of these things are replaced with buttons
58 * --> Most tracks are now selection only.
59 */
60
61static int mouse_nla_tracks(bContext *C, bAnimContext *ac, int track_index, short selectmode)
62{
63 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
64
65 int notifierFlags = 0;
66
67 /* get the track that was clicked on */
68 /* filter tracks */
71 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
72
73 /* get track from index */
74 bAnimListElem *ale = static_cast<bAnimListElem *>(BLI_findlink(&anim_data, track_index));
75 if (ale == nullptr) {
76 /* track not found */
77 if (G.debug & G_DEBUG) {
78 printf("Error: animation track (index = %d) not found in mouse_nla_tracks()\n", track_index);
79 }
80
81 ANIM_animdata_freelist(&anim_data);
82 return 0;
83 }
84
85 /* action to take depends on what track we've got */
86 /* WARNING: must keep this in sync with the equivalent function in `anim_channels_edit.cc`. */
87 switch (ale->type) {
88 case ANIMTYPE_SCENE: {
89 Scene *sce = static_cast<Scene *>(ale->data);
90 AnimData *adt = sce->adt;
91
92 /* set selection status */
93 if (selectmode == SELECT_INVERT) {
94 /* swap select */
95 sce->flag ^= SCE_DS_SELECTED;
96 if (adt) {
97 adt->flag ^= ADT_UI_SELECTED;
98 }
99 }
100 else {
101 sce->flag |= SCE_DS_SELECTED;
102 if (adt) {
103 adt->flag |= ADT_UI_SELECTED;
104 }
105 }
106
107 notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
108 break;
109 }
110 case ANIMTYPE_OBJECT: {
111 ViewLayer *view_layer = ac->view_layer;
112 Base *base = static_cast<Base *>(ale->data);
113 Object *ob = base->object;
114 AnimData *adt = ob->adt;
115
116 if (nlaedit_is_tweakmode_on(ac) == 0 && (base->flag & BASE_SELECTABLE)) {
117 /* set selection status */
118 if (selectmode == SELECT_INVERT) {
119 /* swap select */
121
122 if (adt) {
123 adt->flag ^= ADT_UI_SELECTED;
124 }
125 }
126 else {
127 /* deselect all */
128 /* TODO: should this deselect all other types of tracks too? */
129 BKE_view_layer_synced_ensure(*ac->bmain, ac->scene, view_layer);
130 for (Base &b : *BKE_view_layer_object_bases_get(view_layer)) {
132 if (b.object->adt) {
133 b.object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE);
134 }
135 }
136
137 /* select object now */
139 if (adt) {
140 adt->flag |= ADT_UI_SELECTED;
141 }
142 }
143
144 /* change active object - regardless of whether it is now selected [#37883] */
145 ed::object::base_activate_with_mode_exit_if_needed(C, base); /* adds notifier */
146
147 if ((adt) && (adt->flag & ADT_UI_SELECTED)) {
148 adt->flag |= ADT_UI_ACTIVE;
149 }
150
151 /* notifiers - track was selected */
152 notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
153 }
154 break;
155 }
156 case ANIMTYPE_FILLACTD: /* Action Expander */
157 case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */
158 case ANIMTYPE_DSLAM:
159 case ANIMTYPE_DSCAM:
161 case ANIMTYPE_DSCUR:
162 case ANIMTYPE_DSSKEY:
163 case ANIMTYPE_DSWOR:
164 case ANIMTYPE_DSNTREE:
165 case ANIMTYPE_DSPART:
166 case ANIMTYPE_DSMBALL:
167 case ANIMTYPE_DSARM:
168 case ANIMTYPE_DSMESH:
169 case ANIMTYPE_DSTEX:
170 case ANIMTYPE_DSLAT:
172 case ANIMTYPE_DSSPK:
174 case ANIMTYPE_PALETTE:
175 case ANIMTYPE_DSHAIR:
179 /* sanity checking... */
180 if (ale->adt) {
181 /* select/deselect */
182 if (selectmode == SELECT_INVERT) {
183 /* inverse selection status of this AnimData block only */
184 ale->adt->flag ^= ADT_UI_SELECTED;
185 }
186 else {
187 /* select AnimData block by itself */
189 ale->adt->flag |= ADT_UI_SELECTED;
190 }
191
192 /* set active? */
193 if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED)) {
194 ale->adt->flag |= ADT_UI_ACTIVE;
195 }
196 }
197
198 notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
199 break;
200 }
201 case ANIMTYPE_NLATRACK: {
202 NlaTrack *nlt = static_cast<NlaTrack *>(ale->data);
203
204 if (nlaedit_is_tweakmode_on(ac) == 0) {
205 /* set selection */
206 if (selectmode == SELECT_INVERT) {
207 /* inverse selection status of this F-Curve only */
208 nlt->flag ^= NLATRACK_SELECTED;
209 }
210 else {
211 /* select F-Curve by itself */
213 nlt->flag |= NLATRACK_SELECTED;
214 }
215
216 /* if NLA-Track is selected now,
217 * make NLA-Track the 'active' one in the visible list */
218 if (nlt->flag & NLATRACK_SELECTED) {
221 }
222
223 /* notifier flags - track was selected */
224 notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
225 }
226 break;
227 }
228 case ANIMTYPE_NLAACTION: {
229 AnimData *adt = BKE_animdata_from_id(ale->id);
230
231 /* NOTE: rest of NLA-Action name doubles for operating on the AnimData block
232 * - this is useful when there's no clear divider, and makes more sense in
233 * the case of users trying to use this to change actions
234 * - in tweak-mode, clicking here gets us out of tweak-mode, as changing selection
235 * while in tweak-mode is really evil!
236 * - we disable "solo" flags too, to make it easier to work with stashed actions
237 * with less trouble
238 */
239 if (nlaedit_is_tweakmode_on(ac)) {
240 /* Exit tweak-mode immediately. */
242
243 /* changes to NLA-Action occurred */
244 notifierFlags |= ND_NLA_ACTCHANGE;
245 ale->update |= ANIM_UPDATE_DEPS;
246 }
247 else {
248 /* select/deselect */
249 if (selectmode == SELECT_INVERT) {
250 /* inverse selection status of this AnimData block only */
251 adt->flag ^= ADT_UI_SELECTED;
252 }
253 else {
254 /* select AnimData block by itself */
256 adt->flag |= ADT_UI_SELECTED;
257 }
258
259 /* set active? */
260 if (adt->flag & ADT_UI_SELECTED) {
261 adt->flag |= ADT_UI_ACTIVE;
262 }
263
264 notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
265 }
266 break;
267 }
270 /* The NLA doesn't support layered Actions. */
271 break;
272 default:
273 if (G.debug & G_DEBUG) {
274 printf("Error: Invalid track type in mouse_nla_tracks()\n");
275 }
276 break;
277 }
278
279 /* free tracks */
280 ANIM_animdata_update(ac, &anim_data);
281 ANIM_animdata_freelist(&anim_data);
282
283 /* return the notifier-flags set */
284 return notifierFlags;
285}
286
287/* ------------------- */
288
289/* handle clicking */
291 wmOperator *op,
292 const wmEvent *event)
293{
294 bAnimContext ac;
295 ARegion *region;
296 View2D *v2d;
297 int track_index;
298 int notifierFlags = 0;
299 short selectmode;
300 float x, y;
301
302 /* get editor data */
303 if (ANIM_animdata_get_context(C, &ac) == 0) {
304 return OPERATOR_CANCELLED;
305 }
306
307 /* get useful pointers from animation context data */
308 SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac.sl);
309 region = ac.region;
310 v2d = &region->v2d;
311
312 /* select mode is either replace (deselect all, then add) or add/extend */
313 if (RNA_boolean_get(op->ptr, "extend")) {
314 selectmode = SELECT_INVERT;
315 }
316 else {
317 selectmode = SELECT_REPLACE;
318 }
319
320 /* Figure out which track user clicked in. */
321 ui::view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, &y);
323 NLATRACK_STEP(snla),
324 0,
326 x,
327 y,
328 nullptr,
329 &track_index);
330
331 /* handle mouse-click in the relevant track then */
332 notifierFlags = mouse_nla_tracks(C, &ac, track_index, selectmode);
333
334 /* set notifier that things have changed */
335 WM_event_add_notifier(C, NC_ANIMATION | notifierFlags, nullptr);
336
337 return OPERATOR_FINISHED;
338}
339
341{
342 PropertyRNA *prop;
343
344 /* identifiers */
345 ot->name = "Mouse Click on NLA Tracks";
346 ot->idname = "NLA_OT_channels_click";
347 ot->description = "Handle clicks to select NLA tracks";
348
349 /* API callbacks. */
352
353 /* flags */
354 ot->flag = OPTYPE_UNDO;
355
356 /* props */
357 prop = RNA_def_boolean(ot->srna, "extend", false, "Extend Select", ""); /* SHIFTKEY */
359}
360
361/* *********************************************** */
362/* Special Operators */
363
364/* ******************** Action Push Down ******************************** */
365
367{
368 bAnimContext ac;
369 ID *id = nullptr;
370 AnimData *adt = nullptr;
371 int track_index = RNA_int_get(op->ptr, "track_index");
372
373 /* get editor data */
374 if (ANIM_animdata_get_context(C, &ac) == 0) {
375 return OPERATOR_CANCELLED;
376 }
377
378 /* get anim-channel to use (or more specifically, the animdata block behind it) */
379 if (track_index == -1) {
380 PointerRNA adt_ptr = {};
381
382 /* active animdata block */
383 if (nla_panel_context(C, &adt_ptr, nullptr, nullptr) == 0 || !adt_ptr) {
385 RPT_ERROR,
386 "No active AnimData block to use "
387 "(select a data-block expander first or set the appropriate flags on an AnimData "
388 "block)");
389 return OPERATOR_CANCELLED;
390 }
391
392 id = adt_ptr.owner_id;
393 adt = static_cast<AnimData *>(adt_ptr.data);
394 }
395 else {
396 /* indexed track */
397 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
398
399 /* filter tracks */
402 ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
403
404 /* get track from index */
405 bAnimListElem *ale = static_cast<bAnimListElem *>(BLI_findlink(&anim_data, track_index));
406 if (ale == nullptr) {
407 BKE_reportf(op->reports, RPT_ERROR, "No animation track found at index %d", track_index);
408 ANIM_animdata_freelist(&anim_data);
409 return OPERATOR_CANCELLED;
410 }
411 if (ale->type != ANIMTYPE_NLAACTION) {
413 RPT_ERROR,
414 "Animation track at index %d is not a NLA 'Active Action' track",
415 track_index);
416 ANIM_animdata_freelist(&anim_data);
417 return OPERATOR_CANCELLED;
418 }
419
420 /* grab AnimData from the track */
421 adt = ale->adt;
422 id = ale->id;
423
424 /* we don't need anything here anymore, so free it all */
425 ANIM_animdata_freelist(&anim_data);
426 }
427
428 /* double-check that we are free to push down here... */
429 if (adt == nullptr) {
430 BKE_report(op->reports, RPT_WARNING, "Internal Error - AnimData block is not valid");
431 return OPERATOR_CANCELLED;
432 }
433 if (nlaedit_is_tweakmode_on(&ac)) {
436 "Cannot push down actions while tweaking a strip's action, exit tweak mode first");
437 return OPERATOR_CANCELLED;
438 }
439
440 bAction *action_to_push_down = adt->action;
441 if (!action_to_push_down) {
442 BKE_report(op->reports, RPT_WARNING, "No active action to push down");
443 return OPERATOR_CANCELLED;
444 }
445
446 /* 'push-down' action - only usable when not in Tweak-mode. */
448
449 Main *bmain = CTX_data_main(C);
451
452 /* The action needs updating too, as FCurve modifiers are to be reevaluated. They won't extend
453 * beyond the NLA strip after pushing down to the NLA. */
454 DEG_id_tag_update_ex(bmain, &action_to_push_down->id, ID_RECALC_ANIMATION);
455
456 /* set notifier that things have changed */
458 return OPERATOR_FINISHED;
459}
460
462{
463 /* identifiers */
464 ot->name = "Push Down Action";
465 ot->idname = "NLA_OT_action_pushdown";
466 ot->description = "Push action down onto the top of the NLA stack as a new strip";
467
468 /* callbacks */
471
472 /* flags */
474
475 /* properties */
476 ot->prop = RNA_def_int(ot->srna,
477 "track_index",
478 -1,
479 -1,
480 INT_MAX,
481 "Track Index",
482 "Index of NLA action track to perform pushdown operation on",
483 0,
484 INT_MAX);
486}
487
488/* ******************** Action Unlink ******************************** */
489
491{
493 PointerRNA adt_ptr;
494 return (nla_panel_context(C, &adt_ptr, nullptr, nullptr) && adt_ptr);
495 }
496
497 /* something failed... */
498 return false;
499}
500
502{
503 PointerRNA adt_ptr;
504
505 /* check context and also validity of pointer */
506 if (!nla_panel_context(C, &adt_ptr, nullptr, nullptr)) {
507 return OPERATOR_CANCELLED;
508 }
509
510 /* get animdata */
511 AnimData *adt = static_cast<AnimData *>(adt_ptr.data);
512 if (adt == nullptr) {
513 return OPERATOR_CANCELLED;
514 }
515
516 /* do unlinking */
517 if (adt->action) {
518 bool force_delete = RNA_boolean_get(op->ptr, "force_delete");
519 ED_animedit_unlink_action(C, adt_ptr.owner_id, adt, adt->action, op->reports, force_delete);
520 }
521
522 return OPERATOR_FINISHED;
523}
524
526{
527 /* NOTE: this is hardcoded to match the behavior for the unlink button
528 * (in `interface_templates.cc`). */
529 RNA_boolean_set(op->ptr, "force_delete", event->modifier & KM_SHIFT);
530 return nla_action_unlink_exec(C, op);
531}
532
534{
535 PropertyRNA *prop;
536
537 /* identifiers */
538 ot->name = "Unlink Action";
539 ot->idname = "NLA_OT_action_unlink";
540 ot->description = "Unlink this action from the active action slot (and/or exit Tweak Mode)";
541
542 /* callbacks */
546
547 /* properties */
548 prop = RNA_def_boolean(ot->srna,
549 "force_delete",
550 false,
551 "Force Delete",
552 "Clear Fake User and remove copy stashed in this data-block's NLA stack");
554}
555
556/* ******************** Add Tracks Operator ***************************** */
557/* Add NLA Tracks to the same AnimData block as a selected track, or above the selected tracks */
558
560{
561 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
562 AnimData *lastAdt = nullptr;
563 bool added = false;
564
565 /* get a list of the (selected) NLA Tracks being shown in the NLA */
568 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
569
570 /* add tracks... */
571 for (bAnimListElem &ale : anim_data) {
572 if (ale.type == ANIMTYPE_NLATRACK) {
573 NlaTrack *nlt = static_cast<NlaTrack *>(ale.data);
574 AnimData *adt = ale.adt;
575 NlaTrack *new_track = nullptr;
576
577 const bool is_liboverride = ID_IS_OVERRIDE_LIBRARY(ale.id);
578
579 /* check if just adding a new track above this one,
580 * or whether we're adding a new one to the top of the stack that this one belongs to
581 */
582 if (above_sel) {
583 /* just add a new one above this one */
584 new_track = BKE_nlatrack_new_after(&adt->nla_tracks, nlt, is_liboverride);
585 BKE_nlatrack_set_active(&adt->nla_tracks, new_track);
586 ale.update = ANIM_UPDATE_DEPS;
587 added = true;
588 }
589 else if ((lastAdt == nullptr) || (adt != lastAdt)) {
590 /* add one track to the top of the owning AnimData's stack,
591 * then don't add anymore to this stack */
592 new_track = BKE_nlatrack_new_tail(&adt->nla_tracks, is_liboverride);
593 BKE_nlatrack_set_active(&adt->nla_tracks, new_track);
594 lastAdt = adt;
595 ale.update = ANIM_UPDATE_DEPS;
596 added = true;
597 }
598 }
599 }
600
601 /* free temp data */
602 ANIM_animdata_update(ac, &anim_data);
603 ANIM_animdata_freelist(&anim_data);
604
605 return added;
606}
607
609{
610 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
611
612 bool added = false;
613
614 /* get a list of the selected AnimData blocks in the NLA */
618 ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype));
619
620 /* check if selected AnimData blocks are empty, and add tracks if so... */
621 for (bAnimListElem &ale : anim_data) {
622 AnimData *adt = ale.adt;
623 NlaTrack *new_track;
624
625 /* sanity check */
627
628 /* ensure it is empty */
629 if (adt->nla_tracks.is_empty()) {
630 /* add new track to this AnimData block then */
631 new_track = BKE_nlatrack_new_tail(&adt->nla_tracks, ID_IS_OVERRIDE_LIBRARY(ale.id));
632 BKE_nlatrack_set_active(&adt->nla_tracks, new_track);
633 ale.update = ANIM_UPDATE_DEPS;
634 added = true;
635 }
636 }
637
638 /* cleanup */
639 ANIM_animdata_update(ac, &anim_data);
640 ANIM_animdata_freelist(&anim_data);
641
642 return added;
643}
644
645/* ----- */
646
648{
649 bAnimContext ac;
650 bool above_sel = RNA_boolean_get(op->ptr, "above_selected");
651 bool op_done = false;
652
653 /* get editor data */
654 if (ANIM_animdata_get_context(C, &ac) == 0) {
655 return OPERATOR_CANCELLED;
656 }
657
658 /* perform adding in two passes - existing first so that we don't double up for empty */
659 op_done |= nlaedit_add_tracks_existing(&ac, above_sel);
660 op_done |= nlaedit_add_tracks_empty(&ac);
661
662 /* done? */
663 if (op_done) {
665
666 /* set notifier that things have changed */
668
669 /* done */
670 return OPERATOR_FINISHED;
671 }
672
673 /* failed to add any tracks */
675 op->reports, RPT_WARNING, "Select an existing NLA Track or an empty action line first");
676
677 /* not done */
678 return OPERATOR_CANCELLED;
679}
680
682{
683 /* identifiers */
684 ot->name = "Add Tracks";
685 ot->idname = "NLA_OT_tracks_add";
686 ot->description = "Add NLA-Tracks above/after the selected tracks";
687
688 /* API callbacks. */
691
692 /* flags */
694
695 /* properties */
697 "above_selected",
698 false,
699 "Above Selected",
700 "Add a new NLA Track above every existing selected one");
701}
702
703/* ******************** Delete Tracks Operator ***************************** */
704/* Delete selected NLA Tracks */
705
707{
708 bAnimContext ac;
709
710 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
711
712 /* get editor data */
713 if (ANIM_animdata_get_context(C, &ac) == 0) {
714 return OPERATOR_CANCELLED;
715 }
716
717 /* get a list of the AnimData blocks being shown in the NLA */
720 ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
721
722 /* delete tracks */
723 for (bAnimListElem &ale : anim_data) {
724 if (ale.type == ANIMTYPE_NLATRACK) {
725 NlaTrack *nlt = static_cast<NlaTrack *>(ale.data);
726 AnimData *adt = ale.adt;
727
729 /* No deletion of non-local tracks of override data. */
730 continue;
731 }
732
733 /* if track is currently 'solo', then AnimData should have its
734 * 'has solo' flag disabled
735 */
736 if (nlt->flag & NLATRACK_SOLO) {
738 }
739
740 /* call delete on this track - deletes all strips too */
742 ale.update = ANIM_UPDATE_DEPS;
743 }
744 }
745
746 /* free temp data */
747 ANIM_animdata_update(&ac, &anim_data);
748 ANIM_animdata_freelist(&anim_data);
749
751
752 /* set notifier that things have changed */
754
755 /* done */
756 return OPERATOR_FINISHED;
757}
758
760{
761 /* identifiers */
762 ot->name = "Delete Tracks";
763 ot->idname = "NLA_OT_tracks_delete";
764 ot->description = "Delete selected NLA-Tracks and the strips they contain";
765
766 /* API callbacks. */
769
770 /* flags */
772}
773
774/* *********************************************** */
775/* AnimData Related Operators */
776
777/* ******************** Include Objects Operator ***************************** */
778/* Include selected objects in NLA Editor, by giving them AnimData blocks
779 * NOTE: This doesn't help for non-object AnimData, where we do not have any effective
780 * selection mechanism in place. Unfortunately, this means that non-object AnimData
781 * once again becomes a second-class citizen here. However, at least for the most
782 * common use case, we now have a nice shortcut again.
783 */
784
786{
787 bAnimContext ac;
788
789 /* get editor data */
790 if (ANIM_animdata_get_context(C, &ac) == 0) {
791 return OPERATOR_CANCELLED;
792 }
793
794 /* ensure that filters are set so that the effect will be immediately visible */
795 SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac.sl);
796 if (snla && snla->ads) {
798 }
799
800 /* operate on selected objects... */
801 CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
802 /* ensure that object has AnimData... that's all */
803 BKE_animdata_ensure_id(&ob->id);
804 }
806
807 /* set notifier that things have changed */
809
810 /* done */
811 return OPERATOR_FINISHED;
812}
813
815{
816 /* identifiers */
817 ot->name = "Include Selected Objects";
818 ot->idname = "NLA_OT_selected_objects_add";
819 ot->description = "Make selected objects appear in NLA Editor by adding Animation Data";
820
821 /* API callbacks. */
824
825 /* flags */
827}
828
829/* *********************************************** */
830
831} // namespace blender
Functions and classes to work with Actions.
#define CTX_DATA_BEGIN(C, Type, instance, member)
#define CTX_DATA_END
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition DNA_ID.h:736
Object is a sort of wrapper for general info.
#define NLATRACK_FIRST_TOP(ac)
#define NLATRACK_STEP(snla)
#define NLATRACK_NAMEWIDTH
#define C
Definition RandGen.cpp:29
#define ND_NLA_ACTCHANGE
Definition WM_types.hh:541
#define NC_ANIMATION
Definition WM_types.hh:401
#define NA_ADDED
Definition WM_types.hh:636
#define NA_EDITED
Definition WM_types.hh:634
#define NA_REMOVED
Definition WM_types.hh:637
#define ND_NLA
Definition WM_types.hh:540
#define ND_ANIMCHAN
Definition WM_types.hh:539
#define NA_SELECTED
Definition WM_types.hh:639
#define INT_MAX
void base_select(Base *base, eObjectSelect_Mode mode)
void base_activate_with_mode_exit_if_needed(bContext *C, Base *base)
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1651
void view2d_listview_view_to_cell(float columnwidth, float rowheight, float startx, float starty, float viewx, float viewy, int *r_column, int *r_row)
Definition view2d.cc:1604
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ RPT_WARNING
Definition BKE_report.hh:40
void NLA_OT_action_unlink(wmOperatorType *ot)
bool ED_operator_nla_active(bContext *C)
void ANIM_anim_channels_select_set(bAnimContext *ac, eAnimChannels_SetFlag sel)
static int mouse_nla_tracks(bContext *C, bAnimContext *ac, int track_index, short selectmode)
Definition nla_tracks.cc:61
void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datatype, eAnimFilter_Flags filter, void *channel_data, eAnim_ChannelType channel_type)
bool nlaedit_is_tweakmode_on(bAnimContext *ac)
Definition nla_ops.cc:81
void BKE_nlatrack_set_active(ListBaseT< NlaTrack > *tracks, NlaTrack *nlt)
static wmOperatorStatus nlatracks_pushdown_exec(bContext *C, wmOperator *op)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
int RNA_int_get(PointerRNA *ptr, const char *name)
@ ACHANNEL_SETFLAG_CLEAR
void NLA_OT_tracks_delete(wmOperatorType *ot)
@ ANIMTYPE_NLAACTION
@ ANIMTYPE_DSPOINTCLOUD
@ ANIMTYPE_DSLIGHTPROBE
@ ANIMTYPE_DSNTREE
@ ANIMTYPE_DSVOLUME
@ ANIMTYPE_NLATRACK
@ ANIMTYPE_OBJECT
@ ANIMTYPE_DSMBALL
@ ANIMTYPE_DSMESH
@ ANIMTYPE_DSHAIR
@ ANIMTYPE_FILLACT_LAYERED
@ ANIMTYPE_ACTION_SLOT
@ ANIMTYPE_DSCACHEFILE
@ ANIMTYPE_DSGPENCIL
@ ANIMTYPE_DSPART
@ ANIMTYPE_FILLACTD
@ ANIMTYPE_DSSKEY
@ ANIMTYPE_DSLINESTYLE
@ ANIMTYPE_PALETTE
void NLA_OT_channels_click(wmOperatorType *ot)
static wmOperatorStatus nlaedit_objects_add_exec(bContext *C, wmOperator *)
void ANIM_animdata_update(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data)
Definition anim_deps.cc:365
AnimData * BKE_animdata_ensure_id(ID *id)
Definition anim_data.cc:107
Global G
Definition blender.cc:57
void NLA_OT_selected_objects_add(wmOperatorType *ot)
void ED_animedit_unlink_action(bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete)
AnimData * BKE_animdata_from_id(const ID *id)
Definition anim_data.cc:93
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:541
bool BKE_nlatrack_is_nonlocal_in_liboverride(const ID *id, const NlaTrack *nlt)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
static wmOperatorStatus nlaedit_add_tracks_exec(bContext *C, wmOperator *op)
static wmOperatorStatus nla_action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@ ANIMFILTER_FCURVESONLY
@ ANIMFILTER_ANIMDATA
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_NODUPLIS
@ ANIMFILTER_LIST_CHANNELS
bool nlaedit_disable_tweakmode(bAnimContext *ac, bool do_solo)
Definition nla_edit.cc:223
bool nlaedit_add_tracks_empty(bAnimContext *ac)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
void BKE_nla_action_pushdown(OwnedAnimData owned_adt, bool is_liboverride)
NlaTrack * BKE_nlatrack_new_tail(ListBaseT< NlaTrack > *nla_tracks, const bool is_liboverride)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_ptr, PointerRNA *strip_ptr)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
static bool nla_action_unlink_poll(bContext *C)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
NlaTrack * BKE_nlatrack_new_after(ListBaseT< NlaTrack > *nla_tracks, NlaTrack *prev, bool is_liboverride)
static wmOperatorStatus nla_action_unlink_exec(bContext *C, wmOperator *op)
Main * CTX_data_main(const bContext *C)
void NLA_OT_action_pushdown(wmOperatorType *ot)
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
Definition anim_deps.cc:472
void NLA_OT_tracks_add(wmOperatorType *ot)
@ ID_RECALC_ANIMATION
Definition DNA_ID.h:1077
@ PROP_SKIP_SAVE
Definition RNA_types.hh:414
@ PROP_HIDDEN
Definition RNA_types.hh:408
static wmOperatorStatus nlaedit_delete_tracks_exec(bContext *C, wmOperator *)
void BKE_nlatrack_remove_and_free(ListBaseT< NlaTrack > *tracks, NlaTrack *nlt, bool do_id_user)
void DEG_relations_tag_update(Main *bmain)
bool nlaop_poll_tweakmode_off(bContext *C)
Definition nla_ops.cc:29
bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
static wmOperatorStatus nlatracks_mouseclick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@ ANIM_UPDATE_DEPS
ListBaseT< Base > * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
eAnimData_Flag flag
ListBaseT< NlaTrack > nla_tracks
struct Object * object
eNlaTrack_Flag flag
struct AnimData * adt
struct AnimData * adt
struct bDopeSheet * ads
eAnimCont_Types datatype
eAnim_ChannelType type
eAnim_Update_Flags update
eDopeSheet_FilterFlag filterflag
wmEventModifierFlag modifier
Definition WM_types.hh:834
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141
struct ReportList * reports