Blender Git Loki

Git Commits -> Revision 1c5722b

Revision 1c5722b by Sybren A. Stüvel (master)
October 19, 2021, 14:17 (GMT)
Fix T91197: marking assets from Python may crash

When using `asset_mark` function from a Python script and afterwards
updating the preview image, a crash might happen. The preview image is
generated by the `asset_mark` function. This may happen on a background
thread, introducing potential synchronization issues.

This patch fixes this by separating the preview generation
`ID.asset_generate_preview` from the mark as asset `ID.asset_mark`.

Note: this separation of "mark as asset" and "generate preview" also
applies to the `ED_asset_mark_id()` C function; if it is desired to have
previews rendered after marking as asset, a call to
`ED_asset_generate_preview()` is now also required.

Reviewed By: sybren

Maniphest Tasks: T91197

Differential Revision: https://developer.blender.org/D12922

Commit Details:

Full Hash: 1c5722ba071ac08042f2e3150495b865a0ffa95a
Parent Commit: 0a6cf3e
Lines Changed: +32, -8

4 Modified Paths:

/source/blender/editors/asset/ED_asset_mark_clear.h (+8, -1) (Diff)
/source/blender/editors/asset/intern/asset_mark_clear.cc (+6, -3) (Diff)
/source/blender/editors/asset/intern/asset_ops.cc (+3, -1) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+15, -3) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021