Out of the edit mode, the texture space is affected by the modifiers of a mesh. #57985

Closed
opened 2018-11-21 19:24:24 +01:00 by Germano Cavalcante · 11 comments

Blender Version
Broken: 2.80 Alpha 2
Worked: 2.79.6

Short description of error
Out of edit mode, the Texture Space (me->bb) is behaving like the box bound (ob->bb).

Exact steps for others to reproduce the error
Open the attached file in blender2.79 and blender2.80. Compare the texture space of both cases.
Enter edit mode to see what should be the correct values.
textspace_bug.blend

**Blender Version** Broken: 2.80 Alpha 2 Worked: 2.79.6 **Short description of error** Out of edit mode, the Texture Space (me->bb) is behaving like the box bound (ob->bb). **Exact steps for others to reproduce the error** Open the attached file in blender2.79 and blender2.80. Compare the texture space of both cases. Enter edit mode to see what should be the correct values. [textspace_bug.blend](https://archive.blender.org/developer/F5668986/textspace_bug.blend)
Author
Member

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Bastien Montagne was assigned by Germano Cavalcante 2018-11-21 20:06:11 +01:00
Author
Member

Added subscriber: @mont29

Added subscriber: @mont29
Author
Member

@mont29, it seems you've worked with bound box recently.
Do you know why this happens?

@mont29, it seems you've worked with bound box recently. Do you know why this happens?

This is already known issue, bbox system is fully broken currently, needs complete rethink. CoW kind of forbids bbox being 'shared' between object and obdata, current situation is a complete mess. :(

This is already known issue, bbox system is fully broken currently, needs complete rethink. CoW kind of forbids bbox being 'shared' between object and obdata, current situation is a complete mess. :(

Added subscriber: @Sergey

Added subscriber: @Sergey

Ugh, this looks complicated…

Basically, in DRW_draw_render_loop_ex(), DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN returns evaluated Objects (with valid orig_id pointer) which have obdata pointers (mesh, in our case) which are also evaluated ones, but without any link to orig data (id.orig_id pointer is NULL). @Sergey summoning you here, cannot find where that 'final' eval mesh is generated??? Think those should copy over bbox/texspace from their source, but looks like they do not do it...

Texspace should only be generated from orig mesh afaik. So either depsgraph gives us evaluated obdata with access to orig one, or whole depsgraph chain ensures to copy over bbox and texco data from initial raw Mesh eval (BKE_mesh_eval_geometry(), which unless am mistaken is called on raw, just-copied-from-original mesh eval datablock, does only one thing: compute that bloody bbox).

Ugh, this looks complicated… Basically, in `DRW_draw_render_loop_ex()`, `DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN` returns evaluated Objects (with valid orig_id pointer) which have obdata pointers (mesh, in our case) which are also evaluated ones, but without any link to orig data (id.orig_id pointer is NULL). @Sergey summoning you here, cannot find *where* that 'final' eval mesh is generated??? Think those should copy over bbox/texspace from their source, but looks like they do not do it... Texspace should only be generated from orig mesh afaik. So either depsgraph gives us evaluated obdata with access to orig one, or whole depsgraph chain ensures to copy over bbox and texco data from initial raw Mesh eval (`BKE_mesh_eval_geometry()`, which unless am mistaken is called on raw, just-copied-from-original mesh eval datablock, does only one thing: compute that bloody bbox).

Evaluated mesh is calculated in BKE_object_handle_data_update(), with the last step there of BKE_object_eval_boundbox() which does copy bounding box back to the original object.

Now, this is mainly done for RNA properties and set() functions. Draw manager should stay away from original IDs, and simply handle what is given to it. Also, none of the areas shouldn't even touch orig_id.

If you want to copy something from input mesh from pre-modifier state, do so in mesh_finalize_eval(). This is up to you to do so, dependency graph can not help here. But i think it is wrong thing to do. Bounding box should always be coherent to the data it corresponds to. As in, if you copy bounding box from source mesh to a result of modifiers you are stepping into situation when re-calculating bounding box for the result mesh will give you different value.

To me proper solution here is to explicitly separate bounding box and texture space, and also sanitize things like object's bounding box (which currently will silently fall-back to data's bounding box in certain cases). If such separation is done, you would copy texture space, but keep bounding box in sync with the actual content of the evaluated mesh.

Evaluated mesh is calculated in `BKE_object_handle_data_update()`, with the last step there of `BKE_object_eval_boundbox()` which does copy bounding box back to the original object. Now, this is mainly done for RNA properties and `set()` functions. Draw manager should stay away from original IDs, and simply handle what is given to it. Also, none of the areas shouldn't even touch `orig_id`. If you want to copy something from input mesh from pre-modifier state, do so in `mesh_finalize_eval()`. This is up to you to do so, dependency graph can not help here. But i think it is wrong thing to do. Bounding box should always be coherent to the data it corresponds to. As in, if you copy bounding box from source mesh to a result of modifiers you are stepping into situation when re-calculating bounding box for the result mesh will give you different value. To me proper solution here is to explicitly separate bounding box and texture space, and also sanitize things like object's bounding box (which currently will silently fall-back to data's bounding box in certain cases). If such separation is done, you would copy texture space, but keep bounding box in sync with the actual content of the evaluated mesh.

Forgot to mention, quick solution here would be to set texture space for evaluated mesh from original mesh's bounding box and disable auto texture space there.

Forgot to mention, quick solution here would be to set texture space for evaluated mesh from original mesh's bounding box and disable auto texture space there.

(…) sanitize things like object's bounding box (which currently will silently fall-back to data's bounding box in certain cases.

Did that yesterday actually, was the only way to get back some level of sanity in bbox handling anyway (and to fix some bbox related bugs). ;)

Forgot to mention, quick solution here would be to set texture space for evaluated mesh from original mesh's bounding box and disable auto texture space there.

Oh yes, that sounds promising! :D

> (…) sanitize things like object's bounding box (which currently will silently fall-back to data's bounding box in certain cases. Did that yesterday actually, was the only way to get back some level of sanity in bbox handling anyway (and to fix some bbox related bugs). ;) > Forgot to mention, quick solution here would be to set texture space for evaluated mesh from original mesh's bounding box and disable auto texture space there. Oh yes, that sounds promising! :D

This issue was referenced by 33cbcd7344

This issue was referenced by 33cbcd73448fb1cedc083c2b1fb9a27489d09432

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
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#57985
No description provided.