diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 09:12:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 09:21:34 +0300 |
commit | 55e719ec35a10c3f9e7231dee13d4b05aad7d965 (patch) | |
tree | 563ed5b1b27e9613de8384da90197ce2c3e1924b /source/blender/blenkernel/intern/anim_sys.c | |
parent | c279f879ab86e03dff0dbfd3a36b14bebb4956f9 (diff) | |
parent | d7f55c4ff58f87b80f0ce2fa43ce2f7cd2b72675 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index d4355546c19..351e765a8ea 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -438,8 +438,8 @@ static bool animpath_matches_basepath(const char path[], const char basepath[]) /* Move F-Curves in src action to dst action, setting up all the necessary groups * for this to happen, but only if the F-Curves being moved have the appropriate * "base path". - * - This is used when data moves from one datablock to another, causing the - * F-Curves to need to be moved over too + * - This is used when data moves from one datablock to another, causing the + * F-Curves to need to be moved over too */ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const char basepath[]) { @@ -465,7 +465,7 @@ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const cha fcn = fcu->next; /* should F-Curve be moved over? - * - we only need the start of the path to match basepath + * - we only need the start of the path to match basepath */ if (animpath_matches_basepath(fcu->rna_path, basepath)) { bActionGroup *agrp = NULL; @@ -1179,8 +1179,8 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha ID *id; /* macro for less typing - * - whether animdata exists is checked for by the main renaming callback, though taking - * this outside of the function may make things slightly faster? + * - whether animdata exists is checked for by the main renaming callback, though taking + * this outside of the function may make things slightly faster? */ #define RENAMEFIX_ANIM_IDS(first) \ for (id = first; id; id = id->next) { \ @@ -1456,7 +1456,7 @@ void BKE_keyingsets_free(ListBase *list) return; /* loop over KeyingSets freeing them - * - BKE_keyingset_free() doesn't free the set itself, but it frees its sub-data + * - BKE_keyingset_free() doesn't free the set itself, but it frees its sub-data */ for (ks = list->first; ks; ks = ksn) { ksn = ks->next; @@ -1779,8 +1779,8 @@ static void action_idcode_patch_check(ID *id, bAction *act) /* the actual checks... hopefully not too much of a performance hit in the long run... */ if (act->idroot == 0) { /* use the current root if not set already (i.e. newly created actions and actions from 2.50-2.57 builds) - * - this has problems if there are 2 users, and the first one encountered is the invalid one - * in which case, the user will need to manually fix this (?) + * - this has problems if there are 2 users, and the first one encountered is the invalid one + * in which case, the user will need to manually fix this (?) */ act->idroot = idcode; } @@ -1880,8 +1880,8 @@ static void nlastrip_evaluate_controls(Depsgraph *depsgraph, NlaStrip *strip, fl } /* analytically generate values for influence and time (if applicable) - * - we do this after the F-Curves have been evaluated to override the effects of those - * in case the override has been turned off. + * - we do this after the F-Curves have been evaluated to override the effects of those + * in case the override has been turned off. */ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0) strip->strip_time = nlastrip_get_frame(strip, ctime, NLATIME_CONVERT_EVAL); @@ -1927,8 +1927,8 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li else { /* before next strip - previous strip has ended, but next hasn't begun, * so blending mode depends on whether strip is being held or not... - * - only occurs when no transition strip added, otherwise the transition would have - * been picked up above... + * - only occurs when no transition strip added, otherwise the transition would have + * been picked up above... */ strip = strip->prev; @@ -1955,7 +1955,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li } /* check if a valid strip was found - * - must not be muted (i.e. will have contribution + * - must not be muted (i.e. will have contribution */ if ((estrip == NULL) || (estrip->flag & NLASTRIP_FLAG_MUTED)) return NULL; @@ -1971,8 +1971,8 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li } /* evaluate strip's evaluation controls - * - skip if no influence (i.e. same effect as muting the strip) - * - negative influence is not supported yet... how would that be defined? + * - skip if no influence (i.e. same effect as muting the strip) + * - negative influence is not supported yet... how would that be defined? */ /* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */ nlastrip_evaluate_controls(depsgraph, estrip, ctime); @@ -2016,7 +2016,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, Li /* ---------------------- */ /* find an NlaEvalChannel that matches the given criteria - * - ptr and prop are the RNA data to find a match for + * - ptr and prop are the RNA data to find a match for */ static NlaEvalChannel *nlaevalchan_find_match(ListBase *channels, const PathResolvedRNA *prna) { @@ -2031,7 +2031,7 @@ static NlaEvalChannel *nlaevalchan_find_match(ListBase *channels, const PathReso /* - comparing the PointerRNA's is done by comparing the pointers * to the actual struct the property resides in, since that all the * other data stored in PointerRNA cannot allow us to definitively - * identify the data + * identify the data */ if ((nec->rna.ptr.data == prna->ptr.data) && (nec->rna.prop == prna->prop) && ELEM(nec->rna.prop_index, -1, prna->prop_index)) return nec; @@ -2161,8 +2161,8 @@ static void nlaevalchan_accumulate(NlaEvalChannel *nec, NlaEvalStrip *nes, float case NLASTRIP_MODE_REPLACE: default: /* TODO: do we really want to blend by default? it seems more uses might prefer add... */ /* do linear interpolation - * - the influence of the accumulated data (elsewhere, that is called dstweight) - * is 1 - influence, since the strip's influence is srcweight + * - the influence of the accumulated data (elsewhere, that is called dstweight) + * is 1 - influence, since the strip's influence is srcweight */ nec->value = nec->value * (1.0f - inf) + (value * inf); break; @@ -2223,7 +2223,7 @@ static void nlaeval_fmodifiers_join_stacks(ListBase *result, ListBase *list1, Li } else { /* list1 should be added first, and list2 second, with the endpoints of these being the endpoints for result - * - the original lists must be left unchanged though, as we need that fact for restoring + * - the original lists must be left unchanged though, as we need that fact for restoring */ result->first = list1->first; result->last = list2->last; @@ -2336,11 +2336,11 @@ static void nlastrip_evaluate_transition( nlaeval_fmodifiers_join_stacks(&tmp_modifiers, &nes->strip->modifiers, modifiers); /* get the two strips to operate on - * - we use the endpoints of the strips directly flanking our strip - * using these as the endpoints of the transition (destination and source) - * - these should have already been determined to be valid... - * - if this strip is being played in reverse, we need to swap these endpoints - * otherwise they will be interpolated wrong + * - we use the endpoints of the strips directly flanking our strip + * using these as the endpoints of the transition (destination and source) + * - these should have already been determined to be valid... + * - if this strip is being played in reverse, we need to swap these endpoints + * otherwise they will be interpolated wrong */ if (nes->strip->flag & NLASTRIP_FLAG_REVERSE) { s1 = nes->strip->next; @@ -2352,11 +2352,11 @@ static void nlastrip_evaluate_transition( } /* prepare template for 'evaluation strip' - * - based on the transition strip's evaluation strip data - * - strip_mode is NES_TIME_TRANSITION_* based on which endpoint - * - strip_time is the 'normalized' (i.e. in-strip) time for evaluation, - * which doubles up as an additional weighting factor for the strip influences - * which allows us to appear to be 'interpolating' between the two extremes + * - based on the transition strip's evaluation strip data + * - strip_mode is NES_TIME_TRANSITION_* based on which endpoint + * - strip_time is the 'normalized' (i.e. in-strip) time for evaluation, + * which doubles up as an additional weighting factor for the strip influences + * which allows us to appear to be 'interpolating' between the two extremes */ tmp_nes = *nes; @@ -2512,7 +2512,7 @@ static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, Poin } /* if this track has strips (but maybe they won't be suitable), set has_strips - * - used for mainly for still allowing normal action evaluation... + * - used for mainly for still allowing normal action evaluation... */ if (nlt->strips.first) has_strips = true; @@ -2523,9 +2523,9 @@ static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, Poin } /* add 'active' Action (may be tweaking track) as last strip to evaluate in NLA stack - * - only do this if we're not exclusively evaluating the 'solo' NLA-track - * - however, if the 'solo' track houses the current 'tweaking' strip, - * then we should allow this to play, otherwise nothing happens + * - only do this if we're not exclusively evaluating the 'solo' NLA-track + * - however, if the 'solo' track houses the current 'tweaking' strip, + * then we should allow this to play, otherwise nothing happens */ if ((adt->action) && ((adt->flag & ADT_NLA_SOLO_TRACK) == 0 || (adt->flag & ADT_NLA_EDIT_ON))) { /* if there are strips, evaluate action as per NLA rules */ @@ -2585,8 +2585,8 @@ static void animsys_evaluate_nla(Depsgraph *depsgraph, ListBase *echannels, Poin } /* NLA Evaluation function (mostly for use through do_animdata) - * - All channels that will be affected are not cleared anymore. Instead, we just evaluate into - * some temp channels, where values can be accumulated in one go. + * - All channels that will be affected are not cleared anymore. Instead, we just evaluate into + * some temp channels, where values can be accumulated in one go. */ static void animsys_calculate_nla(Depsgraph *depsgraph, PointerRNA *ptr, AnimData *adt, float ctime) { @@ -2626,34 +2626,34 @@ static void animsys_evaluate_overrides(PointerRNA *ptr, AnimData *adt) /* Evaluation System - Public API */ /* Overview of how this system works: - * 1) Depsgraph sorts data as necessary, so that data is in an order that means - * that all dependencies are resolved before dependents. - * 2) All normal animation is evaluated, so that drivers have some basis values to - * work with - * a. NLA stacks are done first, as the Active Actions act as 'tweaking' tracks - * which modify the effects of the NLA-stacks - * b. Active Action is evaluated as per normal, on top of the results of the NLA tracks + * 1) Depsgraph sorts data as necessary, so that data is in an order that means + * that all dependencies are resolved before dependents. + * 2) All normal animation is evaluated, so that drivers have some basis values to + * work with + * a. NLA stacks are done first, as the Active Actions act as 'tweaking' tracks + * which modify the effects of the NLA-stacks + * b. Active Action is evaluated as per normal, on top of the results of the NLA tracks * * --------------< often in a separate phase... >------------------ * - * 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are - * resolved nicely. - * Note: it may be necessary to have some tools to handle the cases where some higher-level - * drivers are added and cause some problematic dependencies that didn't exist in the local levels... + * 3) Drivers/expressions are evaluated on top of this, in an order where dependencies are + * resolved nicely. + * Note: it may be necessary to have some tools to handle the cases where some higher-level + * drivers are added and cause some problematic dependencies that didn't exist in the local levels... * * --------------< always executed >------------------ * * Maintenance of editability of settings (XXX): - * In order to ensure that settings that are animated can still be manipulated in the UI without requiring - * that keyframes are added to prevent these values from being overwritten, we use 'overrides'. + * In order to ensure that settings that are animated can still be manipulated in the UI without requiring + * that keyframes are added to prevent these values from being overwritten, we use 'overrides'. * * Unresolved things: - * - Handling of multi-user settings (i.e. time-offset, group-instancing) -> big cache grids or nodal system? but stored where? - * - Multiple-block dependencies (i.e. drivers for settings are in both local and higher levels) -> split into separate lists? + * - Handling of multi-user settings (i.e. time-offset, group-instancing) -> big cache grids or nodal system? but stored where? + * - Multiple-block dependencies (i.e. drivers for settings are in both local and higher levels) -> split into separate lists? * * Current Status: - * - Currently (as of September 2009), overrides we haven't needed to (fully) implement overrides. - * However, the code for this is relatively harmless, so is left in the code for now. + * - Currently (as of September 2009), overrides we haven't needed to (fully) implement overrides. + * However, the code for this is relatively harmless, so is left in the code for now. */ /* Evaluation loop for evaluation animation data @@ -2674,15 +2674,15 @@ void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, A RNA_id_pointer_create(id, &id_ptr); /* recalculate keyframe data: - * - NLA before Active Action, as Active Action behaves as 'tweaking track' - * that overrides 'rough' work in NLA + * - NLA before Active Action, as Active Action behaves as 'tweaking track' + * that overrides 'rough' work in NLA */ /* TODO: need to double check that this all works correctly */ if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM)) { /* evaluate NLA data */ if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) { /* evaluate NLA-stack - * - active action is evaluated as part of the NLA stack as the last item + * - active action is evaluated as part of the NLA stack as the last item */ animsys_calculate_nla(depsgraph, &id_ptr, adt, ctime); } @@ -2695,9 +2695,9 @@ void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, A } /* recalculate drivers - * - Drivers need to be evaluated afterwards, as they can either override - * or be layered on top of existing animation data. - * - Drivers should be in the appropriate order to be evaluated without problems... + * - Drivers need to be evaluated afterwards, as they can either override + * or be layered on top of existing animation data. + * - Drivers should be in the appropriate order to be evaluated without problems... */ if ((recalc & ADT_RECALC_DRIVERS) /* XXX for now, don't check yet, as depsgraph hasn't been updated */ @@ -2707,10 +2707,10 @@ void BKE_animsys_evaluate_animdata(Depsgraph *depsgraph, Scene *scene, ID *id, A } /* always execute 'overrides' - * - Overrides allow editing, by overwriting the value(s) set from animation-data, with the - * value last set by the user (and not keyframed yet). - * - Overrides are cleared upon frame change and/or keyframing - * - It is best that we execute this every time, so that no errors are likely to occur. + * - Overrides allow editing, by overwriting the value(s) set from animation-data, with the + * value last set by the user (and not keyframed yet). + * - Overrides are cleared upon frame change and/or keyframing + * - It is best that we execute this every time, so that no errors are likely to occur. */ animsys_evaluate_overrides(&id_ptr, adt); @@ -2740,9 +2740,9 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene printf("Evaluate all animation - %f\n", ctime); /* macros for less typing - * - only evaluate animation data for id if it has users (and not just fake ones) - * - whether animdata exists is checked for by the evaluation function, though taking - * this outside of the function may make things slightly faster? + * - only evaluate animation data for id if it has users (and not just fake ones) + * - whether animdata exists is checked for by the evaluation function, though taking + * this outside of the function may make things slightly faster? */ #define EVAL_ANIM_IDS(first, aflag) \ for (id = first; id; id = id->next) { \ @@ -2753,10 +2753,10 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene } (void)0 /* another macro for the "embedded" nodetree cases - * - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees" - * (i.e. scene/material/texture->nodetree) which we need a special exception - * for, otherwise they'd get skipped - * - ntp = "node tree parent" = datablock where node tree stuff resides + * - this is like EVAL_ANIM_IDS, but this handles the case "embedded nodetrees" + * (i.e. scene/material/texture->nodetree) which we need a special exception + * for, otherwise they'd get skipped + * - ntp = "node tree parent" = datablock where node tree stuff resides */ #define EVAL_ANIM_NODETREE_IDS(first, NtId_Type, aflag) \ for (id = first; id; id = id->next) { \ |