WIP: Fix #106127: crash enabling "Dynamic" on already bound MeshDeform mod #106617
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106617
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "lichtwerk/blender:106127"
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?
The UI would already disable the prop, but setting via python or drivers
would still be possible, resulting in a crash because important dynamic
binding data would be missing in the modifier evaluation.
Now report an error in the modifier in such case instad of crashing.
Alternatively, re-binding under the hood could be investigated.
I wonder whether this should actually be handled on the RNA level and do
BKE_report
when the property is attempted to be assigned from Python?Also, I am not sure whether the property is actually intended to be drivable/animatable.
But as a fall-back for older files this patch might still be useful.
Curios what you think about these points.
@ -383,0 +383,4 @@
/* The UI will not allow enabling Dynamic once bound, but setting via RNA or drivers might
* happen. Evaluation will miss important binding data then though, so better do nothing in such
* case (alternatively re-binding could be considered, see above). */
if (mmd->flag & MOD_MDEF_DYNAMIC_BIND && !mmd->dynverts) {
Use parenthesis to avoid ambiguity:
if ((mmd->flag & MOD_MDEF_DYNAMIC_BIND) && !mmd->dynverts)
I don't think this is a good idea. It'll make it too easy to accidentally discard people's data. Unless I'm mistaken, getting the binding data back once it's gone can be fairly tricky.
I could see the use from an studio-customisation/automatisation point of view, where the driver determines which kind of binding is used in which situation. Unfortunately the bug reporter didn't mention their use case.
The desired behaviour I think also depends on the intent of this driver. If I'm right and it's indeed about automating what should happen when the 'Bind' button is pressed, it means that setting this property should not have any influence when the modifier is already bound.
The crash seems to occur because the property has two purposes now:
I think a proper solution would be to disconnect those two purposes. It might be enough to alter
meshdeform_vert_task()
and replaceif (mmd->flag & MOD_MDEF_DYNAMIC_BIND)
withif (mmd->dynverts != NULL)
. Or better:That way the 'binding mode' that was actually used to construct the data is used when evaluating, and this particular flag is only used for the binding operator.
I would also assume the driver is set up to automate what should happen when binding is triggered.
It is not possible to have both binding data available (dynamic and "un-dynamic"), right? So if dynamic is available, it should always be used, so then what @dr.sybren suggests for
meshdeform_vert_task
makes sense. We could even hide the property completely from the UI after binding then?Would still prefer if we additionally use
BKE_modifier_set_error
if data is not found (so the user knows something is missing/wrong)I think that's the case, yeah.
I think the property still holds value in the sense that it shows what kind of data was set.
👍
Fix #106127: crash enabling "Dynamic" on already bound MeshDeform modto WIP: Fix #106127: crash enabling "Dynamic" on already bound MeshDeform modCheckout
From your project repository, check out a new branch and test the changes.