Blender V5.0
editors/animation/keyingsets.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 <cfloat>
10#include <cstddef>
11#include <cstring>
12
13#include "MEM_guardedalloc.h"
14
15#include "DNA_anim_types.h"
16#include "DNA_scene_types.h"
17
18#include "BLI_listbase.h"
19
20#include "BKE_animsys.h"
21#include "BKE_context.hh"
22#include "BKE_report.hh"
23
24#include "ANIM_keyframing.hh"
25#include "ANIM_keyingsets.hh"
26
27#include "ED_keyframing.hh"
28#include "ED_screen.hh"
29
30#include "UI_interface.hh"
32#include "UI_resources.hh"
33
34#include "WM_api.hh"
35#include "WM_types.hh"
36
37#include "RNA_access.hh"
38#include "RNA_define.hh"
39#include "RNA_enum_types.hh"
40#include "RNA_path.hh"
41
42#include "anim_intern.hh"
43
44/* ************************************************** */
45/* KEYING SETS - OPERATORS (for use in UI panels) */
46/* These operators are really duplication of existing functionality, but just for completeness,
47 * they're here too, and will give the basic data needed...
48 */
49
50/* poll callback for adding default KeyingSet */
52{
53 /* As long as there's an active Scene, it's fine. */
54 return (CTX_data_scene(C) != nullptr);
55}
56
57/* Poll callback for editing active KeyingSet. */
59{
60 Scene *scene = CTX_data_scene(C);
61
62 if (scene == nullptr) {
63 return false;
64 }
65
66 /* There must be an active KeyingSet (and KeyingSets). */
67 return ((scene->active_keyingset > 0) && (scene->keyingsets.first));
68}
69
70/* poll callback for editing active KeyingSet Path */
72{
73 Scene *scene = CTX_data_scene(C);
74
75 if (scene == nullptr) {
76 return false;
77 }
78 if (scene->active_keyingset <= 0) {
79 return false;
80 }
81
82 KeyingSet *keyingset = static_cast<KeyingSet *>(
83 BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1));
84
85 /* there must be an active KeyingSet and an active path */
86 return ((keyingset) && (keyingset->paths.first) && (keyingset->active_path > 0));
87}
88
89/* Add a Default (Empty) Keying Set ------------------------- */
90
92{
93 Scene *scene = CTX_data_scene(C);
94
95 /* Validate flags
96 * - absolute KeyingSets should be created by default.
97 */
99
101
102 /* Call the API func, and set the active keyingset index. */
103 BKE_keyingset_add(&scene->keyingsets, nullptr, nullptr, flag, keyingflag);
104
106
108
109 return OPERATOR_FINISHED;
110}
111
113{
114 /* Identifiers. */
115 ot->name = "Add Empty Keying Set";
116 ot->idname = "ANIM_OT_keying_set_add";
117 ot->description = "Add a new (empty) keying set to the active Scene";
118
119 /* Callbacks. */
122}
123
124/* Remove 'Active' Keying Set ------------------------- */
125
127{
128 Scene *scene = CTX_data_scene(C);
129
130 /* Verify the Keying Set to use:
131 * - use the active one
132 * - return error if it doesn't exist
133 */
134 if (scene->active_keyingset == 0) {
135 BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove");
136 return OPERATOR_CANCELLED;
137 }
138
139 if (scene->active_keyingset < 0) {
140 BKE_report(op->reports, RPT_ERROR, "Cannot remove built in keying set");
141 return OPERATOR_CANCELLED;
142 }
143
144 KeyingSet *keyingset = static_cast<KeyingSet *>(
145 BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1));
146
147 /* Free KeyingSet's data, then remove it from the scene. */
148 BKE_keyingset_free_paths(keyingset);
149 BLI_freelinkN(&scene->keyingsets, keyingset);
150
151 /* The active one should now be the previously second-to-last one. */
152 scene->active_keyingset--;
153
155
156 return OPERATOR_FINISHED;
157}
158
160{
161 /* Identifiers. */
162 ot->name = "Remove Active Keying Set";
163 ot->idname = "ANIM_OT_keying_set_remove";
164 ot->description = "Remove the active keying set";
165
166 /* Callbacks. */
169}
170
171/* Add Empty Keying Set Path ------------------------- */
172
174{
175 Scene *scene = CTX_data_scene(C);
176
177 /* Verify the Keying Set to use:
178 * - use the active one
179 * - return error if it doesn't exist
180 */
181 if (scene->active_keyingset == 0) {
182 BKE_report(op->reports, RPT_ERROR, "No active Keying Set to add empty path to");
183 return OPERATOR_CANCELLED;
184 }
185
186 KeyingSet *keyingset = static_cast<KeyingSet *>(
187 BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1));
188
189 /* Don't use the API method for this, since that checks on values... */
190 KS_Path *keyingset_path = MEM_callocN<KS_Path>("KeyingSetPath Empty");
191 BLI_addtail(&keyingset->paths, keyingset_path);
192 keyingset->active_path = BLI_listbase_count(&keyingset->paths);
193
194 keyingset_path->groupmode = KSP_GROUP_KSNAME; /* XXX? */
195 keyingset_path->idtype = ID_OB;
196 keyingset_path->flag = KSP_FLAG_WHOLE_ARRAY;
197
198 return OPERATOR_FINISHED;
199}
200
202{
203 /* Identifiers. */
204 ot->name = "Add Empty Keying Set Path";
205 ot->idname = "ANIM_OT_keying_set_path_add";
206 ot->description = "Add empty path to active keying set";
207
208 /* Callbacks. */
211}
212
213/* Remove Active Keying Set Path ------------------------- */
214
216{
217 Scene *scene = CTX_data_scene(C);
218 KeyingSet *keyingset = static_cast<KeyingSet *>(
219 BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1));
220
221 /* If there is a KeyingSet, find the nominated path to remove. */
222 if (!keyingset) {
223 BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove a path from");
224 return OPERATOR_CANCELLED;
225 }
226
227 KS_Path *keyingset_path = static_cast<KS_Path *>(
228 BLI_findlink(&keyingset->paths, keyingset->active_path - 1));
229 if (!keyingset_path) {
230 BKE_report(op->reports, RPT_ERROR, "No active Keying Set path to remove");
231 return OPERATOR_CANCELLED;
232 }
233
234 /* Remove the active path from the KeyingSet. */
235 BKE_keyingset_free_path(keyingset, keyingset_path);
236
237 /* The active path should now be the previously second-to-last active one. */
238 keyingset->active_path--;
239
240 return OPERATOR_FINISHED;
241}
242
244{
245 /* Identifiers. */
246 ot->name = "Remove Active Keying Set Path";
247 ot->idname = "ANIM_OT_keying_set_path_remove";
248 ot->description = "Remove active Path from active keying set";
249
250 /* Callbacks. */
253}
254
255/* ************************************************** */
256/* KEYING SETS - OPERATORS (for use in UI menus) */
257
258/* Add to KeyingSet Button Operator ------------------------ */
259
261{
262 PropertyRNA *prop = nullptr;
263 PointerRNA ptr = {};
264 int index = 0, pflag = 0;
265
266 if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) {
267 /* Pass event on if no active button found. */
269 }
270
271 /* Verify the Keying Set to use:
272 * - use the active one for now (more control over this can be added later)
273 * - add a new one if it doesn't exist
274 */
275 KeyingSet *keyingset = nullptr;
276 Scene *scene = CTX_data_scene(C);
277 if (scene->active_keyingset == 0) {
278 /* Validate flags
279 * - absolute KeyingSets should be created by default
280 */
282
284
285 /* Call the API func, and set the active keyingset index. */
286 keyingset = BKE_keyingset_add(
287 &scene->keyingsets, "ButtonKeyingSet", "Button Keying Set", flag, keyingflag);
288
290 }
291 else if (scene->active_keyingset < 0) {
292 BKE_report(op->reports, RPT_ERROR, "Cannot add property to built in keying set");
293 return OPERATOR_CANCELLED;
294 }
295 else {
296 keyingset = static_cast<KeyingSet *>(
297 BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1));
298 }
299
300 /* Check if property is able to be added. */
301 const bool all = RNA_boolean_get(op->ptr, "all");
302 bool changed = false;
303 if (ptr.owner_id && ptr.data && prop && RNA_property_anim_editable(&ptr, prop)) {
304 if (const std::optional<std::string> path = RNA_path_from_ID_to_property(&ptr, prop)) {
305 if (all) {
306 pflag |= KSP_FLAG_WHOLE_ARRAY;
307
308 /* We need to set the index for this to 0, even though it may break in some cases, this is
309 * necessary if we want the entire array for most cases to get included without the user
310 * having to worry about where they clicked.
311 */
312 index = 0;
313 }
314
315 /* Add path to this setting. */
317 keyingset, ptr.owner_id, nullptr, path->c_str(), index, pflag, KSP_GROUP_KSNAME);
318 keyingset->active_path = BLI_listbase_count(&keyingset->paths);
319 changed = true;
320 }
321 }
322
323 if (changed) {
325
326 /* Show notification/report header, so that users notice that something changed. */
327 BKE_reportf(op->reports, RPT_INFO, "Property added to Keying Set: '%s'", keyingset->name);
328 }
329
330 return (changed) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
331}
332
334{
335 /* Identifiers. */
336 ot->name = "Add to Keying Set";
337 ot->idname = "ANIM_OT_keyingset_button_add";
338 ot->description = "Add current UI-active property to current keying set";
339
340 /* Callbacks. */
342 // op->poll = ???
343
344 /* Flags. */
346
347 /* Properties. */
348 RNA_def_boolean(ot->srna, "all", true, "All", "Add all elements of the array to a Keying Set");
349}
350
351/* Remove from KeyingSet Button Operator ------------------------ */
352
354{
355 PropertyRNA *prop = nullptr;
356 PointerRNA ptr = {};
357 int index = 0;
358
359 if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) {
360 /* Pass event on if no active button found. */
362 }
363
364 /* Verify the Keying Set to use:
365 * - use the active one for now (more control over this can be added later)
366 * - return error if it doesn't exist
367 */
368 Scene *scene = CTX_data_scene(C);
369 if (scene->active_keyingset == 0) {
370 BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove property from");
371 return OPERATOR_CANCELLED;
372 }
373
374 if (scene->active_keyingset < 0) {
375 BKE_report(op->reports, RPT_ERROR, "Cannot remove property from built in keying set");
376 return OPERATOR_CANCELLED;
377 }
378
379 KeyingSet *keyingset = static_cast<KeyingSet *>(
380 BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1));
381
382 bool changed = false;
383 if (ptr.owner_id && ptr.data && prop) {
384 if (const std::optional<std::string> path = RNA_path_from_ID_to_property(&ptr, prop)) {
385 /* Try to find a path matching this description. */
386 KS_Path *keyingset_path = BKE_keyingset_find_path(
387 keyingset, ptr.owner_id, keyingset->name, path->c_str(), index, KSP_GROUP_KSNAME);
388
389 if (keyingset_path) {
390 BKE_keyingset_free_path(keyingset, keyingset_path);
391 changed = true;
392 }
393 }
394 }
395
396 if (changed) {
398
399 /* Show warning. */
400 BKE_report(op->reports, RPT_INFO, "Property removed from keying set");
401 }
402
403 return (changed) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
404}
405
407{
408 /* Identifiers. */
409 ot->name = "Remove from Keying Set";
410 ot->idname = "ANIM_OT_keyingset_button_remove";
411 ot->description = "Remove current UI-active property from current keying set";
412
413 /* Callbacks. */
415 // op->poll = ???
416
417 /* Flags. */
419}
420
421/* ******************************************* */
422
423/* Change Active KeyingSet Operator ------------------------ */
424/* This operator checks if a menu should be shown
425 * for choosing the KeyingSet to make the active one. */
426
428 wmOperator *op,
429 const wmEvent * /*event*/)
430{
431 uiPopupMenu *pup;
432 uiLayout *layout;
433
434 /* Call the menu, which will call this operator again, hence the canceled. */
435 pup = UI_popup_menu_begin(C, op->type->name, ICON_NONE);
436 layout = UI_popup_menu_layout(pup);
437 layout->op_enum("ANIM_OT_keying_set_active_set", "type");
438 UI_popup_menu_end(C, pup);
439
440 return OPERATOR_INTERFACE;
441}
442
444{
445 Scene *scene = CTX_data_scene(C);
446 const int type = RNA_enum_get(op->ptr, "type");
447
448 /* If type == 0, it will deselect any active keying set. */
449 scene->active_keyingset = type;
450
452
453 return OPERATOR_FINISHED;
454}
455
456/* Build the enum for all keyingsets except the active keyingset. */
457static void build_keyingset_enum(bContext *C, EnumPropertyItem **item, int *totitem, bool *r_free)
458{
459 /* user-defined Keying Sets
460 * - these are listed in the order in which they were defined for the active scene
461 */
462 EnumPropertyItem item_tmp = {0};
463
464 Scene *scene = CTX_data_scene(C);
465 KeyingSet *keyingset;
466 int enum_index = 1;
467 if (scene->keyingsets.first) {
468 for (keyingset = static_cast<KeyingSet *>(scene->keyingsets.first); keyingset;
469 keyingset = keyingset->next, enum_index++)
470 {
471 if (ANIM_keyingset_context_ok_poll(C, keyingset)) {
472 item_tmp.identifier = keyingset->idname;
473 item_tmp.name = keyingset->name;
474 item_tmp.description = keyingset->description;
475 item_tmp.value = enum_index;
476 RNA_enum_item_add(item, totitem, &item_tmp);
477 }
478 }
479
480 RNA_enum_item_add_separator(item, totitem);
481 }
482
483 /* Builtin Keying Sets. */
484 enum_index = -1;
485 for (keyingset = static_cast<KeyingSet *>(builtin_keyingsets.first); keyingset;
486 keyingset = keyingset->next, enum_index--)
487 {
488 /* Only show KeyingSet if context is suitable. */
489 if (ANIM_keyingset_context_ok_poll(C, keyingset)) {
490 item_tmp.identifier = keyingset->idname;
491 item_tmp.name = keyingset->name;
492 item_tmp.description = keyingset->description;
493 item_tmp.value = enum_index;
494 RNA_enum_item_add(item, totitem, &item_tmp);
495 }
496 }
497
498 RNA_enum_item_end(item, totitem);
499 *r_free = true;
500}
501
503 PointerRNA * /*ptr*/,
504 PropertyRNA * /*prop*/,
505 bool *r_free)
506{
507 if (C == nullptr) {
509 }
510
511 /* Active Keying Set.
512 * - only include entry if it exists
513 */
514 Scene *scene = CTX_data_scene(C);
515 EnumPropertyItem *item = nullptr, item_tmp = {0};
516 int totitem = 0;
517 if (scene->active_keyingset) {
518 /* Active Keying Set. */
519 item_tmp.identifier = "__ACTIVE__";
520 item_tmp.name = "Clear Active Keying Set";
521 item_tmp.value = 0;
522 RNA_enum_item_add(&item, &totitem, &item_tmp);
523
524 RNA_enum_item_add_separator(&item, &totitem);
525 }
526
527 build_keyingset_enum(C, &item, &totitem, r_free);
528
529 return item;
530}
531
533{
534 PropertyRNA *prop;
535
536 /* Identifiers. */
537 ot->name = "Set Active Keying Set";
538 ot->idname = "ANIM_OT_keying_set_active_set";
539 ot->description = "Set a new active keying set";
540
541 /* Callbacks. */
545
546 /* Flags. */
548
549 /* Keyingset to use (dynamic enum). */
550 prop = RNA_def_enum(
551 ot->srna, "type", rna_enum_dummy_DEFAULT_items, 0, "Keying Set", "The Keying Set to use");
553}
554
555/* ******************************************* */
556/* KEYING SETS API (for UI) */
557
558/* Getters for Active/Indices ----------------------------- */
559
561{
562 int index;
563
564 /* If no KeyingSet provided, have none. */
565 if (keyingset == nullptr) {
566 return 0;
567 }
568
569 /* Check if the KeyingSet exists in scene list. */
570 if (scene) {
571 /* Get index and if valid, return
572 * - (absolute) Scene KeyingSets are from (>= 1)
573 */
574 index = BLI_findindex(&scene->keyingsets, keyingset);
575 if (index != -1) {
576 return (index + 1);
577 }
578 }
579
580 /* Still here, so try built-ins list too:
581 * - Built-ins are from (<= -1).
582 * - None/Invalid is (= 0).
583 */
584 index = BLI_findindex(&builtin_keyingsets, keyingset);
585 if (index != -1) {
586 return -(index + 1);
587 }
588 return 0;
589}
590
592 const bContext *C,
594 const bool use_poll)
595{
596 /* Poll requires context. */
597 if (use_poll && (C == nullptr)) {
598 return;
599 }
600
601 Scene *scene = C ? CTX_data_scene(C) : nullptr;
602
603 /* Active Keying Set. */
604 if (!use_poll || (scene && scene->active_keyingset)) {
605 StringPropertySearchVisitParams visit_params{};
606 visit_params.text = "__ACTIVE__";
607 visit_params.info = "Active Keying Set";
608 visit_fn(visit_params);
609 }
610
611 /* User-defined Keying Sets. */
612 if (scene && scene->keyingsets.first) {
613 LISTBASE_FOREACH (KeyingSet *, keyingset, &scene->keyingsets) {
614 if (use_poll && !ANIM_keyingset_context_ok_poll((bContext *)C, keyingset)) {
615 continue;
616 }
617 StringPropertySearchVisitParams visit_params{};
618 visit_params.text = keyingset->idname;
619 visit_params.info = keyingset->name;
620 visit_fn(visit_params);
621 }
622 }
623
624 /* Builtin Keying Sets. */
626 if (use_poll && !ANIM_keyingset_context_ok_poll((bContext *)C, keyingset)) {
627 continue;
628 }
629 StringPropertySearchVisitParams visit_params{};
630 visit_params.text = keyingset->idname;
631 visit_params.info = keyingset->name;
632 visit_fn(visit_params);
633 }
634}
635
637 const bContext *C,
638 PointerRNA * /*ptr*/,
639 PropertyRNA * /*prop*/,
640 const char * /*edit_text*/,
642{
643 anim_keyingset_visit_for_search_impl(C, visit_fn, false);
644}
645
647 const bContext *C,
648 PointerRNA * /*ptr*/,
649 PropertyRNA * /*prop*/,
650 const char * /*edit_text*/,
652{
654}
655
656/* Menu of All Keying Sets ----------------------------- */
657
659 PointerRNA * /*ptr*/,
660 PropertyRNA * /*prop*/,
661 bool *r_free)
662{
663 if (C == nullptr) {
665 }
666
667 /* Active Keying Set
668 * - only include entry if it exists
669 */
670 Scene *scene = CTX_data_scene(C);
671 EnumPropertyItem *item = nullptr, item_tmp = {0};
672 int totitem = 0;
673 if (scene->active_keyingset) {
674 /* Active Keying Set. */
675 item_tmp.identifier = "__ACTIVE__";
676 item_tmp.name = "Active Keying Set";
677 item_tmp.value = 0;
678 RNA_enum_item_add(&item, &totitem, &item_tmp);
679
680 RNA_enum_item_add_separator(&item, &totitem);
681 }
682
683 build_keyingset_enum(C, &item, &totitem, r_free);
684
685 return item;
686}
687
689{
690 if (type == 0) {
691 type = scene->active_keyingset;
692 }
693
694 if (type > 0) {
695 return static_cast<KeyingSet *>(BLI_findlink(&scene->keyingsets, type - 1));
696 }
697
698 return static_cast<KeyingSet *>(BLI_findlink(&builtin_keyingsets, -type - 1));
699}
700
702{
703 KeyingSet *keyingset = static_cast<KeyingSet *>(
704 BLI_findstring(&scene->keyingsets, idname, offsetof(KeyingSet, idname)));
705 if (keyingset == nullptr) {
706 keyingset = static_cast<KeyingSet *>(
708 }
709 return keyingset;
710}
711
712/* ******************************************* */
713/* KEYFRAME MODIFICATION */
714
715/* Polling API ----------------------------------------------- */
716
718{
719 if (keyingset->flag & KEYINGSET_ABSOLUTE) {
720 return true;
721 }
722
724
725 /* Get the associated 'type info' for this KeyingSet. */
726 if (keyingset_info == nullptr) {
727 return false;
728 }
729 /* TODO: check for missing callbacks! */
730
731 /* Check if it can be used in the current context. */
732 return keyingset_info->poll(keyingset_info, C);
733}
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
struct KS_Path * BKE_keyingset_find_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode)
Definition anim_sys.cc:84
void BKE_keyingset_free_paths(struct KeyingSet *ks)
Definition anim_sys.cc:267
struct KeyingSet * BKE_keyingset_add(struct ListBase *list, const char idname[], const char name[], short flag, short keyingflag)
Definition anim_sys.cc:134
struct KS_Path * BKE_keyingset_add_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode)
Definition anim_sys.cc:164
void BKE_keyingset_free_path(struct KeyingSet *ks, struct KS_Path *ksp)
Definition anim_sys.cc:227
Scene * CTX_data_scene(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
@ RPT_INFO
Definition BKE_report.hh:35
@ RPT_ERROR
Definition BKE_report.hh:39
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:586
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:608
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:270
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
@ ID_OB
eKS_Settings
@ KEYINGSET_ABSOLUTE
eInsertKeyFlags
@ KSP_GROUP_KSNAME
@ KSP_FLAG_WHOLE_ARRAY
@ OPERATOR_CANCELLED
@ OPERATOR_INTERFACE
@ OPERATOR_FINISHED
@ OPERATOR_PASS_THROUGH
bool ED_operator_areaactive(bContext *C)
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiBut * UI_context_active_but_prop_get(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
#define ND_KEYINGSET
Definition WM_types.hh:448
#define NC_SCENE
Definition WM_types.hh:378
@ OPTYPE_UNDO
Definition WM_types.hh:182
@ OPTYPE_REGISTER
Definition WM_types.hh:180
ListBase builtin_keyingsets
#define offsetof(t, d)
void ANIM_keyingset_visit_for_search_no_poll(const bContext *C, PointerRNA *, PropertyRNA *, const char *, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset)
void ANIM_OT_keying_set_add(wmOperatorType *ot)
static wmOperatorStatus remove_active_ks_path_exec(bContext *C, wmOperator *op)
static bool keyingset_poll_active_edit(bContext *C)
static wmOperatorStatus remove_keyingset_button_exec(bContext *C, wmOperator *op)
KeyingSet * ANIM_keyingset_get_from_idname(Scene *scene, const char *idname)
void ANIM_OT_keying_set_path_remove(wmOperatorType *ot)
bool ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *keyingset)
void ANIM_keyingset_visit_for_search(const bContext *C, PointerRNA *, PropertyRNA *, const char *, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
static void build_keyingset_enum(bContext *C, EnumPropertyItem **item, int *totitem, bool *r_free)
static bool keyingset_poll_activePath_edit(bContext *C)
void ANIM_OT_keyingset_button_add(wmOperatorType *ot)
static const EnumPropertyItem * keyingset_set_active_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
void ANIM_OT_keying_set_remove(wmOperatorType *ot)
static bool keyingset_poll_default_add(bContext *C)
static wmOperatorStatus remove_active_keyingset_exec(bContext *C, wmOperator *op)
static wmOperatorStatus add_empty_ks_path_exec(bContext *C, wmOperator *op)
static wmOperatorStatus keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keying_set_active_set(wmOperatorType *ot)
void ANIM_OT_keyingset_button_remove(wmOperatorType *ot)
void ANIM_OT_keying_set_path_add(wmOperatorType *ot)
static void anim_keyingset_visit_for_search_impl(const bContext *C, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn, const bool use_poll)
KeyingSet * ANIM_keyingset_get_from_enum_type(Scene *scene, int type)
static wmOperatorStatus add_default_keyingset_exec(bContext *C, wmOperator *)
static wmOperatorStatus keyingset_active_menu_exec(bContext *C, wmOperator *op)
const EnumPropertyItem * ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
static wmOperatorStatus add_keyingset_button_exec(bContext *C, wmOperator *op)
bool all(VecOp< bool, D >) RET
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
KeyingSetInfo * keyingset_info_find_name(const char name[])
eInsertKeyFlags get_keyframing_flags(Scene *scene)
bool RNA_property_anim_editable(const PointerRNA *ptr, PropertyRNA *prop_orig)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
std::optional< std::string > RNA_path_from_ID_to_property(const PointerRNA *ptr, PropertyRNA *prop)
Definition rna_path.cc:1173
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
Definition rna_rna.cc:32
const char * identifier
Definition RNA_types.hh:657
const char * name
Definition RNA_types.hh:661
const char * description
Definition RNA_types.hh:663
short groupmode
cbKeyingSet_Poll poll
char name[64]
char typeinfo[64]
char idname[64]
struct KeyingSet * next
ListBase paths
char description[1024]
void * first
int active_keyingset
ListBase keyingsets
std::optional< std::string > info
Definition RNA_types.hh:773
void op_enum(blender::StringRefNull opname, blender::StringRefNull propname, IDProperty *properties, blender::wm::OpCallContext context, eUI_Item_Flag flag, const int active=-1)
const char * name
Definition WM_types.hh:1033
struct ReportList * reports
struct wmOperatorType * type
struct PointerRNA * ptr
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238
wmOperatorType * ot
Definition wm_files.cc:4237
uint8_t flag
Definition wm_window.cc:145