Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/nla.c
| Show All 31 Lines | |||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include <math.h> | #include <math.h> | ||||
| #include <float.h> | #include <float.h> | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| Show All 13 Lines | |||||
| #ifdef WITH_AUDASPACE | #ifdef WITH_AUDASPACE | ||||
| # include <AUD_Special.h> | # include <AUD_Special.h> | ||||
| #endif | #endif | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "nla_private.h" | #include "nla_private.h" | ||||
| static CLG_LogRef LOG = {"bke.nla"}; | |||||
| /* *************************************************** */ | /* *************************************************** */ | ||||
| /* Data Management */ | /* Data Management */ | ||||
| /* Freeing ------------------------------------------- */ | /* Freeing ------------------------------------------- */ | ||||
| /* Remove the given NLA strip from the NLA track it occupies, free the strip's data, | /* Remove the given NLA strip from the NLA track it occupies, free the strip's data, | ||||
| * and the strip itself. | * and the strip itself. | ||||
| ▲ Show 20 Lines • Show All 1,629 Lines • ▼ Show 20 Lines | |||||
| bool BKE_nla_action_stash(AnimData *adt) | bool BKE_nla_action_stash(AnimData *adt) | ||||
| { | { | ||||
| NlaTrack *prev_track = NULL; | NlaTrack *prev_track = NULL; | ||||
| NlaTrack *nlt; | NlaTrack *nlt; | ||||
| NlaStrip *strip; | NlaStrip *strip; | ||||
| /* sanity check */ | /* sanity check */ | ||||
| if (ELEM(NULL, adt, adt->action)) { | if (ELEM(NULL, adt, adt->action)) { | ||||
| printf("%s: Invalid argument - %p %p\n", __func__, adt, adt->action); | CLOG_ERROR(&LOG, "Invalid argument - %p %p", adt, adt->action); | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* do not add if it is already stashed */ | /* do not add if it is already stashed */ | ||||
| if (BKE_nla_action_is_stashed(adt, adt->action)) | if (BKE_nla_action_is_stashed(adt, adt->action)) | ||||
| return false; | return false; | ||||
| /* create a new track, and add this immediately above the previous stashing track */ | /* create a new track, and add this immediately above the previous stashing track */ | ||||
| ▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | void BKE_nla_action_pushdown(AnimData *adt) | ||||
| if (ELEM(NULL, adt, adt->action)) | if (ELEM(NULL, adt, adt->action)) | ||||
| return; | return; | ||||
| /* if the action is empty, we also shouldn't try to add to stack, | /* if the action is empty, we also shouldn't try to add to stack, | ||||
| * as that will cause us grief down the track | * as that will cause us grief down the track | ||||
| */ | */ | ||||
| /* TODO: what about modifiers? */ | /* TODO: what about modifiers? */ | ||||
| if (action_has_motion(adt->action) == 0) { | if (action_has_motion(adt->action) == 0) { | ||||
| printf("BKE_nla_action_pushdown(): action has no data\n"); | CLOG_ERROR(&LOG, "action has no data"); | ||||
| return; | return; | ||||
| } | } | ||||
| /* add a new NLA strip to the track, which references the active action */ | /* add a new NLA strip to the track, which references the active action */ | ||||
| strip = BKE_nlastack_add_strip(adt, adt->action); | strip = BKE_nlastack_add_strip(adt, adt->action); | ||||
| /* do other necessary work on strip */ | /* do other necessary work on strip */ | ||||
| if (strip) { | if (strip) { | ||||
| ▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines | |||||