Blender  V3.3
rna_animation.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "DNA_action_types.h"
10 #include "DNA_anim_types.h"
11 #include "DNA_scene_types.h"
12 
13 #include "BLI_utildefines.h"
14 
15 #include "BLT_translation.h"
16 
17 #include "MEM_guardedalloc.h"
18 
19 #include "RNA_access.h"
20 #include "RNA_define.h"
21 #include "RNA_enum_types.h"
22 
23 #include "rna_internal.h"
24 
25 #include "WM_types.h"
26 
27 #include "ED_keyframing.h"
28 
29 /* exported for use in API */
31  {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""},
32  {KSP_GROUP_NONE, "NONE", 0, "None", ""},
33  {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""},
34  {0, NULL, 0, NULL, NULL},
35 };
36 
37 /* It would be cool to get rid of this 'INSERTKEY_' prefix in 'py strings' values,
38  * but it would break existing
39  * exported keyingset... :/
40  */
43  "INSERTKEY_NEEDED",
44  0,
45  "Only Needed",
46  "Only insert keyframes where they're needed in the relevant F-Curves"},
48  "INSERTKEY_VISUAL",
49  0,
50  "Visual Keying",
51  "Insert keyframes based on 'visual transforms'"},
53  "INSERTKEY_XYZ_TO_RGB",
54  0,
55  "XYZ=RGB Colors",
56  "Color for newly added transformation F-Curves (Location, Rotation, Scale) "
57  "and also Color is based on the transform axis"},
58  {0, NULL, 0, NULL, NULL},
59 };
60 
61 /* Contains additional flags suitable for use in Python API functions. */
64  "INSERTKEY_NEEDED",
65  0,
66  "Only Needed",
67  "Only insert keyframes where they're needed in the relevant F-Curves"},
69  "INSERTKEY_VISUAL",
70  0,
71  "Visual Keying",
72  "Insert keyframes based on 'visual transforms'"},
74  "INSERTKEY_XYZ_TO_RGB",
75  0,
76  "XYZ=RGB Colors",
77  "Color for newly added transformation F-Curves (Location, Rotation, Scale) "
78  "and also Color is based on the transform axis"},
80  "INSERTKEY_REPLACE",
81  0,
82  "Replace Existing",
83  "Only replace existing keyframes"},
85  "INSERTKEY_AVAILABLE",
86  0,
87  "Only Available",
88  "Don't create F-Curves when they don't already exist"},
90  "INSERTKEY_CYCLE_AWARE",
91  0,
92  "Cycle Aware Keying",
93  "When inserting into a curve with cyclic extrapolation, remap the keyframe inside "
94  "the cycle time range, and if changing an end key, also update the other one"},
95  {0, NULL, 0, NULL, NULL},
96 };
97 
98 #ifdef RNA_RUNTIME
99 
100 # include "BLI_math_base.h"
101 
102 # include "BKE_anim_data.h"
103 # include "BKE_animsys.h"
104 # include "BKE_fcurve.h"
105 # include "BKE_nla.h"
106 
107 # include "DEG_depsgraph.h"
108 # include "DEG_depsgraph_build.h"
109 
110 # include "DNA_object_types.h"
111 
112 # include "ED_anim_api.h"
113 
114 # include "WM_api.h"
115 
116 static void rna_AnimData_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
117 {
118  ID *id = ptr->owner_id;
119 
120  ANIM_id_update(bmain, id);
121 }
122 
123 static void rna_AnimData_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
124 {
126 
127  rna_AnimData_update(bmain, scene, ptr);
128 }
129 
130 static int rna_AnimData_action_editable(PointerRNA *ptr, const char **UNUSED(r_info))
131 {
132  AnimData *adt = (AnimData *)ptr->data;
134 }
135 
136 static void rna_AnimData_action_set(PointerRNA *ptr,
137  PointerRNA value,
138  struct ReportList *UNUSED(reports))
139 {
140  ID *ownerId = ptr->owner_id;
141 
142  /* set action */
143  BKE_animdata_set_action(NULL, ownerId, value.data);
144 }
145 
146 static void rna_AnimData_tweakmode_set(PointerRNA *ptr, const bool value)
147 {
148  AnimData *adt = (AnimData *)ptr->data;
149 
150  /* NOTE: technically we should also set/unset SCE_NLA_EDIT_ON flag on the
151  * scene which is used to make polling tests faster, but this flag is weak
152  * and can easily break e.g. by changing layer visibility. This needs to be
153  * dealt with at some point. */
154 
155  if (value) {
157  }
158  else {
160  }
161 }
162 
163 /* ****************************** */
164 
165 /* wrapper for poll callback */
166 static bool RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
167 {
168  extern FunctionRNA rna_KeyingSetInfo_poll_func;
169 
170  PointerRNA ptr;
171  ParameterList list;
172  FunctionRNA *func;
173  void *ret;
174  int ok;
175 
176  RNA_pointer_create(NULL, ksi->rna_ext.srna, ksi, &ptr);
177  func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
178 
179  RNA_parameter_list_create(&list, &ptr, func);
180  {
181  /* hook up arguments */
182  RNA_parameter_set_lookup(&list, "ksi", &ksi);
183  RNA_parameter_set_lookup(&list, "context", &C);
184 
185  /* execute the function */
186  ksi->rna_ext.call(C, &ptr, func, &list);
187 
188  /* read the result */
189  RNA_parameter_get_lookup(&list, "ok", &ret);
190  ok = *(bool *)ret;
191  }
193 
194  return ok;
195 }
196 
197 /* wrapper for iterator callback */
198 static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks)
199 {
200  extern FunctionRNA rna_KeyingSetInfo_iterator_func;
201 
202  PointerRNA ptr;
203  ParameterList list;
204  FunctionRNA *func;
205 
206  RNA_pointer_create(NULL, ksi->rna_ext.srna, ksi, &ptr);
207  func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
208 
209  RNA_parameter_list_create(&list, &ptr, func);
210  {
211  /* hook up arguments */
212  RNA_parameter_set_lookup(&list, "ksi", &ksi);
213  RNA_parameter_set_lookup(&list, "context", &C);
214  RNA_parameter_set_lookup(&list, "ks", &ks);
215 
216  /* execute the function */
217  ksi->rna_ext.call(C, &ptr, func, &list);
218  }
220 }
221 
222 /* wrapper for generator callback */
223 static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, PointerRNA *data)
224 {
225  extern FunctionRNA rna_KeyingSetInfo_generate_func;
226 
227  PointerRNA ptr;
228  ParameterList list;
229  FunctionRNA *func;
230 
231  RNA_pointer_create(NULL, ksi->rna_ext.srna, ksi, &ptr);
232  func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
233 
234  RNA_parameter_list_create(&list, &ptr, func);
235  {
236  /* hook up arguments */
237  RNA_parameter_set_lookup(&list, "ksi", &ksi);
238  RNA_parameter_set_lookup(&list, "context", &C);
239  RNA_parameter_set_lookup(&list, "ks", &ks);
240  RNA_parameter_set_lookup(&list, "data", data);
241 
242  /* execute the function */
243  ksi->rna_ext.call(C, &ptr, func, &list);
244  }
246 }
247 
248 /* ------ */
249 
250 /* XXX: the exact purpose of this is not too clear...
251  * maybe we want to revise this at some point? */
252 static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr)
253 {
254  KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data;
255  return (ksi->rna_ext.srna) ? ksi->rna_ext.srna : &RNA_KeyingSetInfo;
256 }
257 
258 static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type)
259 {
261 
262  if (ksi == NULL) {
263  return;
264  }
265 
266  /* free RNA data referencing this */
269 
271 
272  /* unlink Blender-side data */
273  ANIM_keyingset_info_unregister(bmain, ksi);
274 }
275 
276 static StructRNA *rna_KeyingSetInfo_register(Main *bmain,
277  ReportList *reports,
278  void *data,
279  const char *identifier,
280  StructValidateFunc validate,
281  StructCallbackFunc call,
283 {
284  KeyingSetInfo dummyksi = {NULL};
285  KeyingSetInfo *ksi;
286  PointerRNA dummyptr = {NULL};
287  int have_function[3];
288 
289  /* setup dummy type info to store static properties in */
290  /* TODO: perhaps we want to get users to register
291  * as if they're using 'KeyingSet' directly instead? */
292  RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr);
293 
294  /* validate the python class */
295  if (validate(&dummyptr, data, have_function) != 0) {
296  return NULL;
297  }
298 
299  if (strlen(identifier) >= sizeof(dummyksi.idname)) {
300  BKE_reportf(reports,
301  RPT_ERROR,
302  "Registering keying set info class: '%s' is too long, maximum length is %d",
303  identifier,
304  (int)sizeof(dummyksi.idname));
305  return NULL;
306  }
307 
308  /* check if we have registered this info before, and remove it */
309  ksi = ANIM_keyingset_info_find_name(dummyksi.idname);
310  if (ksi && ksi->rna_ext.srna) {
311  rna_KeyingSetInfo_unregister(bmain, ksi->rna_ext.srna);
312  }
313 
314  /* create a new KeyingSetInfo type */
315  ksi = MEM_mallocN(sizeof(KeyingSetInfo), "python keying set info");
316  memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo));
317 
318  /* set RNA-extensions info */
319  ksi->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ksi->idname, &RNA_KeyingSetInfo);
320  ksi->rna_ext.data = data;
321  ksi->rna_ext.call = call;
322  ksi->rna_ext.free = free;
324 
325  /* set callbacks */
326  /* NOTE: we really should have all of these... */
327  ksi->poll = (have_function[0]) ? RKS_POLL_rna_internal : NULL;
328  ksi->iter = (have_function[1]) ? RKS_ITER_rna_internal : NULL;
329  ksi->generate = (have_function[2]) ? RKS_GEN_rna_internal : NULL;
330 
331  /* add and register with other info as needed */
333 
335 
336  /* return the struct-rna added */
337  return ksi->rna_ext.srna;
338 }
339 
340 /* ****************************** */
341 
342 static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr)
343 {
344  KS_Path *ksp = (KS_Path *)ptr->data;
345  return ID_code_to_RNA_type(ksp->idtype);
346 }
347 
348 static int rna_ksPath_id_editable(PointerRNA *ptr, const char **UNUSED(r_info))
349 {
350  KS_Path *ksp = (KS_Path *)ptr->data;
351  return (ksp->idtype) ? PROP_EDITABLE : 0;
352 }
353 
354 static void rna_ksPath_id_type_set(PointerRNA *ptr, int value)
355 {
356  KS_Path *data = (KS_Path *)(ptr->data);
357 
358  /* set the driver type, then clear the id-block if the type is invalid */
359  data->idtype = value;
360  if ((data->id) && (GS(data->id->name) != data->idtype)) {
361  data->id = NULL;
362  }
363 }
364 
365 static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value)
366 {
367  KS_Path *ksp = (KS_Path *)ptr->data;
368 
369  if (ksp->rna_path) {
370  strcpy(value, ksp->rna_path);
371  }
372  else {
373  value[0] = '\0';
374  }
375 }
376 
377 static int rna_ksPath_RnaPath_length(PointerRNA *ptr)
378 {
379  KS_Path *ksp = (KS_Path *)ptr->data;
380 
381  if (ksp->rna_path) {
382  return strlen(ksp->rna_path);
383  }
384  else {
385  return 0;
386  }
387 }
388 
389 static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
390 {
391  KS_Path *ksp = (KS_Path *)ptr->data;
392 
393  if (ksp->rna_path) {
394  MEM_freeN(ksp->rna_path);
395  }
396 
397  if (value[0]) {
398  ksp->rna_path = BLI_strdup(value);
399  }
400  else {
401  ksp->rna_path = NULL;
402  }
403 }
404 
405 /* ****************************** */
406 
407 static void rna_KeyingSet_name_set(PointerRNA *ptr, const char *value)
408 {
409  KeyingSet *ks = (KeyingSet *)ptr->data;
410 
411  /* update names of corresponding groups if name changes */
412  if (!STREQ(ks->name, value)) {
413  KS_Path *ksp;
414 
415  for (ksp = ks->paths.first; ksp; ksp = ksp->next) {
416  if ((ksp->groupmode == KSP_GROUP_KSNAME) && (ksp->id)) {
417  AnimData *adt = BKE_animdata_from_id(ksp->id);
418 
419  /* TODO: NLA strips? */
420  if (adt && adt->action) {
421  bActionGroup *agrp;
422 
423  /* lazy check - should really find the F-Curve for the affected path and check its group
424  * but this way should be faster and work well for most cases, as long as there are no
425  * conflicts
426  */
427  for (agrp = adt->action->groups.first; agrp; agrp = agrp->next) {
428  if (STREQ(ks->name, agrp->name)) {
429  /* there should only be one of these in the action, so can stop... */
430  BLI_strncpy(agrp->name, value, sizeof(agrp->name));
431  break;
432  }
433  }
434  }
435  }
436  }
437  }
438 
439  /* finally, update name to new value */
440  BLI_strncpy(ks->name, value, sizeof(ks->name));
441 }
442 
443 static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr, const char **UNUSED(r_info))
444 {
445  KeyingSet *ks = (KeyingSet *)ptr->data;
446 
447  /* only editable if there are some paths to change to */
448  return (BLI_listbase_is_empty(&ks->paths) == false) ? PROP_EDITABLE : 0;
449 }
450 
451 static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr)
452 {
453  KeyingSet *ks = (KeyingSet *)ptr->data;
455  ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path - 1));
456 }
457 
458 static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr,
459  PointerRNA value,
460  struct ReportList *UNUSED(reports))
461 {
462  KeyingSet *ks = (KeyingSet *)ptr->data;
463  KS_Path *ksp = (KS_Path *)value.data;
464  ks->active_path = BLI_findindex(&ks->paths, ksp) + 1;
465 }
466 
467 static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr)
468 {
469  KeyingSet *ks = (KeyingSet *)ptr->data;
470  return MAX2(ks->active_path - 1, 0);
471 }
472 
473 static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value)
474 {
475  KeyingSet *ks = (KeyingSet *)ptr->data;
476  ks->active_path = value + 1;
477 }
478 
479 static void rna_KeyingSet_active_ksPath_index_range(
480  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
481 {
482  KeyingSet *ks = (KeyingSet *)ptr->data;
483 
484  *min = 0;
485  *max = max_ii(0, BLI_listbase_count(&ks->paths) - 1);
486 }
487 
488 static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr)
489 {
490  KeyingSet *ks = (KeyingSet *)ptr->data;
491  KeyingSetInfo *ksi = NULL;
492 
493  /* keying set info is only for builtin Keying Sets */
494  if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
496  }
497  return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetInfo, ksi);
498 }
499 
500 static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset,
501  ReportList *reports,
502  ID *id,
503  const char rna_path[],
504  int index,
505  int group_method,
506  const char group_name[])
507 {
508  KS_Path *ksp = NULL;
509  short flag = 0;
510 
511  /* Special case when index = -1, we key the whole array
512  * (as with other places where index is used). */
513  if (index == -1) {
514  flag |= KSP_FLAG_WHOLE_ARRAY;
515  index = 0;
516  }
517 
518  /* if data is valid, call the API function for this */
519  if (keyingset) {
520  ksp = BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method);
521  keyingset->active_path = BLI_listbase_count(&keyingset->paths);
522  }
523  else {
524  BKE_report(reports, RPT_ERROR, "Keying set path could not be added");
525  }
526 
527  /* return added path */
528  return ksp;
529 }
530 
531 static void rna_KeyingSet_paths_remove(KeyingSet *keyingset,
532  ReportList *reports,
533  PointerRNA *ksp_ptr)
534 {
535  KS_Path *ksp = ksp_ptr->data;
536 
537  /* if data is valid, call the API function for this */
538  if ((keyingset && ksp) == false) {
539  BKE_report(reports, RPT_ERROR, "Keying set path could not be removed");
540  return;
541  }
542 
543  /* remove the active path from the KeyingSet */
544  BKE_keyingset_free_path(keyingset, ksp);
545  RNA_POINTER_INVALIDATE(ksp_ptr);
546 
547  /* the active path number will most likely have changed */
548  /* TODO: we should get more fancy and actually check if it was removed,
549  * but this will do for now */
550  keyingset->active_path = 0;
551 }
552 
553 static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports)
554 {
555  /* if data is valid, call the API function for this */
556  if (keyingset) {
557  KS_Path *ksp, *kspn;
558 
559  /* free each path as we go to avoid looping twice */
560  for (ksp = keyingset->paths.first; ksp; ksp = kspn) {
561  kspn = ksp->next;
562  BKE_keyingset_free_path(keyingset, ksp);
563  }
564 
565  /* reset the active path, since there aren't any left */
566  keyingset->active_path = 0;
567  }
568  else {
569  BKE_report(reports, RPT_ERROR, "Keying set paths could not be removed");
570  }
571 }
572 
573 /* needs wrapper function to push notifier */
574 static NlaTrack *rna_NlaTrack_new(ID *id, AnimData *adt, Main *bmain, bContext *C, NlaTrack *track)
575 {
576  NlaTrack *new_track = BKE_nlatrack_add(adt, track, ID_IS_OVERRIDE_LIBRARY(id));
577 
579 
582 
583  return new_track;
584 }
585 
586 static void rna_NlaTrack_remove(
587  ID *id, AnimData *adt, Main *bmain, bContext *C, ReportList *reports, PointerRNA *track_ptr)
588 {
589  NlaTrack *track = track_ptr->data;
590 
591  if (BLI_findindex(&adt->nla_tracks, track) == -1) {
592  BKE_reportf(reports, RPT_ERROR, "NlaTrack '%s' cannot be removed", track->name);
593  return;
594  }
595 
596  BKE_nlatrack_free(&adt->nla_tracks, track, true);
597  RNA_POINTER_INVALIDATE(track_ptr);
598 
600 
603 }
604 
605 static PointerRNA rna_NlaTrack_active_get(PointerRNA *ptr)
606 {
607  AnimData *adt = (AnimData *)ptr->data;
609  return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track);
610 }
611 
612 static void rna_NlaTrack_active_set(PointerRNA *ptr,
613  PointerRNA value,
614  struct ReportList *UNUSED(reports))
615 {
616  AnimData *adt = (AnimData *)ptr->data;
617  NlaTrack *track = (NlaTrack *)value.data;
618  BKE_nlatrack_set_active(&adt->nla_tracks, track);
619 }
620 
621 static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_driver)
622 {
623  /* verify that we've got a driver to duplicate */
624  if (ELEM(NULL, src_driver, src_driver->driver)) {
625  BKE_report(CTX_wm_reports(C), RPT_ERROR, "No valid driver data to create copy of");
626  return NULL;
627  }
628  else {
629  /* just make a copy of the existing one and add to self */
630  FCurve *new_fcu = BKE_fcurve_copy(src_driver);
631 
632  /* XXX: if we impose any ordering on these someday, this will be problematic */
633  BLI_addtail(&adt->drivers, new_fcu);
634  return new_fcu;
635  }
636 }
637 
638 static FCurve *rna_Driver_new(
639  ID *id, AnimData *adt, Main *bmain, ReportList *reports, const char *rna_path, int array_index)
640 {
641  if (rna_path[0] == '\0') {
642  BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
643  return NULL;
644  }
645 
646  if (BKE_fcurve_find(&adt->drivers, rna_path, array_index)) {
647  BKE_reportf(reports, RPT_ERROR, "Driver '%s[%d]' already exists", rna_path, array_index);
648  return NULL;
649  }
650 
651  FCurve *fcu = verify_driver_fcurve(id, rna_path, array_index, DRIVER_FCURVE_KEYFRAMES);
652  BLI_assert(fcu != NULL);
653 
655 
656  return fcu;
657 }
658 
659 static void rna_Driver_remove(AnimData *adt, Main *bmain, ReportList *reports, FCurve *fcu)
660 {
661  if (!BLI_remlink_safe(&adt->drivers, fcu)) {
662  BKE_report(reports, RPT_ERROR, "Driver not found in this animation data");
663  return;
664  }
665  BKE_fcurve_free(fcu);
667 }
668 
669 static FCurve *rna_Driver_find(AnimData *adt,
670  ReportList *reports,
671  const char *data_path,
672  int index)
673 {
674  if (data_path[0] == '\0') {
675  BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
676  return NULL;
677  }
678 
679  /* Returns NULL if not found. */
680  return BKE_fcurve_find(&adt->drivers, data_path, index);
681 }
682 
684  PointerRNA *ptr_dst,
685  PointerRNA *ptr_src,
686  PointerRNA *ptr_storage,
687  PropertyRNA *prop_dst,
688  PropertyRNA *prop_src,
689  PropertyRNA *UNUSED(prop_storage),
690  const int len_dst,
691  const int len_src,
692  const int len_storage,
693  PointerRNA *UNUSED(ptr_item_dst),
694  PointerRNA *UNUSED(ptr_item_src),
695  PointerRNA *UNUSED(ptr_item_storage),
697 {
698  BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage) && len_dst == 0);
700  "Unsupported RNA override operation on animdata pointer");
701  UNUSED_VARS_NDEBUG(ptr_storage, len_dst, len_src, len_storage, opop);
702 
703  /* AnimData is a special case, since you cannot edit/replace it, it's either existent or not. */
704  AnimData *adt_dst = RNA_property_pointer_get(ptr_dst, prop_dst).data;
705  AnimData *adt_src = RNA_property_pointer_get(ptr_src, prop_src).data;
706 
707  if (adt_dst == NULL && adt_src != NULL) {
708  /* Copy anim data from reference into final local ID. */
709  BKE_animdata_copy_id(NULL, ptr_dst->owner_id, ptr_src->owner_id, 0);
710  RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
711  return true;
712  }
713  else if (adt_dst != NULL && adt_src == NULL) {
714  /* Override has cleared/removed anim data from its reference. */
715  BKE_animdata_free(ptr_dst->owner_id, true);
716  RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
717  return true;
718  }
719 
720  return false;
721 }
722 
723 bool rna_NLA_tracks_override_apply(Main *bmain,
724  PointerRNA *ptr_dst,
725  PointerRNA *ptr_src,
726  PointerRNA *UNUSED(ptr_storage),
727  PropertyRNA *prop_dst,
728  PropertyRNA *UNUSED(prop_src),
729  PropertyRNA *UNUSED(prop_storage),
730  const int UNUSED(len_dst),
731  const int UNUSED(len_src),
732  const int UNUSED(len_storage),
733  PointerRNA *UNUSED(ptr_item_dst),
734  PointerRNA *UNUSED(ptr_item_src),
735  PointerRNA *UNUSED(ptr_item_storage),
737 {
739  "Unsupported RNA override operation on constraints collection");
740 
741  AnimData *anim_data_dst = (AnimData *)ptr_dst->data;
742  AnimData *anim_data_src = (AnimData *)ptr_src->data;
743 
744  /* Remember that insertion operations are defined and stored in correct order, which means that
745  * even if we insert several items in a row, we always insert first one, then second one, etc.
746  * So we should always find 'anchor' track in both _src *and* _dst. */
747  NlaTrack *nla_track_anchor = NULL;
748 # if 0
749  /* This is not working so well with index-based insertion, especially in case some tracks get
750  * added to lib linked data. So we simply add locale tracks at the end of the list always, order
751  * of override operations should ensure order of local tracks is preserved properly. */
752  if (opop->subitem_reference_index >= 0) {
753  nla_track_anchor = BLI_findlink(&anim_data_dst->nla_tracks, opop->subitem_reference_index);
754  }
755  /* Otherwise we just insert in first position. */
756 # else
757  nla_track_anchor = anim_data_dst->nla_tracks.last;
758 # endif
759 
760  NlaTrack *nla_track_src = NULL;
761  if (opop->subitem_local_index >= 0) {
762  nla_track_src = BLI_findlink(&anim_data_src->nla_tracks, opop->subitem_local_index);
763  }
764 
765  if (nla_track_src == NULL) {
766  BLI_assert(nla_track_src != NULL);
767  return false;
768  }
769 
770  NlaTrack *nla_track_dst = BKE_nlatrack_copy(bmain, nla_track_src, true, 0);
771 
772  /* This handles NULL anchor as expected by adding at head of list. */
773  BLI_insertlinkafter(&anim_data_dst->nla_tracks, nla_track_anchor, nla_track_dst);
774 
775  // printf("%s: We inserted a NLA Track...\n", __func__);
776 
777  RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
778  return true;
779 }
780 
781 #else
782 
783 /* helper function for Keying Set -> keying settings */
784 static void rna_def_common_keying_flags(StructRNA *srna, short reg)
785 {
786  PropertyRNA *prop;
787 
788  /* override scene/userpref defaults? */
789  prop = RNA_def_property(srna, "use_insertkey_override_needed", PROP_BOOLEAN, PROP_NONE);
790  RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_NEEDED);
792  "Override Insert Keyframes Default- Only Needed",
793  "Override default setting to only insert keyframes where they're "
794  "needed in the relevant F-Curves");
795  if (reg) {
797  }
798 
799  prop = RNA_def_property(srna, "use_insertkey_override_visual", PROP_BOOLEAN, PROP_NONE);
800  RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_MATRIX);
802  prop,
803  "Override Insert Keyframes Default - Visual",
804  "Override default setting to insert keyframes based on 'visual transforms'");
805  if (reg) {
807  }
808 
809  prop = RNA_def_property(srna, "use_insertkey_override_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
810  RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_XYZ2RGB);
812  prop,
813  "Override F-Curve Colors - XYZ to RGB",
814  "Override default setting to set color for newly added transformation F-Curves "
815  "(Location, Rotation, Scale) to be based on the transform axis");
816  if (reg) {
818  }
819 
820  /* value to override defaults with */
821  prop = RNA_def_property(srna, "use_insertkey_needed", PROP_BOOLEAN, PROP_NONE);
824  "Insert Keyframes - Only Needed",
825  "Only insert keyframes where they're needed in the relevant F-Curves");
826  if (reg) {
828  }
829 
830  prop = RNA_def_property(srna, "use_insertkey_visual", PROP_BOOLEAN, PROP_NONE);
833  prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'");
834  if (reg) {
836  }
837 
838  prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
841  "F-Curve Colors - XYZ to RGB",
842  "Color for newly added transformation F-Curves (Location, Rotation, "
843  "Scale) is based on the transform axis");
844  if (reg) {
846  }
847 }
848 
849 /* --- */
850 
851 /* To avoid repeating it twice! */
852 # define KEYINGSET_IDNAME_DOC \
853  "If this is set, the Keying Set gets a custom ID, otherwise it takes " \
854  "the name of the class used to define the Keying Set (for example, " \
855  "if the class name is \"BUILTIN_KSI_location\", and bl_idname is not " \
856  "set by the script, then bl_idname = \"BUILTIN_KSI_location\")"
857 
859 {
860  StructRNA *srna;
861  PropertyRNA *prop;
862  FunctionRNA *func;
863  PropertyRNA *parm;
864 
865  srna = RNA_def_struct(brna, "KeyingSetInfo", NULL);
866  RNA_def_struct_sdna(srna, "KeyingSetInfo");
868  srna, "Keying Set Info", "Callback function defines for builtin Keying Sets");
869  RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine");
871  srna, "rna_KeyingSetInfo_register", "rna_KeyingSetInfo_unregister", NULL);
872 
873  /* Properties --------------------- */
874 
875  RNA_define_verify_sdna(0); /* not in sdna */
876 
877  prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
878  RNA_def_property_string_sdna(prop, NULL, "idname");
881 
882  prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
883  RNA_def_property_string_sdna(prop, NULL, "name");
884  RNA_def_property_ui_text(prop, "UI Name", "");
885  RNA_def_struct_name_property(srna, prop);
887 
888  prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
889  RNA_def_property_string_sdna(prop, NULL, "description");
890  RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
892  RNA_def_property_ui_text(prop, "Description", "A short description of the keying set");
893 
894  /* Regarding why we don't use rna_def_common_keying_flags() here:
895  * - Using it would keep this case in sync with the other places
896  * where these options are exposed (which are optimized for being
897  * used in the UI).
898  * - Unlike all the other places, this case is used for defining
899  * new "built in" Keying Sets via the Python API. In that case,
900  * it makes more sense to expose these in a way more similar to
901  * other places featuring bl_idname/label/description (i.e. operators)
902  */
903  prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
904  RNA_def_property_enum_sdna(prop, NULL, "keyingflag");
907  RNA_def_property_ui_text(prop, "Options", "Keying Set options to use when inserting keyframes");
908 
910 
911  /* Function Callbacks ------------- */
912  /* poll */
913  func = RNA_def_function(srna, "poll", NULL);
914  RNA_def_function_ui_description(func, "Test if Keying Set can be used or not");
916  RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", ""));
917  parm = RNA_def_pointer(func, "context", "Context", "", "");
919 
920  /* iterator */
921  func = RNA_def_function(srna, "iterator", NULL);
923  func, "Call generate() on the structs which have properties to be keyframed");
925  parm = RNA_def_pointer(func, "context", "Context", "", "");
927  parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
929 
930  /* generate */
931  func = RNA_def_function(srna, "generate", NULL);
933  func, "Add Paths to the Keying Set to keyframe the properties of the given data");
935  parm = RNA_def_pointer(func, "context", "Context", "", "");
937  parm = RNA_def_pointer(func, "ks", "KeyingSet", "", "");
939  parm = RNA_def_pointer(func, "data", "AnyType", "", "");
941 }
942 
944 {
945  StructRNA *srna;
946  PropertyRNA *prop;
947 
948  srna = RNA_def_struct(brna, "KeyingSetPath", NULL);
949  RNA_def_struct_sdna(srna, "KS_Path");
950  RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set");
951 
952  /* ID */
953  prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
954  RNA_def_property_struct_type(prop, "ID");
956  RNA_def_property_editable_func(prop, "rna_ksPath_id_editable");
957  RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL);
959  "ID-Block",
960  "ID-Block that keyframes for Keying Set should be added to "
961  "(for Absolute Keying Sets only)");
963  prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
964 
965  prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
966  RNA_def_property_enum_sdna(prop, NULL, "idtype");
969  RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL);
970  RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
973  prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
974 
975  /* Group */
976  prop = RNA_def_property(srna, "group", PROP_STRING, PROP_NONE);
978  prop, "Group Name", "Name of Action Group to assign setting(s) for this path to");
980  prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
981 
982  /* Grouping */
983  prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE);
984  RNA_def_property_enum_sdna(prop, NULL, "groupmode");
987  prop, "Grouping Method", "Method used to define which Group-name to use");
989  prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
990 
991  /* Path + Array Index */
992  prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
994  prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", "rna_ksPath_RnaPath_set");
995  RNA_def_property_ui_text(prop, "Data Path", "Path to property setting");
996  RNA_def_struct_name_property(srna, prop); /* XXX this is the best indicator for now... */
998 
999  /* called 'index' when given as function arg */
1000  prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE);
1001  RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable");
1003  prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
1004 
1005  /* Flags */
1006  prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE);
1009  prop,
1010  "Entire Array",
1011  "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), "
1012  "entire array is to be used");
1014  prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */
1015 
1016  /* Keyframing Settings */
1017  rna_def_common_keying_flags(srna, 0);
1018 }
1019 
1020 /* keyingset.paths */
1022 {
1023  StructRNA *srna;
1024 
1025  FunctionRNA *func;
1026  PropertyRNA *parm;
1027 
1028  PropertyRNA *prop;
1029 
1030  RNA_def_property_srna(cprop, "KeyingSetPaths");
1031  srna = RNA_def_struct(brna, "KeyingSetPaths", NULL);
1032  RNA_def_struct_sdna(srna, "KeyingSet");
1033  RNA_def_struct_ui_text(srna, "Keying set paths", "Collection of keying set paths");
1034 
1035  /* Add Path */
1036  func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add");
1037  RNA_def_function_ui_description(func, "Add a new path for the Keying Set");
1039  /* return arg */
1040  parm = RNA_def_pointer(
1041  func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set");
1042  RNA_def_function_return(func, parm);
1043  /* ID-block for target */
1044  parm = RNA_def_pointer(
1045  func, "target_id", "ID", "Target ID", "ID data-block for the destination");
1047  /* rna-path */
1048  /* XXX hopefully this is long enough */
1049  parm = RNA_def_string(
1050  func, "data_path", NULL, 256, "Data-Path", "RNA-Path to destination property");
1052  /* index (defaults to -1 for entire array) */
1053  RNA_def_int(func,
1054  "index",
1055  -1,
1056  -1,
1057  INT_MAX,
1058  "Index",
1059  "The index of the destination property (i.e. axis of Location/Rotation/etc.), "
1060  "or -1 for the entire array",
1061  0,
1062  INT_MAX);
1063  /* grouping */
1064  RNA_def_enum(func,
1065  "group_method",
1068  "Grouping Method",
1069  "Method used to define which Group-name to use");
1071  func,
1072  "group_name",
1073  NULL,
1074  64,
1075  "Group Name",
1076  "Name of Action Group to assign destination to (only if grouping mode is to use this name)");
1077 
1078  /* Remove Path */
1079  func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove");
1080  RNA_def_function_ui_description(func, "Remove the given path from the Keying Set");
1082  /* path to remove */
1083  parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
1086 
1087  /* Remove All Paths */
1088  func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
1089  RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set");
1091 
1092  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1093  RNA_def_property_struct_type(prop, "KeyingSetPath");
1095  RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
1097  prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL);
1099  prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
1100 
1101  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
1102  RNA_def_property_int_sdna(prop, NULL, "active_path");
1104  "rna_KeyingSet_active_ksPath_index_get",
1105  "rna_KeyingSet_active_ksPath_index_set",
1106  "rna_KeyingSet_active_ksPath_index_range");
1107  RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
1108 }
1109 
1110 static void rna_def_keyingset(BlenderRNA *brna)
1111 {
1112  StructRNA *srna;
1113  PropertyRNA *prop;
1114 
1115  srna = RNA_def_struct(brna, "KeyingSet", NULL);
1116  RNA_def_struct_ui_text(srna, "Keying Set", "Settings that should be keyframed together");
1117 
1118  /* Id/Label */
1119  prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
1120  RNA_def_property_string_sdna(prop, NULL, "idname");
1123  /* NOTE: disabled, as ID name shouldn't be editable */
1124 # if 0
1126 # endif
1127 
1128  prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
1129  RNA_def_property_string_sdna(prop, NULL, "name");
1130  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_KeyingSet_name_set");
1131  RNA_def_property_ui_text(prop, "UI Name", "");
1132  RNA_def_struct_ui_icon(srna, ICON_KEYINGSET);
1133  RNA_def_struct_name_property(srna, prop);
1135 
1136  prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
1137  RNA_def_property_string_sdna(prop, NULL, "description");
1138  RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
1139  RNA_def_property_ui_text(prop, "Description", "A short description of the keying set");
1140 
1141  /* KeyingSetInfo (Type Info) for Builtin Sets only. */
1142  prop = RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE);
1143  RNA_def_property_struct_type(prop, "KeyingSetInfo");
1144  RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL);
1146  prop, "Type Info", "Callback function defines for built-in Keying Sets");
1147 
1148  /* Paths */
1149  prop = RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE);
1150  RNA_def_property_collection_sdna(prop, NULL, "paths", NULL);
1151  RNA_def_property_struct_type(prop, "KeyingSetPath");
1153  prop, "Paths", "Keying Set Paths to define settings that get keyframed together");
1154  rna_def_keyingset_paths(brna, prop);
1155 
1156  /* Flags */
1157  prop = RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE);
1161  "Absolute",
1162  "Keying Set defines specific paths/settings to be keyframed "
1163  "(i.e. is not reliant on context info)");
1164 
1165  /* Keyframing Flags */
1166  rna_def_common_keying_flags(srna, 0);
1167 
1168  /* Keying Set API */
1169  RNA_api_keyingset(srna);
1170 }
1171 
1172 # undef KEYINGSET_IDNAME_DOC
1173 /* --- */
1174 
1176 {
1177  StructRNA *srna;
1178  PropertyRNA *parm;
1179  FunctionRNA *func;
1180 
1181  PropertyRNA *prop;
1182 
1183  RNA_def_property_srna(cprop, "NlaTracks");
1184  srna = RNA_def_struct(brna, "NlaTracks", NULL);
1185  RNA_def_struct_sdna(srna, "AnimData");
1186  RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks");
1187 
1188  func = RNA_def_function(srna, "new", "rna_NlaTrack_new");
1190  RNA_def_function_ui_description(func, "Add a new NLA Track");
1191  RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after");
1192  /* return type */
1193  parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track");
1194  RNA_def_function_return(func, parm);
1195 
1196  func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove");
1197  RNA_def_function_flag(func,
1199  RNA_def_function_ui_description(func, "Remove a NLA Track");
1200  parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove");
1203 
1204  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1205  RNA_def_property_struct_type(prop, "NlaTrack");
1207  prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
1209  RNA_def_property_ui_text(prop, "Active Track", "Active NLA Track");
1210  /* XXX: should (but doesn't) update the active track in the NLA window */
1212 }
1213 
1215 {
1216  StructRNA *srna;
1217  PropertyRNA *parm;
1218  FunctionRNA *func;
1219 
1220  /* PropertyRNA *prop; */
1221 
1222  RNA_def_property_srna(cprop, "AnimDataDrivers");
1223  srna = RNA_def_struct(brna, "AnimDataDrivers", NULL);
1224  RNA_def_struct_sdna(srna, "AnimData");
1225  RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves");
1226 
1227  /* Match: ActionFCurves.new/remove */
1228 
1229  /* AnimData.drivers.new(...) */
1230  func = RNA_def_function(srna, "new", "rna_Driver_new");
1232  parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path to use");
1234  RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
1235  /* return type */
1236  parm = RNA_def_pointer(func, "driver", "FCurve", "", "Newly Driver F-Curve");
1237  RNA_def_function_return(func, parm);
1238 
1239  /* AnimData.drivers.remove(...) */
1240  func = RNA_def_function(srna, "remove", "rna_Driver_remove");
1242  parm = RNA_def_pointer(func, "driver", "FCurve", "", "");
1244 
1245  /* AnimData.drivers.from_existing(...) */
1246  func = RNA_def_function(srna, "from_existing", "rna_Driver_from_existing");
1248  RNA_def_function_ui_description(func, "Add a new driver given an existing one");
1249  RNA_def_pointer(func,
1250  "src_driver",
1251  "FCurve",
1252  "",
1253  "Existing Driver F-Curve to use as template for a new one");
1254  /* return type */
1255  parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve");
1256  RNA_def_function_return(func, parm);
1257 
1258  /* AnimData.drivers.find(...) */
1259  func = RNA_def_function(srna, "find", "rna_Driver_find");
1261  func,
1262  "Find a driver F-Curve. Note that this function performs a linear scan "
1263  "of all driver F-Curves.");
1265  parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path");
1267  RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
1268  /* return type */
1269  parm = RNA_def_pointer(
1270  func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist");
1271  RNA_def_function_return(func, parm);
1272 }
1273 
1275 {
1276  PropertyRNA *prop;
1277 
1278  prop = RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE);
1279  RNA_def_property_pointer_sdna(prop, NULL, "adt");
1282  RNA_def_property_override_funcs(prop, NULL, NULL, "rna_AnimaData_override_apply");
1283  RNA_def_property_ui_text(prop, "Animation Data", "Animation data for this data-block");
1284 }
1285 
1286 static void rna_def_animdata(BlenderRNA *brna)
1287 {
1288  StructRNA *srna;
1289  PropertyRNA *prop;
1290 
1291  srna = RNA_def_struct(brna, "AnimData", NULL);
1292  RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for data-block");
1293  RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA);
1294 
1295  /* NLA */
1296  prop = RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE);
1297  RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL);
1298  RNA_def_property_struct_type(prop, "NlaTrack");
1299  RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)");
1303  RNA_def_property_override_funcs(prop, NULL, NULL, "rna_NLA_tracks_override_apply");
1304 
1305  rna_api_animdata_nla_tracks(brna, prop);
1306 
1308 
1309  /* Active Action */
1310  prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
1311  /* this flag as well as the dynamic test must be defined for this to be editable... */
1314  prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll");
1315  RNA_def_property_editable_func(prop, "rna_AnimData_action_editable");
1316  RNA_def_property_ui_text(prop, "Action", "Active Action for this data-block");
1317  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA_ACTCHANGE, "rna_AnimData_dependency_update");
1318 
1319  /* Active Action Settings */
1320  prop = RNA_def_property(srna, "action_extrapolation", PROP_ENUM, PROP_NONE);
1321  RNA_def_property_enum_sdna(prop, NULL, "act_extendmode");
1324  prop,
1325  "Action Extrapolation",
1326  "Action to take for gaps past the Active Action's range (when evaluating with NLA)");
1327  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, "rna_AnimData_update");
1328 
1329  prop = RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE);
1330  RNA_def_property_enum_sdna(prop, NULL, "act_blendmode");
1333  prop,
1334  "Action Blending",
1335  "Method used for combining Active Action's result with result of NLA stack");
1336  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, "rna_AnimData_update"); /* this will do? */
1337 
1338  prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_FACTOR);
1339  RNA_def_property_float_sdna(prop, NULL, "act_influence");
1340  RNA_def_property_float_default(prop, 1.0f);
1341  RNA_def_property_range(prop, 0.0f, 1.0f);
1343  "Action Influence",
1344  "Amount the Active Action contributes to the result of the NLA stack");
1345  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, "rna_AnimData_update"); /* this will do? */
1346 
1347  /* Drivers */
1348  prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE);
1349  RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL);
1350  RNA_def_property_struct_type(prop, "FCurve");
1351  RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this data-block");
1352 
1354 
1355  rna_api_animdata_drivers(brna, prop);
1356 
1358 
1359  /* General Settings */
1360  prop = RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE);
1363  prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block");
1364  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, "rna_AnimData_update"); /* this will do? */
1365 
1366  prop = RNA_def_property(srna, "use_tweak_mode", PROP_BOOLEAN, PROP_NONE);
1368  RNA_def_property_boolean_funcs(prop, NULL, "rna_AnimData_tweakmode_set");
1370  prop, "Use NLA Tweak Mode", "Whether to enable or disable tweak mode in NLA");
1371  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, "rna_AnimData_update");
1372 
1373  prop = RNA_def_property(srna, "use_pin", PROP_BOOLEAN, PROP_NONE);
1376  RNA_def_property_ui_text(prop, "Pin in Graph Editor", "");
1378 
1380 
1381  /* Animation Data API */
1382  RNA_api_animdata(srna);
1383 }
1384 
1385 /* --- */
1386 
1388 {
1389  rna_def_animdata(brna);
1390 
1391  rna_def_keyingset(brna);
1392  rna_def_keyingset_path(brna);
1393  rna_def_keyingset_info(brna);
1394 }
1395 
1396 #endif
void BKE_animdata_free(struct ID *id, bool do_id_user)
Definition: anim_data.c:197
bool BKE_animdata_action_editable(const struct AnimData *adt)
bool BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct bAction *act)
Definition: anim_data.c:118
bool BKE_animdata_copy_id(struct Main *bmain, struct ID *id_to, struct ID *id_from, int flag)
Definition: anim_data.c:327
struct AnimData * BKE_animdata_from_id(const struct ID *id)
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.c:160
void BKE_keyingset_free_path(struct KeyingSet *ks, struct KS_Path *ksp)
Definition: anim_sys.c:223
struct ReportList * CTX_wm_reports(const bContext *C)
Definition: context.c:775
void BKE_fcurve_free(struct FCurve *fcu)
Definition: fcurve.c:65
struct FCurve * BKE_fcurve_copy(const struct FCurve *fcu)
struct FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
Definition: fcurve.c:249
struct NlaTrack * BKE_nlatrack_copy(struct Main *bmain, struct NlaTrack *nlt, bool use_same_actions, int flag)
Definition: nla.c:197
bool BKE_nla_tweakmode_enter(struct AnimData *adt)
Definition: nla.c:2019
struct NlaTrack * BKE_nlatrack_add(struct AnimData *adt, struct NlaTrack *prev, bool is_liboverride)
Definition: nla.c:353
void BKE_nla_tweakmode_exit(struct AnimData *adt)
Definition: nla.c:2092
struct NlaTrack * BKE_nlatrack_find_active(ListBase *tracks)
Definition: nla.c:1032
void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt)
Definition: nla.c:1117
void BKE_nlatrack_free(ListBase *tracks, struct NlaTrack *nlt, bool do_id_user)
Definition: nla.c:103
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
#define BLI_assert(a)
Definition: BLI_assert.h:46
void BLI_kdtree_nd_() free(KDTree *tree)
Definition: kdtree_impl.h:102
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:301
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:123
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
#define UNUSED_VARS_NDEBUG(...)
#define UNUSED(x)
#define MAX2(a, b)
#define ELEM(...)
#define STREQ(a, b)
#define BLT_I18NCONTEXT_ID_ID
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_ANIMATION
Definition: DNA_ID.h:794
@ IDOVERRIDE_LIBRARY_OP_INSERT_AFTER
Definition: DNA_ID.h:230
@ IDOVERRIDE_LIBRARY_OP_REPLACE
Definition: DNA_ID.h:220
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition: DNA_ID.h:588
@ ID_OB
Definition: DNA_ID_enums.h:47
@ ADT_CURVES_ALWAYS_VISIBLE
@ ADT_NLA_EVAL_OFF
@ ADT_NLA_EDIT_ON
@ KEYINGSET_ABSOLUTE
@ INSERTKEY_CYCLE_AWARE
@ INSERTKEY_REPLACE
@ INSERTKEY_MATRIX
@ INSERTKEY_NEEDED
@ INSERTKEY_XYZ2RGB
@ INSERTKEY_AVAILABLE
@ KSP_GROUP_KSNAME
@ KSP_GROUP_NAMED
@ KSP_GROUP_NONE
@ KSP_FLAG_WHOLE_ARRAY
Object is a sort of wrapper for general info.
@ DRIVER_FCURVE_KEYFRAMES
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
StructRNA * ID_code_to_RNA_type(short idcode)
#define RNA_DYN_DESCR_MAX
Definition: RNA_define.h:576
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
void(* StructFreeFunc)(void *data)
Definition: RNA_types.h:737
int(* StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_function)
Definition: RNA_types.h:732
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_REGISTER
Definition: RNA_types.h:670
@ FUNC_USE_MAIN
Definition: RNA_types.h:661
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:662
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:650
int(* StructCallbackFunc)(struct bContext *C, struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list)
Definition: RNA_types.h:733
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROPOVERRIDE_LIBRARY_INSERTION
Definition: RNA_types.h:337
@ PROPOVERRIDE_NO_PROP_NAME
Definition: RNA_types.h:344
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_ENUM_FLAG
Definition: RNA_types.h:266
@ PROP_REGISTER_OPTIONAL
Definition: RNA_types.h:274
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_NO_DEG_UPDATE
Definition: RNA_types.h:301
@ PROP_REGISTER
Definition: RNA_types.h:273
@ PROP_ID_REFCOUNT
Definition: RNA_types.h:226
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_FACTOR
Definition: RNA_types.h:144
#define C
Definition: RandGen.cpp:25
#define NC_WINDOW
Definition: WM_types.h:325
#define ND_NLA_ACTCHANGE
Definition: WM_types.h:446
#define NC_ANIMATION
Definition: WM_types.h:338
#define ND_KEYINGSET
Definition: WM_types.h:396
#define NC_SCENE
Definition: WM_types.h:328
#define NA_ADDED
Definition: WM_types.h:525
#define NA_EDITED
Definition: WM_types.h:523
#define NA_REMOVED
Definition: WM_types.h:526
#define ND_NLA
Definition: WM_types.h:445
#define NA_RENAME
Definition: WM_types.h:527
#define ND_ANIMCHAN
Definition: WM_types.h:444
#define NA_SELECTED
Definition: WM_types.h:528
void ANIM_id_update(Main *bmain, ID *id)
Definition: anim_deps.c:99
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
FCurve * verify_driver_fcurve(ID *id, const char rna_path[], const int array_index, eDriverFCurveCreationMode creation_mode)
Definition: drivers.c:50
#define GS(x)
Definition: iris.c:225
KeyingSetInfo * ANIM_keyingset_info_find_name(const char name[])
Definition: keyingsets.c:520
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi)
Definition: keyingsets.c:585
void ANIM_keyingset_info_register(KeyingSetInfo *ksi)
Definition: keyingsets.c:566
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
return ret
const EnumPropertyItem rna_enum_id_type_items[]
Definition: rna_ID.c:33
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:136
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **value)
Definition: rna_access.c:6026
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
Definition: rna_access.c:902
ParameterList * RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSED(ptr), FunctionRNA *func)
Definition: rna_access.c:5826
void * RNA_struct_blender_type_get(StructRNA *srna)
Definition: rna_access.c:897
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3493
void RNA_parameter_list_free(ParameterList *parms)
Definition: rna_access.c:5922
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2143
void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value)
Definition: rna_access.c:6088
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
static void rna_def_common_keying_flags(StructRNA *srna, short reg)
void RNA_def_animation(BlenderRNA *brna)
static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_keying_flag_items_api[]
Definition: rna_animation.c:62
static void rna_def_animdata(BlenderRNA *brna)
static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_keying_flag_items[]
Definition: rna_animation.c:41
#define KEYINGSET_IDNAME_DOC
const EnumPropertyItem rna_enum_keyingset_path_grouping_items[]
Definition: rna_animation.c:30
static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_keyingset_path(BlenderRNA *brna)
static void rna_def_keyingset(BlenderRNA *brna)
void rna_def_animdata_common(StructRNA *srna)
static void rna_def_keyingset_info(BlenderRNA *brna)
void RNA_api_keyingset(StructRNA *srna)
void RNA_api_animdata(StructRNA *srna)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
Definition: rna_define.c:1148
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_define_lib_overridable(const bool make_overridable)
Definition: rna_define.c:742
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
Definition: rna_define.c:2106
void RNA_define_verify_sdna(bool verify)
Definition: rna_define.c:737
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
Definition: rna_define.c:1172
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
Definition: rna_define.c:900
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
Definition: rna_define.c:1920
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
Definition: rna_define.c:2855
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
Definition: rna_define.c:762
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
Definition: rna_define.c:777
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3687
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
Definition: rna_define.c:2879
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
Definition: rna_define.c:2848
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3597
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
BlenderRNA BLENDER_RNA
bool rna_AnimaData_override_apply(struct Main *bmain, struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, struct PointerRNA *ptr_storage, struct PropertyRNA *prop_local, struct PropertyRNA *prop_reference, struct PropertyRNA *prop_storage, int len_local, int len_reference, int len_storage, struct PointerRNA *ptr_item_local, struct PointerRNA *ptr_item_reference, struct PointerRNA *ptr_item_storage, struct IDOverrideLibraryPropertyOperation *opop)
const EnumPropertyItem rna_enum_nla_mode_blend_items[]
Definition: rna_nla.c:27
const EnumPropertyItem rna_enum_nla_mode_extend_items[]
Definition: rna_nla.c:58
#define min(a, b)
Definition: sort.c:35
bAction * action
ListBase drivers
ListBase nla_tracks
StructRNA * srna
Definition: RNA_types.h:766
StructCallbackFunc call
Definition: RNA_types.h:767
void * data
Definition: RNA_types.h:765
StructFreeFunc free
Definition: RNA_types.h:768
ChannelDriver * driver
Definition: DNA_ID.h:368
struct KS_Path * next
short groupmode
char * rna_path
struct ExtensionRNA rna_ext
cbKeyingSet_Generate generate
cbKeyingSet_Iterator iter
cbKeyingSet_Poll poll
char idname[64]
char name[64]
char typeinfo[64]
ListBase paths
void * last
Definition: DNA_listBase.h:31
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
char name[64]
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
struct bActionGroup * next
ListBase groups
float max
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480