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
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-01-12 12:43:42 +0300
committerBastien Montagne <bastien@blender.org>2022-02-08 12:50:39 +0300
commit32278b79a8de225a0edefa3d07693a098611a412 (patch)
tree2e8d0512a301aba00b592ccbcb97e24b709675d7 /source/blender/editors/interface
parent0617efd51b0ae3fa387ee0366a453040d899f318 (diff)
LibOverride: Add 'hierarchy root ID' info.
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.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_templates.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 1f81dd21b83..03d0cba5ec8 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -667,6 +667,13 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
/* Assign new pointer, takes care of updates/notifiers */
RNA_id_pointer_create(override_id, &idptr);
+ /* Insert into override hierarchy if possible. */
+ ID *owner_id = template_ui->ptr.owner_id;
+ if (owner_id != NULL && ID_IS_OVERRIDE_LIBRARY_REAL(owner_id)) {
+ override_id->override_library->hierarchy_root =
+ owner_id->override_library->hierarchy_root;
+ owner_id->override_library->flag &= ~IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY;
+ }
}
undo_push_label = "Make Library Override";
}