Revision ed2df6e by Alexander Gavrilov January 9, 2021, 09:07 (GMT) |
Bone Overlay: support bone wireframe opacity settings. When weight painting the bone overlay is extremely intrusive, effectively requiring either extensive use of hiding individual bones, or disabling the whole bone overlay between selections. This addresses the issue by adding two bone opacity sliders that are used for the 'wireframe' armature drawing mode. One directly controls the opacity in a uniform way. The other one allows fade based on the depth between the near and far clip planes in order to provide an automatic visual cue about which bones are closest. |
Revision a71ee86 by Alexander Gavrilov January 9, 2021, 09:07 (GMT) |
Cloth: add a vertex group setting to exclude from object collision. This can be useful as a workaround on the boundary with the pinned vertices in some situations among other things, and completely copies the existing design of the self collision vertex group setting. Differential Revision: https://developer.blender.org/D10043 |
Revision c123d1d by Alexander Gavrilov January 9, 2021, 09:07 (GMT) |
Weight Paint: avoid creating very small values with locked weights. When painting using Auto-Normalize or Lock Relative with some groups locked, the locked weights may not add up precisely to 1 because of precision limitations, which results in creating nonzero weights close to FLT_EPSILON. With Lock Relative display mode this is very obvious and annoying (random red points amid black or blue), so add an epsilon check to consider less than 1e-6 unlocked weight to be the same as 0. In addition, in cases when no weight can be painted due to locks, don't create vertex group entries at all if they don't exist yet. Also, don't run Auto Normalize when not painting a deform group. Differential Revision: https://developer.blender.org/D10000 |
Revision 66fe48d by Alexander Gavrilov January 9, 2021, 09:07 (GMT) |
Constraints: refactor the D7437 patch adding Custom Space for constraints. As mentioned in the comments to that patch, I had an idea for a different way to do some technical aspects, but it was too complicated to force changes in the original patch. Thus I submit this follow up patch. First, instead of modifying all the get_constraint_targets and flush_constraint_targets callbacks, introduce wrapper functions for accessing constraint targets, convert all code to use them, and handle the new reference there uniformly for all constraints. This incidentally revealed a place in the Collada exporter that didn't clean up after retrieving the targets. Also, tag the special target with a flag so other code can handle it appropriately where necessary. This for instance allows dependency graph to know that the Use B-Bone Shape option doesn't affect this specific target. Finally, rename and simplify the function for initializing the custom space, and make sure it is called everywhere necessary. Differential Revision: https://developer.blender.org/D9732 |
January 9, 2021, 09:07 (GMT) |
Geometry Nodes: Enable Exposing object and collection sockets This patch allows connecting wires for object and collection socket types to the "Group Input" node, which exposes them to be adjusted in the modifier. Thanks a lot to @angavrilov for working on this. I was working on this as well, but Alexander fixed a few more issues than I did, so his version is here with some edits. The patch is composed of a few different changes: - Add code to create pointer properties in the modifier settings for object and collection sockets, and also to draw them in the UI. - Also search through the modifier's `IDProperty` settings to find IDs used by the modifier. - A bug fix in RNA_acces.c for setting pointer `IDProperty` values. - Make pointer `IDProperty` values editable. Previously there was just no need for this. Differential Revision: https://developer.blender.org/D10056 |
Revision 69a4cd8 by Alexander Gavrilov January 8, 2021, 21:59 (GMT) |
Geometry Nodes: support object and collection settings in the modifier. |
January 8, 2021, 15:11 (GMT) |
Merge branch 'master' into temp-gpencil-interpolate |
January 8, 2021, 15:10 (GMT) |
Merge branch 'master' into greasepencil-object |
Revision 9973be8 by Alexander Gavrilov January 8, 2021, 10:52 (GMT) |
Surface Deform: fix binding vertex artifacts causing spikes. There are two issues here. First, like in T81988 there are cases where the modifier would deform some vertices immediately after bind. This is caused by wrong assumptions in the code about the possible relative angles between various vectors, which can cause negative weights that don't blend correctly to appear. Specifically, it seems originally the code assumes that the centroid-point vector in the polygon plane lies somewhere between the mid-edge vectors. This is however not necessarily the case for distant vertices, because the polygon is not guaranteed to be truly planar, so normal projection may be a bit off. The code has to use signed angles and checks to support all possible angular arrangements. The second issue is very thin and long triangles, which tend to be very spatially unstable in their thin dimension, resulting in excess deformation. The code was weighting distance using the distances between the centroid and the mid-edge points, which in this case end up as nearly opposite vectors of sizable length and don't correctly represent how thin the triangle actually is. It is thus better to use centroid-to-line distances, and an additional even stricter value for the midpoint that will use only 3 vertices at evaluation time. |
Revision 8da6446 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Copy Transforms: implement Invert, Fix Shear and more Mix options. This constraint can be naturally viewed as a prototype for a future 4x4 matrix math node (or subset thereof), since its basic semantics already is matrix assignment. Thus it makes sense to add math options to this constraint to increase flexibility in the meantime. This patch adds support for several operations that would be useful: - An option to fix shear in the incoming target matrix. - An option to invert the target matrix. - More ways to combine target and owner matrix. Shear is known to cause issues for various mathematical operations, so an option to remove it at key points is useful. In the future node system this would be a separate operation, but due to the limits of the constraint stack it has to be built in for now. Inverting a matrix is also an operation that can be useful to have. For some uses it may be useful to invert components separately, so implement this by checking the Mix mode setting to avoid UI options. Finally, add two more ways to combine the matrices (multiplied by two due to the necessity for the Before/After choice). Now there are three combine modes: Full implements regular matrix multiplication as the most basic option. Split Channels combines location, rotation and scale separately. Looking at D7547 there is demand for such a mode in some cases, and even with nodes it's cumbersome to rig manually every time. Finally, Aligned emulates the 'anti-shear' Aligned Inherit Scale mode, and basically uses Full for location, and Split for rotation/scale. Differential Revision: https://developer.blender.org/D9469 |
Revision c44e9b4 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Armature: add B-Bone lengthwise scaling and custom handle scaling options. 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, but this is the legacy naming), 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. This patch addresses these deficiencies by adding Length scale inputs, and providing toggles to apply custom handle local scale channels to the now four scale-related properties. The 'Length' name is used to avoid confusion due to the X/Y vs X/Z naming. 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. A Scale Easing option is provided to multiply the easing value by the Length scale factors to synchronize them - this produces a natural scaling effect where both the shape of the curve and the scale is affected. The second issue is addressed by providing toggles for each handle that multiply each of the X, Z, Length 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. Finally, this fixes a strange behavior where the segments were not actually scaled in the Y direction to match their actual length, thus producing gaps or overlap depending on the shape of the curve. For transformation the change should be very small if enough segments are used, but this will affect the results of the Copy Transforms and Armature constraints, so a backwards compatibility option is provided. Newly created bones default to the new behavior. Differential Revision: https://developer.blender.org/D9870 |
Revision 4053af1 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Armature: fix bad B-Bone deformation blending with Preserve Volume. 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. 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. |
Revision 9cd9386 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Bone Overlay: support bone wireframe opacity settings. When weight painting the bone overlay is extremely intrusive, effectively requiring either extensive use of hiding individual bones, or disabling the whole bone overlay between selections. This addresses the issue by adding two bone opacity sliders that are used for the 'wireframe' armature drawing mode. One directly controls the opacity in a uniform way. The other one allows fade based on the depth between the near and far clip planes in order to provide an automatic visual cue about which bones are closest. |
Revision 1f590fb by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Weight Paint: avoid creating very small values with locked weights. When painting using Auto-Normalize or Lock Relative with some groups locked, the locked weights may not add up precisely to 1 because of precision limitations, which results in creating nonzero weights close to FLT_EPSILON. With Lock Relative display mode this is very obvious and annoying (random red points amid black or blue), so add an epsilon check to consider less than 1e-6 unlocked weight to be the same as 0. In addition, in cases when no weight can be painted due to locks, don't create vertex group entries at all if they don't exist yet. Also, don't run Auto Normalize when not painting a deform group. Differential Revision: https://developer.blender.org/D10000 |
Revision 1c7dae9 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Constraints: refactor the D7437 patch adding Custom Space for constraints. As mentioned in the comments to that patch, I had an idea for a different way to do some technical aspects, but it was too complicated to force changes in the original patch. Thus I submit this follow up patch. First, instead of modifying all the get_constraint_targets and flush_constraint_targets callbacks, introduce wrapper functions for accessing constraint targets, convert all code to use them, and handle the new reference there uniformly for all constraints. This incidentally revealed a place in the Collada exporter that didn't clean up after retrieving the targets. Also, tag the special target with a flag so other code can handle it appropriately where necessary. This for instance allows dependency graph to know that the Use B-Bone Shape option doesn't affect this specific target. Finally, rename and simplify the function for initializing the custom space, and make sure it is called everywhere necessary. Differential Revision: https://developer.blender.org/D9732 |
Revision dadd4fd by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Constraints: add support for a new Owner Local Space for targets. Add a new transformation space choice for bone constraints, which represent the local transformation of the bone in the constraint owner's local space. The use case for this is transferring the local (i.e. excluding the effect of parents) transformation of one bone to another one, while ignoring the difference between their rest pose orientations. Owner Local Space replaces the following setup: * A `child` bone of the `target`, rotated the same as `owner` in rest pose. * A `sibling` bone of the `target`, positioned same as `child` in rest pose and using Copy Transforms in World Space from `child`. * The `owner` bone constraint uses Local Space of `sibling`. (This analogy applies provided both bones use Local Location) Since the space list is getting long, this adds a couple of separators. Differential Revision: https://developer.blender.org/D9493 |
Revision 9b0b961 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Limit Rotation: add an Euler Order option and orthogonalize the matrix. Since Limit Rotation is based on Euler decomposition, it should allow specifying the order to use for the same reasons as Copy Rotation does, namely, if the bone uses Quaternion rotation for its animation channels, there is no way to choose the order for the constraint. In addition, add a call to orthogonalize the matrix before processing for the same reasons as D8915, and an early exit in case no limits are enabled for a bit of extra efficiency. Since the constraint goes through Euler decomposition, it would remove shear even before the change, but the rotation won't make much sense. Differential Revision: https://developer.blender.org/D9626 |
Revision eb566b6 by Alexander Gavrilov January 8, 2021, 10:29 (GMT) |
Cloth: add a vertex group setting to exclude from object collision. This can be useful as a workaround on the boundary with the pinned vertices in some situations among other things, and completely copies the existing design of the self collision vertex group setting. Differential Revision: https://developer.blender.org/D10043 |
Revision 97d76ec by Alexander Gavrilov January 7, 2021, 18:36 (GMT) |
Surface Deform: fix binding vertex artifacts causing spikes. There are two issues here. First, like in T81988 there are cases where the modifier would deform some vertices immediately after bind. This is caused by wrong assumptions in the code about the possible relative angles between various vectors, which can cause negative weights that don't blend correctly to appear. Specifically, it seems originally the code assumes that the centroid-point vector in the polygon plane lies somewhere between the mid-edge vectors. This is however not necessarily the case for distant vertices, because the polygon is not guaranteed to be truly planar, so normal projection may be a bit off. The code has to use signed angles and checks to support all possible angular arrangements. The second issue is very thin and long triangles, which tend to be very spatially unstable in their thin dimension, resulting in excess deformation. The code was weighting distance using the distances between the centroid and the mid-edge points, which in this case end up as nearly opposite vectors of sizable length and don't correctly represent how thin the triangle actually is. It is thus better to use centroid-to-line distances, and an additional even stricter value for the midpoint that will use only 3 vertices at evaluation time. |
Revision 5bd1718 by Alexander Gavrilov January 7, 2021, 18:20 (GMT) |
Bone Overlay: support bone wireframe opacity settings. When weight painting the bone overlay is extremely intrusive, effectively requiring either extensive use of hiding individual bones, or disabling the whole bone overlay between selections. This addresses the issue by adding two bone opacity sliders that are used for the 'wireframe' armature drawing mode. One directly controls the opacity in a uniform way. The other one allows fade based on the depth between the near and far clip planes in order to provide an automatic visual cue about which bones are closest. |
|