Custom split normal data on negative or non-uniform scaled geometries gets broken upon applying scale #121831

Open
opened 2024-05-15 16:50:43 +02:00 by Martin-Lorentzon · 10 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: Quadro RTX 5000 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 516.69

Blender Version
Broken version: 4.2.0 Alpha, branch: main, commit date: 2024-05-15 08:16, hash: ed2be4c89f59
Broken version: 4.1.0
Broken version: 4.0
Broken version: 3.6.10 & 3.6 LTS
Broken version: 3.3LTS

Short description of error
Custom split normal data on negative or non-uniform scaled geometries gets broken upon applying scale.
This alone makes Blender difficult to work with when smooth decimated surfaces for optimized graphics are a requirement and they happen to come in as mirrored along one or multiple axes.

Exact steps for others to reproduce the error
Select Suzanne > Ctrl + A > (Apply) Scale

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: Quadro RTX 5000 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 516.69 **Blender Version** Broken version: 4.2.0 Alpha, branch: main, commit date: 2024-05-15 08:16, hash: `ed2be4c89f59` Broken version: 4.1.0 Broken version: 4.0 Broken version: 3.6.10 & 3.6 LTS Broken version: 3.3LTS **Short description of error** Custom split normal data on negative or non-uniform scaled geometries gets broken upon applying scale. This alone makes Blender difficult to work with when smooth decimated surfaces for optimized graphics are a requirement and they happen to come in as mirrored along one or multiple axes. **Exact steps for others to reproduce the error** Select Suzanne > Ctrl + A > (Apply) Scale
Martin-Lorentzon added the
Status
Needs Triage
Type
Report
Priority
Normal
labels 2024-05-15 16:50:44 +02:00
Member

Can confirm. I also had this problem when importing models, thought it's just some broken normals. Looks like it's a bug with applying transform 🤔

Does not happen in 4.0 apparently (and when importing other model + scaling works as well). Will raise priority

Can confirm. I also had this problem when importing models, thought it's just some broken normals. Looks like it's a bug with applying transform 🤔 Does not happen in 4.0 apparently (and when importing other model + scaling works as well). Will raise priority
YimingWu added
Module
Modeling
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-05-16 03:28:36 +02:00
YimingWu added
Priority
High
and removed
Priority
Normal
labels 2024-05-16 03:31:22 +02:00
Member

Does not happen in 4.0 apparently (and when importing other model + scaling works as well). Will raise priority

This is also broken in 4.0, 3.6LTS, 3.3LTS for me.
@ChengduLittleA : did you enable Normals > Auto Smooth in those versions?

Will lower the prio for now...

> Does not happen in 4.0 apparently (and when importing other model + scaling works as well). Will raise priority This is also broken in 4.0, 3.6LTS, 3.3LTS for me. @ChengduLittleA : did you enable `Normals` > `Auto Smooth` in those versions? Will lower the prio for now...
Philipp Oeser added
Priority
Normal
and removed
Priority
High
labels 2024-05-16 08:57:40 +02:00
Member

@lichtwerk Well I did not specifically turn that option on 🤔, if it does then it's from the importer

@lichtwerk Well I did not specifically turn that option on 🤔, if it does then it's from the importer
Member

NOTE: could be that something like 93c8955a72 helps here (applying scale is not really a topo operation though...), or just something corresponding to multiresModifier_scale_disp ?

NOTE: could be that something like 93c8955a722b helps here (applying scale is not really a topo operation though...), or just something corresponding to `multiresModifier_scale_disp` ?
Member

@lichtwerk Well I did not specifically turn that option on 🤔, if it does then it's from the importer

If the option is not ON in older versions, you are not looking at custom normals ;) (they are only used with that option ON)

> @lichtwerk Well I did not specifically turn that option on 🤔, if it does then it's from the importer If the option is not ON in older versions, you are not looking at custom normals ;) (they are only used with that option ON)
Member

Also fails with positive, but non-uniform scaling (assume just anything where CornerNormalSpaceArray also changes?)

@HooglyBoogly might be interested?

Also fails with positive, but non-uniform scaling (assume just anything where `CornerNormalSpaceArray` also changes?) @HooglyBoogly might be interested?
Philipp Oeser changed title from Custom split normal data on mirrored(negative scale) geometries gets broken upon applying scale to Custom split normal data on negative or non-uniform scaled geometries gets broken upon applying scale 2024-05-16 10:12:40 +02:00

Updated the issue with finds higher up. I can also confirm that it's broken in b4.0, just forgot to add it to the original post.

Updated the issue with finds higher up. I can also confirm that it's broken in b4.0, just forgot to add it to the original post.

I found this thread which handles one specific case of the issue.
If anyone wants to join me in trying to generalize and update it for b4.1 (and b4.2 LTS) (with the updated mesh API) it would be very much appreciated.
This is of course not the ideal solution but would certainly help in dealing with the issue.

I found this [thread](https://blender.stackexchange.com/questions/212632/apply-1-x-scale-mirror-to-object-mesh-and-keep-custom-normals-with-python) which handles one specific case of the issue. If anyone wants to join me in trying to generalize and update it for b4.1 (and b4.2 LTS) (with the updated mesh API) it would be very much appreciated. This is of course not the _ideal_ solution but would certainly help in dealing with the issue.

I managed to get something that may work(?)
It could be cleaned up but feel free to point out any mistakes

Edit:
There are a couple mistakes, I will work on correcting the code

Edit 2:
Slightly corrected code (Missing if statement for flipping faces fixed):

Edit 3:
Made a cleaned up version, and included a few comments...
I'm not sure I can further improve it on my own - it solves the issue for negative scaled meshes but not all non-uniform ones.
Would also be nice if it handled child objects similarly to the native Apply Scale...
https://pastebin.com/KrPJ7z2A

I managed to get something that may work(?) It could be cleaned up but feel free to point out any mistakes Edit: There are a couple mistakes, I will work on correcting the code Edit 2: Slightly corrected code (Missing if statement for flipping faces fixed): Edit 3: Made a cleaned up version, and included a few comments... I'm not sure I can further improve it on my own - it solves the issue for negative scaled meshes but not all non-uniform ones. Would also be nice if it handled child objects similarly to the native Apply Scale... https://pastebin.com/KrPJ7z2A

Hello, thanks for the bug report, and investigation!

I would like to add, that this error occurs when joining objects, where one object has custom split normals and a negative scale (I did not check non uniform scales and joining objects).

Blender Version
Broken version: 4.0

Exact steps for others to reproduce the error
Select Mirrored Suzanne > Shift + select non mirrored Suzanne (So that non mirrored Suzanne is active) > Ctrl + J

It also works in the opposite selection order, breaking the normals on the non mirrored version, so the active selection always seems to keep it's split normals on joining.

(These meshes have all triangles (faces) un-welded, but it still occurs when all vertices are merged by distance, but much less noticeable)

Hello, thanks for the bug report, and investigation! I would like to add, that this error occurs when joining objects, where one object has custom split normals and a negative scale (I did not check non uniform scales and joining objects). Blender Version Broken version: 4.0 Exact steps for others to reproduce the error Select Mirrored Suzanne > Shift + select non mirrored Suzanne (So that non mirrored Suzanne is active) > Ctrl + J It also works in the opposite selection order, breaking the normals on the non mirrored version, so the active selection always seems to keep it's split normals on joining. (These meshes have all triangles (faces) un-welded, but it still occurs when all vertices are merged by distance, but much less noticeable)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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#121831
No description provided.