diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2009-09-15 22:01:18 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2009-09-15 22:01:18 +0400 |
commit | 816377cc02fe5dd4be945c0f3d415861114b4980 (patch) | |
tree | 306e9d1363aa66bc919e43b80b3380fab9f60ea9 /source/blender/blenkernel/intern/anim_sys.c | |
parent | c8af263e5d8d9d41a757e8438cdcf3b64d57e0c0 (diff) | |
parent | ee768ada680ce0a8aa184c882005c0ef1c0140fb (diff) |
Undo revision 23130 which was a merge with 2.5, a messy one because I did something wrong (`svn status` output: http://www.pasteall.org/7887).soc-2009-kazanbas
The command: svn merge -r 23130:23129 https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-kazanbas
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 61 |
1 files changed, 17 insertions, 44 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 0e8450025da..5eaf2133515 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -204,35 +204,15 @@ AnimData *BKE_copy_animdata (AnimData *adt) return dadt; } -/* Make Local -------------------------------------------- */ - -static void make_local_strips(ListBase *strips) -{ - NlaStrip *strip; - - for(strip=strips->first; strip; strip=strip->next) { - if(strip->act) make_local_action(strip->act); - if(strip->remap && strip->remap->target) make_local_action(strip->remap->target); - - make_local_strips(&strip->strips); - } -} - -void BKE_animdata_make_local(AnimData *adt) -{ - NlaTrack *nlt; - - if(adt->action) make_local_action(adt->action); - if(adt->tmpact) make_local_action(adt->tmpact); - if(adt->remap && adt->remap->target) make_local_action(adt->remap->target); - - for(nlt=adt->nla_tracks.first; nlt; nlt=nlt->next) - make_local_strips(&nlt->strips); -} - /* *********************************** */ /* KeyingSet API */ +/* NOTES: + * It is very likely that there will be two copies of the api - one for internal use, + * and one 'operator' based wrapper of the internal API, which should allow for access + * from Python/scripts so that riggers can automate the creation of KeyingSets for their rigs. + */ + /* Finding Tools --------------------------- */ /* Find the first path that matches the given criteria */ @@ -265,7 +245,7 @@ KS_Path *BKE_keyingset_find_destination (KeyingSet *ks, ID *id, const char group if ((ksp->rna_path==0) || strcmp(rna_path, ksp->rna_path)) eq_path= 0; - /* index - need to compare whole-array setting too... */ + /* index */ if (ksp->array_index != array_index) eq_index= 0; @@ -319,25 +299,18 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name KS_Path *ksp; /* sanity checks */ - if ELEM(NULL, ks, rna_path) { - printf("ERROR: no Keying Set and/or RNA Path to add destination with \n"); + if ELEM(NULL, ks, rna_path) return; - } /* ID is optional for relative KeyingSets, but is necessary for absolute KeyingSets */ if (id == NULL) { - if (ks->flag & KEYINGSET_ABSOLUTE) { - printf("ERROR: No ID provided for absolute destination. \n"); + if (ks->flag & KEYINGSET_ABSOLUTE) return; - } } /* don't add if there is already a matching KS_Path in the KeyingSet */ - if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) { - if (G.f & G_DEBUG) - printf("ERROR: destination already exists in Keying Set \n"); + if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) return; - } /* allocate a new KeyingSet Path */ ksp= MEM_callocN(sizeof(KS_Path), "KeyingSet Path"); @@ -467,19 +440,19 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(&new_ptr, prop)) + if (RNA_property_array_length(prop)) RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_boolean_set(&new_ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(&new_ptr, prop)) + if (RNA_property_array_length(prop)) RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_int_set(&new_ptr, prop, (int)value); break; case PROP_FLOAT: - if (RNA_property_array_length(&new_ptr, prop)) + if (RNA_property_array_length(prop)) RNA_property_float_set_index(&new_ptr, prop, array_index, value); else RNA_property_float_set(&new_ptr, prop, value); @@ -1204,19 +1177,19 @@ void nladata_flush_channels (ListBase *channels) switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(ptr, prop)) + if (RNA_property_array_length(prop)) RNA_property_boolean_set_index(ptr, prop, array_index, (int)value); else RNA_property_boolean_set(ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(ptr, prop)) + if (RNA_property_array_length(prop)) RNA_property_int_set_index(ptr, prop, array_index, (int)value); else RNA_property_int_set(ptr, prop, (int)value); break; case PROP_FLOAT: - if (RNA_property_array_length(ptr, prop)) + if (RNA_property_array_length(prop)) RNA_property_float_set_index(ptr, prop, array_index, value); else RNA_property_float_set(ptr, prop, value); @@ -1290,7 +1263,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) dummy_strip.act= adt->action; dummy_strip.remap= adt->remap; - /* action range is calculated taking F-Modifiers into account (which making new strips doesn't do due to the troublesome nature of that) */ + // FIXME: what happens when we want to included F-Modifier access? calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1); dummy_strip.start = dummy_strip.actstart; dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend); |