Shapekey Datablocks Unable to be Deleted #106058

Closed
opened 2023-03-23 20:56:41 +01:00 by Haggets · 1 comment

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.5.0 Core Profile Context 23.3.1.230305

Blender Version
Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: rB55485cb379f7

Short description of error
bpy.context.object.shape_key_clear() clears the object of its shapekeys and also removes the shapekey datablock in the process, but for some reason, when shape_key_clear() is used in this chain of commands it seemingly separates the shapekey datablock from their mesh datablock which causes them to remain in the scene without any way to delete them (As bpy.data.shape_keys.remove does not currently exist unlike other data types), which increases the size of the blend file dramatically with objects that have a lot of shapekeys.

Exact steps for others to reproduce the error

  1. Select an object with some shapekeys and modifiers.
  2. Run the script.

Now if you click on Purge it will show the shapekey datablocks on the "Proceed" pop up even though they're not in the list and don't have any mesh connected to them anymore, without a way to individually remove them through code (Aside from using bpy.ops.outliner.orphans_purge() which is not ideal).

Through testing i've found out that if shape_key_clear() is commented out no shapekey datablocks will show up in the purge list, but will cause the plugin to not do its intended purpose. I've attached a blend file that contains everything already setup.

Finally, i'd like to comment that this script is not mine, i've only repurposed bits of it for the purposes of another addon, the github page can be found here.

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.5.0 Core Profile Context 23.3.1.230305 **Blender Version** Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: `rB55485cb379f7` **Short description of error** bpy.context.object.shape_key_clear() clears the object of its shapekeys and also removes the shapekey datablock in the process, but for some reason, when shape_key_clear() is used in this chain of commands it seemingly separates the shapekey datablock from their mesh datablock which causes them to remain in the scene without any way to delete them (As bpy.data.shape_keys.remove does not currently exist unlike other data types), which increases the size of the blend file dramatically with objects that have a lot of shapekeys. **Exact steps for others to reproduce the error** 1. Select an object with some shapekeys and modifiers. 2. Run the script. Now if you click on Purge it will show the shapekey datablocks on the "Proceed" pop up even though they're not in the list and don't have any mesh connected to them anymore, without a way to individually remove them through code (Aside from using bpy.ops.outliner.orphans_purge() which is not ideal). Through testing i've found out that if shape_key_clear() is commented out no shapekey datablocks will show up in the purge list, but will cause the plugin to not do its intended purpose. I've attached a blend file that contains everything already setup. Finally, i'd like to comment that this script is not mine, i've only repurposed bits of it for the purposes of another addon, the github page [can be found here.](https://github.com/greisane/gret)
Haggets added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-23 20:56:42 +01:00
Member

Hi, thanks for the report. If I run C.active_object.shape_key_clear() directly in python console, it removes all shape key data from the object and they neither appear when Purge operation is called.
So some code in the script is not deleting shape-key data entirely which is not the scope of bug tracker.
For help, please try one of the community websites: https://www.blender.org/community/
If you think you found a bug, please submit a new report and carefully follow the instructions. Be sure to provide system information, Blender version, and a .blend file with exact steps to reproduce the problem.
Feel free to comment if there is misunderstanding

Hi, thanks for the report. If I run `C.active_object.shape_key_clear()` directly in python console, it removes all shape key data from the object and they neither appear when Purge operation is called. So some code in the script is not deleting shape-key data entirely which is not the scope of bug tracker. For help, please try one of the community websites: https://www.blender.org/community/ If you think you found a bug, please submit a new report and carefully follow the instructions. Be sure to provide system information, Blender version, and a .blend file with exact steps to reproduce the problem. Feel free to comment if there is misunderstanding
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-03-24 05:59:16 +01: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
2 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#106058
No description provided.