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-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Cleanup: Remove unused/unneeded code from old Asset Engine designJulian Eisel
This code was written for the File Browser together with the Asset Engine design, that is not part of the Asset Browser/System design anymore. Updated comments accordingly. `FileDirEntryRevision` was actually used, but I removed it and moved the used members to the parent `FileDirEntry`, since there is no concept of revisions currently. There should be no functional changes.
2021-07-02File Browser: Refactor file "UUID" code (which wasn't really a "UUID")Julian Eisel
To some degree these are changes in preparation of further Asset Browser related changes, see D11119. But also, the current UUID design was written for the old Asset Engine design, which isn't part of the current Asset Browser/System design anymore. And lastly, "UUID" are a well established standard (https://en.wikipedia.org/wiki/Universally_unique_identifier) which this implementation didn't follow. What we have here is more of an index, or a unique identifier (https://en.wikipedia.org/wiki/Unique_identifier). So this does the following changes: * Renames "UUID" to "UID" * Changes the type of the UID to (a typedef'ed) `uint32_t`, which is more than enough for our current asset system design and simplifies things. * Due to the new type, we can avoid allocations for hash-table storage. * Add/use functions for UID handling Note that I am working on a major rewrite of the file-list code. Meanwhile we want to keep things sensible.
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-30UI: custom free function improvementsJacques Lucke
This changes `UI_but_func_tooltip_set` so that it allows passing a custom free function, which has two benefits: * The caller can pass `null` to indicate that the value should not be freed. * Arbitrary c++ data can be passed to the callback (before the struct had to be trivially destructible). I added `uiFreeArgFunc` and used it in other places where appropriate. Differential Revision: https://developer.blender.org/D11738
2021-06-29Fix crash on link/append for asset data-blocks in Thumbnails modeJulian Eisel
Same fix as 03a83b4eb5bc, but for the Thumbnails display mode.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-25UI: Improved File Browser Preview Image ScalingHarley Acheson
This patch enables sample filtering when scaling preview images in File Browser, improving the result a bit. Reduces blockiness and other artifacts when enlarging the images. see D11706 for details and examples. Differential Revision: https://developer.blender.org/D11706 Reviewed by Julian Eisel
2021-06-24Fix T89129: file dialog displays in-progress Safari downloads as a folderLeon Zandman
In-progress Safari download files/packages are now recognized as bundles and therefore not treated as directories. Differential Revision: https://developer.blender.org/D11613
2021-06-24Fix linking code after own recent commit.Bastien Montagne
More stupid mistake in recent enhanced reports for file load code, rB82c17082ba0e left some read-after-free situations.
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-23Revert "Revert "Enhanced stats/reports for blendfile reading.""Bastien Montagne
This reverts commit rB3a48147b8ab92, and fixes the issues with linking etc. Change compared to previous buggy commit (rBf8d219dfd4c31) is that new `BlendFileReadReports` reports are now passed to the lowest level function generating the `FileData` (`filedata_new()`), which ensures (and asserts) that all code using it does have a valid non-NULL pointer to a `BlendFileReadReport` data. Sorry for the noise, it's always when you think a change is trivial and do not test it well enough that you end up doing those kind of mistakes...
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-18Fix T89262: Crash in regular FileBrowser ID listing of 'asset' .blend files.Bastien Montagne
`ED_fileselect_get_asset_params` would only return actual data pointer when file browser is in ASSET mode. Calling that whole section only makes sense if filebrowser is in asset mode anyway. Regression introduced in rBf6c5af3d4753 I think. @Severin committing this fix now as this is a fairly critical bug for the studio, feel free to revert and do proper fix if this one is not the best solution.
2021-06-15BLI: use explicit task isolation, no longer part of parallel operationsBrecht Van Lommel
After looking into task isolation issues with Sergey, we couldn't find the reason behind the deadlocks that we are getting in T87938 and a Sprite Fright file involving motion blur renders. There is no apparent place where we adding or waiting on tasks in a task group from different isolation regions, which is what is known to cause problems. Yet it still hangs. Either we do not understand some limitation of TBB isolation, or there is a bug in TBB, but we could not figure it out. Instead the idea is to use isolation only where we know we need it: when holding a mutex lock and then doing some multithreaded operation within that locked region. Three places where we do this now: * Generated images * Cached BVH tree building * OpenVDB lazy grid loading Compared to the more automatic approach previously used, there is the downside that it is easy to miss places where we need isolation. Yet doing it more automatically is also causing unexpected issue and bugs that we found no solution for, so this seems better. Patch implemented by Sergey and me. Differential Revision: https://developer.blender.org/D11603
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-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-06-08BLI: support disabling task isolation in task poolJacques Lucke
Under some circumstances using task isolation can cause deadlocks. Previously, our task pool implementation would run all tasks in an isolated region. Now using task isolation is optional and can be turned on/off for individual task pools. Task pools that spawn new tasks recursively should never enable task isolation. There is a new check that finds these cases at runtime. Right now this check is disabled, so that this commit is a pure refactor. It will be enabled in an upcoming commit. This fixes T88598. Differential Revision: https://developer.blender.org/D11415
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-19Fix T87621: Win32 Do Not Create Preview Thumbnails for Offline FilesHarley Acheson
This patch turns off the creation of file thumbnails for files that are offline and therefore not fully-present on the file system. These types of files - typically cloud-based or stored on slower backup media - only have their contents available when actually accessed, at which point there will be a short delay. If we allow thumbnail creation in this state then all offline files in a folder will be downloaded just to view a listing, which can take a long time. Files in this state will instead get a more generic thumbnail that still indicates file type (icon in center) and that shows offline state will a special icon at the bottom-left. Although this currently only affects Windows users, most of this patch is platform-agnostic. So other platforms inherit this behavior if they only add FILE_ATTR_OFFLINE attribute to files in this state. See D11101 for more information. Differential Revision: https://developer.blender.org/D11101 Reviewed by Julian Eisel
2021-05-17File List: micro optimization in the icon previewGermano Cavalcante
No real functional changes. When `i` is zero, `filelist_cache_previews_push` was called twice with the same icon. This caused the preview to be computed twice when only once is needed.
2021-05-17Cleanup: reduce indentation in filelist_cache_previews_pushGermano Cavalcante
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-04-29Correction to own previous commit: Add missing breakJulian Eisel
Small mistake in 88400f0c03a9. Not having this break would be harmless, but we can avoid some unnecessary work with it.
2021-04-29Fix incorrect sorting in Asset Browser after renaming local assetJulian Eisel
When renaming a data-block that is an asset, while the asset is visible in the Asset Browser ("Current File" asset library), the list wouldn't re-sort items, breaking the alphabetical sorting. This was easily possible while changing the data-block name throught the Asset Browser's sidebar, while in the "Current File" asset library.
2021-04-11Cleanup: spellingCampbell Barton
2021-03-24GPencil: New modules for Import and ExportAntonio Vazquez
This patch adds support to export and import grease pencil in several formats. Inlude: * Export SVG * Export PDF (always from camera view) * Import SVG The import and export only support solid colors and not gradients or textures. Requires libharu and pugixml. For importing SVG, the NanoSVG lib is used, but this does not require installation (just a .h file embedded in the project folder) Example of PDF export: https://youtu.be/BMm0KeMJsI4 Reviewed By: #grease_pencil, HooglyBoogly Maniphest Tasks: T83190, T79875, T83191, T83192 Differential Revision: https://developer.blender.org/D10482
2021-03-18Cleanup: spellingCampbell Barton
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