data copy is ommitting vgroups #90087

Closed
opened 2021-07-23 18:31:43 +02:00 by Em Eckx · 15 comments

System Information
Operating system: Windows 10
Graphics card: 3090 / 3060 / 1050ti

Blender Version
Broken: (Current Builds) (3.0.0 hash: fafd21b14c23, master, 2021-07-22)
Worked: (2.93.1 hash: d6b1d35bf874, master, 2021-07-12)
Caused by 3b6ee8cee7

Short description of error

Data copy is deleting vgroup data in 3.0 builds since the 12th.

Exact steps for others to reproduce the error

Running this script deletes the vertex group which began happening in 3.0 builds after the 12th.

import bpy

# all vertices belong to a single group

context = bpy.context
obj = context.object

#get evaluated object
obj_eval = obj.evaluated_get(context.evaluated_depsgraph_get())
print(obj_eval.vertex_groups[:]) #the evaluated object has groups

# and create new mesh from it
new_mesh = bpy.data.meshes.new_from_object(obj_eval)
print(new_mesh.vertices[0].groups[0].weight) # created mesh has groups and weight

# assign new mesh to the object
obj.data = new_mesh
print(obj.vertex_groups[:]) #vertex groups are gone

this example might be more linear

import bpy

context = bpy.context
obj = context.object
print(obj.vertex_groups[:])

# this piece used to preserve vertex groups but it doesn't
obj.data = bpy.data.meshes.new_from_object(obj)
print(obj.vertex_groups[:])

This is what happens in current 3.0 builds.
kfgTvLKgYu.mp4

This is what was happening in 2.93.1LTS and 3.0.0 on the 12th and prior.
GQZC9nXt9N.mp4

Vgroup data was also part of the copy which was expected behavior. The removal of the data is the issue attempting to be outlined.

**System Information** Operating system: Windows 10 Graphics card: 3090 / 3060 / 1050ti **Blender Version** Broken: (Current Builds) (3.0.0 hash: `fafd21b14c23`, master, 2021-07-22) Worked: (2.93.1 hash: `d6b1d35bf874`, master, 2021-07-12) Caused by 3b6ee8cee7 **Short description of error** Data copy is deleting vgroup data in 3.0 builds since the 12th. **Exact steps for others to reproduce the error** Running this script deletes the vertex group which began happening in 3.0 builds after the 12th. ``` import bpy # all vertices belong to a single group context = bpy.context obj = context.object #get evaluated object obj_eval = obj.evaluated_get(context.evaluated_depsgraph_get()) print(obj_eval.vertex_groups[:]) #the evaluated object has groups # and create new mesh from it new_mesh = bpy.data.meshes.new_from_object(obj_eval) print(new_mesh.vertices[0].groups[0].weight) # created mesh has groups and weight # assign new mesh to the object obj.data = new_mesh print(obj.vertex_groups[:]) #vertex groups are gone ``` this example might be more linear ``` import bpy context = bpy.context obj = context.object print(obj.vertex_groups[:]) # this piece used to preserve vertex groups but it doesn't obj.data = bpy.data.meshes.new_from_object(obj) print(obj.vertex_groups[:]) ``` This is what happens in current 3.0 builds. [kfgTvLKgYu.mp4](https://archive.blender.org/developer/F10235086/kfgTvLKgYu.mp4) This is what was happening in 2.93.1LTS and 3.0.0 on the 12th and prior. [GQZC9nXt9N.mp4](https://archive.blender.org/developer/F10235094/GQZC9nXt9N.mp4) Vgroup data was also part of the copy which was expected behavior. The removal of the data is the issue attempting to be outlined.
Author

Added subscriber: @masterxeon1001

Added subscriber: @masterxeon1001
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

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

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

Can confirm. Possibly the culprit commit is 3b6ee8cee7 but will double check.

Can confirm. Possibly the culprit commit is 3b6ee8cee7 but will double check.
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

It looks like this function implements mesh copying from scratch.
I don't have time to test right now, but a quick fix is probably adding these lines to BKE_mesh_nomain_to_mesh:

  BKE_defgroup_copy_list(&mesh_dst->vertex_group_names, &mesh_src->vertex_group_names);
  mesh_dst->vertex_group_active_index = mesh_src->vertex_group_active_index;
It looks like this function implements mesh copying from scratch. I don't have time to test right now, but a quick fix is probably adding these lines to `BKE_mesh_nomain_to_mesh`: ``` BKE_defgroup_copy_list(&mesh_dst->vertex_group_names, &mesh_src->vertex_group_names); mesh_dst->vertex_group_active_index = mesh_src->vertex_group_active_index; ```
Member

Caused by 3b6ee8cee7. Recent regression so marking this a high priority issue.

@HooglyBoogly , sorry did not check your message. Will let you know after testing the change.

Caused by 3b6ee8cee7. Recent regression so marking this a high priority issue. @HooglyBoogly , sorry did not check your message. Will let you know after testing the change.

Added subscriber: @ManuH

Added subscriber: @ManuH
Author

The issue persists in current builds.

RCylvCJSQ9.mp4

The issue persists in current builds. [RCylvCJSQ9.mp4](https://archive.blender.org/developer/F10249934/RCylvCJSQ9.mp4)
Hans Goudey self-assigned this 2021-08-01 01:52:38 +02:00
Member

Right, it hasn't been fixed yet. I will get to it tomorrow or Monday.

Right, it hasn't been fixed yet. I will get to it tomorrow or Monday.

Added subscriber: @niewinny

Added subscriber: @niewinny

Added subscriber: @BoraSI

Added subscriber: @BoraSI

I have an issue too, projects that saved in 3.0 will lose their vertex group data if you try to open it in 2.93.X

I have an issue too, projects that saved in 3.0 will lose their vertex group data if you try to open it in 2.93.X

This issue was referenced by 263fa406cd

This issue was referenced by 263fa406cd2bc1aefe410fe735c22967ee052e22
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
No Assignees
7 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#90087
No description provided.