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-11-09Asset System: New core type to represent assets (`AssetRepresenation`)Julian Eisel
Introduces a new `AssetRepresentation` type, as a runtime only container to hold asset information. It is supposed to become _the_ main way to represent and refer to assets in the asset system, see T87235. It can store things like the asset name, asset traits, preview and other asset metadata. Technical documentation: https://wiki.blender.org/wiki/Source/Architecture/Asset_System/Back_End#Asset_Representation. By introducing a proper asset representation type, we do an important step away from the previous, non-optimal representation of assets as files in the file browser backend, and towards the asset system as backend. It should replace the temporary & hacky `AssetHandle` design in the near future. Note that the loading of asset data still happens through the file browser backend, check the linked to Wiki page for more information on that. As a side-effect, asset metadata isn't stored in file browser file entries when browsing with link/append anymore. Don't think this was ever used, but scripts may have accessed this. Can be brought back if there's a need for it.
2022-11-02Fix use-after-free in asset library storage destructionJulian Eisel
Would only appear when more than 4 asset libraries were loaded, because small buffer optimization would hide the issue.
2022-11-01Nodes: Add node group assets in add menuHans Goudey
This patch builds on the work from bdb57541475f to add node group assets directly in the node editor add menu. Assets are added after separators to distinguish them, but otherwise they look like any other node. The catalog trees from all configured libraries are used to build the menu hierarchy. Only catalogs with matching asset types are used though. There are a few limitations of this initial version. For now this only supports geometry nodes. Support for other built-in node systems just requires some refactoring of the corresponding add menu though. Lazy loading will be added in a followup commit. For now there is a label the first time the menu is opened. Like the search menu integration, re-saving asset library files in 3.4 is required, if it hasn't been done already. Implementation wise, there is a some ugly code here. A lot of that is because the asset system isn't complete. The RNA API doesn't work well yet, and the system isn't built to interact with multiple libraries at once. It's also ugly because of the way we combine automatic menu generation with builtin menus. As noted in a code comment, these two systems could be merged completely so that the menus for builtin nodes are also generated in the same way. Differential Revision: https://developer.blender.org/D16135
2022-10-17Cleanup: replace BLI_join_dirfile with BLI_path_joinCampbell Barton
These functions are almost identical, the main difference being BLI_join_dirfile didn't trim existing slashes when joining paths however this isn't an important difference that warrants a separate function.
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-19Nodes: Add node group assets to search menusHans Goudey
Currently node group assets are supported, but using them by dragging from the asset browser is cumbersome. This patch adds all node group assets from user asset libraries and the current file libraries to the add node search menu and the link drag search menu. Node groups added through the search will have their "options" hidden, meaning the data-block selector is displayed. This helps keep the UI clean, and the selector shouldn't be necessary anyway. To make that possible, metadata like the node tree type and its inputs and outputs has to be saved in the file. This requires re-saving the files that contain the assets with the patch applied. The node add search operator is moved from Python to C++ to ease development and allow more flexibility. It supports a tooltip that gives the description of assets. Currently the node groups are added with the asset system's existing "Append & Reuse" behavior. It's likely that linking should be possible in the future too, but for now the idea is to use the more foolproof option that doesn't create dependencies between files. Because loading assets can potentially take a long time, the search menu refreshes its items as new assets are loaded. However, changing the search field is necessary to see the update. Differential Revision: https://developer.blender.org/D15568
2022-09-10Fix: Missed return in ASSET_OT_bundle_install item enumeratorJesse Yurkovich
Discovered from inspection. Differential Revision: https://developer.blender.org/D15699
2022-08-30Cleanup: Remove misleading std::string reference bindingHans Goudey
These functions that retrieve strings from assets return stringrefs. Storing them as std::strings is unnecessary and relies on binding to the const references.
2022-07-29Merge branch 'blender-v3.3-release'Hans Goudey
2022-07-29Fix: Grammar mistake in info messageHans Goudey
2022-07-29Cleanup: Use LISTBASE_FOREACH macroHans Goudey
2022-07-29Cleanup: Use const context argument for UIList callbacksHans Goudey
2022-04-11Cleanup: malformed C-style comment blocks, spellingCampbell Barton
- Missing star prefix. - Unnecessary indentation. - Blank line after dot-points (otherwise doxygen merges with the previous dot-point). - Use back-slash for doxygen commands. - Correct spelling.
2022-04-01Assets: Enable collection assets (no longer experimental)Julian Eisel
With automatic collection previews (810e225c260d) and a toggle for collection instancing (previous commit) supported, there are no known blocking issues for collection assets. There are still further improvements to come as part of regular developemt (e.g. bounding box based snapping).
2022-03-25Cleanup: remove argument to doxygen \fileCampbell Barton
Doxygen doesn't require this to be set.
2022-03-25Cleanup: use count or num instead of nbrCampbell Barton
Follow conventions from T85728.
2022-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
2022-03-11Fix out of order event handling when calling operators from gizmosCampbell Barton
Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem.
2022-02-24Fix wrong asset library displayed/loaded in asset view templatesJulian Eisel
Sometimes when switching asset libraries in the asset view templates (like the pose library sidebar UI), the wrong library would end up being shown.
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-02-07Fix asset-view template ignoring "Asset Indexing" debug optionJulian Eisel
If the "Asset Indexing" option was disabled in Preferences > Experimental > Debugging, the asset-view template (used by pose libraries for example) would still use the indexing.
2022-02-04Fix: Missing translations from operator descriptionsHans Goudey
The strings in the `get_description` functions for operators need translation, they are not found by the translation system automatically, and there is no translation applied afterwards either (as far as I could tell). Some used `N_` before, but most did nothing. Differential Revision: https://developer.blender.org/D14011
2022-01-26Assets: enable node group assetsJacques Lucke
This enables support for node group assets. Previously, node group assets only worked when the "extended asset browser" experimental features is enabled. Differential Revision: https://developer.blender.org/D13748
2022-01-24Cleanup: sort struct forward declarationsCampbell Barton
2022-01-18Assets: Enabling Asset Indexing.Jeroen Bakker
Asset indexing was disabled as ID property indexing wasn't supported. Now that ID property support is added we can enable asset indexing. Check {T91406} for more information about asset indexing.
2022-01-18AssetsBrowser: Add ID Properties to Asset IndexerJeroen Bakker
Object/collection asset workflow would need the bounding box for snapping. The bounding box is stored using ID properties in the scene. Currently ID properties aren't stored in the asset index, what would break object snapping. For this reason Asset Indexing is turned off in mater. This patch will introduce the indexing of ID properties what will allow the indexing to be turned on again. ## Data Mapping ## For data mapping we store the internal structure of IDProperty to the indexer (including meta-data) to be able to deserialize it back. ``` [ { "name": .., "value": .., "type": .., /* `subtype` and `length` are only available for IDP_ARRAYs. */ "subtype": .., }, ] ``` | **DNA** | **Serialize type** | **Note** | | IDProperty.name | StringValue| | | IDProperty.type | StringValue| "IDP_STRING", "IDP_INT", "IDP_FLOAT", "IDP_ARRAY", "IDP_GROUP", "IDP_DOUBLE"| | IDProperty.subtype | StringValue| "IDP_INT", "IDP_FLOAT", "IDP_GROUP", "IDP_DOUBLE" | | IDProperty.value | StringValue | When type is IDP_STRING | | IDProperty.value | IntValue | When type is IDP_INT | | IDProperty.value | DoubleValue | When type is IDP_FLOAT/IDP_DOUBLE | | IDProperty.value | ArrayValue | When type is IDP_GROUP. Recursively uses the same structure as described in this section. | | IDProperty.value | ArrayValue | When type is IDP_ARRAY. Each element holds a single element as described in this section. | NOTE: IDP_ID and IDP_IDARRAY aren't supported. The entry will not be added. Example ``` [ { "name": "MyIntValue, "type": "IDP_INT", "value": 6, }, { "name": "myComplexArray", "type": "IDP_ARRAY", "subtype": "IDP_GROUP", "value": [ [ { "name": .. .... } ] ] } ] ``` ## Considered alternatives ## - Add conversion functions inside `asset_indexer`; makes generic code part of a specific solution. - Add conversion functions inside `BLI_serialize`; would add data transformation responsibilities inside a unit that is currently only responsible for formatting. - Use direct mapping between IDP properties and Values; leads to missing information and edge cases (empty primitive arrays) that could not be de-serialized. Reviewed By: Severin, mont29, HooglyBoogly Maniphest Tasks: T92306 Differential Revision: https://developer.blender.org/D12990
2022-01-14Cleanup: spelling in comments, C++ style comments for disabled codeCampbell Barton
Also ensure space at end of comment.
2022-01-06CMake: add missing headersCampbell Barton
2022-01-04Cleanup: Code formatting.Jeroen Bakker
2022-01-03Cleanup: Renamed to_object_value to to_dictionary_value.Jeroen Bakker
2022-01-03Cleanup: Rename ObjectValue to DictionaryValue (Serialization).Jeroen Bakker
ObjectValue was to confusing as it is the term from JSON.
2021-12-18Cleanup: compiler warnings with clangBrecht Van Lommel
Includes use of memcpy to avoid warnings about deprecated members.
2021-12-17Allocator: simplify using guarded allocator in C++ codeJacques Lucke
Using the `MEM_*` API from C++ code was a bit annoying: * When converting C to C++ code, one often has to add a type cast on returned `void *`. That leads to having the same type name three times in the same line. This patch reduces the amount to two and removes the `sizeof(...)` from the line. * The existing alternative of using `OBJECT_GUARDED_NEW` looks a out of place compared to other allocation methods. Sometimes `MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined in C++ code. It doesn't look great but it's definitely better. The downside is that it makes the name of the allocation less useful. That's because the same name is used for all allocations of a type, independend of where it is allocated. This patch introduces three new functions: `MEM_new`, `MEM_cnew` and `MEM_delete`. These cover the majority of use cases (array allocation is not covered). The `OBJECT_GUARDED_*` macros are removed because they are not needed anymore. Differential Revision: https://developer.blender.org/D13502
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-13Cleanup: use "filepath" term for Main, BlendFileData & FileGlobalCampbell Barton
Use "filepath" which is the current convention for naming full paths. - Main use "name" which isn't obviously a file path. - BlendFileData & FileGlobal used "filename" which is often used for the name component of a path (without the directory).
2021-12-09Cleanup/Documentation: Add/move comments for asset filesJulian Eisel
Adds some basic high-level explanations for editor/UI level asset APIs. Also moves one such comment from the source file to the header file, so it's in the same file as other API comments.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-08Cleanup: Clang-Tidy modernize-redundant-void-argAaron Carlisle
2021-12-06Disable asset indexing in the Asset ListSybren A. Stüvel
Asset indexing should be disabled, but this was overlooked in the asset list (used for the pose library in the 3D View).
2021-12-06Asset Indexer: use fixed-length string for ID codeSybren A. Stüvel
Use fixed-length string to convert `char[2]` to `std::string`. Otherwise `strlen()` is called, which is problematic as the `char[2]` is not zero-terminated.
2021-11-30Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-11-30Asset Bundle Copy button: only report each external dependency onceSybren A. Stüvel
The `ASSET_OT_bundle_install` operator only works when the blend file is self-contained. It reports any external dependencies. Before this patch: - every dependency was mentioned, even when it repeated the same filename over and over again, and - multiple dependencies were all mentioned in the error popup, potentially filling the screen. This is now resolved by: - only reporting each external file once, and - referring to the console when there are multiple external dependencies. Reviewed by: severin, dfelinto Differential Revision: https://developer.blender.org/D13413
2021-11-30Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
This includes adjustment of rBc12d8a72cef5 to the new path traversal code introduced in rBe5e8db73df86.
2021-11-30BPath traversing: allow skipping weak library referencesSybren A. Stüvel
Add flag to `BKE_bpath_traverse_id()` and friends to skip weak references (see below). This makes a distinction between "this blend file depends on that file" and "this blend file references that file, but doesn't directly use its data". This distinction is for the Asset Bundle install operator, which refuses to copy the blend file when it's not self-contained. Weak references are those that are not directly used by the blend file, but are still present to allow path rewriting. For example, when an Asset is loaded its originating blend file is saved in `ID::library_weak_reference`; this reference is purely for deduplication purposes, and not for actually loading any data. Reviewed by: mont29, brecht Differential Revision: https://developer.blender.org/D13412
2021-11-30Cleanup: spelling in comments & stringsCampbell Barton
2021-11-30Cleanup: use colon after doxygen params, correct slash directionCampbell Barton
2021-11-29Refactor BKE_bpath module.Bastien Montagne
The main goal of this refactor is to make BPath module use `IDTypeInfo`, and move each ID-specific part of the `foreach_path` looper into their own IDTypeInfo struct, using a new `foreach_path` callback. Additionally, following improvements/cleanups are included: * Attempt to get better, more consistent namings. ** In particular, move from `path_visitor` to more standard `foreach_path`. * Update and extend documentation. ** API doc was moved to header, according to recent discussions on this topic. * Remove `BKE_bpath_relocate_visitor` from API, this is specific callback that belongs in `lib_id.c` user code. NOTE: This commit is expected to be 100% non-behavioral-change. This implies that several potential further changes were only noted as comments (like using a more generic solution for `lib_id_library_local_paths`, addressing inconsistencies like path of packed libraries always being skipped, regardless of the `BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value, etc.). NOTE: basic unittests were added to master already in rBdcc500e5a265093bc9cc. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13381
2021-11-25Fix T93357: crash when opening search menuJacques Lucke
This is the same fix as in rBde35a90f9f56d3ff3ac80c13bf1ae296853ba877 but for the blender-v3.0-release branch.
2021-11-24Merge branch 'blender-v3.0-release'Julian Eisel