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