Regression: Overlay -- Measurement display error when some modifiers are present in the object. #110001

Closed
opened 2023-07-12 11:08:25 +02:00 by RedHaloStudio · 6 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.40

Blender Version
Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-07-11 20:50, hash: c728fa0663b6
Worked: dc5b99fa49

Short description of error

Viewport edge measurement display issue if mesh have some modifiers, with bevel modifier being most obvious.

Reproduce:

  • Add a bevel modifier to default cube
  • Go to edit mode
  • Enable viewport Measurement > Edge Length, values will be at weird places, apparently measuring resulting mesh instead of original mesh.

broken between 827baed610 to b894e90106


Original description:

Overlay -- Measurement display error

QQ截图20230712170313.jpg

Exact steps for others to reproduce the error
?

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.40 **Blender Version** Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-07-11 20:50, hash: `c728fa0663b6` Worked: dc5b99fa499d **Short description of error** Viewport edge measurement display issue if mesh have some modifiers, with bevel modifier being most obvious. Reproduce: - Add a bevel modifier to default cube - Go to edit mode - Enable viewport `Measurement > Edge Length`, values will be at weird places, apparently measuring resulting mesh instead of original mesh. broken between 827baed610b8 to b894e901061c ------ Original description: Overlay -- Measurement display error ![QQ截图20230712170313.jpg](/attachments/5de314ce-235e-4f8b-b562-89c9ca2c2391) **Exact steps for others to reproduce the error** ?
RedHaloStudio added the
Status
Needs Triage
Type
Report
Priority
Normal
labels 2023-07-12 11:08:25 +02:00
Member

Cannot repro here in a simple test case.
Could you please share the .blend file where this happens?

Cannot repro here in a simple test case. Could you please share the .blend file where this happens?
Philipp Oeser added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-07-12 12:08:08 +02:00
Author
No description provided.
Member

This is reproducible with any mesh with a bevel (Or some other) modifier in edit mode. Will update description.

Bevel Solidify > Convex Mirror > Bisect
图片 图片 图片
This is reproducible with any mesh with a bevel (Or some other) modifier in edit mode. Will update description. | Bevel | Solidify > Convex | Mirror > Bisect | |--|--|--| ![图片](/attachments/caf1073b-3d44-4f41-8c60-935fc8c88e33) | ![图片](/attachments/c2555a1e-00f9-4cd5-8751-39ef4a1e329f) | ![图片](/attachments/a636a819-8ec3-4bf6-bc05-0de0252b148b)
YimingWu changed title from Overlay -- Measurement display error to Overlay -- Measurement display error when some modifiers are present in the object. 2023-07-21 16:24:02 +02:00
YimingWu added
Priority
High
and removed
Priority
Normal
labels 2023-07-21 16:31:43 +02:00
YimingWu changed title from Overlay -- Measurement display error when some modifiers are present in the object. to Regression: Overlay -- Measurement display error when some modifiers are present in the object. 2023-07-21 16:31:52 +02:00
Member
Broken by 91b27ab637334383b57b8 @HooglyBoogly
Hans Goudey self-assigned this 2023-07-24 21:40:28 +02:00
Member

I'm guessing the fix is the following, but I'll wait for #110546 to test.

diff --git a/source/blender/draw/intern/draw_manager_text.cc b/source/blender/draw/intern/draw_manager_text.cc
index 57505b640e4..88f1ad19e84 100644
--- a/source/blender/draw/intern/draw_manager_text.cc
+++ b/source/blender/draw/intern/draw_manager_text.cc
@@ -18,6 +18,7 @@
 #include "BKE_global.h"
 #include "BKE_mesh.hh"
 #include "BKE_mesh_wrapper.h"
+#include "BKE_object.h"
 #include "BKE_unit.h"
 
 #include "DNA_mesh_types.h"
@@ -223,7 +224,7 @@ void DRW_text_edit_mesh_measure_stats(ARegion *region,
    */
   DRWTextStore *dt = DRW_text_cache_ensure();
   const short txt_flag = DRW_TEXT_CACHE_GLOBALSPACE;
-  Mesh *me = static_cast<Mesh *>(ob->data);
+  Mesh *me = BKE_object_get_editmesh_eval_cage(ob);
   BMEditMesh *em = me->edit_mesh;
   float v1[3], v2[3], v3[3], vmid[3], fvec[3];
   char numstr[32]; /* Stores the measurement display text here */
I'm guessing the fix is the following, but I'll wait for #110546 to test. ```diff diff --git a/source/blender/draw/intern/draw_manager_text.cc b/source/blender/draw/intern/draw_manager_text.cc index 57505b640e4..88f1ad19e84 100644 --- a/source/blender/draw/intern/draw_manager_text.cc +++ b/source/blender/draw/intern/draw_manager_text.cc @@ -18,6 +18,7 @@ #include "BKE_global.h" #include "BKE_mesh.hh" #include "BKE_mesh_wrapper.h" +#include "BKE_object.h" #include "BKE_unit.h" #include "DNA_mesh_types.h" @@ -223,7 +224,7 @@ void DRW_text_edit_mesh_measure_stats(ARegion *region, */ DRWTextStore *dt = DRW_text_cache_ensure(); const short txt_flag = DRW_TEXT_CACHE_GLOBALSPACE; - Mesh *me = static_cast<Mesh *>(ob->data); + Mesh *me = BKE_object_get_editmesh_eval_cage(ob); BMEditMesh *em = me->edit_mesh; float v1[3], v2[3], v3[3], vmid[3], fvec[3]; char numstr[32]; /* Stores the measurement display text here */ ```
Member

@HooglyBoogly The above code fixes this 👍 . The situation of #110546 also seems to be fine.

图片 图片
@HooglyBoogly The above code fixes this 👍 . The situation of #110546 also seems to be fine. | | | |---|---| | ![图片](/attachments/e3712ef6-bd1f-4d07-afec-2da571d61127) | ![图片](/attachments/7a4c3904-004c-4510-bccb-f144a76bf337) |
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2023-07-31 17:18:53 +02:00
Blender Bot added
Status
Resolved
Type
Report
and removed
Status
Confirmed
Type
Bug
labels 2023-07-31 17:18:57 +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
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#110001
No description provided.