Fix #110751: Clear all strokes prior to baking lineart #119381
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
Code Documentation
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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#119381
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ChengduLittleA/blender:fix-110751"
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 is a attempt to fix line art crashing from baking while there are
already strokes in the gpencil object that aren't generated by lineart.
Side effect: If you bake the second time in a different frame range, the
previous bake is going to be cleared.
This crash is probably related to the change to using job system
(instead of a simple loop), and during
BKE_scene_graph_update_for_newframe()
call, blender crashes trying toduplicate some existing strokes.
This seems fine I guess, but I'm not really sure why I'm the reviewer here TBH. I have to say I don't find the PR description that convincing though-- it would be nice if we had more confidence about why there is a crash in the first place.
TBH I'm not really sure either. All I know is that if there are existing strokes prior to baking line art, it will definitely crash. However start baking from empty gp object it won't, even if it will bake new frames of strokes by itself. My guess is that it involves the change to job system (as opposed to blocking) and the UI needs refreshing, which caused conflict since it crashed in depsgraph evaluation while copying strokes from original data block.
I think it's important to understand things, we should only guess if we really can't figure it out.
Running ASAN shows this:
What this indicates is that the depsgraph is accessing strokes that were freed in the baking code. One of the potential causes is that the depsgraph was not tagged for these changes, and did not copy the original to the evaluated object before evaluation. And indeed it seems that
clear_strokes
does not directly cause a depsgraph tag.This fix seems to work from a quick test:
Posted my fix in #119662.
Closing assuming this fix is no longer needed, but feel free to reopen if you disagree. Just for 4.1 the simpler fix seems best.
Pull request closed