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-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
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-09-07Cleanup: remove unused Main argument to RNA_path functionsCampbell Barton
Note that lib_override functions have kept the unused argument, but this may be removed too. It impacts many lib_override functions so this can be handled separately.
2022-09-06Cleanup: IDManagement: Simplify `owner_get` calllback of IDTypeInfo.Bastien Montagne
Now that all embedded IDs have a loopback pointer to their owner, we do need anymore extra parameters for this accessor.
2022-09-01Cleanup: Remove/replace View Layer macros.Monique Dewanchand
This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799
2022-08-30LibOverride: Minor resync optimization by removing unuecessary processing.Bastien Montagne
Not much to gain here, but can make resync faster by a few percents when dealing with linked overrides and such.
2022-08-30Cleanup: Remove one level of indentation by early continue in a loop.Bastien Montagne
2022-08-30Fix T100586: libOverride resync could remove too many data-blocks.Bastien Montagne
Do not delete 'orphaned' overrides when their reference is missing because the library file itself is missing.
2022-08-18LibOverride: Preserve active object when creating overrides.Bastien Montagne
2022-08-16Fix (unreported) bug in liboverride 'leaves' detection.Bastien Montagne
Loopback ID pointers should be ignored here as well, otherwise they are very efficient at preventing proper detection of 'leaf' override IDs in a hierarchy.
2022-08-12IDType `get_owner`: add an optional hint about owner ID.Bastien Montagne
In some cases, there is a chance code already knows who might be the owner of the given ID, in which case it can be more efficient to check it first (especially in cases like embedded node trees or scene collections, where the only other way is to loop over all possible owners currently). Will be used in next commit in some Outliner fix.
2022-08-05Cleanup: Use c++ casting in liboverride BKE code.Bastien Montagne
No functional change expected here!
2022-08-04Cleanup: Move RNA path functions into own C++ fileJulian Eisel
NOTE: This is committed to the 3.3 branch as part of D15606, which we decided should go to this release still (by Bastien, Dalai and me). That is because these are important usability fixes/improvements to have for the LTS release. Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
2022-08-02LibOverride: Expose in public API the utils to get actual override data.Bastien Montagne
This is useful when input ID is a 'non-override' one (like embedded IDs or shapekeys), to get override data and 'owner' ID pointer.
2022-07-27Fix more issues with new name map and liboverrides.Bastien Montagne
Follow-up to rB13e17507c069, forgot to handle shapekeys...
2022-07-27ID namemap: Add check for consistency.Bastien Montagne
Add a util function to check that content of a given Main and the namemaps in it are consistent. Add some asserts calling this check after file read, and after some override operations.
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-15Fix (unreported) LibOverride: invalid behaviors when creating (partial) ↵Bastien Montagne
overrides. The outliner would tagg all existing local IDs (for remap from linked reference data to newly created overrides) when creating a new override. This would become critical issue in case there is several existing copies of the same override hierarchy (leading to several hierarchies using the same override). Further more, BKE override creation code would not systematically properly remapp linked usages to new overrides one whithin the affected override hierarchy, leading to potential undesired remaining usages of linked data.
2022-07-12LibOverride: Fix some issues from.revealed by recent previous commit.Bastien Montagne
rB57097e9a8515 did not properly consider case where you have more than one override for a same reference linked ID. Also adds more security checks around shapekeys, since match between override and its linked reference is never ensured either way (fixes a crash reported by @Rik from Blender studio).
2022-07-12Fix T99261: partial LibOverride creation would not properly remap all needed ↵Bastien Montagne
data. When creating partial overrides, there may also be need to reamap usage of linked data towards already existing overrides, in newly created overrides.
2022-07-11Fix (unreported) crash in liboverride code on rare cases.Bastien Montagne
When dealing with 'embedded' IDs (and the like, e.g. shape keys), liboverride code could fail in case the reference linked data (e.g. a mesh) would not have a shapekey anymore, while the override mesh would still have one. Found while investigating another issue in Heist production file `Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`, r1230.
2022-07-05Fix (unreported) liboverride: incomplete hierarchy when root is not ↵Bastien Montagne
object/collection. We do not (currently) consider other ID types as 'end points' justifying to create an override hierarchy, however if the 'root' ID (i.e. the ID the user selected as base to create the override) is not an object or collection, we still want to check all of its dependencies. This fixes e.g. if a material depends on another Empty object, and user tries to hierarchy-override that material, its Empty dependency not being overridden.
2022-06-30Fix (unreported) liboverride resync creating garbage data in some cases.Bastien Montagne
Regression caused by the introduction of partial resync in February 2022 (rB1695d38989fd482d3c). Code was missing adding some existing overrides to the mapping in some specific cases, causing resync to create 'new' ones instead of re-using existing ones. This commit also adds a basic resync testcase that illustrates this issue.
2022-06-30Revert "Revert "LibOverride: Handle dependencies in both directions in ↵Bastien Montagne
partial override cases."" This reverts commit rB31d80ddeaad, and fixes issue introduced in rBf0b4aa5d59e3 by not doing the 'reversed dependency check' in resync case. Rational here are: * Supporting reversed dependency in a reliable, coinsistent way in resync is likely to be a nightmare, if even possible at all. * Needs for such reversed dependency in resync should be close to 0% of cases, as long as users remain reasonable with their organization of their assets (it could only become a problem in extreme bad practice and corner cases, like a geometry object being added as a child of a rig in a completely new, otherwise un-overridden collection, in partial override context). This decision may need to be re-evaluated later in case we go more towards a very highly partial-override workflow, but even then I would expect current solution to work fine in all reasonable use cases.
2022-06-22Revert "LibOverride: Handle dependencies in both directions in partial ↵Dalai Felinto
override cases." This reverts commit f0b4aa5d59e3b3754bfcf3827f7524d34c809c62. This commit was making files to get bigger and bigger every time they were saved and re-opened. In the orphaned data in the outliner new collections would show up there, even after continuously purging it. This would lead to a massive file which get also very slow. This problem will fix itself after a few re-open/re-saves of the files. For anyone also experimenting this you can fix this faster by purging the unused data multiple times in the file. Example of file from the Project Heist (rev. 1014): heist/pro/shots/010_opening/010_0050/010_0050.anim.blend
2022-06-17LibOverride: Handle dependencies in both directions in partial override cases.Bastien Montagne
When creating etc. a liboverride based on a partial hierarchy pre-selection (e.g: override hierarchy on the rig object of a character), now all linked data also using that rig (e.g. all meshes deformed by that armature) will also automatically be overridden. This si achieved by following dependencies in the reversed order (from used IDs to using IDs) when we find one tagged for override.
2022-06-10LibOverride: Add util to check if a given Override Property is animated.Bastien Montagne
Searches in available animdata for fcuve(s) with matching RNA path.
2022-06-10Liboverride: Add rna array index return value to ↵Bastien Montagne
`BKE_lib_override_rna_property_find`. Very useful e.g. for dealing with FCurves search.
2022-06-07LibOverride: Attempt to improve handling of cyclic deps between libraries.Bastien Montagne
Those cyclic dependencies (lib_A depends on a texture from lib_B, which links geometry from lib_A) are bad, but previous code did not always helped much in idendtifying to actuall issue point. Now, reduce maximum 'recursion' level to 100 (this should already never be reached in practice), and additionally report warnings when reaching level 90, so that user gets more context data to identify more easily the culprit.
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-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`.