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-11-10Fix const-correctness for a number of F-Curve functionsColin Basnett
Reviewed By: sybren Differential Revision: https://developer.blender.org/D16445
2022-11-09Cancel Equalize Handles & Snap Keys when no control points are selectedColin Basnett
The Equalize Handles and Snap Keys operators would allow the user to invoke them successfully even when they would have no effect due to there not being any selected control points. This patch makes it so that an error is displayed when these operators are invoked with no control points are selected. The reason this is in the `invoke` function is because it would be too expensive to run this check in the `poll` function since it requires a linear search through all the keys of all the visible F-Curves. Reviewed By: sybren Differential Revision: https://developer.blender.org/D16390
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-07-14Cleanup: format, unused argumentCampbell Barton
2022-07-14Cleanup: Rename & refactor several F-curve functionsColin Basnett
Rename and refactor several F-curve key manipulation functions, and move them from `editors` to `blenkernel`. The functions formerly known as `delete_fcurve_key`, `delete_fcurve_keys`, and `clear_fcurve_keys` have been moved from `ED_keyframes_edit.h` to `BKE_fcurve.h` and have been renamed according to hierarchical naming rules. Below is a table of the naming changes. | From | To | | -- | -- | | `delete_fcurve_key(fcu, index, do_recalc)` | `BKE_fcurve_delete_key(fcu, index)` | | `delete_fcurve_keys(fcu)` | `BKE_fcurve_delete_keys_selected(fcu)` | | `clear_fcurve_keys(fcu)` | `BKE_fcurve_delete_keys_all(fcu)` | | `calchandles_fcurve()` | `BKE_fcurve_handles_recalc()` | | `calchandles_fcurve_ex()`| `BKE_fcurve_handles_recalc_ex()` | The function formerly known as `delete_fcurve_key` no longer takes a `do_fast` parameter, which determined whether or not to call `calchandles_fcurve`. Now, the responsibility is on the caller to run the new `BKE_fcurve_handles_recalc` function if they have want to recalculate the handles. In addition, there is now a new static private function called `fcurve_bezt_free` which sets the key count to zero and frees the key array. This function is now used in couple of instances of functionally equivalent code. Note that `BKE_fcurve_delete_keys_all` is just a wrapper around `fcurve_bezt_free`. This change was initially spurred by the fact that `delete_fcurve_keys` was improperly named; this was a good opportunity to fix the location and naming of a few of these functions. Reviewed By: sybren Differential Revision: https://developer.blender.org/D15282
2022-06-30Cleanup: colon after params, move text into public doc-strings, spellingCampbell Barton
2022-06-07Cleanup: spelling in comments, minor formatting tweaksCampbell Barton
2022-06-02Anim: Refactor 'F-curve from rna path' code.Bastien Montagne
Move into its own new function the the low-level logic to search for a given RNA path in Action F-curves, then driver F-curves of a given AnimData. This deduplicates code from `BKE_fcurve_find_by_rna_context_ui` and `id_data_find_fcurve`, and will allow for future more usages of this functionality. Differential Revision: https://developer.blender.org/D15068
2022-05-30Cleanup/simplify BKE_fcurve_find_by_rna_context_ui code.Bastien Montagne
From reading the code it looks like at some point the code was expecting the `tptr` PointerRNA to change during the loop? But currently it did not make any sense to have this complex looping and multi-checking of RNA path and animdata, since the RNA pointer (and therefore its `owner_id`) is never modified... NOTE: there could be much more cleanup done in that area, goal of this commit is mainly to simplify the logic by removing all the (seamingly) dead code. Differential Revision: https://developer.blender.org/D15026
2022-04-19Cleanup: Use correct capitalization of "F-Curve"Aaron Carlisle
2022-04-11Cleanup: malformed C-style comment blocks, spellingCampbell Barton
- Missing star prefix. - Unnecessary indentation. - Blank line after dot-points (otherwise doxygen merges with the previous dot-point). - Use back-slash for doxygen commands. - Correct spelling.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
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-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-03-26Animation: add BKE_fcurve_pathcache_find APICampbell Barton
Support a cache for fast RNA path look-ups for RNA-path + index. Unlike a regular hash lookup, this supports using a single lookup for the RNA path which is then used to fill an array of F-curves. Reviewed By: sybren Ref D10781
2021-03-26Animation: add BKE_fcurves_calc_keyed_frames utilityCampbell Barton
This function returns an array of keyed frames with rounding, to avoid duplicates caused by subtle floating point difference. Reviewed By: sybren Ref D10781
2020-11-23Animation: New Euler filter implementationSybren A. Stüvel
This new discontinuity filter performs actions on the entire Euler rotation, rather than only on the individual X/Y/Z channels. This makes it fix a wider range of discontinuities, for example those in T52744. The filter now runs twice on the selected channels, in this order: - New: Convert X+Y+Z rotation to matrix, then back to Euler angles. - Old: Add/remove factors of 360° to minimize jumps. The messaging is streamlined; it now reports how many channels were filtered, and only warns (instead of errors) when there was an actual problem with the selected channels (like selecting three or more channels, but without X/Y/Z triplet). A new kernel function `BKE_fcurve_keyframe_move_value_with_handles()` is introduced, to make it possible to move a keyframe's value and move its handles at the same time. Manifest Task: T52744 Reviewed By: looch Differential Revision: https://developer.blender.org/D9602
2020-10-28Add a Un-Bake FCurves operatorSebastian Parborg
We already had the ability to bake fcurves but no way to convert the baked result back without using python. This patch adds and operator that is available now next to the bake operator in the drop down menu, Reviewed By: Sybren Differential Revision: http://developer.blender.org/D6379
2020-10-15Fix T81743: Changed behaviour in RGB Curves node interpolationSybren A. Stüvel
Restore the old `correct_bezpart()` (pre-rBda95d1d851b4) function as `BKE_curve_correct_bezpart()`, and use that where the old behaviour was desired (that is, curve maps like used by the RGB Curves shader node). The new (post-rBda95d1d851b4) function is also renamed to `BKE_fcurve_correct_bezpart()` to avoid confusion.
2020-10-13Cleanup: use BKE_fcurve_ prefix for keyframing bezier functionsCampbell Barton
- BKE_bezt_subdivide_handles -> BKE_fcurve_bezt_subdivide_handles - binarysearch_bezt_index -> BKE_fcurve_bezt_binarysearch_index These functions are specific to F-Curves and don't make sense for other uses of BezTriple (curve-object data for e.g.) Also: - Move detailed doxygen comment above code, following code-style. - Mark bezt_add_to_cfra_elem unused.
2020-10-07Fix T76595: Indicate the Active Keyframe in Graph EditorHans Goudey
In the graph editor there is a panel that says "Active Keyframe" for numerically editing a keyframe's values, but in the code there is no concept of the "active keyframe." Since this is a useful concept to have for some other features anyway, this commit adds an active keyframe index value to FCurves. It also displays it with a theme color for the active vertex (which didn't exist before) if the FCurve is active. The active keyframe in the graph editor is treated similarly to the active vertex in the 3D view. It is the keyframe most recently selected with a single click, and it is always selected. For now, the only real functional change is that the active keyframe appears in white and it should be more predictable which keyframe is being edited in the sidebar panel. Differential Revision: https://developer.blender.org/D7737
2020-10-05Insert keyframes while preserving shape of curveSybren A. Stüvel
Apply the De Casteljau algorithm to split the Bèzier curve at the X coordinate where the new key is inserted, and uses the result to update both the newly inserted and surrounding handles. For curves that use Auto keyframes this has been largely addressed by the new algorithm from D2884. This commit extends this to non-auto handles. This code is heavily based on D3172 by Alexander Gavrilov (@angavrilov). Manifest Task: https://developer.blender.org/T81353
2020-09-30Cleanup: sort struct declarationsCampbell Barton
2020-09-02Cleanup: use bool instead of int in various placesJacques Lucke
2020-08-28Cleanup: improve function namesJacques Lucke
With this change, the three .blend read operations: data reading, lib reading and expanding are more grouped together.
2020-08-21Refactor: move fcurve/fmodifier code from blenloader to blenkernelJacques Lucke
This is part of T76372.
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-07-13Clang Tidy: enable readability-non-const-parameter warningJacques Lucke
Clang Tidy reported a couple of false positives. I disabled those `NOLINTNEXTLINE`. Differential Revision: https://developer.blender.org/D8199
2020-06-05Code Cleanup: fcurve function namingJeroen Bakker
2020-06-05CleanUp: Introduce BKE_fcurve_createJeroen Bakker
2020-05-26Fix/refactor foreach_id handling of animdata.Bastien Montagne
Now callbacks for animdata, nla strip and fcurve are in their own proper BKE files (mimicking `foreach_id` callback of `IDTypeInfo`). This commit also fixes some missing handling of ID pointers (text ID and IDProperties of script fcurve modifier...).
2020-05-08Cleanup: take includes out of 'extern "C"' blocksJacques Lucke
Surrounding includes with an 'extern "C"' block is not necessary anymore. Also that made it harder to add any C++ code to some headers, or include headers that have "optional" C++ code like `MEM_guardedalloc.h`. I tested compilation on linux and windows (and got help from @LazyDodo). If this still breaks compilation due to some linker error, the header containing the symbol in question is probably missing an 'extern "C"' block. Differential Revision: https://developer.blender.org/D7653
2020-05-01Cleanup: moved drivers to BKE_fcurve_driver.h / fcurve_driver.cSybren A. Stüvel
All the driver-specific code in `fcurve.c` has been moved into a new file `fcurve_driver.c`. The corresponding declarations have been moved from `BKE_fcurve.h` to `BKE_fcurve_driver.h`. All the `#include "BKE_fcurve.h"` statements have been investigated and replaced with `BKE_fcurve_driver.h` where necessary. No functional changes.
2020-02-07Cleanup: Animation, match parameter names in declaration with implementationSybren A. Stüvel
The implementation had more descriptive parameter names, so I copied those to the declarations. No functional changes.
2020-01-24Depsgraph: fix false positive time dependencies for simple drivers.Alexander Gavrilov
The dependency graph has to know whether a driver must be re-evaluated every frame due to a dependency on the current frame number. For python drivers it was using a heuristic based on searching for certain sub- strings in the expression, notably including '('. When the expression is actually evaluated using Python, this can't be easily improved; however if the Simple Expression evaluator is used, this check can be done precisely by accessing the parsed data. Differential Revision: https://developer.blender.org/D6624
2019-11-22UI: Changes to Graph Editor selection and transformJulian Eisel
When introducing "drag-all-selected" support all over Blender, we figured this wouldn't work well with the Graph Editor selection/transform behavior. Hence, William and I worked on the following changes, although we used this chance to improve the behavior in general too. For more info see T70634. * Handles now always move with the key, regardless if they are selected or not. * Selecting the key doesn't select the handles anymore, their selection is separate. * Multiple keys and handles can now be dragged. * Dragging a handle moves all selected handles **on the same side**. * Tweak-dragging any handle can never affect any keyframe location, only handles. * G/R/S should behave as before. * Changing the handle type with a key selected always applies the change to both handles. * Box selection with Ctrl+Drag now allows deselecting handles (used to act on entire triple only). * Box selection //Include Handles// option now only acts on visible handles, wasn't the case with Only Selected Keyframes Handles enabled. * Box selection //Include Handles// is now enabled by default in all bundled keymaps. The changes have been tested for some days by the animators here in the Blender Animation Studio. Some changes are based on their feedback. Also, this improves/adds comments for related code. Differential Revision: https://developer.blender.org/D6235 Reviewed by: Sybren Stüvel, William Reynish
2019-09-01Copy Rotation & Transform: add Euler order override options.Alexander Gavrilov
For reasons similar to drivers, it should be possible to set an explicit Euler rotation order in constraints that use Euler angles. The Transform constraint in a way approaches drivers in its use, in that it effectively alters channels using values of other channels after applying a fixed form mathematical expression. For this reason, instead of just specifying the euler order for its inputs, it uses the same enum as driver variables. However Quaternion components are converted to a weighted pseudo-angle representation as the rest of the constraint UI expects angles.
2019-05-16Fix T64681: evaluate curves with generative modifiers and no keys.Alexander Gavrilov
Introduce a new function and use it everywhere, including automatic curve deletion checks to guarantee consistency.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-17Animation: Refactor storage usage during fcurve modifier evaluationJacques Lucke
Previously, when a fcurve modifier used storage, many heap allocations were done. This caused major slowdowns as described in T63656. Furthermore, the storage usage was a special case only used by the Cycles modifier. This refactor makes storage usage the "normal" case. That reduces the overall complexity. The storage is stack allocated now. The framerate on the provided test scene went up from ~5 fps to ~16 fps. Reviewers: angavrilov Differential Revision: https://developer.blender.org/D4701
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-04-16Cleanup: trailing commasCampbell Barton
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-02Cleanup: remove author/date info from doxy headersCampbell Barton
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-31Fix: allow curve of driver to be evaluated individuallyJacques Lucke
This is necessary when adding a new keyframe to a fcurve that also has a driver. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D4278