Regression: Entering editmode will invalidate the driver associated with that mesh #102221

Closed
opened 2022-11-02 08:04:40 +01:00 by Jun Takahashi · 10 comments

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

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a9
Broken: 3.1.0
Worked: 3.0.1

Apparently caused by 0f89bcdbeb

NOTE: lite builds are not affected for some reason

Short description of error
Entering editmode will invalidate the driver associated with that mesh

3278f437dfe536cd3d9dba2cc21e9bcf.mp4

Exact steps for others to reproduce the error
Test.blend

  • open .blend
  • select the cube
  • (change the value of the Key 1 shapekey to something like 0.5)
  • toggle between editmode and objectmode until the Plane uses its driver (not deformed anymore)
    Please check attached video and blend file
**System Information** Operating system: Windows-10-10.0.19043-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 516.59 **Blender Version** Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: `b292cfe5a9` Broken: 3.1.0 Worked: 3.0.1 Apparently caused by 0f89bcdbeb NOTE: lite builds are not affected for some reason **Short description of error** Entering editmode will invalidate the driver associated with that mesh [3278f437dfe536cd3d9dba2cc21e9bcf.mp4](https://archive.blender.org/developer/F13839088/3278f437dfe536cd3d9dba2cc21e9bcf.mp4) **Exact steps for others to reproduce the error** [Test.blend](https://archive.blender.org/developer/F13839090/Test.blend) - open .blend - select the cube - (change the value of the Key 1 shapekey to something like 0.5) - toggle between editmode and objectmode until the Plane uses its driver (not deformed anymore) Please check attached video and blend file
Author

Added subscriber: @Jun-Takahashi

Added subscriber: @Jun-Takahashi
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm, will check

Can confirm, will check
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Member

Apparently caused by 0f89bcdbeb

NOTE: lite builds are not affected

@Sergey: does this ring a bell?

Apparently caused by 0f89bcdbeb NOTE: lite builds are not affected @Sergey: does this ring a bell?
Philipp Oeser changed title from Editing a vertex will invalidate the driver associated with that mesh to Regression: Entering editmode will invalidate the driver associated with that mesh 2022-11-02 12:22:58 +01:00

Doesn't really ring a bell. An investigation is needed.

Doesn't really ring a bell. An investigation is needed.

I gave it some investigation.

It seems that we need to do similar to D7785 thing in the editbmesh_build_data(): P3284: (An Untitled Masterwork)

diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc
index 97ff45e93ce..bfdfc447baf 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.cc
+++ b/source/blender/blenkernel/intern/DerivedMesh.cc
@@ -1648,6 +1648,12 @@ static void editbmesh_build_data(struct Depsgraph *depsgraph,
   const bool is_mesh_eval_owned = (me_final != mesh->runtime->mesh_eval);
   BKE_object_eval_assign_data(obedit, &me_final->id, is_mesh_eval_owned);

+  /* Make sure that drivers can target shapekey properties.
+   * Note that this causes a potential inconsistency, as the shapekey may have a
+   * different topology than the evaluated mesh. */
+  BLI_assert(mesh->key == nullptr || DEG_is_evaluated_id(&mesh->key->id));
+  me_final->key = mesh->key;
+
   obedit->runtime.editmesh_eval_cage = me_cage;

   obedit->runtime.geometry_set_eval = non_mesh_components;

Did not have time to give it really good test yet though.

P.S. There is another issue i've noticed with the file. Toggling edit mode, or even sliding the key value leads to memory leak of bAnimListElem.

I gave it some investigation. It seems that we need to do similar to [D7785](https://archive.blender.org/developer/D7785) thing in the `editbmesh_build_data()`: [P3284: (An Untitled Masterwork)](https://archive.blender.org/developer/P3284.txt) ``` diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc index 97ff45e93ce..bfdfc447baf 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.cc +++ b/source/blender/blenkernel/intern/DerivedMesh.cc @@ -1648,6 +1648,12 @@ static void editbmesh_build_data(struct Depsgraph *depsgraph, const bool is_mesh_eval_owned = (me_final != mesh->runtime->mesh_eval); BKE_object_eval_assign_data(obedit, &me_final->id, is_mesh_eval_owned); + /* Make sure that drivers can target shapekey properties. + * Note that this causes a potential inconsistency, as the shapekey may have a + * different topology than the evaluated mesh. */ + BLI_assert(mesh->key == nullptr || DEG_is_evaluated_id(&mesh->key->id)); + me_final->key = mesh->key; + obedit->runtime.editmesh_eval_cage = me_cage; obedit->runtime.geometry_set_eval = non_mesh_components; ``` Did not have time to give it really good test yet though. P.S. There is another issue i've noticed with the file. Toggling edit mode, or even sliding the key value leads to memory leak of `bAnimListElem`.
Sergey Sharybin self-assigned this 2022-11-03 15:45:04 +01:00

This issue was referenced by 2c0c431399

This issue was referenced by 2c0c43139962ee43db7235d39db22ec77d3349f3

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne added this to the Core project 2023-02-09 15:43:10 +01:00
Bastien Montagne removed this from the Core project 2023-02-09 18:19:07 +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
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#102221
No description provided.