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-07-07Assets: Keep assets active after renaming, ensure they are scrolled into viewJulian Eisel
When renaming an ID somewhere in the UI after marking it as asset, it would often get lost in the Asset Browser (scrolled out of view). It would also get deactivated. This patch makes sure that if an asset is active whose ID gets renamed, it is kept active and visible. That is important for a fast, uninterrupted asset creation workflow, where users often rename assets while working in the asset browser. Old code stored the new file-name to identify a file after re-reading the file-list after the rename. For assets that doesn't work because there may be multiple assets with the same name. Here the simple solution of just storing the pointer to the renamed ID is chosen, rather than relying on the file-name in this case. (Should be fine with undo, since the ID * reference is short lived, it's not stored over possible undo steps. If it turns out to have issues, I rather switch to a rename_id_uuid, but keep that separate from the file->uid). Reviewed by: Sybren Stüvel Differential Revision: https://developer.blender.org/D11119
2021-07-07Cleanup: Move file deselection function to more appropriate fileJulian Eisel
`filesel.c` seems like the place that should contain file selection functions. Previously it was in `file_ops.c` because that was the only file that actually used it. But a followup commit needs it from a different file.
2021-07-07Cleanup: spelling in commentsCampbell Barton
2021-07-05Assets: Disable file renaming operator for Asset BrowsersJulian Eisel
This operator only works with renaming files, not assets.
2021-07-05Cleanup: Move common File Browser renaming code into functionsJulian Eisel
Code would manually do the same things in a couple of places, obvious case of unnecessary code duplication.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-01Fix race condition when loading multiple File/Asset Browsers at onceJulian Eisel
When multiple File or Asset Browsers would load at once (e.g. when loading a file with two File Browsers open) and they would load multiple directories or .blend files (using the Recursions option in the File Browser or loading an asset library with multiple .blends), often only one File/Asset Browser would correctly load all files. Others would be incomplete or entirely empty. That was because of a race condition, where the directories or .blend files would be loaded concurrently and the first one that finished would cancel the other ones. This again happened because they used the job system with the same "owner", which by design makes all jobs with the same owner cancel as soon as the first is finished. Address this by making sure they have different owners. That is, not the scene anymore, but the filelist the job belongs to. Doesn't make much sense to use the scene as owner for scene-unrelated file loading anyway. Steps to reproduce were: * Open two File Browsers as regular editors. * In the Display Settings popover, set "Recursions" to 2 or 3 levels. * Navigate to a directory with plenty of subdirectories in both File Browsers. * Save the file. * Reload the file, one of the File Browsers likely has an incomplete file list. Alternatively, use Asset Browsers and open an asset library containing multiple .blends.
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-06-14Fix Build WarningHarley Acheson
Marking unused function argument. Introduced in bcff0ef9cabc Differential Revision: https://developer.blender.org/D10887
2021-06-14UI: Windows Blend File AssociationHarley Acheson
This patch allows Windows users to specify that their current blender installation should be used to create thumbnails and be associated with ".blend" files. This is done from Preferences / System. The only way to do this currently is from the command-line and this is sometimes inconvenient. Differential Revision: https://developer.blender.org/D10887 Reviewed by Brecht Van Lommel
2021-06-03Fix invalid return values from file_executeCampbell Barton
Error in 6c8c30d865ee8aafc3a088ce97b1caa4c4cc9ed7
2021-05-27Cleanup: specify array sizes, remove warnings in commentsCampbell Barton
2021-05-05Fix T82002: ENTER does nothing when mouse cursor is over save dialog text fieldSeverin
The `file.execute` operator would early-exit because the mouse wasn't hovering the file list. Caused by 4ba9d7d71e8f. Although simpler solutions would have been possible, I decided it's better to split add a new operator for executing based on the mouse (for double-clicking files), to separate that from the window level execute operator (`file.execute`). This allows more control and we can get rid of the implicit assumption that the keymap would call `file.select` on mouse-press, and `file.execute` on double-click, for the double-click behavior to work. The cost is that we execute the file selection & activation logic twice on the double-click, but that shouldn't be an issue at all. Also removes the `need_active` property from the `file.execute` operator. That's ancient and wasn't implemented well anyway. To be clear, reason this fixes the bug is that `file.execute` works entirely with the `execute()` callback now and doesn't early-exit based on the mouse position anymore. Might trigger warnings about the `need_active` property not being found for custom keymaps. These can be ignored and the property can safely be removed from the keymap. I don't expect other keymap breakages.
2021-03-18Cleanup: spellingCampbell Barton
2021-03-12Cleanup: incorrect doxy section titleCampbell Barton
Also correct typo.
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-02-16Cleanup: spellingCampbell 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-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-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-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-11-03Fix C operators can't set default display or sort type for File BrowserJulian Eisel
`WM_operator_properties_filesel()` allows C operators to set a display or sort type for the File Browser to use. But the File Browser would always override that because of an invalid `_is_set()` check. (The operators don't actually set the value, they only set the property's default value.) The only operator affected by this is "Recover Auto Save". It is supposed to show a vertical list ordered chronologically. It used settings from the previous File Browser usage before this patch. Operators using the File Browser should generally use `FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not to. See comments at their definition. ---- This makes it so operators that set a different display or sort type don't change the sort or display type for the next File Browser operation. So using "Recover Auto Save" entirely isolates display and sort type from other operations. Differential Revision: https://developer.blender.org/D8598 Reviewed by: Bastien Montagne
2020-10-23Cleanup: make formatAaron Carlisle
2020-10-19Spelling: MiscellaneousHarley Acheson
Corrects 34 miscellaneous misspelled words. Differential Revision: https://developer.blender.org/D9248 Reviewed by Campbell Barton
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-09-30Cleanup: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-09-13Cleanup: unused variableCampbell Barton
2020-09-12Fix T70255: Setting file browser bookmark from Python crashesCampbell Barton
Support setting bookmarks even when the file browser isn't the active space.
2020-08-26Cleanup: better naming and no bad level access in BLI_winstuffBrecht Van Lommel
2020-08-23Fix T79989: File browser `Return` doesn't open a directoryCampbell Barton
Regression in e4a50e3f47de1.
2020-08-07Fix fast clicks on File Browser sort columns not changing sortingJulian Eisel
Clicking on the column header is supposed to enable sorting by this column, or switch the sort order if already enabled. The double-click event would be blocked by the `file.execute()` operator, which is not supposed to act if the user clicked outside the file list.
2020-08-07Fix T79616: Sort by column in filebrowser is brokenJulian Eisel
After changes in rBc606044157a3, mouse press events would be blocked by the selection operator. This only worked by chance before.
2020-07-03Cleanup: Editors, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors` module. No functional changes.
2020-06-09Fix T77504: Operator search gives wrong resultsCampbell Barton
Regression in e8ab0137f8766
2020-05-26UI: Windows Shell Links & Improved Mac AliasesHarley Acheson
Adds support for Windows Shell Links (shortcuts) to the File Browser. Extended Mac Alias usage. Better visualization of linked items. Differential Revision: https://developer.blender.org/D7380 Reviewed by Campbell Barton
2020-04-07Cleanup: BLI_path.h function renamingCampbell Barton
Use BLI_path_ prefix, more consistent names: BLI_parent_dir -> BLI_path_parent_dir BLI_parent_dir_until_exists -> BLI_path_parent_dir_until_exists BLI_ensure_filename -> BLI_path_filename_ensure BLI_first_slash -> BLI_path_slash_find BLI_last_slash -> BLI_path_slash_rfind BLI_add_slash -> BLI_path_slash_ensure BLI_del_slash -> BLI_path_slash_rstrip BLI_path_native_slash -> BLI_path_slash_native Rename 'cleanup' to 'normalize', similar to Python's `os.path.normpath`. BLI_cleanup_path -> BLI_path_normalize BLI_cleanup_dir -> BLI_path_normalize_dir BLI_cleanup_unc -> BLI_path_normalize_unc BLI_cleanup_unc16 -> BLI_path_normalize_unc16 Clarify naming for extracting, creating numbered paths: BLI_stringenc -> BLI_path_sequence_encode BLI_stringdec -> BLI_path_sequence_decode Part of T74506 proposal.
2020-04-03Cleanup: Rename ScrArea variables from sa to areaJulian Eisel
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432. Now the area and region naming conventions should be less confusing. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-04-03Cleanup: Continue renaming ARegion variables from ar to regionJulian Eisel
Continuation of b2ee1770d4c3, now non-single word variables are also renamed. Part of T74432. Also ran clang-format on affected files.
2020-04-03Cleanup: use abbreviated names for unsigned types in editorsCampbell Barton
2020-03-26Fix T60682: adds macOS alias redirection for directoriesBrecht Van Lommel
This adds support for macOS aliases in addition to symlinks. It also adds support for hidden, readonly and system file attributes. Contributed by Ankit (ankitm) with modifications by me. Differential Revision: https://developer.blender.org/D6679
2020-03-25Cleanup: use doxy sectionsCampbell Barton
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-13Fix T74699: File browser closing while loading crash.Bastien Montagne
Owner of filelisting job was changed, without proper update of all access/usages of that owner to reach the job, leading to failure of timer removal from the WM, and attempt to double-free the job... Caused by rB2c4dfbb00246ff.
2020-03-07Cleanup: replace BLI_make_file_string with BLI_join_dirfile for the ↵Campbell Barton
file-selector In these cases the file selectors directory is already expanded.
2020-03-07Cleanup: replace BLI_make_file_string with BLI_join_dirfile where possibleCampbell Barton
Use 'BLI_join_dirfile' for joining paths that don't need to expand '//'.
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.