Python: bpy.data.meshes.new_from_object() doesn't duplicate Shape Keys #112570

Closed
opened 2023-09-19 13:15:16 +02:00 by Nika Kutsniashvili · 2 comments
Contributor

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.99

Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: c7fc78b81ecb
Worked: (newest version of Blender that worked as expected)

Short description of error
Operator bpy.data.meshes.new_from_object(obj) is duplicating mesh data of the object in it's entirity, with all its attributes, except for shape keys. I assume that is because shape keys are separata data block that are linked to mesh, instead of being part of mesh.

This creates problem for Keymesh add-on and makes it impossible to do stop-motion animation mixing Keymesh and shape keys, which is a requested feature (I am maintaining Keymesh). There are some workarounds, but none efficient.

It would make the operator more complete and assist Keymesh if bpy.data.meshes.new_from_object(obj) operator also assigned shape key data-block that original mesh has to duplicated mesh (or duplicated it and assigned duplicated one). That would be expected and intuitive behavior. Especially since assigning shape keys to meshes isn't really supported in python.

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.99 **Blender Version** Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: `c7fc78b81ecb` Worked: (newest version of Blender that worked as expected) **Short description of error** Operator `bpy.data.meshes.new_from_object(obj)` is duplicating mesh data of the object in it's entirity, with all its attributes, except for shape keys. I assume that is because shape keys are separata data block that are linked to mesh, instead of being part of mesh. This creates problem for Keymesh add-on and makes it impossible to do stop-motion animation mixing Keymesh and shape keys, which is a requested feature (I am maintaining Keymesh). There are some workarounds, but none efficient. It would make the operator more complete and assist Keymesh if `bpy.data.meshes.new_from_object(obj)` operator also assigned shape key data-block that original mesh has to duplicated mesh (or duplicated it and assigned duplicated one). That would be expected and intuitive behavior. Especially since assigning shape keys to meshes isn't really supported in python.
Nika Kutsniashvili added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-09-19 13:15:17 +02:00
Nika Kutsniashvili changed title from Python: bpy.data.meshes.new_from_object(obj) doesn't duplicate Shape Keys to Python: bpy.data.meshes.new_from_object() doesn't duplicate Shape Keys 2023-09-19 13:30:20 +02:00
Member

Looks like a duplicate of #109313.

For non-evaluated mesh Objects that you need to duplicate and maintain shape keys, you should be able to use Mesh.copy() as a workaround.

Looks like a duplicate of #109313. For non-evaluated mesh Objects that you need to duplicate and maintain shape keys, you should be able to use `Mesh.copy()` as a workaround.
Member

evaluated objects get their modifiers applied (that includes the current shapekey mix), so that is expected, for non-evaluated objects, this is indeed a duplicate of #109313.

Therefor, will close as a duplicate, please subscribe in #109313 if you want further updates.

evaluated objects get their modifiers applied (that includes the current shapekey mix), so that is expected, for non-evaluated objects, this is indeed a duplicate of #109313. Therefor, will close as a duplicate, please subscribe in #109313 if you want further updates.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-09-19 15:12:56 +02:00
Philipp Oeser added
Status
Duplicate
and removed
Status
Archived
labels 2023-09-19 15:13:07 +02: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
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#112570
No description provided.