Data Transfer modifier & Transfer Weights operator don't work with the source on "All Layers" if the source mesh has vertex groups that the target mesh doesn't. #61255

Closed
opened 2019-02-06 20:39:25 +01:00 by Demeter Dzadik · 10 comments
Member

Blender Version
Broken: Since 2.7, also broken in 2.8.
Worked: Probably never?

Short description of error
I'm trying to transfer vertex groups from all layers of a source mesh to all layers of a target mesh, matching by the vertex group name, ie default settings. This only seems to work if the target mesh has every single vertex group that the source mesh does. This seems like an unnecessary requirement for the modifier to work - It should transfer the vertex groups that exist in both meshes, and either ignore or create the ones that don't, depending on Create Data option.

In the example below I'm using the Data Transfer modifier, but the Transfer Weights operator seems to behave the same way when source is set to "All Layers". All other source settings seem to be working fine.

Exact steps for others to reproduce the error
datatransfer_bug.blend

  • Download attached blend (It's a 2.7 blend file so it should work in both that and 2.8)
  • Note that the weights in "Group1" are being transfered "from"->"to" successfully.
  • Delete "Group2" in "to"
  • "Group1" is no longer being transferred.

I'm aware there is a button in the modifier that creates all the vertex groups in the target mesh that it needs, but I think the modifier should be working without having to press that button.

**Blender Version** Broken: Since 2.7, also broken in 2.8. Worked: Probably never? **Short description of error** I'm trying to transfer vertex groups from all layers of a source mesh to all layers of a target mesh, matching by the vertex group name, ie default settings. This only seems to work if the target mesh has every single vertex group that the source mesh does. This seems like an unnecessary requirement for the modifier to work - It should transfer the vertex groups that exist in both meshes, and either ignore or create the ones that don't, depending on Create Data option. In the example below I'm using the Data Transfer modifier, but the Transfer Weights operator seems to behave the same way when source is set to "All Layers". All other source settings seem to be working fine. **Exact steps for others to reproduce the error** [datatransfer_bug.blend](https://archive.blender.org/developer/F6530880/datatransfer_bug.blend) - Download attached blend (It's a 2.7 blend file so it should work in both that and 2.8) - Note that the weights in "Group1" are being transfered "from"->"to" successfully. - Delete "Group2" in "to" - "Group1" is no longer being transferred. I'm aware there is a button in the modifier that creates all the vertex groups in the target mesh that it needs, but I think the modifier should be working without having to press that button.
Author
Member

Added subscriber: @Mets

Added subscriber: @Mets
Bastien Montagne was assigned by Campbell Barton 2019-02-07 00:12:17 +01:00
Demeter Dzadik changed title from Data Transfer modifier doesn't work at all if the source mesh has ANY vertex groups that the target mesh doesn't. to Data Transfer modifier & Transfer Weights operator don't work with the source on "All Layers" if the source mesh has vertex groups that the target mesh doesn't. 2019-02-07 00:57:34 +01:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

No, modifier should absolutely not create missing vgroups, never ever. Because vgroups are actually defined in the object, not the mesh (while weights are being stored in mesh's custom data). Yes, this design is (very) bad, and has been biting us for ages, adding lots of limitations and weird/buggy behaviors (try to assign the same mesh to two objects with different vgroups…).

But modifiers shall absolutely not modify object itself, since that would be no more 'on the fly' changes. So thanks for the report, but having to use the Generate Data Layers button is considered a known limitation of current data design, definitively not a bug.

No, modifier should absolutely not create missing vgroups, never ever. Because vgroups are actually defined in the object, not the mesh (while weights are being stored in mesh's custom data). Yes, this design is (very) bad, and has been biting us for ages, adding lots of limitations and weird/buggy behaviors (try to assign the same mesh to two objects with different vgroups…). But modifiers shall absolutely not modify object itself, since that would be no more 'on the fly' changes. So thanks for the report, but having to use the Generate Data Layers button is considered a known limitation of current data design, definitively not a bug.
Author
Member

Thanks Mont, I understand, that explains why the modifier isn't allowed to create vertex groups, but! I still think that it should transfer the weights from vertex groups that exist on the source mesh into matching vertex groups that exist in the target mesh. This doesn't involve creating any new vertex groups, it just means the modifier would ignore any vertex groups that exist in the source mesh and don't exist in the target mesh. I think this behaviour would be fairly intuitive from a user perspective, and doesn't require the modifier to mess with data that is owned by the object.

Also, the Transfer Weights operator is not a modifier, so shouldn't that be allowed to change object data and add vertex groups? It already does this when the source setting is set to "Selected Pose bones" or "Deform Pose Bones". It only doesn't work with "All Layers".

Thanks Mont, I understand, that explains why the modifier isn't allowed to create vertex groups, but! I still think that it should transfer the weights from vertex groups that exist on the source mesh into matching vertex groups that exist in the target mesh. This doesn't involve creating any new vertex groups, it just means the modifier would ignore any vertex groups that exist in the source mesh and don't exist in the target mesh. I think this behaviour would be fairly intuitive from a user perspective, and doesn't require the modifier to mess with data that is owned by the object. Also, the Transfer Weights operator is not a modifier, so shouldn't that be allowed to change object data and add vertex groups? It already does this when the source setting is set to "Selected Pose bones" or "Deform Pose Bones". It only doesn't work with "All Layers".

Afaik transfer data operator works as expected (i.e. generates needed layers). Note that it works from active object (source) to all other selected objects (destinations).
Transfer Weights is same operator as data transfer, but works reversed (from selected object to active, that was done that way to mimic old weight transfer operator that existed before generic data transfer one was added).

Regarding vgroups being shared between objects and meshes data-blocks, imho this should be changed at some point yes (probably only be defined into meshes, and lattices, like any other geometry data). But that kind of change is not that easy to be made, so there is no firm plans about it currently.

Afaik transfer data operator works as expected (i.e. generates needed layers). Note that it works from active object (source) to all other selected objects (destinations). Transfer Weights is same operator as data transfer, but works reversed (from selected object to active, that was done that way to mimic old weight transfer operator that existed before generic data transfer one was added). Regarding vgroups being shared between objects and meshes data-blocks, imho this should be changed at some point yes (probably only be defined into meshes, and lattices, like any other geometry data). But that kind of change is not that easy to be made, so there is no firm plans about it currently.
Author
Member

You're right in that the Data Transfer operator works as intended in the cases where "Create Data" is enabled.

However, if "Create Data" is disabled, and "Source Layers" is set to "All Layers" it will not do ANYTHING unless the destination mesh has every vertex group that the source mesh does.

transfer_weights_operator.webm

As you can see, both the source and the destination mesh has a "Group1" vgroup, and yet, it doesn't get transferred. The fact that "Group2" does not get transferred makes perfect sense since "Create Data" is turned off, but the fact that "Group1" does not get transferred just because "Group2" exists in the source mesh is really odd.

And the same thing goes for the modifier:
transfer_weights_modifier.webm

I see no reason why the weights in "Group1" shouldn't be transferred just because "Group2" doesn't exist. I'm assuming the code checks if ALL of the source vertex groups can be found in the destination object, and if not, it will do absolutely nothing. Instead, it should make a list of the vertex groups that DO exist in the destination object, and transfer the weights from just those groups, ignoring the rest.

So I still definitely think that there is a bug to be fixed here! Probably two for the price of one, even! :)

You're right in that the Data Transfer operator works as intended in the cases where "Create Data" is enabled. However, if "Create Data" is disabled, and "Source Layers" is set to "All Layers" it will not do ANYTHING unless the destination mesh has every vertex group that the source mesh does. [transfer_weights_operator.webm](https://archive.blender.org/developer/F6539766/transfer_weights_operator.webm) As you can see, both the source and the destination mesh has a "Group1" vgroup, and yet, it doesn't get transferred. The fact that "Group2" does not get transferred makes perfect sense since "Create Data" is turned off, but the fact that "Group1" does not get transferred just because "Group2" exists in the source mesh is really odd. And the same thing goes for the modifier: [transfer_weights_modifier.webm](https://archive.blender.org/developer/F6539810/transfer_weights_modifier.webm) I see no reason why the weights in "Group1" shouldn't be transferred just because "Group2" doesn't exist. I'm assuming the code checks if ALL of the source vertex groups can be found in the destination object, and if not, it will do absolutely nothing. Instead, it should make a list of the vertex groups that DO exist in the destination object, and transfer the weights from just those groups, ignoring the rest. So I still definitely think that there is a bug to be fixed here! Probably two for the price of one, even! :)

Well, that’s not really a bug, as in, code was written to behave that way (abort/do nothing in case some destination vgroups are missing). But I agree it would be better in fact to transfer what we can, will change that (will indeed affect both operator and modifier, since they share 99% of the code ;) ).

Well, that’s not really a bug, as in, code was written to behave that way (abort/do nothing in case some destination vgroups are missing). But I agree it would be better in fact to transfer what we can, will change that (will indeed affect both operator and modifier, since they share 99% of the code ;) ).

This issue was referenced by 0e3475b00d

This issue was referenced by 0e3475b00d44bc0220cee84d28daacaa6735f62f

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'
Author
Member

I love you!

I love you!
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
3 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#61255
No description provided.