Blender V5.3
nla_buttons.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cfloat>
10#include <cstring>
11
12#include "DNA_anim_types.h"
13
14#include "MEM_guardedalloc.h"
15
16#include "BLI_listbase.hh"
17#include "BLI_string_utf8.hh"
18
19#include "BLT_translation.hh"
20
21#include "BKE_context.hh"
22#include "BKE_fcurve.hh"
23#include "BKE_nla.hh"
24#include "BKE_screen.hh"
25
26#include "WM_api.hh"
27#include "WM_types.hh"
28
29#include "RNA_access.hh"
30#include "RNA_prototypes.hh"
31
32#include "ANIM_action.hh"
33#include "ANIM_action_legacy.hh"
34
35#include "ED_anim_api.hh"
36
37#include "UI_interface_c.hh"
39#include "UI_resources.hh"
40
41#include "nla_intern.hh" /* own include */
42
43namespace blender {
44
45/* ******************* nla editor space & buttons ************** */
46
47/* -------------- */
48
49static void do_nla_region_buttons(bContext *C, void * /*arg*/, int /*event*/)
50{
51 // Scene *scene = CTX_data_scene(C);
52#if 0
53 switch (event) {
54 /* pass */
55 }
56#endif
57 /* default for now */
60}
61
63 PointerRNA *adt_ptr,
64 PointerRNA *nlt_ptr,
65 PointerRNA *strip_ptr)
66{
67 bAnimContext ac;
68 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
69 short found = 0; /* not bool, since we need to indicate "found but not ideal" status */
70
71 /* For now, only draw if we could init the anim-context info
72 * (necessary for all animation-related tools)
73 * to work correctly is able to be correctly retrieved. There's no point showing empty panels? */
74 if (ANIM_animdata_get_context(C, &ac) == 0) {
75 return false;
76 }
77
78 /* extract list of active channel(s), of which we should only take the first one
79 * - we need the channels flag to get the active AnimData block when there are no NLA Tracks
80 */
81 /* XXX: double-check active! */
85 ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
86
87 for (bAnimListElem &ale : anim_data) {
88 switch (ale.type) {
89 case ANIMTYPE_NLATRACK: /* NLA Track - The primary data type which should get caught */
90 {
91 NlaTrack *nlt = static_cast<NlaTrack *>(ale.data);
92 AnimData *adt = ale.adt;
93
94 /* found it, now set the pointers */
95 if (adt_ptr) {
96 /* AnimData pointer */
97 *adt_ptr = RNA_pointer_create_discrete(ale.id, RNA_AnimData, adt);
98 }
99 if (nlt_ptr) {
100 /* NLA-Track pointer */
101 *nlt_ptr = RNA_pointer_create_discrete(ale.id, RNA_NlaTrack, nlt);
102 }
103 if (strip_ptr) {
104 /* NLA-Strip pointer */
106 *strip_ptr = RNA_pointer_create_discrete(ale.id, RNA_NlaStrip, strip);
107 }
108
109 found = 1;
110 break;
111 }
112 case ANIMTYPE_SCENE: /* Top-Level Widgets doubling up as datablocks */
113 case ANIMTYPE_OBJECT:
114 case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */
115 case ANIMTYPE_DSLAM:
116 case ANIMTYPE_DSCAM:
118 case ANIMTYPE_DSCUR:
119 case ANIMTYPE_DSSKEY:
120 case ANIMTYPE_DSWOR:
121 case ANIMTYPE_DSNTREE:
122 case ANIMTYPE_DSPART:
123 case ANIMTYPE_DSMBALL:
124 case ANIMTYPE_DSARM:
125 case ANIMTYPE_DSMESH:
126 case ANIMTYPE_DSTEX:
127 case ANIMTYPE_DSLAT:
129 case ANIMTYPE_DSSPK:
131 case ANIMTYPE_PALETTE:
132 case ANIMTYPE_DSHAIR:
136 /* for these channels, we only do AnimData */
137 if (ale.adt && adt_ptr) {
138 ID *id;
139
140 if ((ale.data == nullptr) || (ale.type == ANIMTYPE_OBJECT)) {
141 /* ale->data is not an ID block! */
142 id = ale.id;
143 }
144 else {
145 /* ale->data is always the proper ID block we need,
146 * but ale->id may not be (i.e. for textures) */
147 id = static_cast<ID *>(ale.data);
148 }
149
150 /* AnimData pointer */
151 if (adt_ptr) {
152 *adt_ptr = RNA_pointer_create_discrete(id, RNA_AnimData, ale.adt);
153 }
154
155 /* set found status to -1, since setting to 1 would break the loop
156 * and potentially skip an active NLA-Track in some cases...
157 */
158 found = -1;
159 }
160 break;
161 }
162 /* Don't set a pointer for NLA Actions.
163 * This will break the dependency graph for the context menu.
164 */
166 break;
167
168 case ANIMTYPE_NONE:
171 case ANIMTYPE_SUMMARY:
172 case ANIMTYPE_GROUP:
173 case ANIMTYPE_FCURVE:
180 case ANIMTYPE_DSMCLIP:
182 case ANIMTYPE_GPLAYER:
189 break;
190 }
191
192 if (found > 0) {
193 break;
194 }
195 }
196
197 /* free temp data */
198 ANIM_animdata_freelist(&anim_data);
199
200 return (found != 0);
201}
202
204{
205 return nla_panel_context(C, nullptr, r_ptr, nullptr);
206}
207
209{
210 return nla_panel_context(C, nullptr, nullptr, r_ptr);
211}
212
214{
215 PointerRNA track_ptr;
216 if (!ANIM_nla_context_track_ptr(C, &track_ptr)) {
217 return nullptr;
218 }
219 return static_cast<NlaTrack *>(track_ptr.data);
220}
221
223{
224 PointerRNA strip_ptr;
225 if (!ANIM_nla_context_strip_ptr(C, &strip_ptr)) {
226 return nullptr;
227 }
228 return static_cast<NlaStrip *>(strip_ptr.data);
229}
230
231#if 0
232static bool nla_panel_poll(const bContext *C, PanelType *pt)
233{
234 return nla_panel_context(C, nullptr, nullptr);
235}
236#endif
237
238static bool nla_animdata_panel_poll(const bContext *C, PanelType * /*pt*/)
239{
240 PointerRNA ptr;
241 PointerRNA strip_ptr;
242 return (nla_panel_context(C, &ptr, nullptr, &strip_ptr) && ptr &&
243 (ptr.owner_id != strip_ptr.owner_id));
244}
245
246static bool nla_strip_panel_poll(const bContext *C, PanelType * /*pt*/)
247{
248 PointerRNA ptr;
249 return (nla_panel_context(C, nullptr, nullptr, &ptr) && ptr);
250}
251
253{
254 PointerRNA ptr;
255
256 if (!nla_panel_context(C, nullptr, nullptr, &ptr)) {
257 return false;
258 }
259 if (!ptr) {
260 return false;
261 }
262
263 NlaStrip *strip = static_cast<NlaStrip *>(ptr.data);
264 return eNlaStrip_Type(strip->type) == NLASTRIP_TYPE_CLIP;
265}
266
267static bool nla_strip_eval_panel_poll(const bContext *C, PanelType * /*pt*/)
268{
269 PointerRNA ptr;
270
271 if (!nla_panel_context(C, nullptr, nullptr, &ptr)) {
272 return false;
273 }
274 if (!ptr) {
275 return false;
276 }
277
278 NlaStrip *strip = static_cast<NlaStrip *>(ptr.data);
279
280 if (strip->type == NLASTRIP_TYPE_SOUND) {
281 return false;
282 }
283
284 return true;
285}
286
287/* -------------- */
288
289/* active AnimData */
290static void nla_panel_animdata(const bContext *C, Panel *panel)
291{
292 PointerRNA adt_ptr;
293 PointerRNA strip_ptr;
294 // AnimData *adt;
295 ui::Layout &layout = *panel->layout;
296
297 /* check context and also validity of pointer */
298 if (!nla_panel_context(C, &adt_ptr, nullptr, &strip_ptr)) {
299 return;
300 }
301
302 if (adt_ptr.owner_id == strip_ptr.owner_id) {
303 return;
304 }
305
306 // adt = adt_ptr.data;
307
308 ui::Block *block = layout.block();
309 block_func_handle_set(block, do_nla_region_buttons, nullptr);
310 layout.use_property_split_set(true);
311 layout.use_property_decorate_set(false);
312
313 /* AnimData Source Properties ----------------------------------- */
314
315 /* icon + id-block name of block where AnimData came from to prevent
316 * accidentally changing the properties of the wrong action
317 */
318 if (adt_ptr.owner_id) {
319 ID *id = adt_ptr.owner_id;
321
322 /* ID-block name > AnimData */
323 ui::Layout &row = layout.row(true);
325
326 row.label(id->name + 2, RNA_struct_ui_icon(id_ptr.type)); /* id-block (src) */
327 row.label("", ICON_RIGHTARROW); /* expander */
328 row.label(IFACE_("Animation Data"), ICON_ANIM_DATA); /* animdata */
329
330 layout.separator();
331 }
332
333 /* Active Action Properties ------------------------------------- */
334 /* action */
335 ui::Layout &col = layout.column(true);
336 template_id(&col, C, &adt_ptr, "action", "ACTION_OT_new", nullptr, "NLA_OT_action_unlink");
337 template_search(&col,
338 C,
339 &adt_ptr,
340 "action_slot",
341 &adt_ptr,
342 "action_suitable_slots",
343 nullptr,
344 nullptr,
345 IFACE_("Slot"));
346
347 /* extrapolation */
348 layout.row(true).prop(
349 &adt_ptr, "action_extrapolation", UI_ITEM_NONE, IFACE_("Extrapolation"), ICON_NONE);
350
351 /* blending */
352 layout.row(true).prop(
353 &adt_ptr, "action_blend_type", UI_ITEM_NONE, IFACE_("Blending"), ICON_NONE);
354
355 /* influence */
356 layout.row(true).prop(
357 &adt_ptr, "action_influence", UI_ITEM_NONE, IFACE_("Influence"), ICON_NONE);
358}
359
360/* generic settings for active NLA-Strip */
361static void nla_panel_stripname(const bContext *C, Panel *panel)
362{
363 PointerRNA strip_ptr;
364 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
365 return;
366 }
367
368 ui::Layout &layout = *panel->layout;
369 ui::Block *block = layout.block();
370 block_func_handle_set(block, do_nla_region_buttons, nullptr);
371
372 /* Strip Properties ------------------------------------- */
373 /* strip type */
374 ui::Layout &row = layout.row(false);
375 const int strip_type = RNA_enum_get(&strip_ptr, "type");
376 if (strip_type == NLASTRIP_TYPE_CLIP) {
377 row.label("", ICON_ANIM);
378 }
379 else if (strip_type == NLASTRIP_TYPE_TRANSITION) {
380 row.label("", ICON_ARROW_LEFTRIGHT);
381 }
382 else if (strip_type == NLASTRIP_TYPE_META) {
383 row.label("", ICON_SEQ_STRIP_META);
384 }
385 else if (strip_type == NLASTRIP_TYPE_SOUND) {
386 row.label("", ICON_SOUND);
387 }
388
389 row.prop(&strip_ptr, "name", UI_ITEM_NONE, "", ICON_NLA);
390
391 block_emboss_set(block, ui::EmbossType::NoneOrStatus);
392 row.prop(&strip_ptr, "mute", UI_ITEM_NONE, "", ICON_NONE);
393 block_emboss_set(block, ui::EmbossType::Emboss);
394}
395
396/* generic settings for active NLA-Strip */
397static void nla_panel_properties(const bContext *C, Panel *panel)
398{
399 PointerRNA strip_ptr;
400 short showEvalProps = 1;
401
402 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
403 return;
404 }
405 ui::Layout &layout = *panel->layout;
406 ui::Block *block = layout.block();
407 block_func_handle_set(block, do_nla_region_buttons, nullptr);
408
409 /* Strip Properties ------------------------------------- */
410 /* strip type */
411
412 layout.use_property_split_set(true);
413 layout.use_property_decorate_set(false);
414
415 /* strip extents */
416 ui::Layout &frame_col = layout.column(true);
417 frame_col.prop(&strip_ptr, "frame_start_ui", UI_ITEM_NONE, IFACE_("Frame Start"), ICON_NONE);
418 frame_col.prop(&strip_ptr, "frame_end_ui", UI_ITEM_NONE, IFACE_("End"), ICON_NONE);
419
420 /* Evaluation-Related Strip Properties ------------------ */
421
422 /* sound properties strips don't have these settings */
423 if (RNA_enum_get(&strip_ptr, "type") == NLASTRIP_TYPE_SOUND) {
424 showEvalProps = 0;
425 }
426
427 /* only show if allowed to... */
428 if (showEvalProps) {
429 /* extrapolation */
430 ui::Layout &extrapolation_col = layout.column(false);
431 extrapolation_col.prop(&strip_ptr, "extrapolation", UI_ITEM_NONE, std::nullopt, ICON_NONE);
432 extrapolation_col.prop(&strip_ptr, "blend_type", UI_ITEM_NONE, std::nullopt, ICON_NONE);
433
434 /* Blend in/out + auto-blending:
435 * - blend in/out can only be set when auto-blending is off.
436 */
437
438 layout.separator();
439
440 ui::Layout &blend_col = layout.column(true);
441 blend_col.active_set(RNA_boolean_get(&strip_ptr, "use_auto_blend") == false);
442 blend_col.prop(&strip_ptr, "blend_in", UI_ITEM_NONE, IFACE_("Blend In"), ICON_NONE);
443 blend_col.prop(&strip_ptr, "blend_out", UI_ITEM_NONE, IFACE_("Out"), ICON_NONE);
444
445 ui::Layout &blend_sub = blend_col.row(true);
446 blend_sub.active_set(RNA_boolean_get(&strip_ptr, "use_animated_influence") == false);
447 blend_sub.prop(
448 &strip_ptr, "use_auto_blend", UI_ITEM_NONE, std::nullopt, ICON_NONE); /* XXX as toggle? */
449
450 /* settings */
451 ui::Layout &playback_col = layout.column(true, IFACE_("Playback"));
452 ui::Layout &playback_sub = playback_col.row(true);
453 playback_sub.active_set(!(RNA_boolean_get(&strip_ptr, "use_animated_influence") ||
454 RNA_boolean_get(&strip_ptr, "use_animated_time")));
455 playback_sub.prop(&strip_ptr, "use_reverse", UI_ITEM_NONE, std::nullopt, ICON_NONE);
456 playback_col.prop(
457 &strip_ptr, "use_animated_time_cyclic", UI_ITEM_NONE, std::nullopt, ICON_NONE);
458 }
459}
460
461/* action-clip only settings for active NLA-Strip */
462static void nla_panel_actclip(const bContext *C, Panel *panel)
463{
464 PointerRNA strip_ptr;
465 /* check context and also validity of pointer */
466 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
467 return;
468 }
469 ui::Layout &layout = *panel->layout;
470
471 ui::Block *block = layout.block();
472 block_func_handle_set(block, do_nla_region_buttons, nullptr);
473 layout.use_property_split_set(true);
474 layout.use_property_decorate_set(false);
475
476 /* Strip Properties ------------------------------------- */
477 /* action pointer */
478 ui::Layout &action_col = layout.column(true);
479 action_col.prop(&strip_ptr, "action", UI_ITEM_NONE, std::nullopt, ICON_ACTION);
480
481 NlaStrip *strip = static_cast<NlaStrip *>(strip_ptr.data);
482 if (strip->act) {
483 BLI_assert(strip_ptr.owner_id);
484
485 ID &animated_id = *strip_ptr.owner_id;
486 PointerRNA animated_id_ptr = RNA_id_pointer_create(&animated_id);
487 action_col.context_ptr_set("animated_id", &animated_id_ptr);
488 action_col.context_ptr_set("nla_strip", &strip_ptr);
489 template_search(&action_col,
490 C,
491 &strip_ptr,
492 "action_slot",
493 &strip_ptr,
494 "action_suitable_slots",
495 nullptr,
496 "anim.slot_unassign_from_nla_strip",
497 "Slot");
498 }
499
500 /* action extents */
501 ui::Layout &extent_col = layout.column(true);
502 extent_col.prop(
503 &strip_ptr, "action_frame_start", UI_ITEM_NONE, IFACE_("Frame Start"), ICON_NONE);
504 extent_col.prop(&strip_ptr, "action_frame_end", UI_ITEM_NONE, IFACE_("End"), ICON_NONE);
505
506 ui::Layout &sync_row = layout.row(false, IFACE_("Sync Length"));
507 sync_row.prop(&strip_ptr, "use_sync_length", UI_ITEM_NONE, "", ICON_NONE);
508 sync_row.op("NLA_OT_action_sync_length", IFACE_("Now"), ICON_FILE_REFRESH);
509
510 /* action usage */
511 ui::Layout &usage_col = layout.column(true);
512 usage_col.active_set(RNA_boolean_get(&strip_ptr, "use_animated_time") == false);
513 usage_col.prop(&strip_ptr, "scale", UI_ITEM_NONE, IFACE_("Playback Scale"), ICON_NONE);
514 usage_col.prop(&strip_ptr, "repeat", UI_ITEM_NONE, std::nullopt, ICON_NONE);
515}
516
517/* evaluation settings for active NLA-Strip */
519{
520 PointerRNA strip_ptr;
521
522 /* check context and also validity of pointer */
523 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
524 return;
525 }
526 ui::Layout &layout = *panel->layout;
527
528 ui::Block *block = layout.block();
529 block_func_handle_set(block, do_nla_region_buttons, nullptr);
530
531 ui::Layout &col = layout.column(true);
532 col.prop(&strip_ptr, "use_animated_influence", UI_ITEM_NONE, "", ICON_NONE);
533}
534
535/* evaluation settings for active NLA-Strip */
536static void nla_panel_evaluation(const bContext *C, Panel *panel)
537{
538 PointerRNA strip_ptr;
539 /* check context and also validity of pointer */
540 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
541 return;
542 }
543
544 ui::Layout &layout = *panel->layout;
545
546 ui::Block *block = layout.block();
547 block_func_handle_set(block, do_nla_region_buttons, nullptr);
548 layout.use_property_split_set(true);
549
550 layout.enabled_set(RNA_boolean_get(&strip_ptr, "use_animated_influence"));
551 layout.prop(&strip_ptr, "influence", UI_ITEM_NONE, std::nullopt, ICON_NONE);
552}
553
555{
556 PointerRNA strip_ptr;
557 /* check context and also validity of pointer */
558 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
559 return;
560 }
561 ui::Layout &layout = *panel->layout;
562
563 ui::Block *block = layout.block();
564 block_func_handle_set(block, do_nla_region_buttons, nullptr);
565
566 ui::Layout &col = layout.column(true);
567 col.prop(&strip_ptr, "use_animated_time", UI_ITEM_NONE, "", ICON_NONE);
568}
569
571{
572 PointerRNA strip_ptr;
573 /* check context and also validity of pointer */
574 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
575 return;
576 }
577 ui::Layout &layout = *panel->layout;
578
579 ui::Block *block = layout.block();
580 block_func_handle_set(block, do_nla_region_buttons, nullptr);
581 layout.use_property_split_set(true);
582
583 layout.enabled_set(RNA_boolean_get(&strip_ptr, "use_animated_time"));
584 layout.prop(&strip_ptr, "strip_time", UI_ITEM_NONE, std::nullopt, ICON_NONE);
585}
586
587#define NLA_FMODIFIER_PANEL_PREFIX "NLA"
588
589static void nla_fmodifier_panel_id(void *fcm_link, char *r_name)
590{
591 FModifier *fcm = static_cast<FModifier *>(fcm_link);
593 const FModifierTypeInfo *fmi = get_fmodifier_typeinfo(type);
595}
596
597/* F-Modifiers for active NLA-Strip */
598static void nla_panel_modifiers(const bContext *C, Panel *panel)
599{
600 PointerRNA strip_ptr;
601
602 /* check context and also validity of pointer */
603 if (!nla_panel_context(C, nullptr, nullptr, &strip_ptr)) {
604 return;
605 }
606 NlaStrip *strip = static_cast<NlaStrip *>(strip_ptr.data);
607
608 ui::Block *block = panel->layout->block();
609 block_func_handle_set(block, do_nla_region_buttons, nullptr);
610
611 /* 'add modifier' button at top of panel */
612 {
613 ui::Layout &row = panel->layout->row(false);
614
615 /* FIXME: we need to set the only-active property so that this
616 * will only add modifiers for the active strip (not all selected). */
617 row.op_menu_enum(C, "NLA_OT_fmodifier_add", "type", IFACE_("Add Modifier"), ICON_NONE);
618
619 /* copy/paste (as sub-row) */
620 ui::Layout &sub = row.row(true);
621 sub.op("NLA_OT_fmodifier_copy", "", ICON_COPYDOWN);
622 sub.op("NLA_OT_fmodifier_paste", "", ICON_PASTEDOWN);
623 }
624
626}
627
628/* ******************* general ******************************** */
629
631{
632 PanelType *pt;
633
634 pt = MEM_new_zeroed<PanelType>("spacetype nla panel animdata");
635 STRNCPY_UTF8(pt->idname, "NLA_PT_animdata");
636 STRNCPY_UTF8(pt->label, N_("Animation Data"));
637 STRNCPY_UTF8(pt->category, "Edited Action");
642 BLI_addtail(&art->paneltypes, pt);
643
644 pt = MEM_new_zeroed<PanelType>("spacetype nla panel properties");
645 STRNCPY_UTF8(pt->idname, "NLA_PT_stripname");
646 STRNCPY_UTF8(pt->label, N_("Active Strip Name"));
647 STRNCPY_UTF8(pt->category, "Strip");
652 BLI_addtail(&art->paneltypes, pt);
653
654 PanelType *pt_properties = pt = MEM_new_zeroed<PanelType>("spacetype nla panel properties");
655 STRNCPY_UTF8(pt->idname, "NLA_PT_properties");
656 STRNCPY_UTF8(pt->label, N_("Active Strip"));
657 STRNCPY_UTF8(pt->category, "Strip");
661 BLI_addtail(&art->paneltypes, pt);
662
663 pt = MEM_new_zeroed<PanelType>("spacetype nla panel properties");
664 STRNCPY_UTF8(pt->idname, "NLA_PT_actionclip");
665 STRNCPY_UTF8(pt->label, N_("Action Clip"));
666 STRNCPY_UTF8(pt->category, "Strip");
671 BLI_addtail(&art->paneltypes, pt);
672
673 pt = MEM_new_zeroed<PanelType>("spacetype nla panel evaluation");
674 STRNCPY_UTF8(pt->idname, "NLA_PT_evaluation");
675 STRNCPY_UTF8(pt->parent_id, "NLA_PT_properties");
676 STRNCPY_UTF8(pt->label, N_("Animated Influence"));
677 STRNCPY_UTF8(pt->category, "Strip");
681 pt->parent = pt_properties;
684 BLI_addtail(&pt_properties->children, BLI_genericNodeN(pt));
685 BLI_addtail(&art->paneltypes, pt);
686
687 pt = MEM_new_zeroed<PanelType>("spacetype nla panel animated strip time");
688 STRNCPY_UTF8(pt->idname, "NLA_PT_animated_strip_time");
689 STRNCPY_UTF8(pt->parent_id, "NLA_PT_properties");
690 STRNCPY_UTF8(pt->label, N_("Animated Strip Time"));
691 STRNCPY_UTF8(pt->category, "Strip");
695 pt->parent = pt_properties;
698 BLI_addtail(&pt_properties->children, BLI_genericNodeN(pt));
699 BLI_addtail(&art->paneltypes, pt);
700
701 pt = MEM_new_zeroed<PanelType>("spacetype nla panel modifiers");
702 STRNCPY_UTF8(pt->idname, "NLA_PT_modifiers");
703 STRNCPY_UTF8(pt->label, N_("Modifiers"));
704 STRNCPY_UTF8(pt->category, "Modifiers");
709 BLI_addtail(&art->paneltypes, pt);
710
713}
714
715} // namespace blender
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
#define BKE_ST_MAXNAME
Definition BKE_screen.hh:91
#define STRNCPY_UTF8(dst, src)
#define IFACE_(msgid)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define UI_ITEM_NONE
#define NC_SCENE
Definition WM_types.hh:391
#define ND_TRANSFORM
Definition WM_types.hh:475
#define NC_OBJECT
Definition WM_types.hh:392
BMesh Iterators.
static bool nla_strip_panel_poll(const bContext *C, PanelType *)
static void nla_panel_animdata(const bContext *C, Panel *panel)
static void nla_panel_evaluation(const bContext *C, Panel *panel)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
int RNA_enum_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_id_pointer_create(ID *id)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
static bool nla_strip_actclip_panel_poll(const bContext *C, PanelType *)
@ ANIMTYPE_MASKDATABLOCK
@ ANIMTYPE_NLAACTION
@ ANIMTYPE_NLACURVE
@ ANIMTYPE_GREASE_PENCIL_LAYER_GROUP
@ ANIMTYPE_DSPOINTCLOUD
@ ANIMTYPE_DSMCLIP
@ ANIMTYPE_DSLIGHTPROBE
@ ANIMTYPE_DSNTREE
@ ANIMTYPE_GREASE_PENCIL_DATABLOCK
@ ANIMTYPE_FCURVE
@ ANIMTYPE_ANIMDATA
@ ANIMTYPE_DSVOLUME
@ ANIMTYPE_NLATRACK
@ ANIMTYPE_OBJECT
@ ANIMTYPE_GPLAYER
@ ANIMTYPE_GREASE_PENCIL_LAYER
@ ANIMTYPE_DSMBALL
@ ANIMTYPE_DSMESH
@ ANIMTYPE_NUM_TYPES
@ ANIMTYPE_NLACONTROLS
@ ANIMTYPE_DSHAIR
@ ANIMTYPE_FILLDRIVERS
@ ANIMTYPE_SUMMARY
@ ANIMTYPE_FILLACT_LAYERED
@ ANIMTYPE_SHAPEKEY
@ ANIMTYPE_SPECIALDATA__UNUSED
@ ANIMTYPE_ACTION_SLOT
@ ANIMTYPE_DSCACHEFILE
@ ANIMTYPE_MASKLAYER
@ ANIMTYPE_DSGPENCIL
@ ANIMTYPE_DSPART
@ ANIMTYPE_FILLACTD
@ ANIMTYPE_DSSKEY
@ ANIMTYPE_DSLINESTYLE
@ ANIMTYPE_PALETTE
static void nla_fmodifier_panel_id(void *fcm_link, char *r_name)
void nla_buttons_register(ARegionType *art)
bool ANIM_nla_context_track_ptr(const bContext *C, PointerRNA *r_ptr)
static void nla_panel_stripname(const bContext *C, Panel *panel)
static void nla_panel_animated_influence_header(const bContext *C, Panel *panel)
static bool nla_strip_eval_panel_poll(const bContext *C, PanelType *)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
@ ANIMFILTER_FCURVESONLY
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_ACTIVE
@ ANIMFILTER_LIST_CHANNELS
NlaStrip * BKE_nlastrip_find_active(NlaTrack *nlt)
NlaTrack * ANIM_nla_context_track(const bContext *C)
void ANIM_fmodifier_panels(const bContext *C, ID *owner_id, ListBaseT< FModifier > *fmodifiers, uiListPanelIDFromDataFunc panel_id_fn)
@ NLASTRIP_TYPE_SOUND
@ NLASTRIP_TYPE_TRANSITION
static void do_nla_region_buttons(bContext *C, void *, int)
static bool nla_animdata_panel_poll(const bContext *C, PanelType *)
NlaStrip * ANIM_nla_context_strip(const bContext *C)
LinkData * BLI_genericNodeN(void *data)
Definition listbase.cc:936
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static void nla_panel_animated_strip_time_header(const bContext *C, Panel *panel)
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)
int RNA_struct_ui_icon(const StructRNA *type)
static void nla_panel_modifiers(const bContext *C, Panel *panel)
static void nla_panel_actclip(const bContext *C, Panel *panel)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
@ PANEL_TYPE_DEFAULT_CLOSED
@ PANEL_TYPE_NO_HEADER
static void nla_panel_animated_strip_time(const bContext *C, Panel *panel)
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
Definition anim_deps.cc:472
void ANIM_modifier_panels_register_graph_and_NLA(ARegionType *region_type, const char *modifier_panel_prefix, PanelTypePollFn poll_function)
static void nla_panel_properties(const bContext *C, Panel *panel)
bool ANIM_nla_context_strip_ptr(const bContext *C, PointerRNA *r_ptr)
const FModifierTypeInfo * get_fmodifier_typeinfo(int type)
#define NLA_FMODIFIER_PANEL_PREFIX
ListBaseT< PanelType > paneltypes
eFModifier_Types type
ListBaseT< FModifier > modifiers
eNlaStrip_Type type
char translation_context[BKE_ST_MAXNAME]
PanelType * parent
ListBaseT< LinkData > children
char parent_id[BKE_ST_MAXNAME]
void(*) draw(const bContext *C, Panel *panel)
char category[BKE_ST_MAXNAME]
bool(*) poll(const bContext *C, PanelType *pt)
void(*) draw_header(const bContext *C, Panel *panel)
char idname[BKE_ST_MAXNAME]
char label[BKE_ST_MAXNAME]
ui::Layout * layout
StructRNA * type
Definition RNA_types.hh:63
eAnimCont_Types datatype
void enabled_set(bool enabled)
void alignment_set(LayoutAlign alignment)
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
PointerRNA op_menu_enum(const bContext *C, wmOperatorType *ot, StringRefNull propname, std::optional< StringRefNull > name, int icon)
void label(StringRef name, int icon)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
void active_set(bool active)
Layout & column(bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
Layout & row(bool align)
void context_ptr_set(StringRef name, const PointerRNA *ptr)
#define N_(msgid)