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
2021-03-12Cleanup: incorrect doxy section titleCampbell Barton
Also correct typo.
2021-03-11Fix Asset Browser showing oudated list for changes done while browser is hiddenJulian Eisel
Steps to reproduce were: * Open an Asset Browser * "Mark Asset" on some data-block * Change the Asset Browser into a different editor (not File Browser!) * "Clear Asset" on the data-block again, or mark another asset * Change back to the Asset Browser, it will show an outdated list Now the file-browser reloads local file data after spaces were changed. Note that the current notifier code doesn't limit the space-change notifiers to the affected spaces, so changing any visible space will trigger this. That's an issue to be fixed separately.
2021-03-11Fix failing assert when loading file with untraceable custom asset libraryJulian Eisel
When loading a file with an asset browser open, and it showed a custom asset library that can't be found currently (e.g. because the file is from somebody else), the `BLI_assert(0)` in `rna_FileAssetSelectParams_asset_library_get()` would fail. There was code to handle this case already, but unlike I thought it didn't run right after file read. Now it does.
2021-03-08Fix ID preview not updating in Asset BrowserSybren A. Stüvel
Fix ID preview not updating in Asset Browser, by actually sending an explicit `NA_EDITED` along with the `NC_ASSET` notifier.
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-03-05Cleanup: Rename func occurences to _fnSebastián Barschkis
Use _fn as a suffix for callbacks.
2021-03-05Asset Browser Space API: add `activate_asset_by_id()` functionSybren A. Stüvel
Add an RNA function `activate_asset_by_id(asset_id: ID, deferred: bool)` to the File Browser space type, which intended to be used to activate an asset's entry as identified by its `ID *`. Calling it changes the active asset, but only if the given ID can actually be found. The activation can be deferred (by passing `deferred=True`) until the next refresh operation has finished. This is necessary when an asset has just been added, as it will be loaded by the filebrowser in a background job. Reviewed By: Severin Differential Revision: https://developer.blender.org/D10549
2021-02-25Cleanup: spellingCampbell Barton
2021-02-16Assets: Remove appended asset when dropping operation failsJulian Eisel
When dropping an asset somewhere, it is appended and then a drop operation is called to actually add it to the scene based on current context. If this drop operation fails, the appended data-block is now still in the .blend. The user may not notice and not expect this. Instead idea is to rollback any changes done by dropping code if the operation fails, namely removing the appended data-block again. Adds a new `cancel()` callback which is called if the drop operator returns `OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets on drop failure. Also removes the `free_id_on_error` property of the `NODE_OT_add_group` operator, which was used as ad-hoc solution to get this same behavior.
2021-02-16Cleanup: spellingCampbell Barton
2021-02-13Cleanup: spellingCampbell Barton
2021-02-10Cleanup: remove redundant headers in source/blender/editors/Campbell Barton
Remove redundant headers using `./source/tools/utils_maintenance/code_clean.py` Reviewed By: jmonteath Ref D10364
2021-02-08Fix T85448: File Browser sidebar collapses when selecting a fileJulian Eisel
The logic to ensure a valid region state was too aggressive in setting the region hiding. It would just always update it based on the operator's `hide_props_region` option, not only when file browser was newly opened. It's more selective now.
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-26Merge remote-tracking branch 'origin/blender-v2.92-release'Sybren A. Stüvel
2021-01-26Asset Browser: fix context properties reported to PythonSybren A. Stüvel
Change `"active_id"` to `"id"` so that tab completion in the asset browser context returns the correct properties. 055ef5df615632f81e30e39ae47b42a87af350ca renamed the `active_id` property to `id`, but `dir(thecontext)` still returned `"active_id"`.
2021-01-25Cleanup: pass 'rctf' rectangle to 2D box drawing functionsCampbell Barton
Passing 4x arguments for the rectangle, mixed in with round-box radius & color wasn't very readable. Instead, pass a `rctf` as the first argument to UI box drawing functions.
2021-01-22Fix memory leak when opening file browserJulian Eisel
The name string of each file was duplicated but not freed. The new flag to ensure the file-list frees the name wasn't set. Mistake in ca475479eb26.
2021-01-22Fix Asset Browser showing old name after renaming data-blockJulian Eisel
The "Current File" asset library didn't get refreshed after the data-block name changed. But rather than entirely refreshing the file list, or doing possibly problematic partial refreshes, reference the data-block name directly, so a simple redraw gets the new name displayed. Addresses T83751
2021-01-19Cleanup: use 'const' argument for parameter argumentCampbell Barton
2021-01-19UI Code Quality: Use "params" struct for area and region callbacksHans Goudey
These functions with many arguments can be unwieldy. Aside from the obvious issues with rewriting the list of arguments and the opportunities for error and frustration that presents, the long list of arguments make these systems hard to change. So when an argument should be added, someone might skip that and add some hack instead. So, as proposed in T73586#1037210, this patch instead uses a "params" struct for each of these callbacks. - Use param argument for `ARegionType.listener` - Remove unused window field in region listener - Use param argument for `SpaceType.listener` - Use params struct for `ARegionType.message_subscribe` Differential Revision: https://developer.blender.org/D9750
2021-01-14Fix various issues with regions in Asset BrowserJulian Eisel
Fixes a number of glitches, e.g. the sidebar disappearing when selecting an asset or wrong AZones (the little chevrons to indicate a hidden region). There were a couple of issues: * Execution region was created, but not used. * If an execution region already existed when refreshing the area, it was tagged as hidden, not removed. * The sidebar was always set to be hidden on refreshes. * When toggling from Asset Browser to File Browser as regular editor (i.e. not opened temporary via Ctrl+O or such), the sidebar region wasn't removed. Adresses T83644.
2021-01-13UI: Revert design changes to data-block selector for the 2.92 releaseJulian Eisel
Partially reverts 2250b5cefee7. Removing the user count and fake user count icons was controversial (which was expected) and there are a few further changes needed, that won't make it in time for the release, see D9946. While there is a design to bring back the user count and fake user indicators, a new design idea was proposed that the UI team wants to follow. This came too late for the 2.92 release, the new design is targeted at the 2.93 release now. Meanwhile, UI team decision was to simply revert the design changes. The new design is being worked on in https://developer.blender.org/T84669. Note that this commit does not revert some internal changes done in 2250b5cefee7. Namely the introduction of `ed_util_ops.c` and data-block operators in there. These will still be needed in the new design.
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-08Fix file-handle leak when parsing xdg user directoriesCampbell Barton
2020-12-24UI: Cleanup spelling of compound wordsYevgeny Makarov
Approximately 138 changes in the spelling of compound words and proper names like "Light Probe", "Shrink/Fatten", "Face Map". In many cases, hyphens were used where they aren't correct, like "re-fit". Other common changes include: - "Datablock" -> "data-block" - "Floating point" -> "floating-point" - "Ngons" -> "n-gons" These changes help give the language used in the interface a consistent, more professional feel. Differential Revision: https://developer.blender.org/D9923
2020-12-24Cleanup: Fix capitalization in various UI stringsYevgeny Makarov
Approximately 195 changes of capitalization to conform to MLA title style. UI labels and property names should use MLA title case, while descriptions should be capitalized like regular prose, generally with only the start of a sentence capitalized. Differential Revision: https://developer.blender.org/D9922
2020-12-23Fix crash closing File Browser window after closing temporary render windowJulian Eisel
This seems to be a longer standing issue. Steps to reproduce were: * With factory settings, Ctrl+O then F12 * Close the render window using the window close button * Close the File Browser window using the window close button This could be OS specific though, at least on macOS this caused a crash.
2020-12-21Fix some UI messages and update i18n spellcheck utils.Bastien Montagne
2020-12-18UI: Redesigned data-block selectorsJulian Eisel
The previous design is rather old and has a couple of problems: * Scalability: The current solution of adding little icon buttons next to the data-block name field doesn't scale well. It only works if there's a small number of operations. We need to be able to place more items there for better data-block management. Especially with the introduction of library overrides. * Discoverability: It's not obvious what some of the icons do. They appear and disappear, but it's not obvious why some are available at times and others not. * Unclear Status: Currently their library status (linked, indirectly linked, broken link, library override) isn't really clear. * Unusual behavior: Some of the icon buttons allow Shift or Ctrl clicking to invoke alternative behaviors. This is not a usual pattern in Blender. This patch does the following changes: * Adds a menu to the right of the name button to access all kinds of operations (create, delete, unlink, user management, library overrides, etc). * Make good use of the "disabled hint" for tooltips, to explain why buttons are disabled. The UI team wants to establish this as a good practise. * Use superimposed icons for duplicate and unlink, rather than extra buttons (uses less space, looks less distracting and is a nice + consistent design language). * Remove fake user and user count button, they are available from the menu now. * Support tooltips for superimposed icons (committed mouse hover feedback to master already). * Slightly increase size of the name button - it was already a bit small before, and the move from real buttons to superimposed icons reduces usable space for the name itself. * More clearly differentiate between duplicate and creating a new data-block. The latter is only available in the menu. * Display library status icon on the left (linked, missing library, overridden, asset) * Disables "Make Single User" button - in review we weren't sure if there are good use-cases for it, so better to see if we can remove it. Note that I do expect some aspects of this design to change still. I think some changes are problematic, but others disagreed. I will open a feedback thread on devtalk to see what others think. Differential Revision: https://developer.blender.org/D8554 Reviewed by: Bastien Montagne Design discussed and agreed on with the UI team, also see T79959.
2020-12-18UI: Don't use abbreviations in label textYevgeny Makarov
Expand abbreviations for words like "Bright" (instead of "Brightness"), "Premul", "Lib", "Dir", etc. Differential Revision: https://developer.blender.org/D9862
2020-12-17Fix T83888: Ctrl F in Asset Browser crashes blenderPhilipp Oeser
In case of being in Asset browsing mode, the search field is located in the header (RGN_TYPE_HEADER not RGN_TYPE_UI as for file browsing mode). To be future proof, now iterate all regions and act if the "filter_search" can be activated. Maniphest Tasks: T83888 Differential Revision: https://developer.blender.org/D9882
2020-12-17Fix T83878: Crash right-clicking in Asset Browser with no asset activeJulian Eisel
Data of the File Browser context callback needs to be validated and return `CTX_RESULT_NO_DATA` if the context member is valid but not set in the current context.
2020-12-16Asset Browser: For assets without preview, show type icon in sidebarJulian Eisel
Otherwise it would just show empty space where the icon is supposed to be. Unfortunately this icon is upscaled quite a bit and doesn't look too great. Would be good to improve but not a high priority.
2020-12-16Fix T83843: Crash in Asset Browser sidebar with geometry asset selectedJulian Eisel
No icon should be created if the preview doesn't exist.
2020-12-16Cleanup: Rename Asset Browser context member from "active_id" to "id"Julian Eisel
This is the same name we use elsewhere for the focused/active ID context member, so this should follow it.
2020-12-16Cleanup: sort struct blocksCampbell Barton
2020-12-16Cleanup: use static declarationsCampbell Barton
2020-12-15Cleanup: Clang tidy else after returnHans Goudey
2020-12-15Fix crash opening maximized File Browser from Asset BrowserJulian Eisel
If Preferences > Interface > Temporary Editors > File Browser is set to "Maximized Area", opening a File Browser from an Asset Browser would cause the new maximized editor to be an Asset Browser. Exiting it again would crash. This fixes the wrong behavior and the crash. There's still an issue with exiting the editor again, it stays a File Browser then and doesn't go back to being an Asset Browser. That's to be fixed separately.
2020-12-15Fix crash when deleting/renaming asset library while it's visibleJulian Eisel
Storing the asset library reference by name wasn't a good idea, I thought it would work with a careful fallback, but it's easier to just use the index instead. So change to using indices, make sure fallback methods work reliable and make sure the file list is updated when asset libraries are removed. I added a new notifier type for the latter, I prefer not using file notifiers in asset-library/preferences code. We have more than enough values for notifiers left.
2020-12-15Fix Asset Browser crash with undo in "Current File" library with sidebarJulian Eisel
When the Asset Browser was showing the "Current File" repository and the sidebar was open, undoing could crash, because the context API returned freed data. Don't let context return anything if a refresh is pending due to data changes like undo/redo.
2020-12-15Asset System: New Asset Browser editorJulian Eisel
This introduces the User Interface part of the Asset Browser, based on the design in T54642. Additions: * New Asset Browser (internally a sub-editor of the File Browser). * Navigation region showing asset categories. * Main region showing the assets of the selected asset library with previews. The assets may be stored over multiple .blends in the directory that's "mounted" as asset library in the Preferences. They will all be shown in this list. * Header with an asset library dropdown, allowing to choose the active asset library to show. Options are the "Current File" as asset library and all custom libraries. * Display popover, filter popover and search box (partially dummies, see T82680). * Sidebar showing the metadata of the currently active file (name, preview, description and tags), which can be edited for assets in the "Current File" asset library. (For others it will reset on reload.) * The sidebar includes a button to load a custom preview image from a file. * Make asset files draggable (with preview image). * If a library with invalid path is selected, a message is drawn in the main region to help the user understand what's wrong. * Operators to add and remove asset tags. Exposed in the sidebar. * "Only Assets" option for Link/Append. * Internal utilities for asset UI scripts. For screenshots or demo videos, please see D9725. Or the 2.92 release notes. Note that there are many things to be tweaked and polished in the Asset Browser UI still. For example, the filter and display popovers are mostly dummies. See T82680. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9725 Reviewed by: Brecht Van Lommel, Hans Goudey
2020-12-15Asset System: Prepare File Browser backend for the Asset BrowserJulian Eisel
The Asset Browser will be a sub-editor of the File Browser. This prepares the File Browser code for that. **File-Lists** * Support loading assets with metadata read from external files into the file-list. * New main based file-list type, for the "Current File" asset library. * Refresh file-list when switching between browse modes or asset libraries. * Support empty file-lists (asset library with no assets). * Store file previews as icons, so scripts can reference them via icon-id. See previous commit. **Space Data** * Introduce "browse mode" to differeniate between file and asset browsing. * Add `FileAssetSelectParams` to `SpaceFile`, with `FileSelectParams` as base. Makes sure data is separated between asset and file browsing when switching between them. The active params can be obtained through `ED_fileselect_get_active_params()`. * `FileAssetSelectParams` stores the currently visible asset library ID. * Introduce file history abstraction so file and asset browsing can keep a separate history (previous and next directories). **General** * Option to only show asset data-blocks while file browsing (not exposed here). * Add "active_file" context member, so scripts can get and display info about the active file. * Add "active_id" context member, so `ED_OT_lib_id_load_custom_preview` can set a custom ID preview. (Only for "Current File" asset library) * Expose some of `FileDirEntry` in RNA as (non-editable). That way scripts can obtain name, preview icon and asset-data. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9724 Reviewed by: Bastien Montagne
2020-12-10Cleanup: Use const for filter queriesJulian Eisel
2020-12-08Fix T83559: File Browser uses wrong operationJulian Eisel
When opening a temporary File Browser, we have to make sure the file selection parameters are refreshed. When opening it in a new Window that would always be the case, if the File Browser uses a maximized window (as set in the Preferences), it might reuse space-data from a previous use. So we have to force the refresh. Also renamed the relevant function to be more clear about what it's doing. Mistake in 95b3c4c966f9.
2020-12-08Cleanup: Correct an own earlier commit to use an existing utility functionJulian Eisel
Didn't know this function existed, better to use it then to avoid verbosity.
2020-12-08File Browser: Refactor access to the selection parameters structJulian Eisel
* Avoid direct access to `SpaceFile.params`, use a getter instead. This matters because once the asset-browser changes are in, there will be an alternative selection parameter object. The getter can return the correct one. * Rename the function to ensure the parameters. The old name `ED_fileselect_get_params()` wasn't a mere getter, it would create the parameters if necessary. Now we have an actual getter, so better be clear. * In some instances, I replaced the old "get" function with the new mere getter. So the ensure logic is called less often. However, in these cases we should be able to assume the selection parameters were created already as part of the editor creation routine. The term "active" in the new function names may seem a bit odd in the current context, but that is a preparation for the Asset Browser merge as well. Like said, there will be two file selection parameter objects in the space.
2020-12-08Cleanup: Use guarded allocator for data-block names returned from file readingJulian Eisel
Direcly using the C library allocator functions is usually avoided in favor of our guarded allocator. It's more useful when debugging.