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-05-31Cleanup: Move lib_override.c to C++Hans Goudey
This will allow easier const correctness and use of nicer data structures like `Vector` and `Map`.
2022-05-20LibOverride: Add option to Hierarchy Creation to get all data user-editable ↵Bastien Montagne
by default. Avoids having to manually enable data-blocks for user-edition when you do not care about what should be edited by whom. Similar to default behavior before introduction of system overrides (aka non-user-editable overrides).
2022-05-19Merge branch 'blender-v3.2-release'Bastien Montagne
Conflicts: source/blender/blenkernel/intern/lib_override.c
2022-05-19Fix liboverride extreme resync times in case of libraries dependency loops.Bastien Montagne
That max number of `10000` level of recursivity was a typo (should have been `1000`), but even that is way too high, typical sane situation should not lead to more than a few tens of levels, so reducing the max level to 200. Also improve error message with more context info about the issue. Found while investigating issues for the Blender Studio's Heist production.
2022-05-19Revert "Fix liboverride extreme resync times in case of libraries dependency ↵Bastien Montagne
loops." This reverts commit e42e4e8568edeb4e0b962e2059586c2a3d3b457d. Wrong commit, sorry for the noise.
2022-05-19Fix liboverride extreme resync times in case of libraries dependency loops.Bastien Montagne
That max number of `10000` level of recursivity was a typo (should have been `1000`), but even that is way too high, typical sane situation should not lead to more than a few tens of levels, so reducing the max level to 200. Also improve error message with more context info about the issue. Found while investigating issues for the Blender Studio's Heist production.
2022-05-19Fix T73250: Override Library will always return to Object Mode on file opening.Bastien Montagne
Was an old known annoying issue, since the matching RNA property is read-only we need a manual handling of this in override applying and resyncing code.
2022-05-18Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-18Fix (unreported) crash in some rare case when making liboverride.Bastien Montagne
If making liboverride of an empty collection, this (root of override hierarchy) collection would get untagged in code when checking for collections that do not need to be overridden, leading to not overriding this root collection, and later in code to using NULL pointer.
2022-05-17Cleanup: Remove asserts when logging error messages.Bastien Montagne
If we produce CLOG_ERROR messages and the error is not actually critical, there is no point in asserting too. Mainly related to ID user counts, and a few other ID management areas.
2022-05-17Cleanup: Use `switch` and `BLI_assert_unreachable()` more.Bastien Montagne
Replace some `if/else if` chains by proper `switch` statement. Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-16Fix T98136: Crash undoing "Make Library Override" in some cases.Bastien Montagne
The 'OVERRIDE_HIDDEN' extra collection would often be mistakenly added to a linked collection, which is totally forbidden and guaranteed to crash on undo/redo. Reworked the code instantiating that extra collection in a more generic and hopefully robust way now.
2022-05-10LibOverride: Fix memory leak in resyncing code.Bastien Montagne
2022-05-10LibOverride: Fix bad ID getting hierarchy root updated.Bastien Montagne
Followup to rB6c679aca1770c37.
2022-05-10LibOverride: Make process checking validity of hierarchy roots more robust.Bastien Montagne
Code was not really designed to hanlde corrupted (e.g. local ID) root hierarchies, now it should handle better those invalid cases and restore proper sane situation as best as possible. Fixes crashes with some corrupted files from Blender studio.
2022-03-30Cleanup: spelling in commentsCampbell Barton
2022-03-29LibOverride: Rename 'delete hierarchy' to 'clear hierarchy', add 'clear ↵Bastien Montagne
single' operations. 'Delete' was a confusing name, even though it would delete the overrides it would replace them by linked data. Adding the 'single' version of that operation made it even more confusing, since often it has to keep the override ID for sakes of hierarchy, and just reset it and turn it back into a non-editable system override. Ref: {T95707}.
2022-03-29LibOverride: Add initial handling of system overrides in ↵Bastien Montagne
creation/duplication/resync code, and some basic do_version. When creating with hierarchies, core code only generates system overrides, responsibility to define 'user overrides' is then for the higher-level calling code (Editor/Operator-level). do_version code uses fairly basic euristics, should be good enough here though in most cases. and can always be refined later if needed. Ref: {T95707}.
2022-03-29LibOverride: Add initial System Override flag.Bastien Montagne
This merely adds the flag, exposes it in RMA, and uses it in some of the most common 'is editable' checks (RNA, `BASE_EDITABLE` macro...). Next step: do_version and defining systemoverrides at creation. Ref: {T95707}.
2022-03-29Fix (unreported) LibOverride: re-creation of overrides in consecutive ↵Bastien Montagne
partial overrides of a same hierarchy. If creating partial hierarchy overrides (from the outliner e.g.), that need to create extra overrides, those could be re-created everytime, leading to very bad situation where there would be several overrides of the same reference ID in the same override hierarchy. This fix makes it so that existing overrides in a given hierarchy will always be re-used in case other overrides are added to the hierarchy.
2022-03-16Add 'multiple' variant of ID relink function.Bastien Montagne
Similar to other changes to ID remapping, gives huge speedups in some cases, like certain types of liboverride creation. Case from {T96092} goes from 1725 seconds (almost 30 minutes) to 45 seconds to generate the liboverride, on my machine. Reviewed By: jbakker Maniphest Tasks: T96092 Differential Revision: https://developer.blender.org/D14240
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-10Cleanup: spelling in comments & some minor clarificationsCampbell Barton
2022-03-08LibOverride: Do not assert when root ID is not object/collection.Bastien Montagne
While uncommon, this is still a valid case...
2022-03-08Fix (unreported) liboverride rules from linked data disapearing.Bastien Montagne
Code cleaning up no-more-needed override data during diffing process would systematically remove override data from linked IDs. While this is not a critical issue in theory, it has bad consequences at the very least on user UI/UX, and potentially can cause bugs in some corner-cases scenarii.
2022-03-08LibOverrides: Tweak to ensure no overrides can be created on linked data.Bastien Montagne
Was already mostly the case, but from RNA API there was no proper check.
2022-02-25LibOverrides: fix handling of hierarchy root in complex cases.Bastien Montagne
This affects essentially the Outliner 'create hierarchy' tool currenlty. Previously code did not handle properly hierarchy root in case overrides where created from a non-root ID (e.g. an object inside of a linked collection), and in case additional partial overrides were added to an existing partially overrided hierarchy. Also did some renaming on the go to avoid using 'reference' in override context for anything else but the reference linked IDs.
2022-02-22Merge branch 'blender-v3.1-release'Bastien Montagne
2022-02-22Fix (unreported) LibOverride: missing copying `flag` member.Bastien Montagne
2022-02-18LibOverride: Fix resync sometimes deleting root ID of other liboverrides.Bastien Montagne
While this should not happen in theory, very bad/broken/dirty files can lead to such situations. So we need to re-ensure valid root IDs after resync (for now, done after each 'library indirect level' pass of resync, this may not be 100% bulletproof though, time will say). Found while investigating Blender studio issues in Snow parkour short.
2022-02-18LibOverride: Fix potential broken cases re ShapeKeys when finding hierarchy ↵Bastien Montagne
root ID. In some cases broken files could lead to selecting a shapekey as hierarchy root ID, which is not allowed. Found while investigating Blender studio issues in Snow parkour short.
2022-02-17Cleanup: Replace direct `id.lib` pointer checks with `ID_IS_LINKED` macro ↵Bastien Montagne
usages.
2022-02-14Fix (studio reported) crash in new resync code.Bastien Montagne
We do not always resync/replace the root ID of a hierarchy now that we do partial resync.
2022-02-11Fix (studio-reported) liboverrides potential infinite loop in hierarchy root ↵Bastien Montagne
doversion. Drivers make it way too easy to create dependenciy loops between IDs, so need to use the same trick as in other dependency-following code in this file to prevent those infinite loops. hard to predict for sure how bad of a hierarchy root this can end up producing, but in general cases think this should be OK.
2022-02-11LibOverride: Add partial resync.Bastien Montagne
Reduce compute effort of liboverrides resync process by only re-syncing the parts of the override hierarchy that actually need it. The main change compared to existing code (which was systematically resyncing a whole override hierarchy), is that resyncing now operates over several sub-hierarchies at once, each defined by their own 'resync root' ID. This ensures that we do not get several new overrides for the same data inside of the same hierarchy. Implements T95682. Differential Revision: https://developer.blender.org/D14079
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-10Minor cleanup: Use `ID_IS_LINKED`.Bastien Montagne
2022-02-10Fix (unreported) over-resync from RNA detection code in linked cases.Bastien Montagne
While applying liboverrides on linked data, RNA code (in `rna_property_override_check_resync`) would detect a lot of false positive regarding IDs needing resync, because the temporary ID used to apply overrides was always local, breaking the libraries comparison check. NOTE: that whole 'apply liboverrides' code could use some refreshment, it did not change much from initila version several years ago, we now have better tools and control over non-main data. But for now the 'trick' in that commit should do the job, ultimately those temps IDs should never be put in Main at all.
2022-02-10LibOverride: Fix/improve handling of hierarchy root in tagged creation.Bastien Montagne
Decouple the reference (linked) root ID and the hierarchy (override) root ID. Previous code was assuming that the reference ID was always also tagged for override creation, which is true in current master, but cannot be assumed in general (and won't be true with partial resync anymore). Also add asserts to validate conditions that the reference/hierarchy_root variables must meet.
2022-02-10Cleanup: copyright in headers, spelling in commentsCampbell Barton
- Order year consistently. - Minor consistency (case, double-spacing). - Correct typos.
2022-02-08LibOverride: Use new 'hierarchy root' info in relevant override code.Bastien Montagne
This new info simplifies greatly the handling of resync and deleting liboverride hierarchies, and makes those operations more robust to complex dependencies cases between different hierarchies. Related to T95283.
2022-02-08LibOverride: Add 'hierarchy root ID' info.Bastien Montagne
This change will make handling of liboverrides hierarchies (especially resyncing) much easier and efficient. It should also make it more resilient to 'degenerate' cases, and allow proper support of things like parenting an override to another override of the same linked data (e.g. a override character parented to another override of the same character). NOTE: this commit only implements minimal changes to add that data and generate it for existing files on load. Actual refactor of resync code to take advantage of this new info will happen separately.
2022-02-08LibOverride: Add 'hierarchy root ID' info.Bastien Montagne
This change will make handling of liboverrides hierarchies (especially resyncing) much easier and efficient. It should also make it more resilient to 'degenerate' cases, and allow proper support of things like parenting an override to another override of the same linked data (e.g. a override character parented to another override of the same character). NOTE: this commit only implements minimal changes to add that data and generate it for existing files on load. Actual refactor of resync code to take advantage of this new info will happen separately.
2022-02-03Fix (unreported) broken logic in proxy to liboverride conversion.Bastien Montagne
Iterating over scene's objects while we modify those (through proxy to override conversion code) is call for problems (use after free etc.). Instead, all proxy objects need to be gathered first in a temporary list, and processed all at once in a second loop.
2022-02-03Merge branch 'blender-v3.1-release'Brecht Van Lommel
2022-02-03Fix T91254: Some editing operation indirectly delete objects from override ↵Bastien Montagne
collections. Those cases are fairly hard to track down... Added some more checks, also at lower levels, more generic levels of object editing, and fixed core check in liboverride (previously code was assuming that an override of a collection only could have overrides of objects or linked objects, but this is not necessarily true).
2022-02-02LibOverride: Move proxy conversion code in its own file.Bastien Montagne
This will allow to keep the access to deprecated DNA proxy data in that specific file, instead of allowing deprecated accesses in the whole override kernel code. Part of T91671.
2022-02-02Merge branch 'blender-v3.1-release'Bastien Montagne
2022-02-02Fix (unreported) bug in liboverride resync code.Bastien Montagne
Part of the resynching code would access collections' objects base cache, which can be invalid at that point (due to previous ID remapping and/or deletion). Use a custom recursive iterator over collections' objects instead, since those 'raw' data like collection's objects list, and collection's children lists, should always be valid. Found while investigating a studio production file.
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.