Blender  V3.3
rna_nla.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 "MEM_guardedalloc.h"
16 
17 #include "RNA_access.h"
18 #include "RNA_define.h"
19 #include "RNA_enum_types.h"
20 
21 #include "rna_internal.h"
22 
23 #include "WM_api.h"
24 #include "WM_types.h"
25 
26 /* enum defines exported for rna_animation.c */
29  "REPLACE",
30  0,
31  "Replace",
32  "The strip values replace the accumulated results by amount specified by influence"},
34  "COMBINE",
35  0,
36  "Combine",
37  "The strip values are combined with accumulated results by appropriately using addition, "
38  "multiplication, or quaternion math, based on channel type"},
41  "ADD",
42  0,
43  "Add",
44  "Weighted result of strip is added to the accumulated results"},
46  "SUBTRACT",
47  0,
48  "Subtract",
49  "Weighted result of strip is removed from the accumulated results"},
51  "MULTIPLY",
52  0,
53  "Multiply",
54  "Weighted result of strip is multiplied with the accumulated results"},
55  {0, NULL, 0, NULL, NULL},
56 };
57 
59  {NLASTRIP_EXTEND_NOTHING, "NOTHING", 0, "Nothing", "Strip has no influence past its extents"},
61  "HOLD",
62  0,
63  "Hold",
64  "Hold the first frame if no previous strips in track, and always hold last frame"},
65  {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame"},
66  {0, NULL, 0, NULL, NULL},
67 };
68 
69 #ifdef RNA_RUNTIME
70 
71 # include <math.h>
72 # include <stdio.h>
73 
74 /* needed for some of the validation stuff... */
75 # include "BKE_anim_data.h"
76 # include "BKE_fcurve.h"
77 # include "BKE_nla.h"
78 
79 # include "DNA_object_types.h"
80 
81 # include "ED_anim_api.h"
82 
83 # include "DEG_depsgraph.h"
84 # include "DEG_depsgraph_build.h"
85 
86 static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
87 {
88  NlaStrip *data = (NlaStrip *)ptr->data;
89 
90  /* copy the name first */
91  BLI_strncpy_utf8(data->name, value, sizeof(data->name));
92 
93  /* validate if there's enough info to do so */
94  if (ptr->owner_id) {
97  }
98 }
99 
100 static char *rna_NlaStrip_path(const PointerRNA *ptr)
101 {
102  NlaStrip *strip = (NlaStrip *)ptr->data;
104 
105  /* if we're attached to AnimData, try to resolve path back to AnimData */
106  if (adt) {
107  NlaTrack *nlt;
108  NlaStrip *nls;
109 
110  for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
111  for (nls = nlt->strips.first; nls; nls = nls->next) {
112  if (nls == strip) {
113  /* XXX but if we animate like this, the control will never work... */
114  char name_esc_nlt[sizeof(nlt->name) * 2];
115  char name_esc_strip[sizeof(strip->name) * 2];
116 
117  BLI_str_escape(name_esc_nlt, nlt->name, sizeof(name_esc_nlt));
118  BLI_str_escape(name_esc_strip, strip->name, sizeof(name_esc_strip));
119  return BLI_sprintfN(
120  "animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", name_esc_nlt, name_esc_strip);
121  }
122  }
123  }
124  }
125 
126  /* no path */
127  return BLI_strdup("");
128 }
129 
130 static void rna_NlaStrip_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_NlaStrip_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
138 {
140 
141  rna_NlaStrip_update(bmain, scene, ptr);
142 }
143 
144 static void rna_NlaStrip_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr)
145 {
146  NlaStrip *strip = (NlaStrip *)ptr->data;
147 
149 
150  /* set the flag */
151  if ((strip->flag & NLASTRIP_FLAG_AUTO_BLENDS) && ptr->owner_id) {
152  /* validate state to ensure that auto-blend gets applied immediately */
154 
155  if (iat->adt) {
157  }
158  }
159 
160  rna_NlaStrip_update(bmain, scene, ptr);
161 }
162 
163 static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
164 {
165  /* Simply set the frame start in a valid range : if there are any NLA strips before/after, clamp
166  * the start value. If the new start value is past-the-end, clamp it. Otherwise, set it.
167  *
168  * NOTE: Unless neighboring strips are transitions, NLASTRIP_MIN_LEN_THRESH is not needed, as
169  * strips can be 'glued' to one another. If they are however, ensure transitions have a bit of
170  * time allotted in order to be performed.
171  */
172  NlaStrip *data = (NlaStrip *)ptr->data;
173 
174  const float limit_prev = BKE_nlastrip_compute_frame_from_previous_strip(data);
175  const float limit_next = BKE_nlastrip_compute_frame_to_next_strip(data);
176  CLAMP(value, limit_prev, limit_next);
177 
178  data->start = value;
179 
180  /* The ONLY case where we actively modify the value set by the user, is in case the start value
181  * value is past the old end frame (here delta = NLASTRIP_MIN_LEN_THRESH) :
182  * - if there's no "room" for the end frame to be placed at (new_start + delta), move old_end to
183  * the limit, and new_start to (limit - delta)
184  * - otherwise, do _not_ change the end frame. This property is not accessible from the UI, and
185  * can only be set via scripts. The script should be responsible of setting the end frame.
186  */
187  if (data->start > (data->end - NLASTRIP_MIN_LEN_THRESH)) {
188  /* If past-the-allowed-end : */
189  if ((data->start + NLASTRIP_MIN_LEN_THRESH) > limit_next) {
190  data->end = limit_next;
191  data->start = data->end - NLASTRIP_MIN_LEN_THRESH;
192  }
193  }
194 
195  /* Ensure transitions are kept 'glued' to the strip : */
196  if (data->prev && data->prev->type == NLASTRIP_TYPE_TRANSITION) {
197  data->prev->end = data->start;
198  }
199 }
200 
201 static void rna_NlaStrip_frame_start_ui_set(PointerRNA *ptr, float value)
202 {
203  NlaStrip *data = (NlaStrip *)ptr->data;
204 
205  /* Changing the NLA strip's start frame is exactly the same as translating it in the NLA editor.
206  * When 'translating' the clip, the length of it should stay identical. Se we also need to set
207  * this strip's end frame after modifying its start (to `start + (old_end - old_start)`).
208  * Of course, we might have a few other strips on this NLA track, so we have to respect the
209  * previous strip's end frame.
210  *
211  * Also, different types of NLA strips (*_CLIP, *_TRANSITION, *_META, *_SOUND) have their own
212  * properties to respect. Needs testing on a real-world use case for the transition, meta, and
213  * sound types.
214  */
215 
216  /* The strip's total length before modifying it & also how long we'd like it to be afterwards. */
217  const float striplen = data->end - data->start;
218 
219  /* We're only modifying one strip at a time. The start and end times of its neighbors should not
220  * change. As such, here are the 'bookends' (frame limits) for the start position to respect :
221  * - if a next strip exists, don't allow the strip to start after (next->end - striplen - delta),
222  * (delta being the min length of a Nla Strip : the NLASTRIP_MIN_THRESH macro)
223  * - if a previous strip exists, don't allow this strip to start before it (data->prev) ends
224  * - otherwise, limit to the program limit macros defined in DNA_scene_types.h : {MINA|MAX}FRAMEF
225  */
226  const float limit_prev = BKE_nlastrip_compute_frame_from_previous_strip(data);
227  const float limit_next = BKE_nlastrip_compute_frame_to_next_strip(data) - striplen;
228  /* For above : we want to be able to fit the entire strip before the next frame limit, so shift
229  * the next limit by 'striplen' no matter the context. */
230 
231  CLAMP(value, limit_prev, limit_next);
232  data->start = value;
233 
234  if (data->type != NLASTRIP_TYPE_TRANSITION) {
235  data->end = data->start + striplen;
236  }
237 
238  /* Update properties of the prev/next strips if they are transitions to ensure consistency : */
239  if (data->prev && data->prev->type == NLASTRIP_TYPE_TRANSITION) {
240  data->prev->end = data->start;
241  }
242  if (data->next && data->next->type == NLASTRIP_TYPE_TRANSITION) {
243  data->next->start = data->end;
244  }
245 }
246 
247 static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value)
248 {
249  NlaStrip *data = (NlaStrip *)ptr->data;
250 
251  const float limit_prev = BKE_nlastrip_compute_frame_from_previous_strip(data);
252  const float limit_next = BKE_nlastrip_compute_frame_to_next_strip(data);
253  CLAMP(value, limit_prev, limit_next);
254 
255  data->end = value;
256 
257  /* The ONLY case where we actively modify the value set by the user, is in case the start value
258  * value is past the old end frame (here delta = NLASTRIP_MIN_LEN_THRESH):
259  * - if there's no "room" for the end frame to be placed at (new_start + delta), move old_end to
260  * the limit, and new_start to (limit - delta)
261  * - otherwise, do _not_ change the end frame. This property is not accessible from the UI, and
262  * can only be set via scripts. The script should be responsible for setting the end frame.
263  */
264  if (data->end < (data->start + NLASTRIP_MIN_LEN_THRESH)) {
265  /* If before-the-allowed-start : */
266  if ((data->end - NLASTRIP_MIN_LEN_THRESH) < limit_prev) {
267  data->start = limit_prev;
268  data->end = data->start + NLASTRIP_MIN_LEN_THRESH;
269  }
270  }
271 
272  /* Ensure transitions are kept "glued" to the strip: */
273  if (data->next && data->next->type == NLASTRIP_TYPE_TRANSITION) {
274  data->next->start = data->end;
275  }
276 }
277 
278 static void rna_NlaStrip_frame_end_ui_set(PointerRNA *ptr, float value)
279 {
280  NlaStrip *data = (NlaStrip *)ptr->data;
281 
282  /* Changing the strip's end frame will update its action 'range' (defined by actstart->actend) to
283  * accommodate the extra length of the strip. No other parameters of the strip will change. But
284  * this means we have to get the current strip's end frame right now :
285  */
286  const float old_strip_end = data->end;
287 
288  /* clamp value to lie within valid limits
289  * - must not have zero or negative length strip, so cannot start before the first frame
290  * + some minimum-strip-length threshold
291  * - cannot end later than the start of the next strip (if present)
292  * -> relies on the BKE_nlastrip_compute_frame_to_next_strip() function
293  */
294  const float limit_prev = data->start + NLASTRIP_MIN_LEN_THRESH;
295  const float limit_next = BKE_nlastrip_compute_frame_to_next_strip(data);
296 
297  CLAMP(value, limit_prev, limit_next);
298  data->end = value;
299 
300  /* Only adjust transitions at this stage : */
301  if (data->next && data->next->type == NLASTRIP_TYPE_TRANSITION) {
302  data->next->start = value;
303  }
304 
305  /* calculate the lengths the strip and its action : *
306  * (Meta and transitions shouldn't be updated, but clip and sound should) */
307  if (data->type == NLASTRIP_TYPE_CLIP || data->type == NLASTRIP_TYPE_SOUND) {
308  float actlen = data->actend - data->actstart;
309  if (IS_EQF(actlen, 0.0f)) {
310  actlen = 1.0f; /* Only sanity check needed : we use this as divisor later on. */
311  }
312 
313  /* Modify the strip's action end frame, or repeat based on :
314  * - if data->repeat == 1.0f, modify the action end frame :
315  * - if the number of frames to subtract is the number of frames, set the action end frame
316  * to the action start + 1 and modify the end of the strip to add that frame
317  * - if the number of frames
318  * - otherwise, modify the repeat property to accommodate for the new length
319  */
320  float action_length_delta = (old_strip_end - data->end) / data->scale;
321  /* If no repeats are used, then modify the action end frame : */
322  if (IS_EQF(data->repeat, 1.0f)) {
323  /* If they're equal, strip has been reduced by the same amount as the whole strip length, so
324  * clamp the action clip length to 1 frame, and add a frame to end so that len(strip)!=0 :*/
325  if (IS_EQF(action_length_delta, actlen)) {
326  data->actend = data->actstart + 1.0f;
327  data->end += 1.0f;
328  }
329  else if (action_length_delta < actlen) {
330  /* Now, adjust the new strip's actend to the value it's supposed to have : */
331  data->actend = data->actend - action_length_delta;
332  }
333  /* The case where the delta is bigger than the action length should not be possible, since
334  * data->end is guaranteed to be clamped to data->start + threshold above.
335  */
336  }
337  else {
338  data->repeat -= (action_length_delta / actlen);
339  }
340  }
341 }
342 
343 static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value)
344 {
345  NlaStrip *data = (NlaStrip *)ptr->data;
346 
347  /* set scale value */
348  /* NOTE: these need to be synced with the values in the
349  * property definition in rna_def_nlastrip() */
350  CLAMP(value, 0.0001f, 1000.0f);
351  data->scale = value;
352 
353  /* adjust the strip extents in response to this */
355 }
356 
357 static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value)
358 {
359  NlaStrip *data = (NlaStrip *)ptr->data;
360 
361  /* set repeat value */
362  /* NOTE: these need to be synced with the values in the
363  * property definition in rna_def_nlastrip() */
364  CLAMP(value, 0.01f, 1000.0f);
365  data->repeat = value;
366 
367  /* adjust the strip extents in response to this */
369 }
370 
371 static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value)
372 {
373  NlaStrip *data = (NlaStrip *)ptr->data;
374  float len;
375 
376  /* blend-in is limited to the length of the strip, and also cannot overlap with blendout */
377  len = (data->end - data->start) - data->blendout;
378  CLAMP(value, 0, len);
379 
380  data->blendin = value;
381 }
382 
383 static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value)
384 {
385  NlaStrip *data = (NlaStrip *)ptr->data;
386  float len;
387 
388  /* blend-out is limited to the length of the strip */
389  len = (data->end - data->start);
390  CLAMP(value, 0, len);
391 
392  /* it also cannot overlap with blendin */
393  if ((len - value) < data->blendin) {
394  value = len - data->blendin;
395  }
396 
397  data->blendout = value;
398 }
399 
400 static void rna_NlaStrip_use_auto_blend_set(PointerRNA *ptr, bool value)
401 {
402  NlaStrip *data = (NlaStrip *)ptr->data;
403 
404  if (value) {
405  /* set the flag */
407 
408  /* validate state to ensure that auto-blend gets applied immediately */
409  if (ptr->owner_id) {
411 
412  if (iat->adt) {
414  }
415  }
416  }
417  else {
418  /* clear the flag */
420 
421  /* clear the values too, so that it's clear that there has been an effect */
422  /* TODO: it's somewhat debatable whether it's better to leave these in instead... */
423  data->blendin = 0.0f;
424  data->blendout = 0.0f;
425  }
426 }
427 
428 static int rna_NlaStrip_action_editable(PointerRNA *ptr, const char **UNUSED(r_info))
429 {
430  NlaStrip *strip = (NlaStrip *)ptr->data;
431 
432  /* Strip actions shouldn't be editable if NLA tweak-mode is on. */
433  if (ptr->owner_id) {
435 
436  if (adt) {
437  /* active action is only editable when it is not a tweaking strip */
438  if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact)) {
439  return 0;
440  }
441  }
442  }
443 
444  /* check for clues that strip probably shouldn't be used... */
445  if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) {
446  return 0;
447  }
448 
449  /* should be ok, though we may still miss some cases */
450  return PROP_EDITABLE;
451 }
452 
453 static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value)
454 {
455  NlaStrip *data = (NlaStrip *)ptr->data;
456 
457  /* prevent start frame from occurring after end of action */
458  CLAMP(value, MINAFRAME, data->actend);
459  data->actstart = value;
460 
461  /* adjust the strip extents in response to this */
462  /* TODO: should the strip be moved backwards instead as a special case? */
464 }
465 
466 static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value)
467 {
468  NlaStrip *data = (NlaStrip *)ptr->data;
469 
470  /* prevent end frame from starting before start of action */
471  CLAMP(value, data->actstart, MAXFRAME);
472  data->actend = value;
473 
474  /* adjust the strip extents in response to this */
476 }
477 
478 static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, bool value)
479 {
480  NlaStrip *data = (NlaStrip *)ptr->data;
481 
482  if (value) {
483  /* set the flag, then make sure a curve for this exists */
486  }
487  else {
489  }
490 }
491 
492 static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, bool value)
493 {
494  NlaStrip *data = (NlaStrip *)ptr->data;
495 
496  if (value) {
497  /* set the flag, then make sure a curve for this exists */
498  data->flag |= NLASTRIP_FLAG_USR_TIME;
500  }
501  else {
502  data->flag &= ~NLASTRIP_FLAG_USR_TIME;
503  }
504 }
505 
506 static FCurve *rna_NlaStrip_fcurve_find(NlaStrip *strip,
507  ReportList *reports,
508  const char *data_path,
509  int index)
510 {
511  if (data_path[0] == '\0') {
512  BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
513  return NULL;
514  }
515 
516  /* Returns NULL if not found. */
517  return BKE_fcurve_find(&strip->fcurves, data_path, index);
518 }
519 
520 static NlaStrip *rna_NlaStrip_new(ID *id,
521  NlaTrack *track,
522  Main *bmain,
523  bContext *C,
524  ReportList *reports,
525  const char *UNUSED(name),
526  int start,
527  bAction *action)
528 {
529  NlaStrip *strip = BKE_nlastrip_new(action);
530 
531  if (strip == NULL) {
532  BKE_report(reports, RPT_ERROR, "Unable to create new strip");
533  return NULL;
534  }
535 
536  strip->end += (start - strip->start);
537  strip->start = start;
538 
539  if (BKE_nlastrips_add_strip(&track->strips, strip) == 0) {
540  BKE_report(
541  reports,
542  RPT_ERROR,
543  "Unable to add strip (the track does not have any space to accommodate this new strip)");
544  BKE_nlastrip_free(NULL, strip, true);
545  return NULL;
546  }
547 
548  /* create dummy AnimData block so that BKE_nlastrip_validate_name()
549  * can be used to ensure a valid name, as we don't have one here...
550  * - only the nla_tracks list is needed there, which we aim to reverse engineer here...
551  */
552  {
553  AnimData adt = {NULL};
554  NlaTrack *nlt, *nlt_p;
555 
556  /* 'first' NLA track is found by going back up chain of given
557  * track's parents until we fall off. */
558  nlt_p = track;
559  nlt = track;
560  while ((nlt = nlt->prev) != NULL) {
561  nlt_p = nlt;
562  }
563  adt.nla_tracks.first = nlt_p;
564 
565  /* do the same thing to find the last track */
566  nlt_p = track;
567  nlt = track;
568  while ((nlt = nlt->next) != NULL) {
569  nlt_p = nlt;
570  }
571  adt.nla_tracks.last = nlt_p;
572 
573  /* now we can just auto-name as usual */
574  BKE_nlastrip_validate_name(&adt, strip);
575  }
576 
578 
581 
582  return strip;
583 }
584 
585 static void rna_NlaStrip_remove(
586  ID *id, NlaTrack *track, Main *bmain, bContext *C, ReportList *reports, PointerRNA *strip_ptr)
587 {
588  NlaStrip *strip = strip_ptr->data;
589  if (BLI_findindex(&track->strips, strip) == -1) {
590  BKE_reportf(
591  reports, RPT_ERROR, "NLA strip '%s' not found in track '%s'", strip->name, track->name);
592  return;
593  }
594 
595  BKE_nlastrip_free(&track->strips, strip, true);
596  RNA_POINTER_INVALIDATE(strip_ptr);
597 
599 
602 }
603 
604 /* Set the 'solo' setting for the given NLA-track, making sure that it is the only one
605  * that has this status in its AnimData block.
606  */
607 static void rna_NlaTrack_solo_set(PointerRNA *ptr, bool value)
608 {
609  NlaTrack *data = (NlaTrack *)ptr->data;
611  NlaTrack *nt;
612 
613  if (data == NULL) {
614  return;
615  }
616 
617  /* firstly, make sure 'solo' flag for all tracks is disabled */
618  for (nt = data; nt; nt = nt->next) {
619  nt->flag &= ~NLATRACK_SOLO;
620  }
621  for (nt = data; nt; nt = nt->prev) {
622  nt->flag &= ~NLATRACK_SOLO;
623  }
624 
625  /* now, enable 'solo' for the given track if appropriate */
626  if (value) {
627  /* set solo status */
628  data->flag |= NLATRACK_SOLO;
629 
630  /* set solo-status on AnimData */
631  adt->flag |= ADT_NLA_SOLO_TRACK;
632  }
633  else {
634  /* solo status was already cleared on track */
635 
636  /* clear solo-status on AnimData */
637  adt->flag &= ~ADT_NLA_SOLO_TRACK;
638  }
639 }
640 
641 #else
642 
643 static void rna_def_strip_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
644 {
645  StructRNA *srna;
646 
647  FunctionRNA *func;
648  PropertyRNA *parm;
649 
650  RNA_def_property_srna(cprop, "NlaStripFCurves");
651  srna = RNA_def_struct(brna, "NlaStripFCurves", NULL);
652  RNA_def_struct_sdna(srna, "NlaStrip");
653  RNA_def_struct_ui_text(srna, "NLA-Strip F-Curves", "Collection of NLA strip F-Curves");
654 
655  /* Strip.fcurves.find(...) */
656  func = RNA_def_function(srna, "find", "rna_NlaStrip_fcurve_find");
658  func,
659  "Find an F-Curve. Note that this function performs a linear scan "
660  "of all F-Curves in the NLA strip.");
662  parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path");
664  RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
665 
666  parm = RNA_def_pointer(
667  func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist");
668  RNA_def_function_return(func, parm);
669 }
670 
671 static void rna_def_nlastrip(BlenderRNA *brna)
672 {
673  StructRNA *srna;
674  PropertyRNA *prop;
675 
676  /* enum defs */
677  static const EnumPropertyItem prop_type_items[] = {
678  {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action"},
680  "TRANSITION",
681  0,
682  "Transition",
683  "NLA Strip 'transitions' between adjacent strips"},
684  {NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips"},
686  "SOUND",
687  0,
688  "Sound Clip",
689  "NLA Strip representing a sound event for speakers"},
690  {0, NULL, 0, NULL, NULL},
691  };
692 
693  /* struct definition */
694  srna = RNA_def_struct(brna, "NlaStrip", NULL);
695  RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action");
696  RNA_def_struct_path_func(srna, "rna_NlaStrip_path");
697  RNA_def_struct_ui_icon(srna, ICON_NLA); /* XXX */
698 
700 
701  /* name property */
702  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
703  RNA_def_property_ui_text(prop, "Name", "");
704  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set");
705  RNA_def_struct_name_property(srna, prop);
706  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
707 
708  /* Enums */
709  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
710  RNA_def_property_enum_sdna(prop, NULL, "type");
712  prop, PROP_EDITABLE); /* XXX for now, not editable, since this is dangerous */
713  RNA_def_property_enum_items(prop, prop_type_items);
714  RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip");
715  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
716 
717  prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE);
718  RNA_def_property_enum_sdna(prop, NULL, "extendmode");
721  prop, "Extrapolation", "Action to take for gaps past the strip extents");
722  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
723 
724  prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
725  RNA_def_property_enum_sdna(prop, NULL, "blendmode");
728  prop, "Blending", "Method used for combining strip's result with accumulated result");
729  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
730 
731  /* Strip extents */
732  prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
733  RNA_def_property_float_sdna(prop, NULL, "start");
734  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_start_frame_set", NULL);
735  RNA_def_property_ui_text(prop, "Start Frame", "");
737  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
738 
739  prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_TIME);
740  RNA_def_property_float_sdna(prop, NULL, "end");
741  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL);
742  RNA_def_property_ui_text(prop, "End Frame", "");
744  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
745 
746  /* Strip extents, when called from UI elements : */
747  prop = RNA_def_property(srna, "frame_start_ui", PROP_FLOAT, PROP_TIME);
748  RNA_def_property_float_sdna(prop, NULL, "start");
749  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_frame_start_ui_set", NULL);
751  prop,
752  "Start Frame (manipulated from UI)",
753  "Start frame of the NLA strip. Note: changing this value also updates the value of "
754  "the strip's end frame. If only the start frame should be changed, see the \"frame_start\" "
755  "property instead");
757  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
758 
759  prop = RNA_def_property(srna, "frame_end_ui", PROP_FLOAT, PROP_TIME);
760  RNA_def_property_float_sdna(prop, NULL, "end");
761  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_frame_end_ui_set", NULL);
763  prop,
764  "End Frame (manipulated from UI)",
765  "End frame of the NLA strip. Note: changing this value also updates the value of "
766  "the strip's repeats or its action's end frame. If only the end frame should be "
767  "changed, see the \"frame_end\" property instead");
769  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
770 
771  /* Blending */
772  prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE);
773  RNA_def_property_float_sdna(prop, NULL, "blendin");
774  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL);
776  prop, "Blend In", "Number of frames at start of strip to fade in influence");
777  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
778 
779  prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE);
780  RNA_def_property_float_sdna(prop, NULL, "blendout");
781  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL);
782  RNA_def_property_ui_text(prop, "Blend Out", "");
783  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
784 
785  prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE);
787  RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_use_auto_blend_set");
789  "Auto Blend In/Out",
790  "Number of frames for Blending In/Out is automatically determined from "
791  "overlapping strips");
792  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
793 
794  /* Action */
795  prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
796  RNA_def_property_pointer_sdna(prop, NULL, "act");
797  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll");
799  RNA_def_property_editable_func(prop, "rna_NlaStrip_action_editable");
800  RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip");
802  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_dependency_update");
803 
804  /* Action extents */
805  prop = RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME);
806  RNA_def_property_float_sdna(prop, NULL, "actstart");
807  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL);
808  RNA_def_property_ui_text(prop, "Action Start Frame", "First frame from action to use");
810  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
811 
812  prop = RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME);
813  RNA_def_property_float_sdna(prop, NULL, "actend");
814  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL);
815  RNA_def_property_ui_text(prop, "Action End Frame", "Last frame from action to use");
817  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
818 
819  /* Action Reuse */
820  prop = RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE);
821  RNA_def_property_float_sdna(prop, NULL, "repeat");
822  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL);
823  /* these limits have currently be chosen arbitrarily, but could be extended
824  * (minimum should still be > 0 though) if needed... */
825  RNA_def_property_range(prop, 0.1f, 1000.0f);
826  RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range");
828  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
829 
830  prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
831  RNA_def_property_float_sdna(prop, NULL, "scale");
832  RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL);
833  /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs
834  * due to numeric errors */
835  RNA_def_property_range(prop, 0.0001f, 1000.0f);
836  RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action");
838  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
839 
840  /* Strip's F-Curves */
841  prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE);
842  RNA_def_property_collection_sdna(prop, NULL, "fcurves", NULL);
843  RNA_def_property_struct_type(prop, "FCurve");
845  prop, "F-Curves", "F-Curves for controlling the strip's influence and timing");
846  rna_def_strip_fcurves(brna, prop);
847 
848  /* Strip's F-Modifiers */
849  prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
850  RNA_def_property_struct_type(prop, "FModifier");
852  prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action");
853 
854  /* Strip's Sub-Strips (for Meta-Strips) */
855  prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
856  RNA_def_property_struct_type(prop, "NlaStrip");
858  prop,
859  "NLA Strips",
860  "NLA Strips that this strip acts as a container for (if it is of type Meta)");
861 
862  /* Settings - Values necessary for evaluation */
863  prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
864  RNA_def_property_range(prop, 0.0f, 1.0f);
866  prop, "Influence", "Amount the strip contributes to the current result");
867  /* XXX: Update temporarily disabled so that the property can be edited at all!
868  * Even auto-key only applies after the curves have been re-evaluated,
869  * causing the unkeyed values to be lost. */
870  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, /*"rna_NlaStrip_update"*/ NULL);
871 
872  prop = RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME);
873  RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate");
874  /* XXX: Update temporarily disabled so that the property can be edited at all!
875  * Even auto-key only applies after the curves have been re-evaluated,
876  * causing the unkeyed values to be lost. */
877  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, /*"rna_NlaStrip_update"*/ NULL);
878 
879  /* TODO: should the animated_influence/time settings be animatable themselves? */
880  prop = RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE);
882  RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set");
884  prop,
885  "Animated Influence",
886  "Influence setting is controlled by an F-Curve rather than automatically determined");
887  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
888 
889  prop = RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE);
891  RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
893  prop,
894  "Animated Strip Time",
895  "Strip time is controlled by an F-Curve rather than automatically determined");
896  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
897 
898  prop = RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
901  prop, "Cyclic Strip Time", "Cycle the animated time within the action start and end");
903  prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update");
904 
905  /* settings */
906  prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
907  /* can be made editable by hooking it up to the necessary NLA API methods */
910  RNA_def_property_ui_text(prop, "Active", "NLA Strip is active");
911  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
912 
913  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
915  RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected");
916  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
917 
918  prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
920  RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1);
921  RNA_def_property_ui_text(prop, "Mute", "Disable NLA Strip evaluation");
922  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
923 
924  prop = RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE);
927  "Reversed",
928  "NLA Strip is played back in reverse order (only when timing is "
929  "automatically determined)");
930  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
931 
932  prop = RNA_def_property(srna, "use_sync_length", PROP_BOOLEAN, PROP_NONE);
935  "Sync Action Length",
936  "Update range of frames referenced from action "
937  "after tweaking strip and its keyframes");
938  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
939 
941 }
942 
944 {
945  StructRNA *srna;
946  PropertyRNA *parm;
947  FunctionRNA *func;
948 
949  RNA_def_property_srna(cprop, "NlaStrips");
950  srna = RNA_def_struct(brna, "NlaStrips", NULL);
951  RNA_def_struct_sdna(srna, "NlaTrack");
952  RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips");
953 
954  func = RNA_def_function(srna, "new", "rna_NlaStrip_new");
957  RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track");
958  parm = RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips");
960  parm = RNA_def_int(func,
961  "start",
962  0,
963  INT_MIN,
964  INT_MAX,
965  "Start Frame",
966  "Start frame for this strip",
967  INT_MIN,
968  INT_MAX);
970  parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip");
972  /* return type */
973  parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip");
974  RNA_def_function_return(func, parm);
975 
976  func = RNA_def_function(srna, "remove", "rna_NlaStrip_remove");
979  RNA_def_function_ui_description(func, "Remove a NLA Strip");
980  parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove");
983 }
984 
985 static void rna_def_nlatrack(BlenderRNA *brna)
986 {
987  StructRNA *srna;
988  PropertyRNA *prop;
989 
990  srna = RNA_def_struct(brna, "NlaTrack", NULL);
992  srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips");
993  RNA_def_struct_ui_icon(srna, ICON_NLA);
994 
995  /* strips collection */
996  prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE);
997  RNA_def_property_struct_type(prop, "NlaStrip");
998  /* We do not support inserting or removing strips in overrides of tracks for now. */
1000  RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");
1001 
1002  rna_api_nlatrack_strips(brna, prop);
1003 
1004  prop = RNA_def_boolean(srna,
1005  "is_override_data",
1006  false,
1007  "Override Track",
1008  "In a local override data, whether this NLA track comes from the linked "
1009  "reference data, or is local to the override");
1012 
1014 
1015  /* name property */
1016  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1017  RNA_def_property_ui_text(prop, "Name", "");
1018  RNA_def_struct_name_property(srna, prop);
1019  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
1020 
1021  /* settings */
1022  prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
1023  /* can be made editable by hooking it up to the necessary NLA API methods */
1026  RNA_def_property_ui_text(prop, "Active", "NLA Track is active");
1027  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
1028 
1029  prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE);
1030  /* can be made editable by hooking it up to the necessary NLA API methods */
1033  prop,
1034  "Solo",
1035  "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the "
1036  "same AnimData block are disabled)");
1037  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
1038  RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaTrack_solo_set");
1039 
1040  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1042  RNA_def_property_ui_text(prop, "Select", "NLA Track is selected");
1043  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
1044 
1045  prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
1047  RNA_def_property_ui_text(prop, "Muted", "Disable NLA Track evaluation");
1048  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update");
1049 
1050  prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
1052  RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked");
1053  RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */
1054 
1056 }
1057 
1058 /* --------- */
1059 
1061 {
1062  rna_def_nlatrack(brna);
1063  rna_def_nlastrip(brna);
1064 }
1065 
1066 #endif
struct AnimData * BKE_animdata_from_id(const struct ID *id)
struct FCurve * BKE_fcurve_find(ListBase *list, const char rna_path[], int array_index)
Definition: fcurve.c:249
float BKE_nlastrip_compute_frame_to_next_strip(struct NlaStrip *strip)
Definition: nla.c:1259
float BKE_nlastrip_compute_frame_from_previous_strip(struct NlaStrip *strip)
Definition: nla.c:1242
void BKE_nlastrip_validate_name(struct AnimData *adt, struct NlaStrip *strip)
Definition: nla.c:1625
void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip)
Definition: nla.c:950
void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip)
Definition: nla.c:1452
bool BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip)
Definition: nla.c:767
void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip)
Definition: nla.c:1523
void BKE_nla_validate_state(struct AnimData *adt)
Definition: nla.c:1798
struct NlaStrip * BKE_nlastrip_new(struct bAction *act)
Definition: nla.c:396
#define NLASTRIP_MIN_LEN_THRESH
Definition: BKE_nla.h:11
void BKE_nlastrip_free(ListBase *strips, struct NlaStrip *strip, bool do_id_user)
Definition: nla.c:64
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
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
#define UNUSED(x)
#define IS_EQF(a, b)
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
@ NLASTRIP_FLAG_ACTIVE
@ NLASTRIP_FLAG_USR_INFLUENCE
@ NLASTRIP_FLAG_USR_TIME
@ NLASTRIP_FLAG_AUTO_BLENDS
@ NLASTRIP_FLAG_REVERSE
@ NLASTRIP_FLAG_MUTED
@ NLASTRIP_FLAG_USR_TIME_CYCLIC
@ NLASTRIP_FLAG_SELECT
@ NLASTRIP_FLAG_TWEAKUSER
@ NLASTRIP_FLAG_SYNC_LENGTH
@ ADT_NLA_SOLO_TRACK
@ ADT_NLA_EDIT_ON
@ NLASTRIP_EXTEND_HOLD_FORWARD
@ NLASTRIP_EXTEND_NOTHING
@ NLASTRIP_EXTEND_HOLD
@ NLASTRIP_MODE_REPLACE
@ NLASTRIP_MODE_ADD
@ NLASTRIP_MODE_SUBTRACT
@ NLASTRIP_MODE_COMBINE
@ NLASTRIP_MODE_MULTIPLY
@ NLASTRIP_TYPE_SOUND
@ NLASTRIP_TYPE_META
@ NLASTRIP_TYPE_TRANSITION
@ NLASTRIP_TYPE_CLIP
@ NLATRACK_SOLO
@ NLATRACK_ACTIVE
@ NLATRACK_MUTED
@ NLATRACK_SELECTED
@ NLATRACK_PROTECTED
@ NLATRACK_OVERRIDELIBRARY_LOCAL
Object is a sort of wrapper for general info.
#define MINAFRAME
#define MAXFRAME
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ 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
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
#define RNA_ENUM_ITEM_SEPR
Definition: RNA_types.h:483
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_ID_REFCOUNT
Definition: RNA_types.h:226
@ PROP_TIME
Definition: RNA_types.h:146
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_FACTOR
Definition: RNA_types.h:144
#define C
Definition: RandGen.cpp:25
#define NC_ANIMATION
Definition: WM_types.h:338
#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
void ANIM_id_update(Main *bmain, ID *id)
Definition: anim_deps.c:99
Scene scene
int len
Definition: draw_manager.c:108
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
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
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_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
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_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_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_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_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_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
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_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
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
void RNA_def_nla(BlenderRNA *brna)
Definition: rna_nla.c:1060
static void rna_def_nlastrip(BlenderRNA *brna)
Definition: rna_nla.c:671
static void rna_def_nlatrack(BlenderRNA *brna)
Definition: rna_nla.c:985
const EnumPropertyItem rna_enum_nla_mode_blend_items[]
Definition: rna_nla.c:27
static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_nla.c:943
static void rna_def_strip_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_nla.c:643
const EnumPropertyItem rna_enum_nla_mode_extend_items[]
Definition: rna_nla.c:58
NlaStrip * actstrip
bAction * tmpact
ListBase nla_tracks
Definition: DNA_ID.h:368
AnimData * adt
void * last
Definition: DNA_listBase.h:31
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
struct NlaStrip * next
ListBase fcurves
char name[64]
ListBase strips
struct NlaTrack * next
char name[64]
struct NlaTrack * prev
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480