Regression: Removing shape keys via python iteration messes up normals #115572

Closed
opened 2023-11-29 15:01:25 +01:00 by Nika Kutsniashvili · 5 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.6.0 NVIDIA 537.42

Blender Version
Broken: version: 4.0.0, branch: blender-v4.0-release, commit date: 2023-11-13 17:26, hash: 878f71061b8e
Worked: 3.6.5

Caused by 383a145a19

Short description of error
This is the strangest bug but this is EXTREMELY important for my workflow, as for many others as Keymesh add-on cannot properly function without this issue getting a fix.

When you apply shape keys with bpy.ops.object.shape_key_remove(all=True, apply_mix=True) it gives wrong normals in 4.0. I don't even know what to call it. It looks completely flat, even though shape is the same it seems.

When I use transfer mesh data operator (with any random object active) and randomly check-uncheck some boxes, it returns correct normals, but I can't get that to work with python, and its impossible to do it by hand on amount of objects I'm working on.

3.6
image

4.0
image

Exact steps for others to reproduce the error
I am attaching a blend file with test example. There is a cube with shape key. In Text editor there is a script that copies object and mesh on each frame in some range, aligns them next to each other, and applies shape keys on each of them.

Open file with 3.6 and 4.0, and run script in both. In 3.6 normals will be correctly kept. In 4.0 it will be completely flat.

I hope fix can be found quickly, this feature is imperative for my studios work

**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 537.42 **Blender Version** Broken: version: 4.0.0, branch: blender-v4.0-release, commit date: 2023-11-13 17:26, hash: `878f71061b8e` Worked: 3.6.5 Caused by 383a145a19 **Short description of error** This is the strangest bug but this is EXTREMELY important for my workflow, as for many others as Keymesh add-on cannot properly function without this issue getting a fix. When you apply shape keys with `bpy.ops.object.shape_key_remove(all=True, apply_mix=True)` it gives wrong normals in 4.0. I don't even know what to call it. It looks completely flat, even though shape is the same it seems. When I use transfer mesh data operator (with any random object active) and randomly check-uncheck some boxes, it returns correct normals, but I can't get that to work with python, and its impossible to do it by hand on amount of objects I'm working on. 3.6 ![image](/attachments/280309cb-e946-4b4d-b6bc-7c4199f861af) 4.0 ![image](/attachments/2441bfa4-b4a7-4458-b92b-0033fa2bea08) **Exact steps for others to reproduce the error** I am attaching a blend file with test example. There is a cube with shape key. In Text editor there is a script that copies object and mesh on each frame in some range, aligns them next to each other, and applies shape keys on each of them. Open file with 3.6 and 4.0, and run script in both. In 3.6 normals will be correctly kept. In 4.0 it will be completely flat. I hope fix can be found quickly, this feature is imperative for my studios work
Nika Kutsniashvili added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-11-29 15:01:26 +01:00
Iliya Katushenock added the
Interest
Modeling
label 2023-11-29 15:03:31 +01:00
Member

Can confirm, will check

Can confirm, will check
Philipp Oeser added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-11-29 15:40:03 +01:00
Member

Note: as a (temporary) workaround, going in and out of editmode recalculates the normals correctly

Note: as a (temporary) workaround, going in and out of editmode recalculates the normals correctly
Member

A workaround in 4.0 seems to be calling Mesh.update() after calling bpy.ops.object.shape_key_remove(all=True, apply_mix=True).

image

A workaround in 4.0 seems to be calling `Mesh.update()` after calling `bpy.ops.object.shape_key_remove(all=True, apply_mix=True)`. ![image](/attachments/788a9b38-86e0-4005-8e08-7b2e5c534c3f)
197 KiB
Author
Contributor

Thank you both you saved my deadline! :D But prominent fix is still needed

Thank you both you saved my deadline! :D But prominent fix is still needed
Iliya Katushenock added
Module
Modeling
and removed
Interest
Modeling
labels 2023-11-29 17:02:16 +01:00
Member

Caused by 383a145a19

CC @HooglyBoogly

Possible fix in !115580

Caused by 383a145a190c620e8c0278db65cf183181fdadc7 CC @HooglyBoogly Possible fix in !115580
Philipp Oeser added
Priority
High
and removed
Priority
Normal
labels 2023-11-29 17:34:42 +01:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-11-29 18:18:40 +01:00
Brecht Van Lommel added
Type
Bug
and removed
Type
Report
labels 2023-12-11 16:02:36 +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
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#115572
No description provided.