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-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-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-03-06Cleanup: Fix forward declaration of headersDalai Felinto
2020-02-20BLI_math: add 2x2 matrix utilitiesTiago Chaves
2020-02-20Cleanup: rename mul_m2v2 to mul_m2_v2Campbell Barton
Matches mul_m3_v3
2020-02-15Modifiers: Add option to directly specify a 2D transform for UVWarpLukas Stockner
Currently the only option is to warp based on the transform of other objects, which is inconvenient if you want to e.g. control it through a driver - you need to set up a dummy object and go through that, which is clunky and should be unneccessary. Reviewed By: brecht Differential Revision: https://developer.blender.org/D6690
2019-12-24Action Constraint: introduce a mix mode setting.Alexander Gavrilov
Currently the action channels are applied after the existing transformation, as if the action controlled a child of the bone. This is not very natural, but more importantly, the transform tools are not designed to work conveniently with an additional 'pseudo-child' transformation, resulting in effects like an unexpected pivot location. Implementing a Before mode that integrates the action channels as if applied to a parent allows using the special transform tool code intended for dealing with such constraints. Note that in either mode, Action constraints should be added in reverse order, putting a new constraint before the existing ones that the Action was keyframed to work together. In order to implement the option, extract a utility from the Copy Transform constraint code for combining transforms with special anti-shear scale handling that matches the Aligned Inherit Scale mode. The Before mode also requires switching the constraint to the Local owner space, while the After mode can still use the World space for efficiency as before. Since the constraint doesn't have an Owner space option in the UI, this has to be handled in an RNA setter. For full backward compatibility, the original simple matrix multiplication mode is preserved as the third option, but it is not recommended due to creating shear. Differential Revision: https://developer.blender.org/D6297
2019-09-06Copy Rotation: implement new mixing modes that actually work.Alexander Gavrilov
Upon close inspection, the way the Offset mode works in the Copy Rotation constraint makes no sense, and in fact, destroys the rotation of its owner unless either it's single axis, or the order is set specifically to `ZYX Euler`. Since it can't simply be changed because of backward compatibility concerns, replace the checkbox with a dropdown that provides a set of new modes that actually make sense. Specifically, add a mode that simply adds Euler components together, and two options that use matrix multiplication in different order. The Python use_offset property is replaced with compatibility stubs. Reviewers: brecht Differential Revision: https://developer.blender.org/D5640
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-20BLI: double version of some math functions.YimingWu
2019-05-07Fix T57767: Pivot point broken after scaling to 0 in a dimensionPhilipp Oeser
matrix inversion was changed in rB01c75c3765eb from own code to EIGEN for performance reasons. EIGEN would return a zero matrix on failure (resulting in the pivot always being at the object origin). This brings back the "old" matrix inversion code (which has the benifit of providing a partial solution which makes the local transform center appear correct) Reviewers: campbellbarton Maniphest Tasks: T57767 Differential Revision: https://developer.blender.org/D4804
2019-05-06Drivers: add an Average Scale option to the Transform Channel driver vars.Alexander Gavrilov
Unlike location and rotation, there is a meaningful definition of overall/average scaling via the total change in the volume. This adds an option to retrieve that via a single driver variable, instead of having to use three and an expression. Using the determinant to compute the volume scaling also allows detecting flipping due to negative scale - this is impossible to do via the three variable approach. The volume_scale functions are added purely for code readability: 'volume scale factor' is easier to understand than determinant. Differential Revision: https://developer.blender.org/D4803
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-14Complete the set of matrix multiplication functions.Alexander Gavrilov
Also, mul_m3_m3m4 was named incorrectly.
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-03-19Cleanup: comment blocksCampbell 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-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.
2018-06-29Merge branch 'master' into blender2.8Campbell Barton
2018-06-29Cleanup: trailing newlinesCampbell Barton
2018-06-17Merge branch 'master' into blender2.8Campbell Barton
2018-06-17Cleanup: trailing space for BLICampbell Barton
2017-11-14BLI: sync changes from 2.8Campbell Barton
2017-10-07Cleanup: style, duplicate includesCampbell Barton
2017-08-04BLI_math: use const args for mul_m#_seriesCampbell Barton
2017-04-26BLI_math: add helper function to extract XY 2D scale from a 4D matrix.Bastien Montagne
2016-12-01Merge branch 'master' into blender2.8Lukas Tönne
2016-11-25Math Lib: rotate matrix cleanupCampbell Barton
- Remove 'rotate_m2', unlike 'rotate_m4' it created a new matrix duplicating 'angle_to_mat2' - now used instead. (better avoid matching functions having different behavior). - Add 'axis_angle_to_mat4_single', convenience wrapper for 'axis_angle_to_mat3_single'. - Replace 'unit_m4(), rotate_m4()' with a single call to 'axis_angle_to_mat4_single'.
2016-09-25port math function from Viewport FXMike Erwin
mul_v4_m4v3(r, M, v) means r = M * vec4(v, 1.0) Based on rB194998766c65
2016-09-25specialize mat3 multiply routinesMike Erwin
Same as 5c6baf1ee9754e39392926cd077bb2097baf39b9 but for 3x3 matrices.
2016-09-25specialize mat4 multiply routinesMike Erwin
mul_m4_m4m4(R, A, B) gives us R = AB in general. Existing code assumed the worst, that A and B both alias the output R. For safety it makes internal copies of A and B before calculating & writing R. This is the least common case. Usually all 3 matrices differ. Often we see M = AM or M = MB, but never M = MM. With this revision mul_m4_m4m4 is called in exactly the same way but copies inputs only when needed. If you know the inputs are independent of the output use the "uniq" variant to skip the saftety checks.
2016-09-24constify BLI_math_matrix inputsMike Erwin
GPU_matrix needs this very soon, and it's good practice in general. also sprinkled in some TODOs for later
2016-06-23Fix minor typo - Was m[3][4] instead of m[4][4] for a 4x4 matrixJoshua Leung
2016-06-16BLI_math: Add double versions of functionsCampbell Barton
- mul_v3_m3v3_db - mul_m3_v3_db - negate_v3_db
2016-05-13BLI_math: add 'equals_m4m4' (and 'm3' variant) helpers.Bastien Montagne
2015-12-07Added a comment to our use of the term 'adjoint' in BLI_math.Lukas Tönne
In modern usage this means the conjugate transpose, but we stick to the classical usage (i.e. adjugate matrix), like Eigen does.
2015-10-15BLI_math: add normalize_m#_ex functionsCampbell Barton
Useful when we need to use the axis lengths too.
2015-10-09BLI_math: add mat3_polar_decompose, interp_m3_m3m3 and interp_m4_m4m4.Bastien Montagne
mat3_polar_decompose gives the right polar decomposition of given matrix, as a pair (U, P) of matrices. interp_m3_m3m3 uses that polar decomposition to perform a correct matrix interpolation, even with non-uniformly scaled ones (where blend_m3_m3m3 would fail). interp_m4_m4m4 just adds translation interpolation to the _m3 variant.
2015-07-11BLI_matrix space_transform: Add a 'local-invariant' setter.Bastien Montagne
`BLI_space_transform_from_matrices()` defines a 'global-invariant' transform (same point in global space, two different coordinates in local and target spaces). New `BLI_space_transform_global_from_matrices()` is kind of opposite, it defines a 'local-invariant' transform (two different points in global space, same coordinates in local and target spaces). Useful to 'match' meshes.
2015-04-27Math Lib: add mul_v3_mat3_m4v3Campbell Barton
2014-10-30Complementary fix for rB8054372: Follow the common naming scheme byLukas Tönne
using negate_mat3_m4 instead of negate_m4. This avoids changing the behavior and only flips the 3x3 part of the matrix.
2014-10-30Math Lib: add transpose_m3_m3, m3_m4, m4_m4Campbell Barton
2014-10-30Fix negate_m3 (taking 4x4 matrix)Campbell Barton
Cycles bake used incorrectly.
2014-09-16Math Lib: add mul_v3_project_m4_v3Campbell Barton
2014-09-06Math Lib: Add copy_m2_m2, unit_m2, zero_m2Campbell Barton
2014-08-01Cleanup: Move SpaceTransform helpers from `BKE_shrinkwrap` to `BLI_math_matrix`.Bastien Montagne
2014-07-21Math Lib: rename mul_serie_m3 to mul_m3_series & reorder argsCampbell Barton
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
2014-07-20Math Lib: use variable length args for mul_serie_m3,m4 (instead of trailing ↵Campbell Barton
NULL's)
2014-06-26Code cleanup: remove MAT3/4_UNITY defines, just call unit_m3/4Campbell Barton