33 Commits

Author SHA1 Message Date
Harley Acheson
42b6c7f804 Fix #132460: Remove File Browser Path Validation
This PR removes validation of saved bookmarks and system paths in File
Browser. The act of checking validity of a path can result in a timeout
that can last many seconds. Blender will have a very long startup time
if any such items are disconnected, invalid, offline, or removed. Even
if these paths are not used during the Blender session, like network
shares used only at work, web storage for some non-Blender use, a
shortcut to a USB drive, etc. Items will not be greyed out, and
clicking on one will result in a timeout _at that time_ but this seems
like expected behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/138218
2025-08-12 21:22:52 +02:00
Trantor
665aff0797 UI: Change default height of bookmark UIList
Update bookmark UIList, so it appears same as Vertex Groups,
Shape Keys, etc. (by default 3 and 5 rows visible depending on
element count)

See images in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/141790
2025-07-23 11:00:49 +02:00
Nika Kutsniashvili
efa8d942b8 Refactor: Remove grid and compact UI list layout in Python scripts
The grid layout type for UI list is planned for removal in 5.0, see
blender/blender#110461.

In previous UI meetings, we talked about deprecating the Grid mode of
the UI list, which is not actually accessible in UI and was never used.
Nowadays, there is a new grid view that can be exposed in the API in
the future.

Initially, I wanted to remove references to layout_type in UI templates
in the text editor, because a lot of add-on developers on the
extensions platform base their lists on that code, and a lot of them
are therefore including soon to be deprecated code in their add-ons,
which I want to avoid in the future. But I thought we might as well
remove it from our python scripts as well, since it's just basically
redundant code that doesn't do anything. And also because many add-on
developers use bundled python scripts for references as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/138395
2025-06-18 13:45:06 +02:00
Christoph Lendenfeld
5f5c06fc24 Assets: Create Asset thumbnails via a screenshot anywhere in Blender
This patch adds the option to take screenshots for asset previews.
Since the functionality lives inside an operator, the screenshot can only
be taken from within the GUI of Blender.

* The operator can be accessed from the dropdown menu in the asset
browser preview n-panel.
* It works for local assets and assets that are managed by blender
(e.g. brush assets)
* Click drag anywhere in Blender to create a capture
* Holding Space will move the capture area
* Holding Shift will unlock the aspect ratio
* On a re-run, the operator remembers it previous capture
area to easily create an identical screenshot
* If the screenshot is fully contained within a single 3D viewport,
the background will render transparent

Pull Request: https://projects.blender.org/blender/blender/pulls/132904
2025-05-20 13:56:45 +02:00
Pablo Vazquez
a97ce49298 Fix: Asset Browser: typo in Import Method popover 2025-05-14 16:37:54 +02:00
Nika Kutsniashvili
47f80eb158 UI: Improve labels of asset browser parameters
In new asset browser popover "Import Settings" there are new options
for instancing. Naming of properties wasn't clear enough at a glance, and
it reuses terms "Link" and "Append" which are used way too frequently and
can be mistaken for something else. This commit clarifies what parameters
do in labels.

See Images attached in PR description.

Pull Request: https://projects.blender.org/blender/blender/pulls/137295
2025-04-18 06:04:44 +02:00
Julian Eisel
6c1c5e8923 Asset browser import settings popover with collection instancing option
Part of #134755 / #134766.

Adds options to the new Import Settings popover (added in 7a6beb65f4)
to toggle collection instancing for dragging in collections. It can be
toggled separately for linking and appending, since it's typical to use
instancing for linking, but not appending (current default, also with
this change).

Previously, toggling collection instancing was only possible via the
Adjust Last Operation panel but this wasn't obvious, many people were
not aware. Adding this option based on feedback by the Blender Studio.

Pull Request: https://projects.blender.org/blender/blender/pulls/135996
2025-03-20 18:44:24 +01:00
Julian Eisel
7a6beb65f4 Asset Browser: Add import settings popover, move import method into it
Part of #134755 / #134766.

Replaces the current import method menu in the middle of the Asset
Browser header with a "Import Settings" popover. The import method is
located there now, because it doesn't need to be as prominent as it used
to be, especially with #104686.

Plan is to add further settings to this popover, e.g. see #135996 or
 #134943.
2025-03-18 17:49:44 +01:00
Julian Eisel
4499fad40e UI: Horizontal list view for asset browser
Part of #134755 / #134766.

The asset browser currently lacks a compact view that leaves names
readable. Especially when managing asset libraries (e.g. to prepare it
for sharing or set up a production library), this is quite a usability
issue. A column view like the file browser has can solve this, allowing
a quick overview and fast browsing of libraries, while keeping names
readable.

Adds a new "Horizontal List" display mode to the asset browser that
distributes assets over multiple columns, with horizontal scrolling.
Asset previews are shown in this mode, plus an asset type icon if
there's enough space. The size of previews and the columns can be
configured next to the display mode, for optimizing the display.

Pull Request: https://projects.blender.org/blender/blender/pulls/135306
2025-03-14 16:43:12 +01:00
IREXTIA
24d9eedc15 UI: Rename 'Inverse' to 'Invert' in File/Asset Browser
Rename 'Inverse' to 'Invert' for consistency with other select menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/134514
2025-02-19 21:51:55 +01:00
Campbell Barton
c7804568e7 Cleanup: reference imported types in class definitions 2025-02-13 10:15:19 +11:00
dupoxy
40b0185a8e UI: Add asset browser option to remove the preview of asset
Allow user to remove the preview of an asset from the asset browser details region.
Additionally, user can now reuse the default icons after adding a preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/132575
2025-01-16 20:32:40 +01:00
Campbell Barton
be0c9174aa Cleanup: argument wrapping for Python scripts
- Wrap the closing parenthesis onto it's own line
  which makes assignments to the return value
  read better.
- Reduce right-shift with multi-line function calls.
2025-01-14 12:53:32 +11:00
Julian Eisel
f49d0390a1 UI: Add asset browser option to sort by catalogs, new default
So far asset browsers always sorted assets by name, which resulted in
barely related assets being placed together, and related assets being
scattered. This can make navigating assets tedious, and introduces a lot
of visual noise because of scattered preview image styles.

Related assets are typically put into common asset catalogs, and related
catalogs are typically organized close to each other in the catalog
hierarchy. This makes catalogs a better characteristic to sort by,
solving the mentioned issues.

For asset shelves sorting by catalogs was introduced in 471378c666. This
PR exposes this feature to the asset browser, by introducing a new
option to sort either by name or by catalog. The new default is sorting
by catalog. Within a single catalog, assets are still sorted alphabetically.

Pull Request: https://projects.blender.org/blender/blender/pulls/129480
2024-10-29 16:58:49 +01:00
Philipp Oeser
77f874ae1d Fix #123782: Asset Browser does not show tags for active asset
Caused by a6ed013baa

Tags live on the `AssetMetaData` of an `AssetRepresentation` (so
`metadata` in py),
`asset_data`(also pointing to `AssetMetaData`) is a member of
`FileSelectEntry` only [which the above commit tried to get rid off...]

Pull Request: https://projects.blender.org/blender/blender/pulls/123818
2024-06-27 10:57:33 +02:00
Julian Eisel
a6ed013baa Refactor: Get asset data via asset representation, not file
The "active_file" context member as a way to get the active asset should be
avoided, in favor of "asset". This moves us away from the file browser backend
as basis of the asset system,
2024-06-05 13:46:33 +02:00
Nika Kutsniashvili
ede675705e UI: Reorganize 'Select' menus in editors
Reorganizes (and in some cases add missing operators to) all 'Select'
menus in all editors except 3D Viewport (done in a separate patch).

The goal of this change is to make menus as consistent as possible, and
to group & sort items according to a certain logic, which should be easy to
remember and users can always expect certain items to be always at same
place in every editor.

More details and images in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/121337
2024-05-13 16:27:23 +02:00
Campbell Barton
56388dc8fe Cleanup: reduce right-shift in startup scripts
Also un-wrap lines that fit in the column width.
2024-04-30 12:46:05 +10:00
Campbell Barton
d07d6f1c10 Cleanup: un-wrap lines that fit within 120 width for Python scripts 2024-03-15 10:04:03 +11:00
Julian Eisel
ca2a8be15f Assets: Rename "Import Type" to "Import Method" in code/BPY
It was already called that way in the UI, since it's referring to a
behavior, not a type. Update the code to match that. Note that this is
a BPY compatibility breaking change for 4.0.
2023-09-26 16:48:47 +02:00
Pablo Vazquez
05fc31f27f UI: Remove redundant "Context Menu" in menu titles
Context menus are a type of menu, like header menus, there is no need to mention
the type as part of the name since it is implied by context.

Pull Request: https://projects.blender.org/blender/blender/pulls/112662
2023-09-25 16:25:55 +02:00
persun
90d8a07213 UI: Move "Reset Recent" inside a menu
Move the File Browser's `Reset Recent` button into a menu to prevent
accidental clicks of a destructive operation.

Also rename it to a more descriptive  `Clear Recent Items`, and since
the word "Reset" is used for resetting values to default.

Pull Request: https://projects.blender.org/blender/blender/pulls/112853
2023-09-25 15:15:53 +02:00
Harley Acheson
0dab5818d7 UI: Discrete Thumbnail Sizes for Menus
Allow menus to select thumbnail sizes in discrete steps.

Pull Request: https://projects.blender.org/blender/blender/pulls/112455
2023-09-22 18:49:01 +02:00
Julian Eisel
974d70918b RNA/BPY: Replace asset_library_ref with asset_library_reference
This is a compatibility breaking change to rename all usages of the name
`asset_library_ref` with `asset_library_reference`. Brecht recently
suggested that such abbreviations should be avoided in public API names.
2023-09-19 16:27:07 +02:00
Julian Eisel
591a1ae323 Assets: Remove (almost) all usages of asset handle in Python scripts
The asset handle type is supposed to be replaced by the asset
representation type. It is designed for the asset system as opposed to
the file browser backend. With d421ebac5e, d04cd3f3e6 and f6a6b27ac1, it
can now do everything that is needed in Python to be a replacement.

With this commit the asset handle type and the file handle type it uses
is almost entirely replaced in Python files (only for the asset view
template we require a collection property taking asset handles still,
for internal reasons.)

Part of #102877 and #108806.
2023-09-19 14:41:34 +02:00
Harley Acheson
9659b2deda UI: Change Order of Lists in File Browser Sidebar
Change File Browser sidebar order to Bookmarks, System, Volumes, Recent

Pull Request: https://projects.blender.org/blender/blender/pulls/112114
2023-09-13 19:27:33 +02:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
Damien Picard
56df93bfc6 I18n: Asset browser: do not translate non-editable tags
Asset tags are data and should not be translated, even if they are
built-in data such as hair nodes.

Issue reported by @SatoshiYamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/107907
2023-05-16 10:45:15 +02:00
Harley Acheson
199c7da06d Assets: Do Not Show Blank Read-Only Metadata
Do not show asset metadata "description", "license", "copyright", or
"author" if they are empty AND read-only, since they can't be edited
and contain no useful information to show.

Pull Request: https://projects.blender.org/blender/blender/pulls/105812
2023-04-19 19:55:26 +02:00
Harley Acheson
694f792ee1 UI: OS File Operations Within File Browser
Adds a submenu to the File Browser selected item context menu that
allows opening the item or viewing the location in an OS browsing
window. On Win32 also allows other actions like editing, searching,
opening command prompt, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/104531
2023-04-18 20:39:30 +02:00
Harley Acheson
d0918c5c7f Assets: Add License and Copyright meta-data
As per #105300, this adds optional "license" and "copyright" meta-data
to assets.

Pull Request: https://projects.blender.org/blender/blender/pulls/105318
2023-03-07 18:22:43 +01:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00