Page MenuHome

Shape key users not properly mapped when duplicating an object & mesh
Closed, ResolvedPublicBUG


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 =["Cube"]

# add a shape key

# get the new key block
kb =[0]

# print the mesh and shape key user (should match)
print("Before copy:")

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

# get the key block again, from the duplicated mesh
kb_dup =[0]

# print the duplicated mesh and shape key user (should match)
print("After copy:")

Event Timeline

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.

Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Mon, Feb 17, 8:55 AM
Richard Antalik (ISS) added a project: Python.
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".
Bastien Montagne (mont29) edited projects, added Data, Assets & I/O; removed Python.