Broken Shrinkwrap Modifier (and Bendy Bones) #73840

Closed
opened 2020-02-15 16:12:51 +01:00 by Evan Biesaga · 15 comments

System Information
Operating system: Windows 10 1909
Graphics card: Nvidia GeForce RTX 2070

Blender Version
Broken: 2.82, 2020-2-16
Worked: 2.81-adfe68e2025b-windows64 d1657b406e

Short description of error
The shrinkwrap modifier seems to have a completely different algorithm in this new version of Blender. The eyebrows, which I projected onto her face, worked perfect in 2.81, but is completely distorted in 2.82
2.81 on top, 2.82 on the bottom.
{F8341304}2.82.png

File
clothes.blend

EDIT Upon closer inspection, it's a problem of both shrinkwrap AND bendy bones. For some reason, the roll of the bendy bones are really messed up.

**System Information** Operating system: Windows 10 1909 Graphics card: Nvidia GeForce RTX 2070 **Blender Version** Broken: 2.82, 2020-2-16 Worked: 2.81-adfe68e2025b-windows64 d1657b406e **Short description of error** The shrinkwrap modifier seems to have a completely different algorithm in this new version of Blender. The eyebrows, which I projected onto her face, worked perfect in 2.81, but is completely distorted in 2.82 2.81 on top, 2.82 on the bottom. {[F8341304](https://archive.blender.org/developer/F8341304/2.81.png)}![2.82.png](https://archive.blender.org/developer/F8341303/2.82.png) **File** [clothes.blend](https://archive.blender.org/developer/F8341288/clothes.blend) **EDIT** Upon closer inspection, it's a problem of both shrinkwrap AND bendy bones. For some reason, the roll of the bendy bones are really messed up.
Author

Added subscriber: @sagaevan

Added subscriber: @sagaevan
Evan Biesaga changed title from Broken Shrinkwrap Modifier to Broken Shrinkwrap Modifier (and Bendy Bones) 2020-02-15 16:33:17 +01:00

Added subscriber: @CodyWinchester

Added subscriber: @CodyWinchester

I have been looking into this and it seems this has nothing to do with the shrinkwrap modifier. It is the result of changes to the bbone roll calculation.

I have isolated the issue to the changes made in this patch https://developer.blender.org/rBd1657b406ed0f3df9e1690cd445702c6178ffd15

If I reverse the patch the provided file works as it did in 2.81a.

Also, the provided file has the bones using Absolute custom handles and the Start custom handle bone has its head at the same coord as the bbones head which causes roll issues.

I have been looking into this and it seems this has nothing to do with the shrinkwrap modifier. It is the result of changes to the bbone roll calculation. I have isolated the issue to the changes made in this patch https://developer.blender.org/rBd1657b406ed0f3df9e1690cd445702c6178ffd15 If I reverse the patch the provided file works as it did in 2.81a. Also, the provided file has the bones using Absolute custom handles and the Start custom handle bone has its head at the same coord as the bbones head which causes roll issues.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author

Aaah! Sorry, I guess I just didn't understand bendy bones. Thank you so much!

Aaah! Sorry, I guess I just didn't understand bendy bones. Thank you so much!

Added subscribers: @angavrilov, @mont29

Added subscribers: @angavrilov, @mont29
Alexander Gavrilov was assigned by Bastien Montagne 2020-02-17 15:22:45 +01:00

@angavrilov can you please check whether that behavior is expected/correct in current code? Or whether d1657b406 did introduce some regression? Thanks.

@angavrilov can you please check whether that behavior is expected/correct in current code? Or whether d1657b406 did introduce some regression? Thanks.

In #73840#872701, @CodyWinchester wrote:
Also, the provided file has the bones using Absolute custom handles and the Start custom handle bone has its head at the same coord as the bbones head which causes roll issues.

Absolute handle with position that is the same as the bbone makes no sense. It's like expecting a reasonable result from dividing 0 by 0.

> In #73840#872701, @CodyWinchester wrote: > Also, the provided file has the bones using Absolute custom handles and the Start custom handle bone has its head at the same coord as the bbones head which causes roll issues. Absolute handle with position that is the same as the bbone makes no sense. It's like expecting a reasonable result from dividing 0 by 0.

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

In #73840#873856, @mont29 wrote:
can you please check whether that behavior is expected/correct [...] Or whether d1657b406 did introduce some regression?

I think d1657b406 is a considerable improvement. I did some tests, and the old code did produce some dubious results. For example, in a case like this:

  float unit_matrix[3][3];
  unit_m3(unit_matrix);

  float vector[3] = {1.0f, 1.0f, 1.0f};
  float roll;
  mat3_vec_to_roll(unit_matrix, vector, &roll);

I would expect the roll to be zero, as the matrix performs no rotation at all. This is also the result now, but before d1657b406e it produced a roll of approximately -15 degrees. Another test case:

  const float rot_around_x[3] = {1.234f, 0.0f, 0.0f};
  eul_to_mat3(rotation_matrix, rot_around_x);

  const float between_x_and_y[3] = {1.0f, 1.0f, 0.0f};
  mat3_vec_to_roll(rotation_matrix, between_x_and_y, &roll);

Here the rotation matrix rotates 1.234 radians around the X-axis. Given that an input vector of (1, 0, 0) results in a roll of the full 1.234 radians, and an input vector (0, 1, 0) results in a zero roll, I would expect the answer for the in-between vector (1, 1, 0) to be in between these values as well. Neither the new code nor the old one produces exactly half the angle, but the new code is certainly closer, with respectively 1.111 and 0.572 radians.

In #73840#873963, @angavrilov wrote:
Absolute handle with position that is the same as the bbone makes no sense. It's like expecting a reasonable result from dividing 0 by 0.

To elaborate on this a bit more, the Custom Handles section in the Blender manual states about absolute handles:

The Bézier handle is controlled by the position of the head of the handle bone relative to the head of the current bone.

This means that there should be a positional difference between the bone positions, or the direction of the Bézier curve is undefined.
Since d1657b406e, Blender behaves differently in this undefined case, but I think that's not really a bug.

> In #73840#873856, @mont29 wrote: > can you please check whether that behavior is expected/correct [...] Or whether d1657b406 did introduce some regression? I think d1657b406 is a considerable improvement. I did some tests, and the old code did produce some dubious results. For example, in a case like this: ``` float unit_matrix[3][3]; unit_m3(unit_matrix); float vector[3] = {1.0f, 1.0f, 1.0f}; float roll; mat3_vec_to_roll(unit_matrix, vector, &roll); ``` I would expect the roll to be zero, as the matrix performs no rotation at all. This is also the result now, but before d1657b406e it produced a roll of approximately -15 degrees. Another test case: ``` const float rot_around_x[3] = {1.234f, 0.0f, 0.0f}; eul_to_mat3(rotation_matrix, rot_around_x); const float between_x_and_y[3] = {1.0f, 1.0f, 0.0f}; mat3_vec_to_roll(rotation_matrix, between_x_and_y, &roll); ``` Here the rotation matrix rotates 1.234 radians around the X-axis. Given that an input vector of `(1, 0, 0)` results in a roll of the full 1.234 radians, and an input vector `(0, 1, 0)` results in a zero roll, I would expect the answer for the in-between vector `(1, 1, 0)` to be in between these values as well. Neither the new code nor the old one produces exactly half the angle, but the new code is certainly closer, with respectively 1.111 and 0.572 radians. > In #73840#873963, @angavrilov wrote: > Absolute handle with position that is the same as the bbone makes no sense. It's like expecting a reasonable result from dividing 0 by 0. To elaborate on this a bit more, [the Custom Handles section in the Blender manual](https://docs.blender.org/manual/en/dev/animation/armatures/bones/properties/bendy_bones.html#custom-handles) states about absolute handles: > The Bézier handle is controlled by the position of the head of the handle bone relative to the head of the current bone. This means that there should be a positional difference between the bone positions, or the direction of the Bézier curve is undefined. Since d1657b406e, Blender behaves differently in this undefined case, but I think that's not really a bug.

For a more practical answer, if you want handle controls that are located at the head/tail of the bbone, you probably want to use the Tangent mode. Absolute is just the default 'connected chain' mode that allows manually selecting the adjacent bone of the chain, instead of automatically using parent/child.

For a more practical answer, if you want handle controls that are located at the head/tail of the bbone, you probably want to use the Tangent mode. Absolute is just the default 'connected chain' mode that allows manually selecting the adjacent bone of the chain, instead of automatically using parent/child.

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

@sagaevan I did a quick test with the left eyebrow, and the rig works a lot better with @angavrilov 's suggestion of setting the handle type to Tangent. It does require a flip ({key Alt+F} in edit mode) of the eyebrow control.L bone to work properly, though. Is this a solution you could work with?

@sagaevan I did a quick test with the left eyebrow, and the rig works a lot better with @angavrilov 's suggestion of setting the handle type to Tangent. It does require a flip ({key Alt+F} in edit mode) of the eyebrow control.L bone to work properly, though. Is this a solution you could work with?

Changed status from 'Needs User Info' to: 'Resolved'

Changed status from 'Needs User Info' to: 'Resolved'

I have clarified the requirement (that there should be a distance between the bones) in the manual, see rBM6742.

I'll assume that the silence implies that this issue is indeed solved. If this is not the case, please open a new report with more detail about the issue.

I have clarified the requirement (that there should be a distance between the bones) in the manual, see rBM6742. I'll assume that the silence implies that this issue is indeed solved. If this is not the case, please open a new report with more detail about the issue.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#73840
No description provided.