Blender Git Loki

Blender Git "asset-browser" branch commits.

Page: 22 / 27

November 30, 2020, 16:03 (GMT)
General cleanup
November 30, 2020, 14:30 (GMT)
Remove preview pointer in asset-data

Not needed, we get the preview via the ID.
November 30, 2020, 13:09 (GMT)
Cleanup: Use C++ scope based mutex locks

Rather than verbose and unsafe (in case of early exits or exceptions) explicit
lock/unlock pairs, use RAII based locks which explicitly unlock on stack
unwinding.
November 30, 2020, 12:48 (GMT)
Compile BKE icons source file with C++

That way we can use scoped mutex locks, which should make code cleaner/saver
and avoids the annoying unlock calls for every early-exit. Will happen in a
followup commit.

Mostly had to address casts from `void *` of course. Used C style casts, almost
all of the file still uses C style coding anyway.
`BKE_icon_geom_from_memory()` was using `goto`s for cleanup logic which
wouldn't compile with C++. Changed to RAII based resource handling.
November 30, 2020, 10:40 (GMT)
Fix thread-lock when re-generating material preview icon

Thought the spin lock supported recursion, it doesn't.
November 29, 2020, 23:41 (GMT)
Merge branch 'master' into asset-browser
November 29, 2020, 23:39 (GMT)
Show asset preview in Asset Browser sidebar

Addresses T82977.
November 29, 2020, 23:36 (GMT)
Turn file previews into icons to allow access from BPY

That way we can expose an icon-id that scripts can use to reference the icon.
The Python API for file entries has the icon-id exposed.

To get this to work I had to make parts of the icon system thread safe. I added
a bunch of spin locks, but as a whole it's rather weak.

Part of T82977.
November 25, 2020, 18:27 (GMT)
Fix compile error on Windows

`alloca.h` doesn't seem to be available there.
November 25, 2020, 18:03 (GMT)
Fix broken custom preview-icons & failing script_load_addons test
November 25, 2020, 16:58 (GMT)
Merge branch 'master' into asset-browser
Revision 272e077 by Julian Eisel (asset-browser)
November 25, 2020, 15:58 (GMT)
Proper implementation of "Make Asset" for button context menus

Buttons or other UI elements can now set a "focused_id" context pointer. The
asset operators (and in future, general data-block operators) can use this
then. Further the UI code automatically sets it when a button represents a
data-block pointer. That way, data-block search menus or data-block selectors
also show "Make Asset" in the context menu.

This also works for material slots now, the material slot you right click will
properly set the "focused_id" context pointer, and "Make Asset" makes that
material an asset.

Had to add support for using custom context pointers to context menus and
UILists.

Addresses T82664.
November 24, 2020, 20:07 (GMT)
Support custom preview images for assets

Assets types that already support previews (objects, collections, images,
textures, materials, brushes, lights, worlds, scenes and screens) now support
custom previews too.
To assign a preview, the Asset Browser sidebar shows a "Load Custom Preview"
button. It opens a File Browser to select an image. Once an image is selected,
it overrides whatever preview was previously set. No reference to the image is
created, it basically copies the image to the data-block preview.

The button looks a bit out-of-place currently, that will be improved later.
November 23, 2020, 18:45 (GMT)
Asset Browser: Milestone 1 - Basic, Local Asset Browser

NOTE: This is not ready for a merge yet. Purpose of this patch is to give
reviewers a first look. I plan to address some TODOs marked in code, and then
merge it soon to continue work in master. The patch can go through some proper
review then.

For remaining TODOs and project description, see #asset_browser_milestone_1.

This patch includes:
* "Make Asset" operator, exposed in Outliner and button context menus (the
latter is disabled currently)
* Asset meta-data storage and management
* Custom asset tags
* Reading asset meta-data for separate files (but not more)
* Automatic object previews
* Custmo Asset repository setup via Preferences (has to be .blend files
currently), directories are a ToDo.
* Default repository at ~/assets.blend on Linux/macOS, ~/Documents/assets.blend
on Windows
* Asset Browser editor, internally a sub-editor of the File Browser
* Internal File Browser changes need for asset browsing
* "Current File" repository for the File Browser
* Basic UI for editing asset meta-data
* Dragging object, collection, image and material assets into 3D Views
* Option to only show assets on Append/Link
* Some unfinished code for per repository Asset Catalogs (should likely be
disabled for now)

Differential Revision: https://developer.blender.org/D9633
Revision 5c38de4 by Julian Eisel (asset-browser)
November 23, 2020, 15:34 (GMT)
Support reading all asset meta-data from external repositories

When displaying a repository that is not the "Current File" one, we can now
show all the meta-data of its assets in the UI. Editing is currently possible,
but changes will be lost on reload of the repository. Editing should simply not
be disabled for now.

Note that this also works for custom properties. So assets can store custom
properties, and the Asset Browser can show them, even if they are stored in an
external repository.
One important thing is that custom asset properties must not store pointers to
other data-blocks, but the BPY should forbid this already for assets.

Addresses T82860.
Revision 967f763 by Julian Eisel (asset-browser)
November 23, 2020, 15:26 (GMT)
Fix Python error print when no asset file is active
November 23, 2020, 13:21 (GMT)
Merge branch 'asset-metadata' into asset-browser
November 23, 2020, 13:14 (GMT)
Add custom property support for assets

I didn't do this earlier because I was afraid it would make reading of asset
data (and asset data only!) difficult. Mainly because custom properties could
store pointers to other data, that would have to be read too then (e.g. an
object). But turns out, we can easily disable custom pointers to other
data-blocks, so reading stays simple :).
November 23, 2020, 12:31 (GMT)
Merge branch 'asset-metadata' into asset-browser
November 23, 2020, 12:31 (GMT)
Merge branch 'master' into asset-metadata
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021