From 4a771263fdd3c2e8cb408de4dd187430b33eff81 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Jan 2021 15:36:54 +1100 Subject: Outliner: use the scene ID for ObjectBase PointerRNA While this didn't cause any problems, `Base` structs are part of the scene which is being set in other uses of this type. --- source/blender/editors/space_outliner/outliner_draw.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner_draw.c') diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 3795f9a17d1..8104c1e0d58 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -347,17 +347,15 @@ static void outliner_layer_or_collection_pointer_create(Scene *scene, } /** Create either a RNA_ObjectBase or a RNA_Object pointer. */ -static void outliner_base_or_object_pointer_create(ViewLayer *view_layer, - Collection *collection, - Object *ob, - PointerRNA *ptr) +static void outliner_base_or_object_pointer_create( + Scene *scene, ViewLayer *view_layer, Collection *collection, Object *ob, PointerRNA *ptr) { if (collection) { RNA_id_pointer_create(&ob->id, ptr); } else { Base *base = BKE_view_layer_base_find(view_layer, ob); - RNA_pointer_create(&base->object->id, &RNA_ObjectBase, base, ptr); + RNA_pointer_create(&scene->id, &RNA_ObjectBase, base, ptr); } } @@ -384,7 +382,7 @@ static void outliner_collection_set_flag_recursive(Scene *scene, * otherwise we would not take collection exclusion into account. */ LISTBASE_FOREACH (CollectionObject *, cob, &layer_collection->collection->gobject) { - outliner_base_or_object_pointer_create(view_layer, collection, cob->ob, &ptr); + outliner_base_or_object_pointer_create(scene, view_layer, collection, cob->ob, &ptr); RNA_property_boolean_set(&ptr, base_or_object_prop, value); if (collection) { @@ -1116,7 +1114,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, BKE_view_layer_base_find(view_layer, ob); if (base) { PointerRNA base_ptr; - RNA_pointer_create(&ob->id, &RNA_ObjectBase, base, &base_ptr); + RNA_pointer_create(&scene->id, &RNA_ObjectBase, base, &base_ptr); bt = uiDefIconButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, -- cgit v1.2.3