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/makesrna
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/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_path.cc2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_path.cc b/source/blender/makesrna/intern/rna_path.cc
index c1613e3927e..0997ad6ee2f 100644
--- a/source/blender/makesrna/intern/rna_path.cc
+++ b/source/blender/makesrna/intern/rna_path.cc
@@ -942,7 +942,7 @@ ID *RNA_find_real_ID_and_path(Main *bmain, ID *id, const char **r_path)
BLI_assert_msg(0, "Missing handling of embedded id type.");
return id;
}
- return id_type->owner_get(bmain, id);
+ return id_type->owner_get(bmain, id, nullptr);
}
static char *rna_prepend_real_ID_path(Main *bmain, ID *id, char *path, ID **r_real_id)
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index f24aec3447b..8ed07a8dbf7 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1478,7 +1478,7 @@ static void rna_ImageFormatSettings_color_management_set(PointerRNA *ptr, int va
if (owner_id && GS(owner_id->name) == ID_NT) {
/* For compositing nodes, find the corresponding scene. */
const IDTypeInfo *type_info = BKE_idtype_get_info_from_id(owner_id);
- owner_id = type_info->owner_get(G_MAIN, owner_id);
+ owner_id = type_info->owner_get(G_MAIN, owner_id, NULL);
}
if (owner_id && GS(owner_id->name) == ID_SCE) {
BKE_image_format_color_management_copy_from_scene(imf, (Scene *)owner_id);