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-07-29Fix (unreported) lib-linking of ID properties not taking library parameter.Bastien Montagne
While this was not a critical issue (that lib pointer is only used for some kind of sanity check that no linked data uses local ID pointers), better to keep `IDP_BlendReadLib` in sync with all other lib-linking code.
2022-07-08Fix T99364: Unable to select bones when custom shape display is disabledCampbell Barton
Regression in [0] which revealed an error in [1]. Logic for pose channel custom transform ignored ARM_NO_CUSTOM. [0]: 3267c91b4d5caab7da8aef071a446dd2e86f86a9 [1]: c3fef001ee926fc183255b623f56da9fc5fcbb73
2022-07-07Fix T99270: bones using empties as custom shapes can't be selectedCampbell Barton
Regression in [0] which didn't account for the bounds of empty objects. Add support support calculating bounds from empty draw-type to use in pose-bone culling. [0]: 3267c91b4d5caab7da8aef071a446dd2e86f86a9
2022-04-26Fix bone "auto-name by axis" failure to clip long namesCampbell Barton
Failure to clip automatic-names meant named could end with a "." for e.g. Error in [0] meant the clipped text was copied then immediately overwritten. [0]: 354e6b9c189bb6cea57577ba3a8e7fb7ca28a796
2022-04-19Cleanup: Use correct capitalization of "F-Curve"Aaron Carlisle
2022-03-23Cleanup: move documentation to headers, other minor correctionsCampbell Barton
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-02-08Fix T91253: Slow pose bone selection with many bonesCampbell Barton
Viewport cull bones during selection to avoid depth-picking reading the depth buffer for bones that aren't in the viewport. Files with thousands of bones could hang blender for seconds while selecting. The issue could still happen with overlapping bones or when zoomed out so all bones are under the cursor, however in practice this rarely happens. Now files with many bones select quickly. Related changes include: - Split `BKE_pchan_minmax` out of `BKE_pose_minmax`. - Add `mat3_to_size_max_axis` to return the length of the largest axis (used for scaling the radius). Reviewed By: sybren Maniphest Tasks: T91253 Ref D13990
2022-02-04Cleanup: remove unused LOG declarationSybren A. Stüvel
No functional changes.
2022-02-04Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-01-20Cleanup: quiet ASAN warnings for divide by zero & NULL memcpy argsCampbell Barton
No functional changes as the inf value was never used & memcpy args were only NULL when the size to copy was zero.
2022-01-06Correct error when moving doc-strings into headerCampbell Barton
Error in ffc4c126f5416b04a01653e7a03451797b98aba4, which moved doc-strings from implementation into headers. Some changes in BKE_animsys.h needed to done manually as there were already doc-strings in both the header and implementation (with overlapping information). When making these changes some doc-strings were removed unintentionally. Thanks for @sybren for the heads up.
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-11-29Refactor BKE_bpath module.Bastien Montagne
The main goal of this refactor is to make BPath module use `IDTypeInfo`, and move each ID-specific part of the `foreach_path` looper into their own IDTypeInfo struct, using a new `foreach_path` callback. Additionally, following improvements/cleanups are included: * Attempt to get better, more consistent namings. ** In particular, move from `path_visitor` to more standard `foreach_path`. * Update and extend documentation. ** API doc was moved to header, according to recent discussions on this topic. * Remove `BKE_bpath_relocate_visitor` from API, this is specific callback that belongs in `lib_id.c` user code. NOTE: This commit is expected to be 100% non-behavioral-change. This implies that several potential further changes were only noted as comments (like using a more generic solution for `lib_id_library_local_paths`, addressing inconsistencies like path of packed libraries always being skipped, regardless of the `BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value, etc.). NOTE: basic unittests were added to master already in rBdcc500e5a265093bc9cc. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13381
2021-11-24Cleanup: `IDTypeInfo` new `asset_type_info` member.Bastien Montagne
Two issues addressed here: I) `asset_type_info` is sub-data, not a callback. Therefore, move it before the callbacks in the `IDTypeInfo` struct. II) More important, initialize this new attribute in *ALL* `IDTypeInfo` instances. No member of this struct should ever be left implicitely uninitilazed, ever. Aftermath of rBa84f1c02d251.
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-22Cleanup: spelling in comments, use C style commentsCampbell Barton
2021-10-21Fix T92169: "View Selected" on Custom Boneshape with transform wrongPhilipp Oeser
Since the introduction in rBfc5bf09fd88c, `BKE_pose_minmax` was not taking these custom transforms into account (making "View Selected" ignoring these as well and focusing on the bone instead). Now consider these transforms in `BKE_pose_minmax`. Maniphest Tasks: T92169 Differential Revision: https://developer.blender.org/D12942
2021-10-20Fix precision issues and a bug in vec_roll_to_mat3_normalized.Alexander Gavrilov
When the input vector gets close to -Y, y and theta becomes totally unreliable. It is thus necessary to compute the result in a different way based on x and z. The code already had a special case, but: - The threshold for using the special case was way too low. - The special case was not precise enough to extend the threshold. - The special case math had a sign error, resulting in a jump. This adds tests for the computation precision and fixes the issues by adjusting the threshold, and replacing the special case with one based on a quadratic Taylor expansion of sqrt instead of linear. Replacing the special case fixes the bug and results in a compatibility break, requiring versioning for the roll of affected bones. Differential Revision: https://developer.blender.org/D9551
2021-10-20Fix T82455: vec_roll_to_mat3_normalized returns NaN when nor close to -Y.Gaia Clary
In this case theta is completely unsafe to use, so a different threshold based on x and z has to be used to avoid division by zero. Ref D9551
2021-10-18Cleanup: spelling in commentsCampbell Barton
2021-10-14Cleanup: pass the sizeof(..) as the second arg for array allocationCampbell Barton
By argument naming and convention this is the intended argument order.
2021-09-22Initial implementation of local ID re-use when appending.Bastien Montagne
This commit adds to ID struct a new optional 'weak reference' to a linked ID (in the form of a blend file library path and full ID name). This can then be used on next append to try to find a matching local ID instead of re-making the linked data local again. Ref. T90545 NOTE: ID re-use will be disabled for regular append for the time being (3.0 release), and only used for assets. Therefore, this commit should not change anything user-wise. Differential Revision: https://developer.blender.org/D12545
2021-08-19Cleanup: Blendwrite: Move code deciding if an ID should be written out of ID ↵Bastien Montagne
callbacks. This was not really useful, and added estra useless steps in case and ID should not actually be written. Further more, it prevented clearing the usercount on write, which can be cause a false positive 'chanhged' detection in undo/redo case.
2021-08-03Fix T90387: division by zero when trying to invert scaleSybren A. Stüvel
Fix division by zero when `BKE_bone_parent_transform_invert()` inverts a scale vector with zero components. Zero values in the to-be-inverted vector are now simply skipped, i.e. remain zero after inversion. This at least ensures that `invert_v3_safe(invert_v3_safe(vector))` results in the same vector. This commit does NOT fix the conceptual problem that an inversion of a potentially non-invertible vector is relied upon. It just avoids the division by zero.
2021-08-03Cleanup: use C++ comments or 'if 0' for commented codeCampbell Barton
2021-07-12Cleanup: improve naming and comments of scene frame/ctime functionsBrecht Van Lommel
Confusingly, BKE_scene_frame_get did not match the frame number as expected by BKE_scene_frame_set. Instead it return the value after time remapping, which is commonly named "ctime". * Rename BKE_scene_frame_get to BKE_scene_ctime_get * Add a new BKE_scene_frame_get that matches BKE_scene_frame_set * Use int/float depending if fractional frame is expected
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-06-18Armature: add automatic B-Bone Scale toggles.Alexander Gavrilov
Currently B-Bone scaling can only be controlled via their properties, thus requiring up to 8 drivers per joint between B-Bones to transfer scaling factors from the handle bone. A Scale Easing option is added to multiply the easing value by the Y scale channels to synchronize them - this produces a natural scaling effect where both the shape of the curve and the scale is affected. In addition, four toggles are added for each handle, which multiply each of the X, Y, Z and Ease values by the matching Local Scale channel of the handle bone, thus replacing trivial drivers. The Scale Easing option has no effect on this process since it's easy to just enable both Length and Ease buttons. Differential Revision: https://developer.blender.org/D9870
2021-06-18Armature: implement lengthwise scaling of B-Bone segments.Alexander Gavrilov
Implement actual behavior for the B-Bone Y Scale channels added to DNA and UI in the previous commit in addition to the existing X and Z Scale inputs. The two length scale inputs control the ratio between the lengths of the start and end segments of the bone: although for convenience two inputs are provided, the whole chain is still uniformly scaled to fit the curve. Differential Revision: https://developer.blender.org/D9870
2021-06-18Armature: add B-Bone Y scale channel and extra flag fields to DNA.Alexander Gavrilov
In addition to the base bone transformation itself, B-Bones have controls that affect transformation of its segments. For rotation the features are quite complete, allowing to both reorient the Bezier handles via properties, and to control them using custom handle bones. However for scaling there are two deficiencies. First, there are only X and Y scale factors (actually X and Z), while lengthwise all segments have the same scaling. The ease option merely affects the shape of the curve, and does not cause actual scaling. Second, scaling can only be controlled via properties, thus requiring up to 6 drivers per joint between B-Bones to transfer scaling factors from the handle bone. This is very inefficient. Finally, the Z channels are confusingly called Y. This commit adds a B-Bone Y Scale channel and extra B-Bone flag fields to DNA with appropriate versioning (including for F-Curves and drivers) in preparation to addressing these limitations. Functionality is not changed, so the new fields are not used until the following commits. Differential Revision: https://developer.blender.org/D9870
2021-05-21Fix T88375: Bone Size Small After V3D.View_AllWayde Moss
The wrong matrix function was used and overwrote the custom bone shape scale instead of reading from it. Reviewed By: sybren Differential Revision: https://developer.blender.org/D11330
2021-05-11Rigging: Add transform for custom bone shapesYuki Shirakawa
Add translation/rotation/scale parameters for custom bones shapes. The new scale is a 3D vector `custom_shape_scale_xyz`, and replaces the `custom_shape_scale` float. Reviewed By: #animation_rigging, sybren, zeddb Differential Revision: https://developer.blender.org/D10974
2021-04-30Cleanup: rename BKE_pose_channel_{verify => ensure}Campbell Barton
The term `verify` doesn't fit with what this function does and is sometimes used to check data is valid or to control validity checking as with `RNA_define_verify_sdna`. use more common term `ensure`.
2021-04-30Cleanup: rename BKE_pose_channels_hash_{make => ensure}Campbell Barton
Use the term `ensure` since it makes it clear the data is not manipulated if it already exists.
2021-04-28Fix T87631: Crash undoing edit-mode bone duplicationCampbell Barton
Edit mode could leave pose channels in the object that didn't have an associated bone. These are now cleared when freeing edit-mode data.
2021-03-24Cleanup: use new BLI_assert_unreachable macroCampbell Barton
2021-03-19Cleanup: remove unused functionCampbell Barton
2021-02-25Refactor: IDTypeInfo: Add `owner_get` to get owner of embedded IDs.Bastien Montagne
This concerns currently only collections (`master_collection` of scenes) and root node trees. It removes the matching type-specific helpers (`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`). No functional change expected here. NOTE: Current implementation of `owner_get` is far from optimal, we could probably do it better, see {T69169}. NOTE: While it could also have it, shapekeys IDTypeInfo was left out of this change for now. Mainly because it sould not be used currently, and we ultimately want to demote shape keys from ID status anyway.
2021-02-10Cleanup: spellingCampbell Barton
2021-01-22LibOverride: Add an 'post apply' callback to IDTypeInfo.Bastien Montagne
Currently this is needed to properly tag PointCache's for info update (fixes an issue reported in T82503). Suspect we may need this in more cases in the future though, RNA assign/update processes are not always 100% enough to deal with complicated corner cases.
2021-01-18Armature: fix B-Bone deformation blending artifacts with Preserve Volume.Alexander Gavrilov
The double quaternion blending method in addition to the deformation matrix of each bone requires their rest matrices. For ordinary bones this literally should use the bone rest matrix without any ambiguity. However, it was also using the bone rest matrix for all of its B-Bone segments, which is incorrect and causes strange deformation in some cases involving extreme non-uniform scale, especially at boundaries between different B-Bones. There is also a similar known issue that happens with scale at bending joints, and this fix reduces the distortion when both bones are B-Bones. This changes both the Armature modifier and the Armature constraint to use the actual segment rest matrices. Unlike bones, these can have scale even in rest pose, so normalization is required. Differential Revision: https://developer.blender.org/D10003
2021-01-04Cleanup: spelling (use 'gimbal' instead of 'gimble')Campbell Barton
2020-12-15Cleanup: doxy comments (use colon after parameter name)Campbell Barton
Also remove colon after `\note`.
2020-11-27Fix T82758: Convert Proxy to Override: Local constraints aren't saved.Bastien Montagne
Ensure consistent order of pose bones. Now it should always match the one from bones in armature obdata (as exposed by e.g. RNA, i.e. children-first). Previously when some pose bones would need to be added or removed from a pose due to changes in the bone armature, or if bones in armature were re-ordered, the bones order in pose would not match anymore the one from armature, and could even become different between e.g. a proxy and its linked source. This was not really nice, but not a big issue before either. But with diffing process of override, consistent order of items between reference linked collection and local override one is crucial. Reviewed By: #animation_rigging, sybren Maniphest Tasks: T82758 Differential Revision: https://developer.blender.org/D9646
2020-11-13refactor vec_roll_to_mat3_normalized() for clarityGaia Clary
the function vec_roll_to_mat3_normalized() has a bug as described in T82455. This Differential is only for refactoring the code such that it becomes more clear what the function does and how the bug can be fixed. This differential is supposed to not introduce any functional changes. Reviewed By: sybren Differential Revision: https://developer.blender.org/D9410