Shape key users not properly mapped when duplicating an object & mesh #73817

Closed
opened 2020-02-14 20:44:04 +01:00 by Christopher Gearhart · 5 comments

System Information
Operating system: Windows 10
Graphics card:

Blender Version
Broken: 2.80 - 2.82
Worked: 2.79

Short description of error

Shape key users do not get properly mapped when duplicating an object & mesh via the python interface

Exact steps for others to reproduce the error

  1. Open the default startup
  2. Run the following script:
import bpy

# get the default cube
obj = bpy.data.objects["Cube"]

# add a shape key
obj.shape_key_add()

# get the new key block
kb = obj.data.shape_keys.key_blocks[0]

# print the mesh and shape key user (should match)
print()
print("Before copy:")
print(obj.data.name)
print(kb.id_data.user.name)

# duplicate the object and the object's mesh
obj_dup = obj.copy()
obj_dup.data = obj.data.copy()
obj_dup.name = "duplicate_obj"
obj_dup.data.name = "duplicate mesh"

# get the key block again, from the duplicated mesh
kb_dup = obj_dup.data.shape_keys.key_blocks[0]

# print the duplicated mesh and shape key user (should match)
print()
print("After copy:")
print(obj_dup.data.name)
print(kb_dup.id_data.user.name)
**System Information** Operating system: Windows 10 Graphics card: <irrelevant> **Blender Version** Broken: 2.80 - 2.82 Worked: 2.79 **Short description of error** Shape key users do not get properly mapped when duplicating an object & mesh via the python interface **Exact steps for others to reproduce the error** 1. Open the default startup 2. Run the following script: ``` import bpy # get the default cube obj = bpy.data.objects["Cube"] # add a shape key obj.shape_key_add() # get the new key block kb = obj.data.shape_keys.key_blocks[0] # print the mesh and shape key user (should match) print() print("Before copy:") print(obj.data.name) print(kb.id_data.user.name) # duplicate the object and the object's mesh obj_dup = obj.copy() obj_dup.data = obj.data.copy() obj_dup.name = "duplicate_obj" obj_dup.data.name = "duplicate mesh" # get the key block again, from the duplicated mesh kb_dup = obj_dup.data.shape_keys.key_blocks[0] # print the duplicated mesh and shape key user (should match) print() print("After copy:") print(obj_dup.data.name) print(kb_dup.id_data.user.name) ```

Added subscriber: @bblanimation

Added subscriber: @bblanimation

When the blend file is saved and restarted, the following prints to the Command Line:

Error: ID MEduplicate mesh uses shapekey KEKey.001, but its 'from' pointer is invalid (0000017945F54248), fixing...

Once the invalid pointer is fixed by this automatic cleanup, the shape keys work fine.

When the blend file is saved and restarted, the following prints to the Command Line: `Error: ID MEduplicate mesh uses shapekey KEKey.001, but its 'from' pointer is invalid (0000017945F54248), fixing...` Once the invalid pointer is fixed by this automatic cleanup, the shape keys work fine.

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

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

This issue was referenced by 3a53ae8d4b

This issue was referenced by 3a53ae8d4bd3b18bdf0a9468742518584f8f49c1
Bastien Montagne self-assigned this 2020-02-17 15:47:43 +01:00

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
4 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#73817
No description provided.