WIP: Brush Assets: Add initial support for the new 'brush asset' usage. #111659
This commit mainly adds the low-level logic to link and create a runtime
override for brushes.
The biggest changes are in
setup_app_data (post-loading of .blend
file), to add support to move over some data from old bmain to newly
loaded bmain. The logic is complex, and different depending on whether
it is an undo (aka memfile read) step, or an actual .blend file reading:
- On undo, we only port over brushes themselves, their dependencies are
not handled. However, since memfile reading code already ported over
linked IDs, these do not need to be swapped.
- On real .blend file loading, brushes from the old bmain are being
reused, as long as they do not conflict (name/lib) with brushes from
the new bmain. Their dependencies are also re-used if needed.
Only exception: local assets from old bmain are never re-used.
There is also a new step added to the 'open file' process, which checks
if the to-be-opened file is a library of the currently opened one, and
if so, if there are local tweaked overrides of assets from the new file.
The option to save these tweaks in draft is currently an empty mockup,
but the rest is functional.
Brush now has a new
AssetWeakReference pointer to keep track of the
last active brush asset, and restore it on fileread in case there is
currently no active brush asset for the given paint/sculpt mode.
Some parts of this commits are mockups/place-holders that are not
expected to be committed as-is, if at all:
- Some initial support for an asset-shelf (using code from
brush-asset-projectbranch), very much WIP still.
- Definition of test brush library with semi-hard-coded path.
- There is also a drawing bug because the poll function of Brush
panels return false initially (tool has no data-block ref).
Very unclear what's hapening here.
NOTE: This branch is based on the
CheckoutFrom your project repository, check out a new branch and test the changes.
No due date set.
No dependencies set.
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?