Refactor: Remove pre-2.8 function to reevaluate a single object #106186
No reviewers
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106186
Loading…
Reference in New Issue
No description provided.
Delete Branch "HooglyBoogly/blender:fix-remove-broken-reevaluate-mesh"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This function replaced the evaluated mesh with a new one with the given
custom data type mask. That doesn't work in general anymore for a few
reasons: the increased dependence on named attributes (a opposed to
custom data types), and the "all or nothing" approach to reevaluating
the depsgraph. Other objects might depend on the object's evaluated
geometry, so it shouldn't just be replaced. Pushed a bit further, this could
give nice simplifications to mesh modifier evaluation.
There are two breaking changes,
bmesh_from_object
and BVH treeFromObject
require the source object to have a proper evaluatedmesh now.
If this causes a regression, it's likely that the object is missing
an update tag when a mode is entered that requires extra evaluated data.
@ -1354,2 +1353,2 @@
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src);
const Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_src);
const Mesh *me_eval = BKE_object_get_evaluated_mesh(ob_eval);
Here I don't think we can assume the existence of
depsgraph
,ob_eval
orme_eval
. I think they could be NULL for objects that are hidden or part of another scene, and crash.Using context and the depsgraph here at all is dodgy, but that's not something to solve as part of this.
There's probably more cases like this where the object may not have been evaluated, but I didn't have time today to check them all. Probably best to be extra careful and add null pointer checks in various places.
@ -1133,3 +1134,3 @@
}
else {
me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, &data_masks);
me_eval = BKE_object_get_evaluated_mesh(ob_eval);
This could be a breaking change, it's conceivable a script calls this for a hidden object.
Maybe best to postpone changing this one.
@ -1048,3 +1049,3 @@
}
return mesh_get_eval_final(depsgraph, scene, ob_eval, &data_masks);
return BKE_object_get_evaluated_mesh(ob_eval);
Same here, could be a breaking change.
Thanks for looking at this. I think I'll postpone the change until 4.0 so that we can be more liberal about requiring an evaluated depsgraph for certain Python functions. It would also allow going a bit further too, I think there are other similar functions that could be removed as well.
Fix: Remove pre-2.8 function to reevaluate a single objectto WIP: Fix: Remove pre-2.8 function to reevaluate a single objectWIP: Fix: Remove pre-2.8 function to reevaluate a single objectto WIP: Refactor: Remove pre-2.8 function to reevaluate a single objectWIP: Refactor: Remove pre-2.8 function to reevaluate a single objectto Refactor: Remove pre-2.8 function to reevaluate a single object@blender-bot build
It looks to me like more functions have the same problem:
mesh_get_eval_deform
mesh_create_eval_final
mesh_create_eval_no_deform
mesh_create_eval_no_deform_render
editbmesh_get_eval_cage
editbmesh_get_eval_cage_from_orig
I guess they can be removed in separate steps.
@blender-bot build windows