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-03-06Cleanup: spellingCampbell Barton
2020-02-27Constraints: replace 'Set Inverse' operator with an eval-time updateSybren A. Stüvel
This fixes {T70269}. Before this commit there was complicated code to try and compute the correct parent inverse matrix for the 'Child Of' and 'Object Solver' constraints outside the constraint evaluation. This was done mostly correctly, but did have some issues. The Set Inverse operator now defers this computation to be performed during constraint evaluation by just setting a flag. If the constraint is disabled, and thus tagging it for update in the depsgraph is not enough to trigger immediate evaluation, evaluation is forced by temporarily enabling it. This fix changes the way how the inverse matrix works when some of the channels of the constraint are disabled. Before this commit, the channel flags were used to filter both the parent and the inverse matrix. This meant that it was impossible to make an inverse matrix that would actually fully neutralize the effect of the constraint. Now only the parent matrix is filtered, while inverse is applied fully. As a result, pressing the 'Set Inverse' matrix produces the same transformation as disabling the constraint. This is also reflected in the changed values in the 'Child Of' unit test. This change is not backward compatible, but it should be OK because the old way was effectively unusable, so it is unlikely anybody relied on it. The change in matrix for the Object Solver constraint is due to a different method of computing it, which caused a slightly different floating point error that was slightly bigger than allowed by the test, so I updated the matrix values there as well. This patch was original written by @angavrilov and subsequently updated by me. Differential Revision: https://developer.blender.org/D6091
2020-02-20Cleanup: unused enumsCampbell Barton
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-12-17Fix deprecated DNA define checksCampbell Barton
Also remove dead code which checked for SPACE_TIME.
2019-11-07Stretch To: implement a mode similar to Damped Track for rotation.Alexander Gavrilov
Most of the time Stretch To is used in actual rigs, like BlenRig or Rigify, in combination with Damped Track to handle rotation before the stretch, because it produces rotations more appropriate for organic deformation, and doesn't flip because of internal gimbal lock. The prevalence of this pattern suggests that Stretch To should support that kind of rotation directly as an option. Differential Revision: https://developer.blender.org/D6134
2019-09-06Transformation Constraint: implement a Mix Mode option.Alexander Gavrilov
Allow selecting how the new location/rotation/scale is combined with the existing transformation. This is most useful for rotation, which has multiple options, and scale, which previously could only replace.
2019-09-06Copy Transforms: add a mixing mode option.Alexander Gavrilov
Allow combining location, rotation and scale at the same time, using one constraint. The mixing modes are based on matrix multiplication, but handle scale in a way that avoids creating shear. Reviewers: brecht Differential Revision: https://developer.blender.org/D5640
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-01Copy Rotation & Transform: add Euler order override options.Alexander Gavrilov
For reasons similar to drivers, it should be possible to set an explicit Euler rotation order in constraints that use Euler angles. The Transform constraint in a way approaches drivers in its use, in that it effectively alters channels using values of other channels after applying a fixed form mathematical expression. For this reason, instead of just specifying the euler order for its inputs, it uses the same enum as driver variables. However Quaternion components are converted to a weighted pseudo-angle representation as the rest of the constraint UI expects angles.
2019-08-29Copy Scale: support copying arbitrary non-uniform scale as uniform.Alexander Gavrilov
Uniform scale is superior to non-uniform scale in that it works with parenting without causing shear. Thus it is a valid desire in some cases to turn arbitrary scale into guaranteed uniform scale. Implementing this in the Copy Scale constraint allows one for instance to 'inherit scale as uniform' by disabling Inherit Scale, and using Copy Scale from parent with Offset and Make Uniform. Reviewers: brecht Differential Revision: https://developer.blender.org/D5614
2019-08-01Cleanup: misc spelling fixesCampbell Barton
T68035 by @luzpaz
2019-06-28Remove Sticky option from the Floor constraintSergey Sharybin
This option from the very beginning of its existence needed more work to make it work correct and this was never done. This option was working fine during continuous playback, when there are no skipped frames, but it was failing when AV-sync of framedrop was enabled. It was never working correct when jumping between frames, including rendering on a farm which usually does frame-range based rendering. With copy-on-write things became even more tricky, since the "stuck" flag was never preserved between re-evaluations. Fixes T65683: Sticky Option in Floor Constraint for Bones Not Working
2019-06-15Cleanup: Rename: Static Override -> Library Override.Bastien Montagne
Better to make internal code naming match official/UI naming to some extent, this will reduce confusion in the future. This is 'breaking' scripts and files that would use that feature, but since it is not yet officially supported nor exposed in 2.80, as far as that release is concerned, it is effectively a 'no functional changes' commit.
2019-05-08Copy Scale: support raising the copied scale to an arbitrary power.Alexander Gavrilov
Since scale is multiplicative, the appropriate way to partially copy it is to use power. However, the influence slider of constraints uses linear interpolation. Thus, there is no way to correctly split scale via constraints without adding this feature. In addition, this allows inverting scale by using negative powers, fulfilling the function of Copy Rotation's Invert checkboxes.
2019-05-07Spline IK: support using both original scaling and volume preservation.Alexander Gavrilov
Add a new option that makes the Spline IK solver apply volume preservation on top of the original scaling, considering the pre-IK scale of the bone as the goal volume to be preserved. This basically works similar to the Stretch To constraint, and allows easily rigging a stretchy chain that uniformly follows its parent's scaling. Since the Stretch To behavior is more familiar, the new option is on by default for newly created Spline IK constraints.
2019-05-06Maintain Volume: introduce an option switching between modes.Alexander Gavrilov
After a lot of thinking about this, I decided that all operation modes that I've tried over the past couple of years, including the original 2.79 one, have their uses after all. Thus the only reasonable solution is to add yet another option. The modes are: - Strict: The current 2.80 mode, which overrides the original scaling of the non-free axes to strictly preserve the volume. This is the most obvious way one would expect a 'Maintain Volume' constraint to work. - Uniform: The original 2.79 mode, which assumes that all axes have been scaled the same as the free one when computing the volume. This seems strange, but the net effect is that when simply scaling the object uniformly with S, the volume is preserved; however, scaling the non- free axes individually allows deviating from the locked volume. This was obviously intended as a more or less convenient UI tool. - Single Axis: My own variant of the intent of the Uniform scale, which does volume-preserving if the object is scaled just on the Free axis, while passing the non-free axis scaling through. I.e. instead of uniform S scaling, the user has to scale the object just on its primary axis to achieve constant volume. This can allow reducing the number of animation curves when only constant volume scaling is needed, or be an easier to control tool inside a complex rig.
2019-05-01Alembic: integrate cache file into the dependency graphBrecht Van Lommel
* The cache file datablock is now evaluated as part of the dependency graph, creating/freeing the Alembic file handle matching the current frame. Modifiers and constraints depend on this evaluation. * Cache file handles and readers now only exist on COW datablocks, never the original ones. * Object data paths are flushed back to the original for the user interface. * The cache file keeps a list of all readers associated with its handle, and automatically frees them when the handle is freed. This kind of sharing of data across datablocks is weak but we have no better mechanism for it. Fix T62720: Alembic sequences not working and crashing Differential Revision: https://developer.blender.org/D4774
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-16Spline IK: support changing individual bone length via Y scaling.Alexander Gavrilov
Previously Spline IK provided only two choices: either scale the length of the bone chain to fit the length of the curve, or don't scale the bone in the Y dimension at all (ignoring effects of actually fitting to the curve due to curvature and curve object scale). This patch adds a new option to use the pre-IK Y scale of the bones to adjust their length when fitted to the curve, allowing individual posing control over the length of the segments. Reviewers: brecht Differential Revision: https://developer.blender.org/D4687
2019-04-16Cleanup: trailing commasCampbell Barton
2019-03-18Cleanup: spaces around operators in DNA headersCampbell Barton
2019-03-15Cleanup: style, use doxygen for commentsCampbell Barton
2019-02-27Cleanup: use '_pad' convention for padding in all DNA structsCampbell Barton
Avoids mixing these in with regular variables in code-completion. Use char for pad members except for 'void *', to make size clearer. Removed/shrink a few redundant padding vars which were >= 8 bytes.
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.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2019-01-15Cleanup: commas at the end of enumsCampbell Barton
Without this clang-format may wrap them onto a single line.
2019-01-15Cleanup: comment line length (DNA)Campbell Barton
Prevents clang-format wrapping text before comments.
2019-01-07Cleanup: corrections to last commitCampbell Barton
2019-01-07Cleanup: move DNA comments before struct membersCampbell Barton
Needed for clang-format in some cases, see: T53211
2018-12-17Merge branch 'master' into blende2.8Campbell Barton
2018-12-17Cleanup: use bit-shifted flag definitions in DNACampbell Barton
2018-11-14Merge branch 'master' into blender2.8Campbell Barton
2018-11-14Cleanup: comment block tabsCampbell Barton
2018-11-06Implement an Armature constraint that mimics the modifier.Alexander Gavrilov
The main use one can imagine for this is adding tweak controls to parts of a model that are already deformed by multiple other major bones. It is natural to expect such locations to deform as if the tweaks aren't there by default; however currently there is no easy way to make a bone follow multiple other bones. This adds a new constraint that implements the math behind the Armature modifier, with support for explicit weights, bone envelopes, and dual quaternion blending. It can also access bones from multiple armatures at the same time (mainly because it's easier to code it that way.) This also fixes dquat_to_mat4, which wasn't used anywhere before. Differential Revision: https://developer.blender.org/D3664
2018-10-17Shrinkwrap: implement the use of smooth normals in constraint & modifier.Alexander Gavrilov
- Use smooth normals to displace in Above Surface mode. - Add an option to align an axis to the normal in the constraint. I've seen people request the alignment feature, and it seems useful. For the actual aligning I use the damped track logic. In order to conveniently keep mesh data needed for normal computation together, a new data structure is introduced. Reviewers: mont29 Differential Revision: https://developer.blender.org/D3762
2018-10-01Shrinkwrap Constraint: implement projection features from the modifier.Alexander Gavrilov
Allow raycasting in two directions and culling front or back faces. Also implement a new Invert Cull option in both constraint and modifier that can be used to aim for faces aligned with the project axis direction when raycasting both ways. Reviewers: mont29 Differential Revision: https://developer.blender.org/D3737
2018-09-26Implement additional modes for Shrinkwrap to a surface.Alexander Gavrilov
In addition to the original map to surface and Keep Above Surface, add modes that only affect vertices that are inside or outside the object. This is inspired by the Limit Distance constraint, and can be useful for crude collision detection in rigs. The inside/outside test works based on face normals and may not be completely reliable near 90 degree or sharper angles in the target. Reviewers: campbellbarton, mont29 Differential Revision: https://developer.blender.org/D3717
2018-09-24Merge branch 'master' into blender2.8Brecht Van Lommel
2018-09-24Spelling fixes in comments and descriptions, patch by luzpaz.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D3719
2018-08-13Use full transformation of B-Bone segments in Copy Transforms.Alexander Gavrilov
Currently constraints can only read the location along the spline. This obviously limits opportunities for complex bone interactions in rigs. This patch exposes access to rotation and scale as well in Copy Transforms. However, due to the way how things work, this data cannot be smoothly interpolated, and abruptly changes when switching to the next segment. Reviewers: aligorith Differential Revision: https://developer.blender.org/D3545
2018-08-13Implement multiplicative Copy Scale and make it the new default.Alexander Gavrilov
Scale is a multiplicative quantity, so adding it doesn't make sense. However, for backward compatibility reasons, and in case somebody actually desires the old additive behavior, the old way remains as an option. Without this change the only way to properly combine scale is via parenting or the complicated Transformation constraint. The new mode is turned on by a flag for file compatibility, but the RNA option is reversed so that the new behavior feels more default. Reviewers: aligorith Differential Revision: https://developer.blender.org/D3558
2018-08-13Fix dependency graph for constraints depending on B-Bone shape.Alexander Gavrilov
Some constraints have an option to take the final bezier shape of the target B-Bone into account. This shape usually depends on two other bones in addition to the target itself, so the graph should include the relevant dependencies. Reviewers: sergey Differential Revision: https://developer.blender.org/D3591
2018-06-17Merge branch 'master' into blender2.8Campbell Barton
2018-06-17Cleanup: trailing space for DNA headersCampbell Barton
2018-06-01Merge branch 'master' into blender2.8Campbell Barton
2018-06-01Cleanup: trailing whitespace (comment blocks)Campbell Barton
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-05-02Static Override: add insertion for modifiers and one constraints, fix ↵Bastien Montagne
editing of inserted items in collections. Now insertable collection items have a flag to say they are 'local' (and hence can be freely edited).