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-10-18File Browser: Fix slowdown with non-existing ID previews in big filesJulian Eisel
When the File (or Asset) Browser would display data-blocks without previews in a heavy .blend file, there would be a drastic slowdown. See patch for details and comparison videos. Differential Revision: https://developer.blender.org/D16273 Reviewed by: Bastien Montagne
2022-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-05-17Cleanup: use term 'filepath' for full file pathsCampbell 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-02-02Proxies Removal: Handle conversion to liboverrides also for linked data.Bastien Montagne
So far linked proxies were just kept as-is, this is no longer an option. Attempt to convert them into liboverrides as much as possible, though some cases won't be supported: - Appending proxies is broken since a long time, so conversion will fail here as well. - When linking data, some cases will fail to convert properly. in particular, if the linked proxy object is not instanced in a scene (e.g. when linking a collection containing a proxy as an epty-instanced collection instead of a view-layer-instanced collection). NOTE: converion when linking/appending is done unconditionnaly, option to not convert on file load will be removed in next commit anyway. Part of T91671.
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-14Cleanup: resolve parameter mis-matches in doc-stringsCampbell Barton
Renamed or removed parameters which no longer exist.
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-08Cleanup: move public doc-strings into headers for 'blenloader'Campbell Barton
Ref T92709
2021-12-02Blendread: Remove all instantiation logic from `BLO_library_link_` code.Bastien Montagne
Instantiation is now fully handled by BKE_blendfile_link_append module. Note that this also allows removal of the `BLO_LIBLINK_NEEDS_ID_TAG_DOIT` flag. Part of T91414: Unify link/append between WM operators and BPY context manager API, and cleanup usages of `BKE_library_make_local`.
2021-12-02Cleanup: Readfile: Remove deprecated `BLO_library_link_copypaste`.Bastien Montagne
Rewrite of ID paste code in rB3f08488244c0 made this function useless, ID pasting is now handled by the BKE_blendfile_link_append module too.
2021-11-22BKE Link/Append: Use BLO's LibraryLink_Params.Bastien Montagne
This allows to reduce signature of several functions, and make it eaiser to integrate more higher-level usages later on. This should be a non-behavioral-change commit. Part of T91414: Unify link/append between WM operators and BPY context manager API, and cleanup usages of `BKE_library_make_local`.
2021-11-12Cleanup: use term sequence_strip instead of vse_stripCampbell Barton
2021-10-21IDManagement: Add option to clear asset data when making ID local.Bastien Montagne
When appending an asset from the asset browser, its asset data needs to be cleared. However, linking an asset (or regular append from the file browser) should not clear such data. In linking case, it would be there again after a blend file reload anyway. So this commit introduces a new `BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR` option. NOTE: in case the appended ID needs to be copied from its linked data (instead of making the later directly local), asset data is lost anyway since it is never copied with the ID currently. Ref. {T91749} and D11768.
2021-10-21Cleanup: de-duplicate function to instantiate objectsCampbell Barton
De-duplicates wm_append_loose_data_instantiate_object_base_instance_init and object_base_instance_init. Add BLO_object_instantiate_object_base_instance_init which also adds to a collection since all callers did this.
2021-10-20Cleanup: spelling in commentsCampbell Barton
2021-10-19Fix T92224: Refactor of append code unexpectedly changed behavior with ↵Bastien Montagne
'localize all' off. In 2.93 and before, when appending wityh 'localize all' off, all linked IDs (including indirectly linked ones) from initial library would be made local. In 3.0, after refactor from rB3be5ce4aad5e, only directly linked IDs (i.e. user-selected IDs) would be made local. This change was not intentional (result of confusing code and naming in previous implementation), and old behavior is used in some workflows to control which data is kept linked and which data is made local. This commit revert to 2.93 behavior. NOTE: there is still an (extreme) corner case where behavior is different between 2.93 and 3.0: If you append (at the same time) object A from LibA.blend, and object B from LibB.blend, and object B uses somehow a material from LibA.blend: * In 2.93, that material would have been made local (because it belonged to one of the 'initial' libraries, even though not the initial lib of object B). * In 3.0, this material will remain linked, since from object B persective it comes from a different library.
2021-10-13Cleanup: use typedef struct for BLODataBlockInfo.Jeroen Bakker
2021-10-03Cleanup: spelling in commentsCampbell Barton
2021-09-28VSE: Implement sanity check for files with more channels than supportedDalai Felinto
This is a follow up to 8fecc2a8525467ee2fbbaae16ddbbc10b3050d46. This makes sure future .blend files that have more channels than the limit won't break Blender. It can be backported to LTS. This is part of https://developer.blender.org/D12645 Differential Revision: https://developer.blender.org/D12648
2021-09-24LibOverride: Deprecate Proxies: Add auto-conversion on file load.Bastien Montagne
This commit also add an experimental userPreferences to prevent proxies conversions on file load, and reporting for amount of coverted proxies (and possible issues). Note that potentially linked proxies from other libraries are not hamdled here (this feature seems to be broken anyway in master currently?).
2021-09-24FileBrowser: Reduce Overhead Browsing Libraries.Jeroen Bakker
When Browsing libraries the asset files were opened multiple times. once to determine the needed groups to query and once for each group to query the items in the group. For file browsing this makes sense but for asset browsing this can be reduced. This patch will load the asset files recursively and only opens them once. Another change is that only the assets are requested and not filtered out later in the process. This patch is needed to simplify the library indexing. Where we need access to the full library content. ## The numbers ## Benchmarked by adding scenes of the spring open movie to the default asset library. Refreshing the asset library would recursively load all the files there. | **8bc27c508a** | Processed 317 'directories/libraries' | 7.573986s | | **Patch** | Processed 42 'directories/libraries' | 0.821013s | {F10442811} Reviewed By: mont29, Severin Maniphest Tasks: T91406 Differential Revision: https://developer.blender.org/D12499
2021-09-23Cleanup: spelling in commentsCampbell Barton
2021-09-23LibLink Append: Expose 'reuse ID' through new BLO flag, and add basic tests.Bastien Montagne
Option is now available to append operator, alsthough hidden and disabled by default.
2021-09-23Cleanup: eBLOLibLinkFlags: Add 'space' between `APPEND` flags and `INSTANCE` ↵Bastien Montagne
ones.
2021-09-23Link/Append: Refactor flags.Bastien Montagne
Flags controlling link/append code are split between two enums, one in `DNA_space_types.h` and one in `BLO_readfile.h`. This commit: - Moves flags exclusively used in WM and BLO code to `eBLOLibLinkFlags` in `BLO_readfile.h`. Flags in `eFileSel_Params_Flag` from `DNA_space_types.h` are now only the ones effectively used by the file browser editor code too. - Fixes some internal utils in `readfile.c` still taking `short` flag parameter instead of proper `int` one. NOTE: there are a few other flags that could probably be moved to `eBLOLibLinkFlags` (at the very least `FILE_LINK`, probably also `FILE_AUTOSELECT` and `FILE_ACTIVE_COLLECTION`), since those are not effectively used by the file browser, and control linking/appending behavior, not filebrowser behavior. However for now think it's safer to not touch that.
2021-08-25T90908: Reduce loading times when extracting thumbnails from Blendfiles.Jeroen Bakker
Previously when loading an thumbnails for an asset the whole file was read. Reason this was done was perhaps a future idea to load all thumbnails inside a blendfile in a single go. This was never implemented and currently unneeded disk and cpu cycles was spend with finding out what preview to load. This patch adds an early break when the thumbnail that the caller is interested in has been found. This improves the thumbnail extraction when looking into large files. Reviewed By: mont29 Maniphest Tasks: T90908 Differential Revision: https://developer.blender.org/D12312
2021-08-13Blendloader: Option to reports to skip list of recursively ↵Bastien Montagne
liboverride-resynced libs. This extra info is not always needed/convinient to use, and requires special attention to free the list, so allow not generating it.
2021-08-03Blender Readfile: Fix annoying useless Object reading error messages.Bastien Montagne
Extend the 'reading error' container to produce the generic short message in the popup directly visible by the user, and move all detailed info the `INFO` reports that only show up in the console and Info editor.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
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: clang-format, spellingCampbell 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-22Revert "Enhanced stats/reports for blendfile reading."Brecht Van Lommel
This change crashes library linking operators, related tests and probably more. This reverts commit f8d219dfd4c31a918e33cb715472d91a5cd3fd51. Ref D11583
2021-06-22Enhanced stats/reports for blendfile reading.Bastien Montagne
Add direct user feedback (as a warning report) to user when recursive resync of overrides was needed. And some timing (as CLOG logs) about main readfile process steps. This is essentially adding a new BlendFileReadReport structure that wraps BKE_reports list, and adds some extra info (some timing, some info about overrides and (recursive) resync, etc.).
2021-04-16Fix BLO_library_temp_load_id loading temporary ID's into G.mainCampbell Barton
The intention with this API function was to temporarily load ID's tagged LIB_TAG_TEMP_MAIN, however the way the `real_main` was used, these ID's were loaded into the G.main.
2021-03-18BLO: Functions for temporarily loading a single datablockSybren A. Stüvel
This introduces two functions to the blenloader module, here shown as calls for brevity: * `temp_lib_ctx = BLO_library_temp_load_id(real_main, blend_file_path, idcode, idname, reports);` * Now the data in `temp_lib_ctx->temp_id` can be used (but ought not to be not assigned to non-temp datablocks). * `BLO_library_temp_free(temp_lib_ctx);` The first loads a datablock from a blend file, and returns it as part of a `struct TempLibraryContext`. This struct contains the temp-loaded ID, as well as enough information to correctly free everything again. Differential Revision: https://developer.blender.org/D10736
2021-03-08readfile: add id_tag_extra argumentCampbell Barton
This allows adding ID tags when linking/loading data. This is needed to implement loading non 'G.main' ID data-blocks, see D10612.
2021-02-05Cleanup: use 'r_' prefix for return arguments, order lastCampbell Barton
2021-02-05Cleanup/refactor: Undosys: Get rid of the magic values for undo direction.Bastien Montagne
Move `eUndoStepDir` to `BKE_undo_system.h` and use its values everywhere. Note that this also introduce the `STEP_INVALID` value in that enum. Finally, kept the matching struct members in some lower-level readfile code as an `int` to avoid having to include `BKE_undo_system.h` in a lot of unrelated files.
2021-02-03BPY: allow `bpy.data.libraries.load()` to filter out non-asset data-blocks.Bastien Montagne
Differential Revision: https://developer.blender.org/D10237
2020-12-15Asset System: Data-block asset metadata storage, reading and APIJulian Eisel
Asset metadata is what turns a regular data-block into an asset. It is a small data-structure, but a key part of the technical design of the asset system. The design foresees that asset data-blocks store an `ID.asset_data` pointer of type `AssetMetaData`. This data **must not** have dependencies on other data-blocks or data-block data, it must be an independent unit. That way we can read asset-metadata from .blends without reading anything else from the file. The Asset Browser will use this metadata (together with the data-block name, preview and file path) to represent assets in the file list. Includes: * New `ID.asset_data` for asset metadata. * Asset tags, description and custom properties. * BKE code to manage asset meta-data and asset tags. * Code to read asset data from files, without reading IDs. * RNA for asset metadata (including tags) 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/D9716 Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-10-03Cleanup: rename main preferences versioning functionCampbell Barton
BLO_version_defaults_userpref_blend -> blo_do_versions_userdef The name was misleading as it was declared along with BLO_update_defaults_startup_blend making it seem these functions were related. In fact preference defaults don't need to be updated as is done for startup.blend since an in-memory blend file isn't used. Rename the function to match other versioning functions called from readfile.c. Also add/update comments on these differences.
2020-10-02Fix userpref.blend using version from startup.blendCampbell Barton
Version patching userpref.blend wasn't using the correct version, causing settings not to be properly updated. This seems the likely cause of T70196 and similar bugs.
2020-09-08Cleanup: naming for library link enumCampbell Barton
Use 'e' prefix, update comments.
2020-09-08Refactor: move library linking arguments into a parameter structCampbell Barton
Move arguments to BLO_library_link_{begin/named_part/end} into a single parameter struct, to ensure arguments always match. This allows is to skip tagging ID's LIB_TAG_DOIT when it's not needed, previously it was always cleared just in case it was needed. This also makes it possible to remove BLO_library_link_named_part_ex which was only used when tagging was needed.
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
2020-08-18No experimental feature (but debug ones) to work for blender beta/releaseDalai Felinto
Final releases (including beta) should strictly show features that are finalized to prevent loss of data, old API clanging around, and the overall quality of the product (Blender) presented. Note that rendering should never be affected by user preferences, so this is only changing things in the UI level. Development note: This is reset experimental UI on file load. Also note: to hide RNA (needed for hair and particles) will be done as a separate patch. Differential Revision: https://developer.blender.org/D8606
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-06-23Cleanup: use doxy sections for BLI read/write headersCampbell Barton
Add reference between the read/write functions too.