Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-02Cleanup: remove "<pep8 compliant>" from headersCampbell Barton
It can be assumed that all scripts comply with basic pep8 formatting regarding white-space, indentation etc. Also remove note in best practices page & update `tests/python/pep8.py`. If we want to exclude some scripts from make format, this can be done by adding them to `ignore_files` in: source/tools/utils_maintenance/autopep8_format_paths.py Or using `# nopep8` for to ignore for individual lines. Ref T98554
2022-05-23Asset Browser: Show "Current File" icon in sidebar source fieldJulian Eisel
If the asset is stored in the current file, display the corresponding icon in the "Source" button in the sidebar. This is a nice indicator and helps users learn what this icon represents (it's used in the main region without text too).
2022-04-19Cleanup: run autopep8 on release/scripts/startup/Campbell Barton
2022-04-06Cleanup: line wrapping, remove unused args, variables in UI scriptsCampbell Barton
2022-03-04Cleanup: unused Python variables & importsCampbell Barton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-01-26Assets: allow creating preview image by rendering active objectJacques Lucke
For node groups there is no good default preview generation. Nevertheless, t would be useful to generate a preview image for a node group by rendering an object in some cases. This commit adds a new operator that allows updating the preview image for the active asset by rendering the active object. Note, the operator can also be used for other asset types, not just node groups. The operator can be found in a menu right below the refresh-preview button. Currently it is the only operator in that menu. In the future, more operators to create previews may be added. Differential Revision: https://developer.blender.org/D13747
2022-01-07Cleanup: use static sets for comparison, quiet unused arg warningsCampbell Barton
2022-01-04Fix T94308: Window Manager console errorJulian Eisel
2021-11-30Asset Browser: Fix incorrect user messageJulian Eisel
Text would display "No asset selected" when it actually inidicates that there is no asset active (not selected). Changed it to "No active asset" now.
2021-11-30Fix Asset Browser properties region toggle not showing open/closed stateJulian Eisel
The button is supposed to be blue (default theme) when the properties region is open, to indicate that state.
2021-11-23Asset: Merge asset library/list refresh operatorsJulian Eisel
In rBdcdbaf89bd11, I introduced a new operator (`file.asset_library_refresh()`) to handle Asset Browser refreshing more separate from File Browser refreshing. However, there already was `asset.asset_list_refresh()`, which at this point only works for asset view templates, but was intended to cover the Asset Browser case in future too. This would happen once the Asset Browser uses the asset list design of the asset view template. So rather than having two operators for refreshing asset library data, have one that just handles both cases, until they converge into one. This avoids changes to the Python API in future (deprecating/changing operators). Differential Revision: https://developer.blender.org/D13239
2021-11-16Asset Browser: hide catalog debug info behind debug optionSybren A. Stüvel
Add a new "experimental" debug option `show_asset_debug_info`, and use that to determine the visibility of the active asset's catalog UUID and simple name. Previously this was only determined by the "Developer Extras" option, which meant it was visible in too many situations. It's not really a "developer extra", and really just a debugging tool, so the new option is more in line with its purpose. Reviewed by: Severin Differential Revision: https://developer.blender.org/D13242
2021-11-01Asset Browser: Correct name & tooltip for asset list refresh operatorJulian Eisel
The name and tooltip were talking about file-lists, which exposes the fact that the Asset Browser uses the File Browser code in the UI, which we shouldn't do. This can confuse users. Instead have a dedicated operator for the Asset Browser with a proper name and tooltip.
2021-10-27Asset Browser: Increase size of search button a bitJulian Eisel
Before this, the search button was quite small really, not much text would fit into it. Increase the size a bit, but not too much to still make the layout work in smaller area sizes.
2021-10-25Assets: Add Author field to asset metadataJulian Eisel
This is information you'd typically want to be visible in the UI. It's optional of course, so if not relevant, it can just remain unset.
2021-10-24Cleanup: line length in Python scriptsCampbell Barton
2021-10-23Asset Browser: Filter options for specific ID typesJulian Eisel
Adds a filter popup to the header that allows specifiying which data-block types to show. The menu automatically reflects all supported ID types, so it shows a checkbox for materials, worlds and actions currently by default, and all ID types with the "Extended Asset Browser" experimental feature enabled.
2021-10-23UI: Show ID filter settings in Link/Append File Browser as icon & checkboxJulian Eisel
The checkboxes integrate better with the surrounding layout and are not that attention grabbing. To my knowledge the only reason not to use checkboxes was so the icons could be displayed. But this does it just like the Outliner filter settings: Show the icon before the checkbox. Also widen the popover a bit to fit longer labels (didn't fit before this patch even).
2021-10-21Assets: Allow specific data-block types to be enabled by defaultJulian Eisel
Updates UI code so that we can enable the asset UI for specific data-block types by default, i.e. irrespective of the "Extended Asset Browser" experimental feature. "Mark as Asset" and "Clear Asset" are always visible in the Outliner context menu now, but are grayed out if not applicable and show a disabled hint in the tooltip. A known side-effect of this: The "Mark as Asset" and "Clear Asset" operators are enabled for action data-blocks now, even though only pose actions created through the Pose Libraries add-on are supported. If this is something worth addressing is being discussed still. Differential Revision: https://developer.blender.org/D12955 Reviewed by: Sybren Stüvel
2021-10-20Asset Browser: UI polish for the asset metadata sidebarJulian Eisel
* Show asset path in a (read only) text button. Makes it possible to see the full path in the tooltip, brings support for copying the path and integrates better with the sourrounding layout. Previous label needed lots of space to show the full path without clipping. * Remove "Details" panel, it only contained one item (description). That is moved next to the name and asset path button. * Use property split layout for name source and description buttons. Now that there are multiple buttons, it's better to have a label for them. * Always show operators for asset previews, just gray them out if not applicable instead of hiding. Keeps the layout consistent and graying out is less confusing than hiding UI elements.
2021-10-15Asset Browser: Hide Import Types menu for "Current File" asset libraryJulian Eisel
This menu doesn't have an effect on the importing while in the "Current File" asset library. This can be quite confusing. However, just hiding the menu may be a temporary solution. Decision actually to instead show a different menu, that allows choosing between duplicating and reusing data on drop. This is being reviewed here https://developer.blender.org/D12879. Meanwhile (or in case we end up rejecting that), this change should avoid some confusion. Differential Revision: https://developer.blender.org/D12752
2021-10-12Asset Catalogs: expose undo/redo operators to UISybren A. Stüvel
Ensure that catalog operations create an undo snapshot, and show undo/redo operators in the asset browser. A hidden operator `ASSET_OT_catalog_undo_push` is also added such that add-ons can also set undo snapshots if they need.
2021-10-12Assets: hide low-level catalog info behind "developer extra's"Sybren A. Stüvel
Hide the catalog UUID and the catalog simple name from the Asset Browser side-panel, unless "Developer Extra's" is enabled in the user prefs.
2021-10-07Asset Browser: Move Asset Library selector to navigation barJulian Eisel
The menu to select the active Asset Library is now in the left bar (so called "Source List", although I'd prefer "Navigation-Bar"). This has some benefits: * All Asset Library navigation is in the left sidebar now, giving nice grouping and a top-to-bottom & left-to-right flow of the layout. The header is focused on view set-up now. * Catalogs are stored inside the asset library. Makes sense to have them right under that. * Less content in the header allows for less wide Asset Browsers without extensive scrolling. * This location gives more space to add options or operators for Asset Libraries. Main downside I see is that the side-bar needs to be opened to change libraries, which takes quite some space. In practice there shouldn't be need to do this often though.
2021-09-29Asset Browser: Initial Asset Catalog UIJulian Eisel
The Asset Browser now displays a tree with asset catalogs in the left sidebar. This replaces the asset categories. It uses the new UI tree-view API (https://wiki.blender.org/wiki/Source/Interface/Views#Tree-View). Buttons are displayed for adding and removing of catalogs. Parent items can be collapsed, but the collapsed/uncollapsed state is not stored in files yet. Note that edits to catalogs (e.g. new or removed catalogs) are only written to the asset library's catalog definition files when saving a .blend. In the "Current File" asset library, we try to show asset catalogs from a parent asset library, or if that fails, from the directory the file is stored in. See adaf4f56e1ed. There are plenty of TODOs and smaller glitches to be fixed still. Plus a UI polishing pass should be done. Important missing UI features: * Dragging assets into catalogs (WIP, close to being ready). * Renaming catalogs * Proper handling of catalogs in the "Current File" asset library (currently not working well). The "Current File" asset library is especially limited still. Since this is the only place where you can assign assets to a catalog, this makes the catalogs very cumbersome in general. To assign an asset to a catalog, one has to manually copy the Catalog ID (a random hash like number) to the asset metadata through a temporary UI in the Asset Browser Sidebar. These limitations should be addressed over the next few days, they are high priority. Differential Revision: https://developer.blender.org/D12670
2021-09-28Assets: Clear Asset operator variants for clearing/setting Fake UserSybren A. Stüvel
The Clear Asset operator (`ASSET_OT_clear`) now clears the Fake User. This makes it symmetrical with the Mark Asset (`ASSET_OT_mark`) operator, which sets Fake User to ensure assets are always saved to disk. Clear Asset now also has a `set_fake_user` boolean option, which allows users to Clear Asset and set Fake User in one go. The asset browser now shows these options in the context menu: - Clear Asset: also clears Fake User. This makes it possible to actually remove assets from the blend file without leaving the Asset Browser. - Clear Asset (Set Fake User): keeps the Fake User bit set. This makes it possible to "hide" the asset from the asset browser, without loosing the actual data. Internally, the `ED_asset_clear_id(id)` function now always clears the Fake User bit. If it was intended that this bit was kept set, it's up to the caller to explicitly call `id_fake_user_set(id)` afterwards. Manifest Task: T90844 Reviewed By: Severin Differential Revision: https://developer.blender.org/D12663
2021-09-23Assets: add Asset Catalog systemSybren A. Stüvel
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: https://developer.blender.org/D12589
2021-09-20UI: Change "Favorites" to "Bookmarks"Harley Acheson
Change of File Browser "Favorites" section header in source list (T panel) to "Bookmarks" to maintain consistency with all the other bookmark-related text and operations. See D10262 for more information and alternatives considered. Differential Revision: https://developer.blender.org/D10262 Reviewed by Julian Eisel
2021-09-10UI: File Browser Options FixHarley Acheson
With D12436 two File Browser properties were renamed but two references not changed in space_filebrowser.py See D12449 for details. Differential Revision: https://developer.blender.org/D12449 Reviewed by Hans Goudey
2021-08-31Fix AssetBrowser UI errorsPhilipp Oeser
Steps to reproduce: - enable Extended Asset Browser - open a regular File Browser gives: "rna_uiItemR: property not found: FileSelectParams.asset_category" Now do proper poll. Differential Revision: https://developer.blender.org/D12350
2021-08-11Enable Asset Browser by default for poses, rest stays experimentalJulian Eisel
Idea for 3.0 is to disable all functionality that isn't well polished and focus on those parts first. Starting with poses. * Adds a new experimental option "Extended Asset Browser", replacing "Asset Browser". * Unlike the previous option, this isn't enabled by default anymore. This didn't work well in practice and caused plenty of confusion. * "Mark as Asset" and "Clear Asset" are hidden if the option is disabled. * Same for the category selection in the Asset Browser. * Always show display the "Only Assets" option in the File Browser while browing inside .blend files. That way you can hide data-blocks that are not pose assets. * The Asset Library setup UI in the Preferences is always visible now, it's needed for pose library access. Addresses T90181, T90180 and T90300. Differential Revision: https://developer.blender.org/D12120
2021-08-06Cleanup: rename `FileList::asset_library` → `asset_library_ref`Sybren A. Stüvel
In the `FileList` struct, rename the `AssetLibraryReference *asset_library` field to `asset_library_ref` -- it's a description of which asset library is used, and not the asset library itself. This is to make space for a future `AssetLibrary *asset_library` field, which will point to an actual asset library struct/class. No functional changes. Reviewed by: Severin Differential Revision: https://developer.blender.org/D12151
2021-08-03Cleanup: Remove redundant checks in File Browser UI scriptJulian Eisel
Was already checking these preconditions in the poll method.
2021-08-03Fix T90341: Crash opening 2.4 file with File Browser editor openJulian Eisel
The file selection parameters (e.g. `context.space_data.params`) are expected to be unset in certain cases. Reading 2.4 files seems to be one of them. Hence, code using it should check it's set first. Also added an assert to a File Browser UI template printing a message when the parameters are unset, to help debugging the issue.
2021-08-02Asset Browser: Proper context menu for assetsJulian Eisel
Add a context menu dedicated to asset operations to the Asset Browser. There are two separate context menus to keep things separated well and avoid confusing if-else logic (similar to D12057 & D12059). Their polls make sure they are displayed for the right contexts only. Also (to be committed as followup cleanup): Remove now unused special handling for assets in file delete operator. Differential Revision: https://developer.blender.org/D12062
2021-08-02Asset Browser: Don't show inapplicable filter and display settingsJulian Eisel
So far the Asset Browser just showed the same popups and settings as the File Browser. Not all of them made sense for the Asset Browser though. * Don't show inapplicable recursion toggle. * Don't show sorting options, which don't work with assets anyway. * Don't show the Filter popover, there are currently no applicable items in there. Just like in D12057, I decided to add separate classes for the Asset Browser case. Differential Revision: https://developer.blender.org/D12059
2021-08-02Asset Browser: Adjust header pulldowns to be Asset Browser specificJulian Eisel
So far the Asset Browser just showed the same menus as the File Browser. Not all of their entries made sense for the Asset Browser though. I decided to just give them entirely different classes to avoid confusing if-else checks everywhere. I think the code duplication this adds is a minor issue, it's better to keep things seperated clearly IMO. * View menu: Add "Asset Details" toggle for the sidebar region. * View menu: Remove recursion sub-menu * View menu: Remove "File Path" region toggle, which doesn't apply for the Asset Browser. Differential Revision: https://developer.blender.org/D12057
2021-07-15Assets: Open Blend File operatorSybren A. Stüvel
Add operator 'Open Blend File' to the Asset Browser. This operator: - starts a new Blender process, - opens the blend file containing the asset, - monitors the new Blender process, and when it stops, - reloads the assets to show any changes made.
2021-07-15Assets: Show asset path in asset browser sidebarJulian Eisel
It's useful to know where an asset is stored in, before this there was no way to tell this. This could probably be displayed nicer in the UI but we're currently unsure how. But at least the information is there now.
2021-06-11Add option to link assets on drag & dropJulian Eisel
Note: Linking in this case as in link vs. append. Easily confused with linking a data-block to multiple usages (e.g. single material used by multiple objects). Adds a drop-down to the Asset Browser header to choose between Link and Append. This is probably gonna be a temporary place, T54642 shows where this could be placed eventually. Linking support is crucial for usage of the asset browser in production environments. It just wasn't enabled yet because a) the asset project currently focuses on single user, not production assets, and b) because there were many unkowns still for the workflow that have big impact on production use as well. With the recently held asset workshop I'm more confident with enabling linking, as design ideas relevant to production use were confirmed. Differential Revision: https://developer.blender.org/D11536 Reviewed by: Bastien Montagne
2021-03-08File Browser: scroll selected files into viewSybren A. Stüvel
Add operator `FILE_OT_view_selected` to the file browser (and thus also to the asset browser) that scrolls selected files into view. This includes the active file, even though it is not selected. In certain cases the active file can loose its selected state (clicking next to it, or refreshing the asset browser), but then it's still shown in the right-hand sidebar. Because of this, I found it important to take it into account when scrolling. This also includes a change to the keymaps: - Blender default: {key NUMPAD_PERIOD} is removed from the "reload" operator, and assigned to the new "view selected files" operator. The reload operator was already doubly bound, and now {key R} is the only remaining hotkey for it. - Industry compatible: {key F} is assigned to the new "view selected files" operator. This is consistent with the other "view selected" operators in other editors. Reviewed By: Severin Differential Revision: https://developer.blender.org/D10583
2021-01-13Asset System: Disable Asset Browser as experimental featureJulian Eisel
The Asset Browser will be disabled and not available for the 2.92 release. In alpha/beta builds, there will be an "Asset Browser" option under Preferences > Experimental, if the developer extras are enabled. Note that this also disables related UI elements (e.g. "Mark Asset" buttons, Preferences settings for asset libraries, etc.). The code is still in master of course, development and testing will continue there. But there simply needs to be too much polishing and fixing before the 2.92 release, plus there are some design decisions to be reevaluated. Check the milestone 1 project to follow ongoing work: https://developer.blender.org/project/view/124/
2021-01-13Cleanup: use single quotes for enum literalsCampbell Barton
2020-12-21Some more UI messages fixes...Bastien Montagne
2020-12-17Fix asset data-block name button not showing up in custom repositoriesJulian Eisel
The Python syntax was wrong, as noted by Campbell in 0ae15e68c785.
2020-12-16Assets: Add operator & button to regenerate the automatic previewJulian Eisel
This makes it possible to trigger a refresh of the data-block preview, available next to the preview in the Asset Browser sidebar. The previews get easily outdated and automatically refreshing it all the time is not an option because it would be a consistently running, quite expensive process. So a button to cause a refresh should be reasonable. This button can also be used to switch back from a custom preview to a generated one. Although that may not be clear, and we should probably think of a way to explain that better. Addresses T82719.
2020-12-16Asset Browser UI: Changes to the sidebar layoutJulian Eisel
The current layout wasn't great at all, and it was planned to polish this. This does a first round of improvements, some more tweaking may follow. * Place name button at the top, with no panel and no leading label. * Add "Preview" panel, people may not want to see the preview all the time, it's already visible in the file list. * Move button to browse for a custom preview to the right of the preview, as icon-only. We have a similar layout in other places (UI-lists, matcaps). * Don't make the details panel a sub-panel. Looked weird because the parent doesn't have a header. * Add info icon to "No asset selected", looks a bit friendlier. * Minor cleanups in the UI script. Based on designs and feedback by William Reynish.
2020-12-16Asset Browser: Allow renaming asset data-blocks from the sidebar directlyJulian Eisel
This is something we wanted to support doing. It's confusing if users see the name but it's always grayed out. So be convenient and avoid the confusion.
2020-12-16Cleanup: pep8Campbell Barton