Crash when using to_mesh() on a depsgraph object in a driver #84117
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#84117
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.30
Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash:
0f45cab862
Short description of error
Blender crashes when we use the following driver for a bone's X position:
Exact steps for others to reproduce the error
crashTest.blend
Added subscriber: @KevinHays
Added subscriber: @rjg
I can reproduce a crash, but I'm not sure if this use of the Python API in the driver is permitted. I'm confirming this for now, so that the Data, Assets & I/O module can take a closer look.
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @mont29
This can crash in several different places... Here is another ASAN backtrace:
I think that this code cannot work in a driver because depsgraph is not aware of the dependency from the Object to its mesh evaluation then?
But even with adding manually explicit dependencies over
Cube.001
mesh and object (through unused driver variables)......it still crashes, although with a slithly different backtrace:
In any case, this is for the depsgraph & animation department, not really related to Data & IO module...
Added subscriber: @dr.sybren
@KevinHays converting an object to a mesh may not be the most elegant approach here. What is your use case for this code? Why not use something like a Hook constraint, for example? What kind of object are you converting to a mesh?
Changed status from 'Confirmed' to: 'Needs User Info'
So when I encountered this crash, I was working on a facial mocap system. I have footage of a face with dots painted on it, and tracked those dots to give me motion-tracked empties. My goal was to use those empty positions to drive the bone positions of a rigged character.
However there's not a 1:1 mapping from tracker dots to character bone positions. I wrote some python code to figure out the best character bone positions based on the input tracker data.
Unfortunately my code had poor results when relying solely on tracker locations as input data, so I created a mesh that connects the tracker dots: https://i.imgur.com/JeAJUYe.gif
The idea was to use edge lengths and edge angles as input data for my code that calculates the character bone positions. My code was able to produce better, less-jittery bone positions using the edge data, but also but also crashed often (hence the bug report).
I admit this is probably a pretty obscure use case, but it crashes consistently which is why I decided to report the bug.
I ended up going with an off-line approach by calculating bone positions for each frame, and inserting a keyframe of my calculated bone location (as opposed to relying on drivers to give me the correct bone positions for the current frame).
Changed status from 'Needs User Info' to: 'Needs Triage'
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
@dr.sybren : since there is new information here: how would you classify this then?
I still don't understand why
.to_mesh()
is called. The cube object is already a mesh, so there should be no need to do this conversion.Changed status from 'Needs Developer To Reproduce' to: 'Archived'
I looked at the code for
BKE_object_to_mesh()
(the C function that's called when you call.to_mesh()
from Python), and it looks like it's not made for being called on evaluated data-blocks. As such this is simply a design limitation, and not a bug.