Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-06Cleanup: anim, remove `const` declarations from pass-by-value paramsSybren A. Stüvel
Remove `const` from pass-by-value parameters in function declarations. The variables passed as parameters can never be modified by the function anyway, so declaring them as `const` is meaningless. Having the declaration there could confuse, especially as it suggests it does have a meaning, training people to write meaningless code.
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-05-12NLA: Extract ..get_inverted_upper_snapshot()Wayde Moss
Extracts `nlasnapshot_blend_get_inverted_upper_snapshot()` from `BKE_animsys_nla_remap_keyframe_values()` This introduces a new struct member: `NlaEvalChannelSnapshot->remap_domain` and marks which values of `blended_snapshot` are processed for remapping/used-for-inverting. Effectively, it marks which values have successfully been remapped and can be further used for remapping. `nlasnapshot_blend_get_inverted_upper_snapshot()`: output snapshot `r_upper_snapshot` has each channel's `remap_domain` written to which effectively marks the successfully remapped values. The only reason a value is not in the remap domain is if inversion failed or it wasn't marked to be remapped. `..get_inverted_upper_snapshot()` has a variant `nlasnapshot_blend()` from {D10220}, but this patch doesn't depend on it at all. A third variant will later be added `..get_inverted_lower_snapshot()`. Altogether, these three functions allow solving for any of (lower_snapshot, upper_snapshot, blended_snapshot) given the other two. The function `..get_inverted_lower_snapshot()` will also similarly process the remap domain of the blended and lower snapshot. added assertions within `nlasnapshot_blend()` and `..get_inverted_upper_snapshot()` to future proof branches dealing with blendmode and mixmodes. (suggested by sybren) No user functional changes Reviewed By: sybren Differential Revision: https://developer.blender.org/D10222
2021-02-17Fix: NLA Blends Non-Animated Upper Channel ValuesWayde Moss
Issue introduced by my commit: rB40b7929cc040 **User-level Problem**: The issue resulted in a full-replace upper strip with only a Z location channel full-replacing the XY location channels of the lower stack. replaced to default. The expected behavior is that only the Z location channel is affected. **Technical-level Problem**: Before the problematic commit, fcurves were blended as they were read. So only existing animated channels would blend. My recent commit changed the process to read all fcurve values into an isolated upper_snapshot then blend with the lower stack. There is no data stored to know whether the upper snapshot channel values were sampled from fcurves or were default values. Only those sampled from fcurves should be blended. **Solution**: Added a `blend_domain` bitmask member to NlaEvalChannelSnapshot. The blending function only blends values within the `blend_domain`. Sampled fcurve values are now marked as within the `blend_domain`. We also now always copy the lower snapshot to the result snapshot which only matters when they aren't the same. Currently, it's always the same so the change is more for future unseen cases. Reviewed By: sybren, #animation_rigging Differential Revision: https://developer.blender.org/D10339
2021-02-06NLA: Refactor Transition, Use Snapshot Blend FuncWayde Moss
The function `nlastrip_evaluate_transition()` has been slightly modified to use `nlasnapshot_blend()` instead of it's own special blending function `nlaeval_snapshot_mix_and_free()`. No user functional changes Reviewed By: sybren, #animation_rigging Differential Revision: https://developer.blender.org/D10221
2021-02-04NLA: Extract nlasnapshot_blend()Wayde Moss
Refactor //nlastrip_evaluate_actionclip()// and //nlaeval_blend_value()// into //nlasnapshot_blend()//, //nlastrip_evaluate_actionclip()//, //nlasnapshot_from_action()//. **Motivations**: * {T83615} Requires reading all pose bone fcurves before being able to apply pre-blend transforms. The function //nlasnapshot_from_action()// achieves this. This effectively removed the need to specially handle Quaternion blend queuing so that code has been removed. * {D8296} Adds support for keyframe remapping through an upper stack of strips. Instead of introducing a variant of the form: //nlastrip_evaluate_actionclip_inverted_get_lower()//, //nlastrip_evaluate_actionclip()// will later be extended to take an `evaluation_mode` as input to avoid duplicating the recursion functions related to //nlastrip_evaluate()//. * //nlasnapshot_blend()// will eventually have variants of //nlasnapshot_blend_get_inverted_lower_snapshot()// and //nlasnapshot_blend_get_inverted_upper_snapshot()// which are all independent of NlaStrips and NlaTracks, further simplifying the blending implementation. Ideally, //nlastrip_evaluate()// would get renamed to //nlasnapshot_blend_strip()// but that'll be a later patch to avoid unnecessary patches slowing the review of more important patches. No User-side Functional changes Reviewed By: sybren, #animation_rigging Differential Revision: https://developer.blender.org/D10220
2021-01-15Nla: Rename NlaEvalChannel->valid to domainWayde Moss
For term consistency with usage. The clarity is more for consistency with the nla domain() processing function names and the core struct member name it stores the results in, "valid". The name "domain", which implies a function can operate on it, seems more natural than "valid", which implies something is wrong if false. No functional changes. Reviewed by: sybren Differential Revision: http://developer.blender.org/D9692
2020-12-21Nla Refactor: Better blend function parm namingWayde Moss
**Renames parms**: | **old name** | **new name** | old_value | lower_value | target_value | blended_value | value | strip_value | inf | influence **Reason**: {D8296} allows full nla stack evaluation with proper keyframing support. These names should make it more intuitive how all the data gets processed and inverted. Note, that I do use the term "strip_value" instead of something like "fcurve_value" of the tweak strip. Technically, "strip_value" is closer to what is solved for. For example, if a noise fmodifier was active for the fcurve, then the remapping would appear to be wrong. In the future, further solving can be done afterward, outside of the nla system, to remove the effects of fmodifiers. **Renames functions**: | nla_invert_blend_value | nla_blend_get_inverted_strip_value | nla_invert_combine_value | nla_combine_get_inverted_strip_value **Reason**: D8296 adds get_inverted_lower_value() variants, so "invert" alone is too vague. **Renames NlaKeyframingContext member**: | nla_channels | lower_eval_data **Reason**: D8296 evaluates the upper stack. This name makes it more obvious what data is stored there. No functional changes (relative to the dependency below) Split from {D9247} Depends on {D9694} since the code was so close to eachother. Reviewed By: sybren Differential Revision: https://developer.blender.org/D9695
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-07-20T77086 Animation: Passing Dependency Graph to DriversSybren A. Stüvel
Custom driver functions need access to the dependency graph that is triggering the evaluation of the driver. This patch passes the dependency graph pointer through all the animation-related calls. Instead of passing the evaluation time to functions, the code now passes an `AnimationEvalContext` pointer: ``` typedef struct AnimationEvalContext { struct Depsgraph *const depsgraph; const float eval_time; } AnimationEvalContext; ``` These structs are read-only, meaning that the code cannot change the evaluation time. Note that the `depsgraph` pointer itself is const, but it points to a non-const depsgraph. FCurves and Drivers can be evaluated at a different time than the current scene time, for example when evaluating NLA strips. This means that, even though the current time is stored in the dependency graph, we need an explicit evaluation time. There are two functions that allow creation of `AnimationEvalContext` objects: - `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time)`, which creates a new context object from scratch, and - `BKE_animsys_eval_context_construct_at(AnimationEvalContext *anim_eval_context, float eval_time)`, which can be used to create a `AnimationEvalContext` with the same depsgraph, but at a different time. This makes it possible to later add fields without changing any of the code that just want to change the eval time. This also provides a fix for T75553, although it does require a change to the custom driver function. The driver should call `custom_function(depsgraph)`, and the function should use that depsgraph instead of information from `bpy.context`. Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D8047
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-02Cleanup: make remaining blenkernel headers work in C++Jacques Lucke
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-07-31Animation: Remove depsgraph argument from a lot of APISergey Sharybin
Use explicit boolean flag to indicate whether flush to original data is needed or not. Makes it possible to avoid confusion on whether an evaluated or any depsgraph can be passed to the API. Allows to remove depsgraph from bAnimContext as well. Reviewers: brecht Differential Revision: https://developer.blender.org/D5379
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-14NLA: implement a new blending mode that intelligently combines actions.Alexander Gavrilov
The existing Add and Multiply blending modes have limited usability, because the appropriate operation for meaningfully combining values depends on the channel. This adds a new mode that chooses the operation automatically based on property settings: - Axis+Angle channels are summed, effectively averaging the axis, but adding up the angle. Default is forced to 0. - Quaternion channels use quaternion multiplication: result = prev * value ^ influence - Scale-like multiplicative channels use multiplication: result = prev * (value / default) ^ influence - Other channels use addition: result = prev + (value - default) * influence Inclusion of default in the computation ensures that combining keyframed default values of properties keeps the default state, even if the default isn't 0 or 1. Strips with this mode can be keyframed normally in Tweak mode, except that for quaternion rotation keyframing always inserts all 4 channels, and the channel value sliders on the left side of Graph/Action editors won't insert keys without Auto Key. Quaternion keys are also automatically normalized. Differential Revision: https://developer.blender.org/D4190
2019-01-05NLA: rewrite evaluation channel data structures.Alexander Gavrilov
Implementing a new intelligent mixing mode that combines quaternions via multiplication requires rewriting the NLA code to recombine array properties from separate scalar channels during evaluation. In addition, stable evaluation of NLA stack requires that any channel that is touched by any of the actions in the stack should always be set to a definite value by evaluation, even if no strip affects it at this point of the timeline. The obvious choice for the fallback is the default value of the property. To make scanning all actions reasonably efficient, mapping paths to channels should be done using hash tables. Differential Revision: https://developer.blender.org/D4120
2018-12-14NLA: insert keyframes correctly for strips with non-Replace mode.Alexander Gavrilov
NLA strips support using the keyframe values in a variety of ways: adding, subtracting, multiplying, linearly mixing with the result of strips located below in the stack. This is intended for layering tweaks on top of a base animation. However, when inserting keyframes into such strips, it simply inserts the final value of the property, irrespective of these settings. This in fact makes the feature nearly useless. To fix this it is necessary to evaluate the NLA stack below the edited strip and correctly compute the raw key that would produce the intended final value, according to the mode and influence. Differential Revision: https://developer.blender.org/D3927
2018-11-12Remove AnimMapper: it has been left unimplemented for almost ten years.Alexander Gavrilov
It was supposed to be a feature for substituting RNA paths on the fly, but has never been implemented, apart from a couple of structure definitions and passing around some always-NULL pointers. Now it gets in the way of refactoring NLA evaluation to use GHash for efficiency.
2018-11-07NLA: use animsys_write_orig_anim_rna when applying NLA stack results.Alexander Gavrilov
Without this keyframing on top of an NLA stack is quite weirdly broken.
2018-06-17Merge branch 'master' into blender2.8Campbell Barton
2018-06-17Cleanup: trailing space for blenkernelCampbell Barton
2018-05-31Animation: Pass dependency graph to animation systemSergey Sharybin
This way we allow animation system to make decisions based on which context dependency graph is coming from, and whether it belongs to an active edit window or not.
2013-03-22correct enums which were in fact variables defined in headers.Campbell Barton
2012-10-09code cleanup: make header defines more consistent, JOYSENSOR header guard ↵Campbell Barton
had a typo too.
2012-05-13code cleanup: header cleanup and remove some duplicate defines.Campbell Barton
2012-02-17unify include guard defines, __$FILENAME__Campbell Barton
without the underscores these clogged up the namespace for autocompleation which was annoying.
2011-10-23remove $Id: tags after discussion on the mailign list: ↵Campbell Barton
http://markmail.org/message/fp7ozcywxum3ar7n
2011-02-27doxygen: blender/blenkernel tagged.Nathan Letwory
2011-02-23doxygen: prevent GPL license block from being parsed as doxygen comment.Nathan Letwory
2010-02-12correct fsf addressCampbell Barton
2009-07-12SVN maintenance.Guillermo S. Romero
2009-07-07NLA SoC: Meta Strips + F-Modifiers Joshua Leung
F-Modifiers now work on 'all' types of NLA Strip. To get them working on Meta-strips, F-Modifiers on the Meta strip must be applied on top of those for child strips. For now, this is done by joining the lists of modifiers, and evaluating the joined list. Currently, Transitions don't work that great with F-Modifiers yet (only the endpoints get evaluated with the F-Modifiers). Solving this is for another time...
2009-07-07NLA SoC: Recoded way that Meta-Strips are EvaluatedJoshua Leung
Previously, the quick-hack I coded for Meta-strips evaluation didn't really take into account the possibilities to use Meta-Strips as strips in their own right - i.e. reversed, muted, time-mapping-curves, influence-blending - were all unavailable. This commit makes the aforementioned capabilities of other strips available for Meta-Strips too. The evaluation is now kind-of recursive (as with most of the other methods which take them into account) so that each 'level' of strips get evaluated correctly within their frame-of-reference. TODO: * F-Modifier support for Metas...
2009-06-28NLA SoC: NLA Mapping Cleanup Joshua Leung
While trying to fix the mapping conversions for repeat, I came across some limitations with the current (soon to be previous) mapping methods. Now the mapping conversions should work nicely for all places that use them.
2009-06-23NLA SoC: Big Commit - Restored NLA-Mapping Corrections Joshua Leung
In TweakMode, the keyframes of the Active Action are now shown (and can be edited) in NLA-mapped time, with appropriate corrections applied when editing. This works in the DopeSheet and Graph Editors :) To do this, got rid of the old wrappers/API-methods, replacing them with new-style ones. A few methods previously (in this branch) used only for evaluation are now used for this purpose too. As the same code is used for editing + evaluation, this should now be much better to work with. I've only done a few brief tests now, but I think I might've muddled the invert-flags on one or two cases which I'll need to check out tomorrow. So, beware that there may be some weird and critical bugs for the next few days here... Also, added proper license headers to new NLA files. TODO: - testing + bugfixing due to this commit - show range of keyframes in NLA Editor active-action line