Brush Assets: Store assets outside Main #117730

Manually merged
Brecht Van Lommel merged 18 commits from brecht/blender:brush-separate-main into brush-assets-project 2024-02-27 14:53:03 +01:00

18 Commits

Author SHA1 Message Date
Hans Goudey cf1b05802b Merge branch 'brush-assets-project' into brush-separate-main 2024-02-22 13:04:24 -05:00
Hans Goudey 1678f831ff Merge branch 'brush-assets-project' into brush-separate-main 2024-02-22 13:02:47 -05:00
Hans Goudey befe409e30 Merge branch 'brush-assets-project' into brush-separate-main 2024-02-21 17:10:01 -05:00
Hans Goudey 38c0fd5579 Add comment 2024-02-21 15:10:06 -05:00
Hans Goudey 67bb4a80b9 Remove "brush select" operator
Selecting a brush based on the tool type isn't done anymore,
and this operator doesn't really make sense in the context of
prioritizing brush selection instead of tool selection / the asset
shelf. It would otherwise have to be fixed for storing brush
data-blocks in other mains.
2024-02-21 14:26:07 -05:00
Hans Goudey 99e6409a2e Remove creating a new brush on Paint init when none is found
Now instead of creating a brush from scratch, the default asset
should be used instead. I'm pretty sure that is done elsewhere,
and if it isn't it should be fixed.
2024-02-21 14:14:34 -05:00
Hans Goudey 716a582583 Remove unnecessary tool -> brush connection
These were adding brushes and finding brushes in the active (non-asset)
main. This sort of thing should be handled differently now anyway
2024-02-21 14:13:44 -05:00
Hans Goudey 45b5c20f20 Remove BRUSH_OT_add operator
This doesn't seem to be visible anywhere in the UI. New brushes
are more easily created by duplicating existing brushes anyway.
2024-02-21 14:02:47 -05:00
Hans Goudey 629d1c3c4b Cleanup: Remove some unnecessary temporary main variables
Maybe this makes it a bit harder to use the wrong main by mistake
2024-02-21 13:59:40 -05:00
Hans Goudey 0475797e05 Make BKE_asset_weak_reference_ensure ID type agnostic 2024-02-21 13:39:35 -05:00
Hans Goudey 64d07edd0c Cleanup: Avoid c strings 2024-02-21 12:29:56 -05:00
Hans Goudey a5b136bbd6 Only search for Main in ListBase of data-block type 2024-02-21 12:29:23 -05:00
Hans Goudey ef391974ff Cleanup: Use construct after first use idiom
Removes the need to manually free the mains, since the static variable
will be destructed in the proper order. But still keep that for now, just in case.
2024-02-21 12:25:22 -05:00
Hans Goudey d0118a0eee Merge branch 'brush-assets-project' into brush-separate-main 2024-02-21 12:21:05 -05:00
Brecht Van Lommel a93300fe20 Fix creating textures and images for brush not working 2024-02-01 22:41:34 +01:00
Brecht Van Lommel ef90ec70ce Fix Revert to Asset not working 2024-02-01 22:41:34 +01:00
Brecht Van Lommel aefbdf8cee Fix: same asset getting loaded multiple times 2024-02-01 22:41:34 +01:00
Brecht Van Lommel 44d253d0c4 Brush Assets: experiment storing brush asset outside Main
This is an experiment, more restructuring and renaming would be needed
if we do this.

* One main database per asset blend file, so that there are no
  conflicts between the regular main and different asset blend files.
* Various code for avoiding conflicts and untangling databases can
  be removed because of this.
* Assets are appended to this, no linking and overrides. Revert and
  changed property highlighting is current broken due to this. This
  change does not necessarily need to be made along with the rest
  but it makes the brush name editable.
* Some basic checks to avoid linking between regular main and
  asset main, but much more would be needed.
* Tool settings brush pointers were changed to do no user counting,
  but really should not be part of ID management at all and handled
  purely through some runtime lookup outside of it.
2024-02-01 19:02:24 +01:00