WIP: Rewrite asset browser as separate editor #107576

Draft
Julian Eisel wants to merge 95 commits from asset-browser-frontend-split into main

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

95 Commits

Author SHA1 Message Date
Julian Eisel 9175d1d7e2 Adapt to changes in main branch 2023-09-21 13:48:16 +02:00
Julian Eisel 4017025662 Merge branch 'main' into asset-browser-frontend-split 2023-09-21 13:06:29 +02:00
Julian Eisel 04dab5090a Further updates to main branch 2023-08-30 13:18:08 +02:00
Julian Eisel 167a2bb257 Cleanup: clang-format 2023-08-30 12:53:49 +02:00
Julian Eisel 7026452e45 Merge remote-tracking branch 'origin/main' into asset-browser-frontend-split 2023-08-30 12:49:46 +02:00
Julian Eisel d260d47f5e Update to changes in main & related fixes 2023-08-30 12:48:11 +02:00
Julian Eisel 7e9dc6a75a Merge branch 'main' into asset-browser-frontend-split 2023-08-29 16:31:53 +02:00
Julian Eisel 0d4a0b975f Merge branch 'main' into asset-browser-frontend-split 2023-06-01 18:41:31 +02:00
Julian Eisel b9e9d1eefe Merge branch 'main' into asset-browser-frontend-split 2023-06-01 16:04:21 +02:00
Julian Eisel db12cfd565 Merge branch 'main' into asset-browser-frontend-split 2023-05-17 18:31:06 +02:00
Julian Eisel 25c21c907e Merge branch 'main' into asset-browser-frontend-split 2023-05-10 21:30:09 +02:00
Julian Eisel 331d685ef6 Fix new asset browser not updating as assets get loaded
buildbot/vexp-code-patch-coordinator Build done. Details
2023-05-05 15:07:36 +02:00
Julian Eisel bed24caa13 Display "Select all" operators in Select pulldown menu 2023-05-04 18:23:28 +02:00
Julian Eisel bc893f8ad8 Merge branch 'main' into asset-browser-frontend-split 2023-05-04 15:25:24 +02:00
Julian Eisel 5e91778d97 Merge branch 'main' into asset-browser-frontend-split 2023-05-04 15:12:42 +02:00
Julian Eisel ed2cffc0f7 Show asset type icon while preview is loaded or couldn't be found 2023-05-04 13:09:50 +02:00
Julian Eisel 06a5cd6e91 Fix double highlight of grid tiles 2023-05-04 13:09:02 +02:00
Julian Eisel 84383ff706 Fix broken metadata sidebar UI with no active asset 2023-05-04 12:35:33 +02:00
Julian Eisel 8946ab70be Fixes for metadata UI: properties and preview display 2023-05-03 20:32:35 +02:00
Julian Eisel 90fd5461c6 Remove horizontal scrollbar 2023-05-03 19:55:10 +02:00
Julian Eisel 5cbb8b2245 Merge branch 'main' into asset-browser-frontend-split 2023-05-03 19:46:59 +02:00
Julian Eisel ca72626d50 Mouse selection support for views (except Shift to fill selection) 2023-05-03 18:10:46 +02:00
Julian Eisel 74b7e40fbc Highlight active view item some more 2023-05-03 14:59:46 +02:00
Julian Eisel c90dfcc52d Add selection state support & "Select All" operator
No mouse select possible yet, since this is a bit more involved.
2023-05-03 14:34:53 +02:00
Julian Eisel 8bc451f5c1 Cleanup: Remove unused argument 2023-05-03 11:56:22 +02:00
Julian Eisel 2ee9cb57fb Cleanup: Clang-format 2023-05-03 11:40:44 +02:00
Julian Eisel 488ae43825 Merge branch 'main' into asset-browser-frontend-split 2023-05-03 11:39:42 +02:00
Julian Eisel 176abe3488 Merge branch 'main' into asset-browser-grid-view 2023-04-06 11:57:20 +02:00
Julian Eisel e927791dbf Cleanup: Clang-format 2023-04-06 11:55:19 +02:00
Julian Eisel 73d7bde25c Increase size of catalog navigation bar
Use same size as File Browser, this is a bit too tight.
2023-04-05 19:03:40 +02:00
Julian Eisel a34ac195ac Fix now unnecessary FIXME comment
This C++ incompatibility is solved in the main branch now.
2023-04-05 19:01:32 +02:00
Julian Eisel f5f95f5a03 Fix compile errors, adapt to changes in master 2023-04-05 18:52:24 +02:00
Julian Eisel 81f00c4cc1 Merge branch 'main' into asset-browser-grid-view 2023-04-05 18:51:27 +02:00
Julian Eisel 8a31a872f3 Update for changes in master, fixing build errors & warnings 2023-02-20 16:38:27 +01:00
Julian Eisel ac05bce173 Merge branch 'main' into asset-browser-grid-view 2023-02-20 15:57:11 +01:00
Julian Eisel 7246c38743 Merge branch 'master' into asset-browser-grid-view 2022-11-10 13:17:42 +01:00
Julian Eisel c5f55d1709 Fix compile error after changes in master 2022-09-13 15:45:47 +02:00
Julian Eisel 22580aff76 Merge branch 'master' into asset-browser-grid-view 2022-09-13 15:45:25 +02:00
Julian Eisel 15ad4334fc Merge branch 'master' into asset-browser-grid-view 2022-07-21 16:45:13 +02:00
Julian Eisel 85f0b2ef5d Merge branch 'master' into asset-browser-grid-view 2022-07-20 17:17:12 +02:00
Julian Eisel bffc1fbf31 Apply changes to catalog tree view from master 2022-07-20 16:01:05 +02:00
Julian Eisel 6bae10ef45 Merge branch 'master' into asset-browser-grid-view 2022-07-20 15:42:58 +02:00
Julian Eisel 0f8e58e7b8 Merge commit 'c355be6faeac~1' into asset-browser-grid-view 2022-07-20 15:42:48 +02:00
Julian Eisel 6fc388743d Merge branch 'master' into asset-browser-grid-view 2022-06-15 20:20:21 +02:00
Julian Eisel 66204860ca Merge branch 'master' into asset-browser-grid-view 2022-06-02 13:01:29 +02:00
Julian Eisel 5162632a20 Merge branch 'master' into asset-browser-grid-view 2022-05-27 11:33:05 +02:00
Julian Eisel 560c20e067 Fix wrong data passed after recent changes in master 2022-05-20 12:00:52 +02:00
Julian Eisel c8c8783088 Merge branch 'master' into asset-browser-grid-view 2022-05-20 11:46:53 +02:00
Julian Eisel 1049b0c818 Merge branch 'master' into asset-browser-grid-view 2022-05-18 22:43:03 +02:00
Julian Eisel 46934eaf25 Merge branch 'master' into asset-browser-grid-view 2022-05-10 17:09:32 +02:00
Julian Eisel c67a650718 Merge branch 'master' into asset-browser-grid-view 2022-05-10 17:09:13 +02:00
Julian Eisel 065bc42ce5 Merge branch 'master' into asset-browser-grid-view 2022-04-06 11:37:28 +02:00
Julian Eisel 063689b8a8 Cleanup: Use new license header convention 2022-03-28 00:14:49 +02:00
Julian Eisel eaa58a1607 Adopt to RNA prototypes changes in master (fix compile error) 2022-03-28 00:13:49 +02:00
Julian Eisel 72e67691ed Merge branch 'master' into asset-browser-grid-view 2022-03-27 23:56:26 +02:00
Julian Eisel e1a8a15945 Merge branch 'master' into asset-browser-grid-view 2022-03-02 15:07:28 +01:00
Julian Eisel e91e4bf8e5 Merge branch 'master' into asset-browser-grid-view 2022-02-28 14:32:46 +01:00
Julian Eisel 9ae2259db5 Solve redraw performance issue in huge asset libraries
In a big asset library (>3000 assets in the one I'm testing with), the asset
browser would get a notable redraw lag due to the O(n^2) complexity of the tree
item matching (to recognize items over multiple redraws and keep state like
selection, highlights, renaming, ...).
2022-02-17 23:50:41 +01:00
Julian Eisel 9bac0894f6 Merge branch 'master' into asset-browser-grid-view 2022-02-17 21:43:07 +01:00
Julian Eisel 731c1be92a Speedup preview icon loading
Significantly speeds up loading of previews, not just for assets but also
Python loaded custom previews. Patch will be submitted for master.
2022-02-17 21:41:22 +01:00
Julian Eisel 3d31ad823a Fix missing redraw when switching asset libraries 2022-02-17 21:40:17 +01:00
Julian Eisel fdc5301205 Fix crash when loading asset library takes multiple redraws 2022-02-17 21:39:43 +01:00
Julian Eisel 2ce7f02a06 Fix missing (re)load when changing asset libraries
Logic to compare asset library references was incorrect.
2022-02-17 21:35:34 +01:00
Julian Eisel 91853d95a9 Merge branch 'master' into asset-browser-grid-view 2022-02-16 18:13:12 +01:00
Julian Eisel eafd98c920 Remove preview-caching from asset-list API
This isn't needed anymore, see previous commit.
2022-02-16 18:10:40 +01:00
Julian Eisel 39eab45c8e Let UI do lazy-loading of previews, rather than file-list cache
This is an important step to decouple the asset-views from the file browser
backend. One downside is that the UI preview loading is much slower than the
file browser one, however, I'm pretty sure I know how to address this.
2022-02-16 17:59:27 +01:00
Julian Eisel ef58467594 Store active item, asset metadata sidebar
Also:
- Fix double-free bug when closing Blender
- Fix issues with identifying assets with the same name.
- Add functions to store asset handle as pointer in the asset list storage,
  asset browser exposes it via context.
2022-02-15 21:44:08 +01:00
Julian Eisel 8f48dd8f72 Merge branch 'master' into asset-browser-grid-view 2022-02-14 17:57:52 +01:00
Julian Eisel d46357dd25 Merge branch 'master' into asset-browser-grid-view 2022-02-14 17:57:16 +01:00
Julian Eisel 696295f849 Support active item
Makes activating assets in the Asset Browser work. The active item is only
stored at the UI level now, so it's not stored in files, not accessible via
context and is lost when changing editors. The Asset Browser itself will have
to get a way to store that.
2022-02-14 17:48:51 +01:00
Julian Eisel c9c332f422 Fix failed assert with small region size
If there's not enough space to draw at least one item per row, there would be a
failed assert in the code to skip drawing items scrolled out of view.
2022-02-14 16:15:29 +01:00
Julian Eisel 18f8749fb7 Only add items to layout that are visible on screen
Basically we skip adding buttons for items that aren't visible, but
scrolled out of view. This already makes scrolling in very large
libraries smoother. However this also prepares the next step, where we
only load previews for items that are currently in view, which should
make the experience with large asset libraries better.
2022-02-11 20:30:54 +01:00
Julian Eisel 947c73578c Merge branch 'master' into asset-browser-grid-view 2022-02-11 18:18:59 +01:00
Julian Eisel f41368cf02 Fix null-reference use 2022-02-11 18:18:15 +01:00
Julian Eisel f29fa9895f Bring back editor pulldown menus, get operators to work, T for nav-bar
- Adds the View, Edit & Select pulldown menus
- Makes asset operators work (e.g. catalog management)
- Correct notifiers (fixing missing redraws)
- Add T shortcut to toggle toolbar
2022-02-11 18:13:48 +01:00
Julian Eisel ff213c802c Fix failing assert when splitting new asset browser in 2
This is an issue in master already, but for many layouts it just isn't
triggered. Pretty sure the assert just shouldn't be executed in extreme
cases, where there is no width for the layout and max-sizes become < 0.
2022-02-09 19:35:07 +01:00
Julian Eisel 5fcf6822dd Reduce brightness of grid item highlight
Also show theme settings for the view item in the Theme Preferences.
Called it "Data-View Item" for now, to be evaluated.
2022-02-09 19:33:58 +01:00
Julian Eisel 9530fb60ad Fix crash when loading files with asset browser open
Some fun with static memory. When loading a file, the asset-library
service was destructed since some while ago. For the old asset browser
that wasn't a problem, since its storage was recreated from scratch. But
the new asset browser accesses the global asset library storage of the
asset system which is static and thus stays alive if a different file is
loaded.

For now just destruct the global asset library storage when loading
a new file.
2022-02-09 19:01:12 +01:00
Julian Eisel 86ea1ad5df Support reading and writing asset browsers from/to files 2022-02-09 18:53:21 +01:00
Julian Eisel 2011d1f6d0 Various GUI tweaks
- Tweak tile size to match previous Asset Browser better
- Reduce margins between preview tiles (grid view was ignoring `align`
  parameter).
- Improve placement of text below previews (allowing previews to be
  slightly bigger).
- Tweak margins of main asset browser layout.
2022-02-09 17:59:01 +01:00
Julian Eisel f17ea3da02 Add theme colors for view items 2022-02-09 15:04:27 +01:00
Julian Eisel 400d7235c3 Mouse hover highlight for grid items
Like the tree-view rows, grid items use an overlapping layout to draw
the background and a custom layout on top. There is a new dedicated
button type for the grid view items.
Adds some related bits needed for persistent view-item state storage.
Also a bunch of code for the grid item button type can be shared with
the tree-row one, but I prefer doing that separately.
2022-02-09 14:41:11 +01:00
Julian Eisel 29fdd43605 Get changes in catalog tree to update the UI correctly
The catalog tree-view now sends appropriate notifiers and messages when
changing data. Either itself or other UIs (like the main asset browser
region) can then listen to these and update.
I try to design this in a way that the views become independent on the
editor displaying them, so the views can be reused in multiple places.
2022-02-08 16:29:49 +01:00
Julian Eisel eab2a8479a Move asset catalog filtering to editors/assets
Such general asset-view functionality can go to the general editors
level, I think that makes the most sense.
2022-02-07 18:58:25 +01:00
Julian Eisel ee013f44b5 Show asset catalog tree-view in navigation sidebar
Selecting catalogs doesn't work yet.
Includes some temporary changes needed to avoid conflicts between old
File/Asset Browser and new Asset Browser code.
2022-02-07 17:18:08 +01:00
Julian Eisel f20814892a Merge branch 'master' into asset-browser-grid-view 2022-02-07 12:20:07 +01:00
Julian Eisel 39e3580065 Enforce a fixed column number for the grid layout
Avoid stretching items to fit the layout, they should always have a
fixed size.
2022-02-07 12:17:17 +01:00
Julian Eisel d2c4918d77 Merge branch 'master' into asset-browser-grid-view 2022-02-07 11:13:31 +01:00
Julian Eisel 11d0c91ba5 Merge branch 'master' into asset-browser-grid-view 2022-02-04 16:58:04 +01:00
Julian Eisel 925b82efb0 Basic grid layout with big preview tiles
Draws the asset previews in a grid layout, similar to the "old" Asset
Browser. No interactivity is supported yet.
The layout is managed through the grid-view.
2022-02-04 15:18:40 +01:00
Julian Eisel 3df2e4e888 Display a basic list of assets, set up scrolling and notifier listening
* Display a non-interactive list of assets, updates as assets get
  loaded.
* Notifier listening happens via the view, so the grid-view supports
  listening to notifiers. This is what triggers regular redraws as
  assets get loaded.
* Scrolling may need more fine tuning, so that scroll-bars are
  hidden if they don't apply (e.g. don't show horizontal scroll-bar for
  the vertically expanding grid-view layout).
2022-02-03 15:36:05 +01:00
Julian Eisel a54bd5fe19 Merge branch 'master' into asset-browser-grid-view 2022-01-31 23:51:12 +01:00
Julian Eisel 4b43bd820e Merge branch 'master' into asset-browser-grid-view 2022-01-31 23:45:08 +01:00
Julian Eisel b8b7b0af70 Add basic asset library loading, general cleanups
Adds an asset library selector and prints the list of assets when drawing the
Asset Browser main window.
2022-01-31 23:39:29 +01:00
Julian Eisel b3597b1128 Add Asset Browser as own editor
This is part of a (tentative) plan to split off the Asset Browser from
the File Browser, while adding a new grid-view API that generalizes most
of the UI. Both editors can use this and only have to implement their
case-specific logic. This then allows us to add a proper asset system,
that's not tied to the file browser backend anymore.
2022-01-28 19:27:37 +01:00