Armature Modifier: Multi Modifier changes the meaning of the mask vertex group. #103074

Closed
opened 2022-12-09 16:20:14 +01:00 by Alexander Gavrilov · 12 comments

The Armature modifier provides a vertex group option, which allows limiting the area of effect of the modifier.

The modifier also has a Multi Modifier option, which when used on an Armature modifier that immediately follows another Armature modifier makes the subsequent modifier evaluate on top of the same input vertex coordinates as the first one. This effectively makes the modifiers evaluate their deformation in parallel rather than in sequence.

Main Issue

The main issue is that the Multi-Modifier evaluation mode of the modifier interprets the vertex group opposite to the normal mode.

test-armature-mask-mm.blend

{F14046805,size=full}

{F14055443,size=full}

This test has two rigs with a single bone, and a number of meshes weighted to give that bone full influence over the whole mesh. However, they also have vertex group A and B, painted to cover the top and bottom of the mesh correspondingly.

The first two meshes only use a single Armature modifier, using the corresponding rig and mask vertex group. This interprets the group to specify the area affected by the corresponding modifier.

The third mesh uses two modifiers in a Multi-Modifier setup to combine the effect of the two rigs. However, unexpectedly, the vertex group on the second modifier has to be inverted. Effectively, the vertex group in the Multi-Modifier mode specifies the area not affected by the corresponding modifier.

Secondary Issue

However, the worst part is that this difference depends not on the value of the Multi Modifier checkbox, but on whether the modifier is actually evaluated in this mode.

In the last example the first modifier (using rig A with group A) is muted, switching the evaluation of the second one (rig B, inverted group B) to normal mode - and this interprets the vertex group regularly, deforming the top (i.e. inverse of bottom marked by B) using rig B.

Compatibility Concerns

This is easy to fix, but the main concern is backward compatibility.

The most conservative solution is to address only the secondary issue, making the behavior depend purely on the Multi Modifier setting. This only affects cases where the Multi Modifier option is enabled, but doesn't actually work. Versioning could disable the Multi-Modifier option in such cases to upgrade the files in a backward and forward compatible way.

A full fix would make files non forward compatible, and would affect Python code that generates Armature modifier setups in a way that can only be detected by checking the Blender version.

The Armature modifier provides a vertex group option, which allows limiting the area of effect of the modifier. The modifier also has a Multi Modifier option, which when used on an Armature modifier that immediately follows another Armature modifier makes the subsequent modifier evaluate on top of the same input vertex coordinates as the first one. This effectively makes the modifiers evaluate their deformation in parallel rather than in sequence. # Main Issue The main issue is that the Multi-Modifier evaluation mode of the modifier interprets the vertex group opposite to the normal mode. [test-armature-mask-mm.blend](https://archive.blender.org/developer/F14046828/test-armature-mask-mm.blend) {[F14046805](https://archive.blender.org/developer/F14046805/test-armature-mask-mm.png),size=full} {[F14055443](https://archive.blender.org/developer/F14055443/2022-12-13_06.21.35.gif),size=full} This test has two rigs with a single bone, and a number of meshes weighted to give that bone full influence over the whole mesh. However, they also have vertex group A and B, painted to cover the top and bottom of the mesh correspondingly. The first two meshes only use a single Armature modifier, using the corresponding rig and mask vertex group. This interprets the group to specify the area *affected* by the corresponding modifier. The third mesh uses two modifiers in a Multi-Modifier setup to combine the effect of the two rigs. However, unexpectedly, the vertex group on the second modifier has to be inverted. Effectively, the vertex group in the Multi-Modifier mode specifies the area *not affected* by the corresponding modifier. # Secondary Issue However, the worst part is that this difference depends not on the value of the Multi Modifier checkbox, but on whether the modifier is actually evaluated in this mode. In the last example the first modifier (using rig A with group A) is muted, switching the evaluation of the second one (rig B, inverted group B) to normal mode - and this interprets the vertex group regularly, deforming the top (i.e. inverse of bottom marked by B) using rig B. # Compatibility Concerns This is easy to fix, but the main concern is backward compatibility. The most conservative solution is to address only the secondary issue, making the behavior depend purely on the Multi Modifier setting. This only affects cases where the Multi Modifier option is enabled, but doesn't actually work. Versioning could disable the Multi-Modifier option in such cases to upgrade the files in a backward and forward compatible way. A full fix would make files non forward compatible, and would affect Python code that generates Armature modifier setups in a way that can only be detected by checking the Blender version.
Author
Member

Added subscriber: @angavrilov

Added subscriber: @angavrilov
Alexander Gavrilov self-assigned this 2022-12-09 16:21:02 +01:00
Author
Member

Added subscribers: @dr.sybren, @jpbouza-4, @Mets

Added subscribers: @dr.sybren, @jpbouza-4, @Mets
Author
Member

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

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

Added subscriber: @icappiello

Added subscriber: @icappiello
Member

Added subscriber: @BClark

Added subscriber: @BClark

This was discussed in today's module meeting. The conclusion:

  • Yes, this behaviour seems rather buggy & arbitrary.
  • The chance of this property being set by Python code (for example in a rig generation script) is expected to be rather low. I did a quick search, and none of the Blender addons in A and blender/blender-addons@C mention the property. Nobody on Blender Stack Exchange asks about it.
  • There is one question on Blender Stack Exchange about the checkbox (the above link checks for the Python property name), and in the comments you can see that this person had to invert the weight group.

So it seems like a great thing to fix, especially with nice versioning code to adjust existing files.

This was discussed in [today's module meeting](https://devtalk.blender.org/t/2022-12-13-animation-rigging-off-schedule-module-meeting/26875). The conclusion: - Yes, this behaviour seems rather buggy & arbitrary. - The chance of this property being set by Python code (for example in a rig generation script) is expected to be rather low. I did a quick search, and none of the Blender addons in A and blender/blender-addons@C mention the property. Nobody on [Blender Stack Exchange](https://blender.stackexchange.com/search?q=use_multi_modifier) asks about it. - There is [one question on Blender Stack Exchange](https://blender.stackexchange.com/a/140708) about the checkbox (the above link checks for the Python property name), and in the comments you can see that this person had to invert the weight group. So it seems like a great thing to fix, especially with nice versioning code to adjust existing files.

The vgroup option being inverted has always been confusing... I can only think of the Big Buck Bunny rigs using this option, hehe, so I guess it won't be too harmful to do the fix!

To tell you the truth, I was never able to understand what this multi-modifier option really does, I only know I have to use it on certain scenarios, like using mesh deform in dynamic mode, but it's really an obscure option to me.

The vgroup option being inverted has always been confusing... I can only think of the Big Buck Bunny rigs using this option, hehe, so I guess it won't be too harmful to do the fix! To tell you the truth, I was never able to understand what this multi-modifier option really does, I only know I have to use it on certain scenarios, like using mesh deform in dynamic mode, but it's really an obscure option to me.
Author
Member

In #103074#1459716, @jpbouza-4 wrote:
To tell you the truth, I was never able to understand what this multi-modifier option really does, I only know I have to use it on certain scenarios, like using mesh deform in dynamic mode, but it's really an obscure option to me.

It really isn't complicated at all, it is a hack to evaluate armatures in parallel in a linear modifier stack. Here it is expressed as a node mockup (with this bug fixed):

{F14055897,size=full}

Edit: this bug is basically swapping the two vector inputs on the second Mix node, and I suspect it may have been caused by essentially doing that accidentally in the code.

> In #103074#1459716, @jpbouza-4 wrote: > To tell you the truth, I was never able to understand what this multi-modifier option really does, I only know I have to use it on certain scenarios, like using mesh deform in dynamic mode, but it's really an obscure option to me. It really isn't complicated at all, it is a hack to evaluate armatures in parallel in a linear modifier stack. Here it is expressed as a node mockup (with this bug fixed): {[F14055897](https://archive.blender.org/developer/F14055897/multi-modifier.png),size=full} Edit: this bug is basically swapping the two vector inputs on the second Mix node, and I suspect it may have been caused by essentially doing that accidentally in the code.

This issue was referenced by ea1c31a244

This issue was referenced by ea1c31a24438442a4fa866d13af1563d76ffa3fc
Author
Member

I actually searched history and found that this behavior was seemingly introduced in 1199744188, but the reason is still unclear.

I actually searched history and found that this behavior was seemingly introduced in 1199744188, but the reason is still unclear.
Author
Member

So I made a build for this patch D16787 here for testing: https://builder.blender.org/download/patch/

It would be appreciated if the riggers here could test it and reply.

So I made a build for this patch [D16787](https://archive.blender.org/developer/D16787) here for testing: https://builder.blender.org/download/patch/ It would be appreciated if the riggers here could test it and reply.
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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#103074
No description provided.