WIP: Brush Assets: Add initial support for the new 'brush asset' usage. #111659

Closed
Bastien Montagne wants to merge 1 commits from mont29:tmp-brush-assets into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

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-project branch), 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 brush-asset-project branch.

Ref. #101908.

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-project` branch), 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 `brush-asset-project` branch. Ref. #101908.
Author
Owner

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR111659) when ready.
Author
Owner

@dfelinto @JulianEisel @JulienKaspar FYI, current status of Brush Asset branch rebased on current main.

@dfelinto @JulianEisel @JulienKaspar FYI, current status of Brush Asset branch rebased on current main.
Bastien Montagne force-pushed tmp-brush-assets from 51c7e1b06b to 7132788d6a 2023-08-30 16:05:53 +02:00 Compare
Author
Owner

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR111659) when ready.
Author
Owner

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR111659) when ready.
Bastien Montagne force-pushed tmp-brush-assets from 7132788d6a to ab0cf3e4a3 2023-09-08 14:36:50 +02:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from ab0cf3e4a3 to bd9fcd6d0b 2023-11-02 16:19:47 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from bd9fcd6d0b to 4477485f87 2023-11-06 10:26:50 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from 4477485f87 to aedeb2dd3a 2023-11-06 18:49:57 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from aedeb2dd3a to e3ef163816 2023-11-09 12:07:03 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from e3ef163816 to fe9e7eab13 2023-11-23 11:30:55 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from fe9e7eab13 to b3964b1b0d 2023-11-24 10:41:34 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from b3964b1b0d to 30e81d1100 2023-11-24 15:24:23 +01:00 Compare
Bastien Montagne force-pushed tmp-brush-assets from 30e81d1100 to eb505ad1c7 2023-11-24 15:31:57 +01:00 Compare
Bastien Montagne closed this pull request 2024-01-09 16:42:06 +01:00

Pull request closed

Sign in to join this conversation.
No reviewers
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111659
No description provided.