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-08-12 11:39:03 +0300
committerBastien Montagne <bastien@blender.org>2022-08-12 13:37:10 +0300
commit12b36168957dd27c253251555c29e8523b94fbe8 (patch)
tree654af023fc4ae7bc3e6472409140e813efdc9800 /source/blender/editors/space_outliner
parent498e26fa0f6486fa2d3bb0029b11eb1dc48a32be (diff)
IDType `get_owner`: add an optional hint about owner ID.
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.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc
index 8ca2ffe6a9c..b29d20f9f9c 100644
--- a/source/blender/editors/space_outliner/outliner_collections.cc
+++ b/source/blender/editors/space_outliner/outliner_collections.cc
@@ -364,7 +364,7 @@ void outliner_collection_delete(
const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(&parent->id);
BLI_assert(id_type->owner_get != nullptr);
- ID *scene_owner = id_type->owner_get(bmain, &parent->id);
+ ID *scene_owner = id_type->owner_get(bmain, &parent->id, NULL);
BLI_assert(GS(scene_owner->name) == ID_SCE);
if (ID_IS_LINKED(scene_owner) || ID_IS_OVERRIDE_LIBRARY(scene_owner)) {
skip = true;
@@ -597,7 +597,7 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op)
const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(&parent->id);
BLI_assert(id_type->owner_get != nullptr);
- Scene *scene_owner = (Scene *)id_type->owner_get(bmain, &parent->id);
+ Scene *scene_owner = (Scene *)id_type->owner_get(bmain, &parent->id, NULL);
BLI_assert(scene_owner != nullptr);
BLI_assert(GS(scene_owner->id.name) == ID_SCE);