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 <montagne29@wanadoo.fr>2018-05-31 17:21:47 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-31 17:21:47 +0300
commiteb1feb9f4a62e3caca4b72964c9fdd8187df53e5 (patch)
tree2c6b18ee72db4a386bf68425cc40620f9d49c48f /source/blender/editors/object
parent0b396bc15bd4433bfe9b8c6ffbc87d312d2426c1 (diff)
parent16100f8261770e367b0892bb38c778699ed609fe (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')
-rw-r--r--source/blender/editors/object/object_add.c6
-rw-r--r--source/blender/editors/object/object_relations.c3
-rw-r--r--source/blender/editors/object/object_select.c6
3 files changed, 9 insertions, 6 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");
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 75ff3fc24e6..aee8c3f9122 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2504,12 +2504,13 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot)
static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
+ Main *bmain = CTX_data_main(C);
Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
Material *ma;
char name[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "name", name);
- ma = (Material *)BKE_libblock_find_name(ID_MA, name);
+ ma = (Material *)BKE_libblock_find_name(bmain, ID_MA, name);
if (base == NULL || ma == NULL)
return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index d5e6f08352f..9746e4af714 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -905,6 +905,7 @@ void OBJECT_OT_select_all(wmOperatorType *ot)
static int object_select_same_collection_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Collection *collection;
char collection_name[MAX_ID_NAME];
@@ -913,7 +914,7 @@ static int object_select_same_collection_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "collection", collection_name);
- collection = (Collection *)BKE_libblock_find_name(ID_GR, collection_name);
+ collection = (Collection *)BKE_libblock_find_name(bmain, ID_GR, collection_name);
if (!collection) {
return OPERATOR_PASS_THROUGH;
@@ -955,6 +956,7 @@ void OBJECT_OT_select_same_collection(wmOperatorType *ot)
/**************************** Select Mirror ****************************/
static int object_select_mirror_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
bool extend;
@@ -968,7 +970,7 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op)
BLI_string_flip_side_name(name_flip, primbase->object->id.name + 2, true, sizeof(name_flip));
if (!STREQ(name_flip, primbase->object->id.name + 2)) {
- Object *ob = (Object *)BKE_libblock_find_name(ID_OB, name_flip);
+ Object *ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, name_flip);
if (ob) {
Base *secbase = BKE_view_layer_base_find(view_layer, ob);