diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 17:21:47 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-31 17:21:47 +0300 |
commit | eb1feb9f4a62e3caca4b72964c9fdd8187df53e5 (patch) | |
tree | 2c6b18ee72db4a386bf68425cc40620f9d49c48f /source/blender/editors/object/object_add.c | |
parent | 0b396bc15bd4433bfe9b8c6ffbc87d312d2426c1 (diff) | |
parent | 16100f8261770e367b0892bb38c778699ed609fe (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/object/object_add.c
source/blender/editors/object/object_select.c
source/blender/editors/space_outliner/outliner_edit.c
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 4c90336dc0c..958b656d323 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1051,6 +1051,7 @@ void OBJECT_OT_lamp_add(wmOperatorType *ot) static int collection_instance_add_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Collection *collection; unsigned int layer; float loc[3], rot[3]; @@ -1059,7 +1060,7 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) char name[MAX_ID_NAME - 2]; RNA_string_get(op->ptr, "name", name); - collection = (Collection *)BKE_libblock_find_name(ID_GR, name); + collection = (Collection *)BKE_libblock_find_name(bmain, ID_GR, name); if (0 == RNA_struct_property_is_set(op->ptr, "location")) { const wmEvent *event = CTX_wm_window(C)->eventstate; @@ -1078,7 +1079,6 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if (collection) { - Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2399,7 +2399,7 @@ static int add_named_exec(bContext *C, wmOperator *op) /* find object, create fake base */ RNA_string_get(op->ptr, "name", name); - ob = (Object *)BKE_libblock_find_name(ID_OB, name); + ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, name); if (ob == NULL) { BKE_report(op->reports, RPT_ERROR, "Object not found"); |