Blender Git Commits

Blender Git "master" branch commits.

Page: 2 / 5436

5 hours 55 min ago
Asset Catalogs: explicit version number in catalog definition files

Declare the current format used for asset catalog definition files as
version 1, and write that to the files. Files without that version number
will be rejected.

This makes it much easier to move to different versions later, with the
opportunity to do versioning on file load.

The version is not associated with any version of Blender, but a separate
integer that's simply incremented when a non-backward-compatible change
Revision aa2493e by Julian Eisel
6 hours 57 min ago
Fix unused variable warning in release builds

The variable is only used in debug builds.
7 hours 1 min ago
Assets: add Asset Catalog system

Catalogs work like directories on disk (without hard-/symlinks), in that
an asset is only contained in one catalog.

See T90066 for design considerations.

#### Known Limitations

Only a single catalog definition file (CDF), is supported, at
`${ASSET_LIBRARY_ROOT}/blender_assets.cats.txt`. In the future this is
to be expanded to support arbitrary CDFs (like one per blend file, one
per subdirectory, etc.).

The current implementation is based on the asset browser, which in
practice means that the asset browser owns the `AssetCatalogService`
instance for the selected asset library. In the future these instances
will be accessible via a less UI-bound asset system.

The UI is still very rudimentary, only showing the catalog ID for the
currently selected asset. Most notably, the loaded catalogs are not
shown yet. The UI is being implemented and will be merged soon.

#### Catalog Identifiers

Catalogs are internally identified by UUID. In older designs this was a
human-readable name, which has the problem that it has to be kept in
sync with its semantics (so when renaming a catalog from X to Y, the
UUID can be kept the same).

Since UUIDs don't communicate any human-readable information, the
mapping from catalog UUID to its path (stored in the Catalog Definition
File, CDF) is critical for understanding which asset is stored in which
human-readable catalog. To make this less critical, and to allow manual
data reconstruction after a CDF is lost/corrupted, each catalog also has
a "simple name" that's stored along with the UUID. This is also stored
on each asset, next to the catalog UUID.

#### Writing to Disk

Before saving asset catalogs to disk, the to-be-overwritten file gets
inspected. Any new catalogs that are found thre are loaded to memory
before writing the catalogs back to disk:

- Changed catalog path: in-memory data wins
- Catalogs deleted on disk: they are recreated based on in-memory data
- Catalogs deleted in memory: deleted on disk as well
- New catalogs on disk: are loaded and thus survive the overwriting

#### Tree Design

This implements the initial tree structure to load catalogs into. See
T90608, and the basic design in T90066.

Reviewed By: Severin

Maniphest Tasks: T91552

Differential Revision:
Revision 222fd1a by Julian Eisel
7 hours 15 min ago
Asset Browser: Disable metadata editing for external asset libraries

Buttons to edit asset metadata are now disabled for assets from an
external library (i.e. assets not stored in the current .blend file).
Their tooltips explain why they are disabled.

Had to do some RNA trickery to disable the metadata properties at RNA
level, not at UI script level.
The basic idea is:
* Local data-block assets set the data-block as owning ID for the asset
metadata RNA pointer now.
* That way we can use the owner ID to see where the metadata belongs to
and decide if it's editable that way.
* Additionaly, some Python operators needed better polling so they show
as grayed out, and don't just fail.

One important thing: Custom properties of the metadata can still be
edited. The edits won't be saved however. Would be nice to disable that,
but it's currently not supported on BPY/IDProperty/RNA level.

Addresses T82943.

Differential Revision:
7 hours 19 min ago
Fileops: call `BLI_path_slash_native()` in `BLI_dir_create_recursive()`

Make the Windows version of `BLI_dir_create_recursive()` call
`BLI_path_slash_native()` before it tries to handle the path. This
should make it possible to call it with non-native path separators.

This change was provided by our Windows platform maintainer @LazyDodo in
P2414, so I assume he agrees with this change.
7 hours 51 min ago
Keymap: RMB select option to place cursor on Alt-LMB

This allows most tools to activate on press, removing a small but
noticeable distance between the initial press and detection of a drag

Gizmo tweak no longer actives when Alt is held, to avoid conflicting
with cursor placement.

This has the advantage that the gizmo doesn't get in the way when Alt
is used for activating tools or placing the cursor.
7 hours 54 min ago
Cleanup: spelling in comments
7 hours 54 min ago
WM: gestures now activate immediately on mouse press

Some gestures were activating immediately on tweak events,
extend this to mouse-press and click-drag.

Without this change, box-select for example wouldn't be automatically
activated on mouse-press.
7 hours 55 min ago
Cleanup: assign variable for LMB select
8 hours 13 min ago
LibLink: Modify WM API to link/append one ID to take flag parameter.

There is no reason to lock behavior into a specific configuration in
those calls, make them properly configurable like the rest of the
link/append code.

This also enable users of those functions to activate 'ID reuse'
8 hours 15 min ago
Geometry Nodes: add utility to print an attribute id.
8 hours 58 min ago
Fix T91629: Crash in "Open Cached Render" function
9 hours 5 min ago
LibLink Append: Expose 'reuse ID' through new BLO flag, and add basic tests.

Option is now available to append operator, alsthough hidden and
disabled by default.
9 hours 7 min ago
LibLink Append: Fix 'reused ID' case keeping linked data around.

When we re-use a local ID, we need to delete the matching linked data.
9 hours 15 min ago
Cleanup: proper handling of `LIB_TAG_DOIT` in append code.
9 hours 16 min ago
Cleanup: eBLOLibLinkFlags: Add 'space' between `APPEND` flags and `INSTANCE` ones.
9 hours 31 min ago
Cleanup: Silence unused var warning in release builds.
10 hours 33 min ago

Forgot that one in rB794c2828af60.

Noted by Antonio Vazquez (@antoniov), thanks.
10 hours 46 min ago
Append: Reuse local data: remove limitation on directly selected data.

in asset context, when user drag & drop a material several time, they
would still expect to re-use existing one instead of getting new copies
of it, even if this material is directly appended (and not an indirect
dependency of an object e.g.).
11 hours 1 min ago
Link/Append: Refactor flags.

Flags controlling link/append code are split between two enums, one in
`DNA_space_types.h` and one in `BLO_readfile.h`.

This commit:
- Moves flags exclusively used in WM and BLO code to `eBLOLibLinkFlags`
in `BLO_readfile.h`. Flags in `eFileSel_Params_Flag` from
`DNA_space_types.h` are now only the ones effectively used by the
file browser editor code too.
- Fixes some internal utils in `readfile.c` still taking `short` flag
parameter instead of proper `int` one.

NOTE: there are a few other flags that could probably be moved to
`eBLOLibLinkFlags` (at the very least `FILE_LINK`, probably also
`FILE_AUTOSELECT` and `FILE_ACTIVE_COLLECTION`), since those are not
effectively used by the file browser, and control linking/appending
behavior, not filebrowser behavior.

However for now think it's safer to not touch that.
By: Miika HämäläinenLast update: Nov-07-2014 14:18 MiikaHweb | 2003-2021