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
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
2019-04-18Armature: remove remains of the object-level deformation data cache.Alexander Gavrilov
Now that B-Bone shape data is kept in bPoseChannel_Runtime, the armature level cache only holds one quaternion value per bone. It can also be moved to runtime, and the structure removed. This has an additional effect that, as far as I can tell, now the Armature modifier can run as soon as all of the bones it actually needs are done, thus making T59848 a purely depsgraph level problem.
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-14Depsgraph: fix hard CTD on dependency cycles through POSE_INIT.Alexander Gavrilov
As reported in T63582, it can cause chan_array to be not ready. To reliably avoid crashing, the only easy way seems to be to create the index during COW -- maybe @sergey has a better idea.
2019-04-13Fix T37500: implement Bendy bone segment deformation interpolation.Alexander Gavrilov
Previously B-Bone deformation mapped every vertex to just one B-Bone segment. This results in abrupt transformation differences between the sides of each threshold plane, reducing the quality of B-Bone deformation and making the use of shape keys impractical. This commit replaces this approach with a linear blend between the two closest segment transformations, effectively representing the B-Bone as two weight-blended plain bones for each vertex. In order to distribute the interpolation more evenly along the bone, segment matrices for deformation are now computed at points between the segments and at the ends of the B-Bone. The computation also uses the true tangents of the Bezier curve for the orientation. The nodes at the end of the bone require some special handling to deal with zero-length Bezier handles caused by a zero ease value. The Copy Transforms constraint now also smoothly interpolates rotation and scaling along the bone shape when enabled. The initial version of the patch was submitted by @Sam200. Differential Revision: https://developer.blender.org/D4635
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-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-12-20Cleanup: namingCampbell Barton
2018-12-11RNA: provide access to bone parent transform math from Python.Alexander Gavrilov
Applying the effect of bone parent is much more complicated than simple matrix multiplication because of the various flags like Inherit Scale. Thus it is reasonable to provide access to this math from Python for complicated rest pose related manipulations. The simple case of this is handled by Object.convert_space, so the new method is only needed for complex tasks. Differential Revision: https://developer.blender.org/D4053
2018-12-10Cleanup: Variable namingSergey Sharybin
2018-12-02Merge branch 'master' into blender2.8Campbell Barton
2018-12-02Cleanup: BKE b-bone API namingCampbell Barton
Use BKE_pchan_bbone prefix.
2018-11-27RNA: expose access to B-Bone shape data from Python.Alexander Gavrilov
B-Bone shape is a non-trivial computation, so access to the results would be useful for Python scripts working with B-Bones, e.g. rig generation. This exposes both final segment matrices, and the tangent vectors computed from the custom handle bones. Since the handle tangents use the axis+roll orientation math of edit bones, add matrix conversion static methods to Bone. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D3983
2018-11-23Depsgraph: add a new operation node for computing B-Bone segments.Alexander Gavrilov
Computing the shape of a B-Bone is a quite expensive operation, and there are multiple constraints that can access this information in a variety of useful ways. This means computing the shape once per bone and saving it is good for performance. Since the shape may depend on the position of up to two other bones, often in a "cyclic" manner, this computation has to be a separate node with its own dependencies. Reviewers: sergey Differential Revision: https://developer.blender.org/D3975
2018-11-22Cleanup: Use proper module prefix in function namesSergey Sharybin
2018-11-20Speedup rigs with multiple objects deformed by bbonesSergey Sharybin
Previously each of the objects which has armature modifier will request deformation matricies from bbones. Thing is, all those deformations are the same and do not depend on object which is being modified. What's even worse is that this calculation is not cheap. This change makes it so bbones deformation is calculated once and stored in the armature object. After this armature modifiers simply use it. With a rigs we've got here dependency graph evaluation time goes down from 0.02 sec to 0.012 sec. Possible further optimization is to make bbone deformation calculated at the time when bone is calculated. This will avoid an extra threaded loop over all bones.
2018-11-07Depsgraph: Ensure dependency cycle does not clear runtime memorySergey Sharybin
If there was a dependency cycle involved, it was possible that pchan array will be freed before all bones are evaluated. Now clear is done in a dedicated node, which is never a part of dependency cycle.
2018-11-05Cleanup: use boolCampbell Barton
2018-10-31Allow changing B-Bone custom handle references from Pose Mode.Alexander Gavrilov
@jpbouza was rather upset these were made read-only, and unlike parents, it's not that hard to allow changing these Bone fields: all is needed is to carefully refresh the matching fields in the relevant bPoseChannel objects and properly tag update. Reviewers: brecht Differential Revision: https://developer.blender.org/D3870
2018-10-05Add and use a utility for computing B-Bone roll from custom handles.Alexander Gavrilov
This also fixes a stability problem with the start handle due to an incorrect matrix multiplication order.
2018-10-04Fix T56268: display the correct rest shape for B-Bones in Edit Mode.Alexander Gavrilov
The rest shape of B-Bones is actually affected by custom handles or the default connected parent/child mechanism. Ignoring these effects thus leads to the edit mode shape being different from the actual rest pose. This splits the b_bone_spline_setup function that is used to compute the correct rest and pose shape from pose channels into two parts, and applies the data structure independent half to edit mode. In order to access the custom handle settings in Edit Mode, they are moved to Bone and EditBone, while the bPoseChannel fields are downgraded in status to a cache for performance. Also, instead of flags, introduce an enum to specify the handle operation modes, so that new ones could be added later. Reviewers: aligorith, brecht Differential Revision: https://developer.blender.org/D3588
2018-09-24Merge branch 'master' into blender2.8Brecht Van Lommel