Applying Data Transfer Modifier - only the active Shape Key is taken into account #103929

Open
opened 2023-01-17 00:04:43 +01:00 by cmto · 8 comments

System Information
Operating system: Win 10 x64
Graphics card: 3080 TI

Blender Version
Broken: 3.3.2, 86abbf7176, master, 2022-11-28
Worked: ??

When applying data transfer modifier to an object (to transfer vertex groups), it only takes into account the selected shape key, not all others too.

Example:

Download test Blend:
datatransfer_shapekeys.blend

This is the cube's vertex group:
image.png

Plane is moved down by shape key "Key 1". All looks good in the viewport, this is how the vertex group should look when you apply it:
image.png

But if the 'Basis' shape key is selected instead of 'Key 1' when you apply the modifier, it ignores Key 1.
image.png

See how the position of the vertex weight is off as compared to the first picture, as if Key 1 were disabled.
image.png

But if you were to have Key 1 selected when you apply the modifier, it works as expected:
image.png

This is troublesome with objects that have many shape keys, all with different influences on the affected area. When you apply the modifier, it should take into account every active shape key.

This gets even less predictable if you have multiple shapekeys besides the Basis shapekey.
Here I have two (both with 0.5 weight).
You get different results selecting Key 1 or Key 2 and none look like what you had in the viewport:
datatransfer_shapekeys_multiple.blend

**System Information** Operating system: Win 10 x64 Graphics card: 3080 TI **Blender Version** Broken: 3.3.2, 86abbf717691, master, 2022-11-28 Worked: ?? When applying data transfer modifier to an object (to transfer vertex groups), it only takes into account the selected shape key, not all others too. Example: Download test Blend: [datatransfer_shapekeys.blend](https://archive.blender.org/developer/F14154460/datatransfer_shapekeys.blend) This is the cube's vertex group: ![image.png](https://archive.blender.org/developer/F14154959/image.png) Plane is moved down by shape key "Key 1". All looks good in the viewport, this is how the vertex group should look when you apply it: ![image.png](https://archive.blender.org/developer/F14154462/image.png) But if the 'Basis' shape key is selected instead of 'Key 1' when you apply the modifier, it ignores Key 1. ![image.png](https://archive.blender.org/developer/F14154470/image.png) See how the position of the vertex weight is off as compared to the first picture, as if Key 1 were disabled. ![image.png](https://archive.blender.org/developer/F14154466/image.png) But if you were to have Key 1 selected when you apply the modifier, it works as expected: ![image.png](https://archive.blender.org/developer/F14154477/image.png) This is troublesome with objects that have many shape keys, all with different influences on the affected area. When you apply the modifier, it should take into account every active shape key. This gets even less predictable if you have multiple shapekeys besides the `Basis` shapekey. Here I have two (both with 0.5 weight). You get different results selecting `Key 1` or `Key 2` and none look like what you had in the viewport: [datatransfer_shapekeys_multiple.blend](https://archive.blender.org/developer/F14171447/datatransfer_shapekeys_multiple.blend)
Author

Added subscriber: @CHARLES-MURRAY

Added subscriber: @CHARLES-MURRAY
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

#90276 (ShapeKey does not "see" modified Vertex Group (e.g. proximity modifier, dynamic paint)) might be related, needs a bit more checking though.

NOTE: in 3.5 there also seems to be a bug (in that if you select Key 1 and then apply the Data Transfer modifier, you seem to loose the shapekey shape alltogether)

#90276 (ShapeKey does not "see" modified Vertex Group (e.g. proximity modifier, dynamic paint)) might be related, needs a bit more checking though. NOTE: in 3.5 there also seems to be a bug (in that if you select `Key 1` and then apply the Data Transfer modifier, you seem to loose the shapekey shape alltogether)
Member

In #103929#1475383, @lichtwerk wrote:
NOTE: in 3.5 there also seems to be a bug (in that if you select Key 1 and then apply the Data Transfer modifier, you seem to loose the shapekey shape alltogether)

I reported this separately, see #103937 (Regression: applying NonGeometrical modifiers (UVProject, DataTransfer, ...) looses shape key data)

> In #103929#1475383, @lichtwerk wrote: > NOTE: in 3.5 there also seems to be a bug (in that if you select `Key 1` and then apply the Data Transfer modifier, you seem to loose the shapekey shape alltogether) I reported this separately, see #103937 (Regression: applying NonGeometrical modifiers (UVProject, DataTransfer, ...) looses shape key data)
Member

So first intuition was to use geometry nodes instead as a workaround:

geometrynodes_shapekeys.blend

But then again, you cannot apply that modifier with shapekeys...
Off to a closer look now...

So first intuition was to use geometry nodes instead as a workaround: [geometrynodes_shapekeys.blend](https://archive.blender.org/developer/F14171086/geometrynodes_shapekeys.blend) But then again, you cannot apply that modifier with shapekeys... Off to a closer look now...
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Added subscribers: @mont29, @ideasman42, @JosephEagar, @dr.sybren

Added subscribers: @mont29, @ideasman42, @JosephEagar, @dr.sybren
Member

Hm, so after a bit of digging, I found that this has its origins way back in 798e0b02c0

Since above commit, the selected shapekey is "applied fully" during create_applied_mesh_for_modifier (if you can apply a modifier with shapekeys at all -- only eModifierTypeType_NonGeometrical can) via BKE_keyblock_convert_to_mesh.

There have been a couple of related commits (even though these dont really affect the behavior):

This gets even less predictable if you have multiple shapekeys besides the Basis shapekey.
Here I have two (both with 0.5 weight).
You get different results selecting Key 1 or Key 2 and none look like what you had in the viewport:
datatransfer_shapekeys_multiple.blend

Calling create_applied_mesh_for_modifier with both use_virtual_modifiers & build_shapekey_layers as true fixes the issue (but that in return results in #97758, see above)

I would like input from developers that touched this area:

CC @ideasman42
CC @JosephEagar
CC @dr.sybren
CC @mont29

Hm, so after a bit of digging, I found that this has its origins way back in 798e0b02c0 Since above commit, the selected shapekey is "applied fully" during `create_applied_mesh_for_modifier` (if you can apply a modifier with shapekeys at all -- only `eModifierTypeType_NonGeometrical` can) via `BKE_keyblock_convert_to_mesh`. There have been a couple of related commits (even though these dont really affect the behavior): - 929a210608 - 65c5ebf577 This gets even less predictable if you have multiple shapekeys besides the `Basis` shapekey. Here I have two (both with 0.5 weight). You get different results selecting `Key 1` or `Key 2` and none look like what you had in the viewport: [datatransfer_shapekeys_multiple.blend](https://archive.blender.org/developer/F14171447/datatransfer_shapekeys_multiple.blend) Calling `create_applied_mesh_for_modifier` with both `use_virtual_modifiers` & `build_shapekey_layers` as `true` fixes the issue (but that in return results in #97758, see above) I would like input from developers that touched this area: CC @ideasman42 CC @JosephEagar CC @dr.sybren CC @mont29
Philipp Oeser changed title from Data Transfer Modifier - Shape Keys Not Counted Unless Selected to Applying Data Transfer Modifier - only the active Shape Key is taken into account 2023-01-18 12:57:55 +01:00
Philipp Oeser removed the
Interest
Animation & Rigging
label 2023-02-09 14:34:41 +01:00
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
No Assignees
2 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#103929
No description provided.