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-09-21Cleanup: spelling in commentsCampbell Barton
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-09Cleanup: spelling in commentsCampbell Barton
2022-09-08IDManagement: Add new `BKE_id_owner_get` accessor.Bastien Montagne
Essentially calls `IDTypeInfo->owner_get` for now, will make more sense once the callback is changed to return the address of the pointer instead.
2022-08-11Cleanup: doxy parameters, use static set instead of tupleCampbell Barton
2022-08-04Fix T99460: Allow creation new datablocks from evaluatedSergey Sharybin
This changes makes it possible to copy evaluated result and put it to the original bmain. Prior to this change from the API point of view there was false perception that it is possible, while in practice it was very fragile: it only worked if the ID did not reference any evaluated IDs. This change makes it so `id.copy()` Python API call will make it so the copied ID only references original data-blocks. This sounds a bit implicit, so here is motivational aspect why it is considered better approach to all other: - There needs to be a way to support the described scenario, in the lest fragile way. Requiring to always use an explicit function call or an argument is too verbose and is easy to be missed. - The `id.copy()` is already doing implicit thing: it always adds the result to the bmain. So it might as well ensure the copied result does not reference evaluated data-blocks. - Added clarity in the documentation should address possible confusion. The limitation of this change is that the copy() of evaluated geometry will clear its reference to the shape key. This is because the key is only referenced for validness of RNA paths for drivers and the key itself might not match topology of evaluated geometry due to modifiers. Differential Revision: https://developer.blender.org/D15611
2022-08-03Cleanup: Improve doc of the `BKE_id_copy` functions.Bastien Montagne
2022-07-27Fix crashes due to non-uniqueness in ID names in some cases.Bastien Montagne
Liboverrides are doing some very low-level manipulation of IDs in apply code, to reduce over-head of name and sorting handling. This requires specific care to ensure thatr the new namemap runtime data remains up-to-date and valid. Otherwise, names of existing IDs would be missing from the map, which would later lead to having several different IDs with the same name. Critical corruption in Blender ID management. Reported by animators at the Blender studio. Regression from rB7f8d05131a77.
2022-07-20IDManagement: Speedup ID unique name assignment by tracking used ↵Aras Pranckevicius
names/basenames/suffixes An implementation of T73412, roughly as outlined there: Track the names that are in use, as well as base names (before numeric suffix) plus a bit map for each base name, indicating which numeric suffixes are already used. This is done per-Main/Library, per-object-type. Timings (Windows, VS2022 Release build, AMD Ryzen 5950X): - Scene with 10k cubes, Shift+D to duplicate them all: 8.7s -> 1.9s. Name map memory usage for resulting 20k objects: 4.3MB. - Importing a 2.5GB .obj file of exported Blender 3.0 splash scene (24k objects), using the new C++ importer: 34.2s-> 22.0s. Name map memory usage for resulting scene: 8.6MB. - Importing Disney Moana USD scene (almost half a million objects): 56min -> 10min. Name map usage: ~100MB. Blender crashes later on when trying to render it, in the same place in both cases, but that's for another day. Reviewed By: Bastien Montagne Differential Revision: https://developer.blender.org/D14162
2022-05-31Cleanup: Improve const correctness of ID functionsHans Goudey
These functions don't change their inputs, so they can be const, which is a bit more intuitive and clean to use for callers. Differential Revision: https://developer.blender.org/D14943
2022-03-30Cleanup: spelling in commentsCampbell Barton
2022-03-29LibOverride: Massive edits to 'editable' IDs checks in editors code.Bastien Montagne
Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes previous check (simple `ID_IS_LINKED()` macro) for many editing cases. This allows to also take into account 'system override' (aka non-editable override) case. Ref: {T95707}.
2022-03-28Cleanup: Move scene.c to C++Hans Goudey
This is meant to allow using C++ data structures in this file as a performance improvement. Particularly `Vector` instead of `ListBase` for `duplilist`. This change builds and passes tests on all platforms on the buildbot.
2022-03-10Cleanup: spelling in comments & some minor clarificationsCampbell Barton
2022-02-11Remap multiple items in referenced data.Jeroen Bakker
This patch increases the performance when remapping data. {D13615} introduced a mechanism to remap multiple items in a single go. This patch uses the same mechanism when remapping data inside ID datablocks. Benchmark results when loading the village scene of sprite fright on AMD Ryzen 7 3800X 8-Core Processor Before this patch 115 seconds When patch applied less than 43 seconds There is still some room for improvement by porting relink code. Reviewed By: mont29 Maniphest Tasks: T95279 Differential Revision: https://developer.blender.org/D14043
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-04Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-01-25Fix T95037: Allow making local IDs that are not used by anything.Bastien Montagne
Some IDs (like text ones) can be linked and only kept around thanks to editors, allow making such IDs local in `BKE_lib_id_make_local_generic`. Also refactor logic checking whether ID should be made directly local or copied into its own util function, so that we can remain sure all special-cases 'make local' code still uses the same logic here.
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-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-11-19Merge branch 'blender-v3.0-release'Omar Emara
2021-11-19Fix (unreported) wrong behavior of constraints in liboverrides.Bastien Montagne
All constraints were 'made local', including the ones comming from the reference linked object.
2021-11-13Cleanup: spelling in comments, comment block formattingCampbell Barton
2021-11-05Fix part of T89313: Attribute search crash during animation playbackHans Goudey
During animation playback, data-blocks are reallocated, so storing pointers to the resulting data is not okay. Instead, the data should be retrieved from the context. This works when the applied search item is the "dummy" item added for non-matches. However, it still crashes for every other item, because the memory is owned by the modifier value log, which has been freed by the time the exec function runs. The next part of the solution is to allow uiSearchItems to own memory for the search items.
2021-11-04Cleanup: Move object.c to C++Germano Cavalcante
This is useful to allow the use of features made in C++. Differential Revision: https://developer.blender.org/D13115
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-09-30Fix T90246: Full Copy'ing a scene confuses physics in the original scene.Bastien Montagne
Handling of RigidBody data in duplicate of scenes/collections was very wrong. This commit: - Add handling of duplication of RB collections when fully duplicating a scene. - Fix Object duplication trying to add duplicated RB objects to matching RBW collections. While the later behavior is desired when only duplicated objects, when duplicating their collections and/or scenes it is actually very bad, as it would add back new object duplicates to old (RBW) collections.
2021-09-16Cleanup: Rename `BKE_id_clear_newpoin` to `BKE_id_newptr_and_tag_clear`.Bastien Montagne
2021-09-16IDManagement: refactor: Remove 'test' part from `BKE_lib_id_make_local`.Bastien Montagne
Mixing testing and actual action in a single function is just not a good way to do things, and the 'testing' feature is not used anywhere anymore, time to get rid of it.
2021-09-07ID management: add options to force make local or force copy IDs when making ↵Bastien Montagne
them local. This is to be used when calling code already knows whether the 'made local' linked ID should be copied, or can directly be converted to a local one. Currently unused , this is preparation for rewrite of append code.
2021-08-24Fix T90840: Can't duplicate or copy (Ctrl-C) object from linked file.Bastien Montagne
We need to separate the flag telling duplicate code to not handle remapping to new IDs etc., from the one telling the code that we are currently duplicating a 'root' ID (i.e. not a dependency of another duplicated ID). This whole duplicate code/logic is still fairly unsatisfying, think it will need further refactor, or maybe even re-design, at some point...
2021-08-11Cleanup: ID management: remove unused old `BKE_libblock_copy_for_localize` ↵Bastien Montagne
function.
2021-08-11Fix T88033: Python reference memory leaks for non main data-blocksCampbell Barton
ID data-blocks that could be accessed from Python and weren't freed using BKE_id_free_ex did not release the Python reference count. Add BKE_libblock_free_data_py function to clear the Python reference in this case. Add asserts to ensure no Python reference is held in situations when ID's are copied for internal use (not exposed through the RNA API), to ensure these kinds of leaks don't go by unnoticed again.
2021-06-24Depsgraph: support flushing parameters without a full COW updateCampbell Barton
Avoid computationally expensive copying operations when only some settings have been modified. This is done by adding support for updating parameters without tagging for copy-on-write. Currently only mesh data blocks are supported, other data-blocks can be added individually. This prepares for changing values such as edit-mesh auto-smooth angle in edit-mode without duplicating all mesh-data. The benefit will only be seen when the user interface no longer tags all ID's for copy on write updates. ID_RECALC_GEOMETRY_ALL_MODES has been added to support situations where non edit-mode geometry is modified in edit-mode. While this isn't something user are likely to do, Python scripts may change the underlying mesh. Reviewed By: sergey Ref D11377
2021-06-01ID Management: Allow unique name check for linked IDs too.Bastien Montagne
This is mandatory for liboverride resync, since this feature may imply we have to create linked overrides in libraries, and there may be several copies of those. This is also a first step to a more general support of IDmanagement-editing library data. Note that this commit should have absolutely no effect on current code, as the only function allowed to check unique names for linked IDs currently is `BKE_libblock_management_main_add`, which is unused. This commit also adds some basic testing for `BKE_id_new_name_validate`.
2021-05-27Cleanup: rename BKE_main_id_{clear_newpoins => newptr_and_tag_clear}Campbell Barton
It wasn't obvious this function cleared the tag as well.
2021-05-18Fix T88026: Repeated switch to rendered viewport crashesCampbell Barton
Resolve ownership ambiguity with shared physics pointers. Previously, LIB_ID_CREATE_NO_MAIN allowed pointer sharing with the source ID so physics caches can be shared between original and evaluated data: (Object.soft.shared & Object.rigidbody_object.shared). This only worked properly for LIB_TAG_COPIED_ON_WRITE ID's, as LIB_TAG_NO_MAIN can be used in situations where the original ID's lifetime limited by it's original data. This commit adds `LIB_ID_COPY_SET_COPIED_ON_WRITE` so ID's only share memory with original data for ID's evaluated in the depsgraph. For all other uses, a full copy of physics data is made. Ref D11228#287094
2021-04-10LibOverride: Add own flag to copy or not overrides to ID copy code.Bastien Montagne
Relying on only no-main for that was weak, and inn the end it turns out we sometimes also need to ifnore override data during copy of Main data-blocks. NOTE: The new `LIB_ID_COPY_NO_LIB_OVERRIDE` is also added to the `LIB_ID_COPY_LOCALIZE` set of flags. NOTE: The fact that we may now copy liboverrides in some non-main cases may cause issues in some cases, pretty impossible to track all possible ones from reading the code... Would not expect too many problem though, usages of `LIB_ID_CREATE_NO_MAIN` by itself are not so common.
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2020-12-22RNA: make `bpy.data.orphans_purge()` return number of deleted datablocksSybren A. Stüvel
Sometimes multiple calls to `bpy.data.orphans_purge()` are needed to delete all orphans, because a call can turn previously-used datablocks into orphans. Returning the number of deleted datablocks makes it possible to keep looping until nothing can be deleted any more. This patch keeps track of deletions in `id_delete()` so that it can be returned up the call stack. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D9918
2020-12-16Cleanup: remove redundant struct declarationsCampbell Barton
2020-12-15Asset System: "Mark Asset" & "Clear Asset" operators and UI integrationJulian Eisel
This makes it possible to turn data-blocks into assets and back into normal data-blocks. A core design decision made for the asset system is that not every data-block should be an asset, because not every data-block is made for reuse. Users have to explicitly mark data-blocks as assets. Exposes "Mark Asset" and "Clear Asset" in Outliner context menus (currently ID Data submenu) and button context menus. We are still not too happy with the names, they may change. This uses the new context members to pass data-blocks to operators, added in af008f553293 and 0c1d4769235c. 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/D9717 Reviewed by: Brecht Van Lommel
2020-10-07Refactor `BKE_id_copy` to return the new ID pointer.Bastien Montagne
No reasons to keep the new ID pointer as parameter here. Part of T71219.
2020-10-07Refactor `BKE_id_copy_ex` to return the new ID pointer.Bastien Montagne
Note that possibility to pass the new ID pointer as parameter was kept, as this is needed for some rather specific cases (like in depsgraph/COW, when copying into already allocated memory). Part of T71219.
2020-10-07Refactor: Remove `BKE_XXX_localize()`, in favor of using regular ID copying ↵Bastien Montagne
code. Besides the NodeTree case (which remains unchanged), the localize code is only used in one place (to generate previews of shading data-blocks). This commit introduces a new `LIB_ID_CREATE_LOCAL` option for ID creation/copying, which essentially implements the behavior of the removed `BKE_XXX_localize()` functions into regular mainstream ID copy code. When this option is set: - new ID is tagged with `LIB_TAG_LOCALIZED`; - Some ID copying callbacks have specific behaviors, mainly the root nodetree of shading IDs gets duplicated with specialized `ntreeLocalize()` function. Note that I would not consider getting rid of `ntreeLocalize` for now, this function is recursive, which should ideally never happen within ID management copying code (this introduces all kind of complications). No behavioral change expected from this commit.
2020-10-07Cleanup: IDManagement: Localize: tweak to flags.Bastien Montagne
Add a specific flag for nodetree deep-copy special localization code. And add a new `LIB_ID_CREATE_LOCALIZE` flag, similar to `LIB_ID_COPY_LOCALIZE`, for creation purposes. No behavioral changes expected here.
2020-09-30Cleanup: sort struct declarationsCampbell Barton
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
2020-08-28Refactor: move Mesh .blend I/O to IDTypeInfo callbacksJacques Lucke
I'm also adding `BKE_id_blend_write`, so that it can be accessed outside of `readfile.c`.
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