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-08Cleanup: spelling in commentsCampbell Barton
Also move mis-placed doc-string.
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-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-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-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-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-08Cleanup: spelling in commentsCampbell Barton
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-07-16Cleanup: sort struct declarationsCampbell Barton
2021-07-15Animation: add function to blend Action into poseSybren A. Stüvel
Add function `BKE_pose_apply_action_blend()`, which blends a given Action into current pose. The Action is evaluated at a specified frame, and the result is applied to the armature's pose. A blend factor can be given to blend between the current pose and the one in the Action. Quaternions are interpolated with SLERP; it is assumed that their FCurves are consecutively stored in the Action. This function will be used in the upcoming new Pose Library.
2021-07-15Animation: apply pose to all or selected bones of armatureSybren A. Stüvel
New function `BKE_pose_apply_action_all_bones()`, which will be necessary for the upcoming pose library v2.0. This renames the function `BKE_pose_apply_action` to `BKE_pose_apply_action_selected_bones`, to reflect that it only works on selected bones, to contrast it to the new function.
2021-06-30Cleanup: use const arguments for accessor functionsCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
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-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-29Animation: add `PBONE_SELECTED` macroSybren A. Stüvel
Add `PBONE_SELECTED` macro to determine selection state of bones, while also taking visibility into account.
2021-03-19Cleanup: remove unused functionCampbell Barton
2021-03-05Animation: add function to apply a pose from an ActionSybren A. Stüvel
Add `BKE_pose_apply_action(object, action, anim_eval_context)` function and expose in RNA as `Pose.apply_action(action, evaluation_time)`. This makes it possible to do the following: - Have a rig in pose mode. - Select a subset of the bones. - Have some Action loaded that contains the pose you want to apply. - Run `C.object.pose.apply_pose_from_action(D.actions['PoseName'])` - The selected bones are now posed as determined by the Action. Just like Blender's current pose library, having no bones selected acts the same as having all bones selected. Manifest Task: T86159 Reviewed By: Severin Differential Revision: https://developer.blender.org/D10578
2020-10-22Pose: Add a 'pose_ensure' new utils that only rebuilds if needed.Bastien Montagne
Avoids having to spread the check logic everywhere in the code.
2020-10-07Refactor: remove `BKE_<id_type>_copy` functions.Bastien Montagne
Those were only shallow wrappers around `BKE_id_copy`, barely used (even fully unused in some cases), and we want to get rid of those ID-specific helpers for the common ID management tasks. Also prevents weird custom behaviors (like `BKE_object_copy`, who was the only basic ID copy function to reset user count of the new copy to zero). Part of 71219.
2020-10-02Fix T81345: part three, armature `free_data` was not handling editbones ↵Bastien Montagne
properly. Armature freeing would not correctly free its editbone IDProperties. Add a utils to free the whole list of edit bones, and properly handle their potential IDProperties.
2020-10-02Fix T81345, part two: crash in depsgraph when freeing COW armature.Bastien Montagne
Freeing of bones' IDproerties from Armature `free_data` callback would always attempt to do user refcounting, which should never be done from that code. This would generate crashes in depsgraph/COW context e.g.
2020-10-02Cleanup: Move `EditBone` structure definition from `ED` to `BKE` area.Bastien Montagne
Access to this structure will be needed in BKE's armature code.
2020-09-09Cleanup: use bool instead of intJacques Lucke
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
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-08-02Cleanup: pass const matricesCampbell Barton
Also order return matrices last.
2020-06-13Cleanup: use const arguments to deform functionsCampbell Barton
This changes curve deform code not to set the objects inverse matrix, this shouldn't cause problems as it's not used elsewhere afterwards.
2020-06-13Modifier: skip edit-mesh conversion for armature, curve & latticeCampbell Barton
This is an improvement over 2.7x which converted edit-mesh to mesh (CDDM) for all 3 modifiers. Overall this increases performance in edit-mode by around 15-20%.
2020-06-12Cleanup: split object data deform functions into their own filesCampbell Barton
Move armature/curve functions into their headers, they were previously in BKE_lattice.h
2020-05-19Merge branch 'blender-v2.83-release'Philipp Oeser
2020-05-19Fix T76689: Armature layers not indicating the existence of bonesSybren A. Stüvel
From what I can see, there are two issues at play in {T76689} and its merged-in report {T76590}: - In Blender ≤ 2.79 the bone layer dots were updated in the draw code. This ensured the info was up to date before drawing. This is no longer possible, as the drawing code uses evaluated objects, and those should not be written to. This has been addressed in rB709f126e8143 by calling the update function explicitly in various places in the code. The problem is that this wasn't added to all necessary spots. - When in edit mode, changes are made to the edit bones but not to the 'actual' bones (this is synced when exiting edit mode). This causes undo to mess up the layer indicators. I think both issues can be addressed by having the dependency graph update the used layer info as part of the armature evaluation. This will make the undo system work properly, and allows the removal of some `BKE_armature_refresh_layer_used()` from various places. There is still the issue that there are two functions (`BKE_armature_refresh_layer_used()` and `ED_armature_edit_refresh_layer_used()`) that are both responsible for updating `bArmature::layer_used`. This is a trickier thing to solve, though, as the definition of the `EditBone` struct resides in the armature editor module. This means that blenkernel can't iterate over edit bones, but on the other hand the dependency graph shouldn't call any editor functions either. This is why I left the `ED_armature_edit_refresh_layer_used()` calls untouched. The downside of recalculating `layer_used` from the dependency graph (at least in the way that I did it now) is that it is called every time a user moves a bone in pose mode. This frequency of updates is not necessary. Differential Revision: https://developer.blender.org/D7709
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-04-21Cleanup: added missing header to BKE_armature.hSybren A. Stüvel
No functional changes.
2020-03-29Cleanup: spelling, commentsCampbell Barton
2020-03-06Cleanup: Armature: Move to IDTypeInfo, and remove unused BKE API.Dalai Felinto
2020-03-04Refactor ID make local to use a single flag parameter.Bastien Montagne
Instead of using anonymous booleans flags, also allows to keep the same behavior in all cases, without needing special handling from calling code for our beloved oddballs object proxies...
2020-03-02Cleanup: make remaining blenkernel headers work in C++Jacques Lucke
2019-11-21Bones: implement a new Aligned Inherit Scale mode.Alexander Gavrilov
Implement one more way of inheriting scale from the parent bone, as an addition to the choices introduced in D5588. This new mode inherits parent scale as if the parent and child were not rotated relative to each other, always applying parent X scale to child X scale and so forth. It is quite natural for connected bone chains with coherent roll, like limbs or tentacles, falling roughly between Average and Fix Shear in how closely the parent scaling is followed. Currently this can be achieved by using Inherit Scale: None plus a Copy Scale with Offset from parent on the child; however, this is cumbersome, and loses the distinction between true local and inherited scale in the child's Local space. This new mode also matches how the Before/After Original mix modes work in the Copy Transforms constraint. On the technical side this mode requires adding a right side scale matrix multiplication into the Local<->Pose conversion, in addition to the existing two left side matrices used for location and orientation. Differential Revision: https://developer.blender.org/D6099
2019-09-04Armature: add Inherit Scale options to remove shear or average the scale.Alexander Gavrilov
As an inherent property of matrix-based transformation math, non- uniform scaling of a parent bone induces shear into the transform matrix of any rotated child. Such matrices cannot be cleanly decomposed into a combination of location/rotation/scale, which causes issues for rigging and animation tools. Blender bones have options to exclude rotation and/or scale from the inherited transformation, but don't have any support for removing the often undesired shear component. That goal requires replacing simple parenting with a combination of multiple bones and constraints. The same is true about the goal of inheriting some scale, but completely avoiding shear. This patch replaces the old Inherit Scale checkbox with a enum that supports multiple options: * Full: inherit all effects of scale, like with enabled Inherit Scale. * Fix Shear: removes shear from the final inherited transformation. The cleanup math is specifically designed to preserve the main axis of the bone, its length and total volume, and minimally affect roll on average. It however will not prevent reappearance of shear due to local rotation of the child or its children. * Average: inherit uniform scale that represents the parent volume. This is the simplest foolproof solution that will inherit some scale without ever causing shear. * None: completely remove scale and shear. * None (Legacy): old disabled Inherit Scale checkbox. This mode does not handle parent shear in any way, so the child is likely to end up having both scale and shear. It is retained for backward compatibility. Since many rigging-related addons access the use_inherit_scale property from Python, it is retained as a backward compatibility stub that provides the old functionality. As a side effect of reworking the code, this also fixes a matrix multiplication order bug in the Inherit Rotation code, which caused the parent local scale to be applied in world space. In rigger opinion this option is useless in production rigs, so this fix should not be a problem. Reviewers: brecht Differential Revision: https://developer.blender.org/D5588
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-08-23Armature: add BKE_armature_transformCampbell Barton
ED_armature_transform uses edit-mode conversion which re-creates bones. Needed for efficiently transforming object-data in object-mode.
2019-08-23Cleanup: const args, naming, doxy groups, clang-formatCampbell Barton
2019-07-26Fix T67507: Set origin on armature moves incorrectly parented objectsSergey Sharybin
Need to copy changes from original armature to evaluated one prior to BKE_pose_where_is(), otherwise the pose matrix in pose channels will not be correct. Can not use dependency graph update here, since we must not re-evaluate possible dependencies of the changed armature. Reviewers: brecht Reviewed By: brecht Maniphest Tasks: T67507 Differential Revision: https://developer.blender.org/D5331
2019-07-17Fix T59713: Armature layer dots not updated on changesmano-wii
`layer_used` runtime data, which controls the drawing of dots in the UI was not getting refreshed properly. This used to happen in the drawing code, but was no longer working for reasons explained in: {rB2b09062defa093a243b5fe64b099accb07b440a3} The solution was to update each layer manually in the operators: * ARMATURE_OT_bone_primitive_add * ARMATURE_OT_delete * ARMATURE_OT_dissolve * ARMATURE_OT_fill * ARMATURE_OT_merge * ARMATURE_OT_separate * ARMATURE_OT_bone_layers * POSE_OT_bone_layers Differential Revision: https://developer.blender.org/D5281
2019-05-14Armature: implement universal hash table lookup of Bone objects by name.Alexander Gavrilov
Since drivers on Bone properties are really supposed to be stored in Armature data and access bones via its bones[] collection, this lookup path should work efficiently. Mass lookup of bones by name was already done through hashes, but they were built temporarily every time that was needed. This simply replaces it with a common hash table computed immediately after file load, copy, or Edit to Object mode switch.
2019-05-01BKE_pchan: add BKE_pchan_rot_to_mat3Campbell Barton
Useful to get the un-scaled rotation from a pose channel.
2019-04-23Cleanup: rename the curveInX etc bbone DNA fields to curve_in_x etc.Alexander Gavrilov
2019-04-23B-Bones: split the Scale In/Out properties into X and Y values.Alexander Gavrilov
As far as I can tell, there is no technical reason why the B-Bone segment thickness scaling can't be separated into two axes. The only downside is the increase in complexity of the B-Bone settings, but this is inevitable due to the increase in flexibility. Updating the file is somewhat complicated though, because F-Curves and drivers have to be duplicated and updated to the new names. Reviewers: campbellbarton Subscribers: icappiello, jpbouza Differential Revision: https://developer.blender.org/D4716