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-28Cleanup: spelling in commentsCampbell Barton
Also add missing task ID.
2022-09-26Cleanup: use 'u' prefixed integer types for brevity in C codeCampbell Barton
This also simplifies using function style casts when moving to C++.
2022-09-25Cleanup: use 'u' prefixed integer types for brevity & cast styleCampbell Barton
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
2022-07-29Cleanup: Move RNA path functions into own C++ fileJulian Eisel
Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
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-09FCurve: optimize search from an RNA path + index.Bastien Montagne
By checking the index value first instead of a full fledge string comparision in `BKE_fcurve_find`, we can make that code significatly faster (from about 10% in a Heist production file to over 45% in a heavily animated test file). While this code was already very fast (a few microseconds per call typically), it gets called a lot from the UI (several hundreds of time per refresh), among other things. NOTE: the `UNLIKELY` hint is responsible for 25% to 30% of the speed improvement.
2022-06-03Cleanup: spelling in commentsCampbell 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-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
2021-12-23Cleanup: remove BKE_animdata_driver_path_hackSybren A. Stüvel
The `BKE_animdata_driver_path_hack()` function has had almost no effect since rB51b796ff1528, and basically boils down to: ``` return base_path ? base_path : RNA_path_from_ID_to_property(ptr, prop); ``` Since `base_path` was `NULL` in the majority of cases, it's just been replaced by a direct call to `RNA_path_from_ID_to_property()`. The conditional now just appears in one remaining case. This relates to T91387. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D13646
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-10-29LibQuery: Add macro to help break looping when requested.Bastien Montagne
The new `BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL` execute the given statement and then check status of `LibraryForeachIDData` data, and return in case stop of iteration is requested. This is very similar to the other `BKE_LIB_FOREACHID_PROCESS_` existing macros, and allows us to properly break iteration when a sub-function has requested it. Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
2021-10-26Cleanup: LibQuery: Rename `BKE_LIB_FOREACHID_PROCESS` to ↵Bastien Montagne
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`. More in-line name with the rest of that macro-based API, especially since this will be extended in the future.
2021-09-04RNA: support extracting names from paths without allocating memoryCampbell Barton
Support extracting identifiers RNA paths into fixed size buffer since the maximum size of the identifier is known all cases. - Add BLI_str_unescape_ex to support limiting the destination buffer. - Add BLI_str_quoted_substr to copy values into a fixed size buffer.
2021-09-01Cleanup: remove redundant strstr callsCampbell Barton
Rely on BLI_str_quoted_substrN to detect if the prefix exists since this function exists early there is no need to check before calling.
2021-07-21Cleanup: replace BLI_assert(test || !"text") with BLI_assert_msg(test, text)Campbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Cleanup: spelling in commentsCampbell Barton
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-03Cleanup: use ascii characters instead of unicode where possibleCampbell Barton
Follow own code style docs.
2021-04-09Cleanup: use our own code style for doxy-gen comment blocksCampbell Barton
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
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson
2020-11-28Fix some naming and comments in F-Curve smoothing code.Alexander Gavrilov
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-11-10Animation: Expand unit tests for `BKE_fcurve_active_keyframe_index()`Sybren A. Stüvel
Expand unit test for `BKE_fcurve_active_keyframe_index()` to test edge cases better. This also introduces a new test macro `EXPECT_BLI_ASSERT()`, which can be used to test that an assertion fails successfully. No functional changes to actual Blender code.
2020-11-10Merge remote-tracking branch 'origin/blender-v2.91-release'Sybren A. Stüvel
2020-11-10Animation: More explicit boundary checks when setting active keyframeSybren A. Stüvel
Fix unit test failing in debug mode by having more explicit boundary checks when setting an FCurve's active keyframe. No functional changes.
2020-11-06Cleanup: use ELEM macroCampbell Barton
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-26Cleanup: spellingCampbell Barton
2020-10-22Fix T81905: Active keyframe unavailable when handle selectedCampbell Barton
Selecting an F-Curve handle caused an assertion as well as treating the key-frame as inactive. Allow active the keyframe to be active when it's handle is selected, as is done with bezier curves.
2020-10-20Cleanup: General comment style clean up of graph_edit.c and fcurve.cSebastian Parborg
No functional changes. Reviewed By: Sybren A. Stüvel Differential Revision: http://developer.blender.org/D7850
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-12Animation: fix assertion failure on unsetting active keyframeSybren A. Stüvel
Avoid NULL pointer dereference when checking keyframe selection state in `BLI_assert()` call.
2020-10-12Animation: enforce that the active keyframe is always selectedSybren A. Stüvel
Check selection state in `BKE_fcurve_active_keyframe_index()`, and only return the active keyframe index when that keyframe is actually selected. This is now also asserted in the `BKE_fcurve_active_keyframe_set()` function, which is now also used when inserting a keyframe.
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
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: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-09-16Cleanup: spellingCampbell Barton
2020-09-15Fix T75881: Animation, limitation of Bézier HandlesTonyG
Relax limits of FCurve Bézier handles during evaluation. FCurve handles can be scaled down to avoid the curve looping backward in time. This scaling was done correctly but over-carefully, posing unnecessary limitations on the possible slope of FCurves. This commit changes the scaling approach such that the FCurve can become near-vertical. Bump Blender's subversion from 291.0.1 to 291.0.2 to ensure that older animation files are correctly updated. Reviewed By: sybren Differential Revision: https://developer.blender.org/D8752
2020-09-15Cleanup: FCurve, comments should be sentencesTonyG
No functional changes.
2020-09-09Cleanup: reduce variable scopesJacques Lucke
2020-09-02Cleanup: use bool instead of int in various placesJacques Lucke