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
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')
-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
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
-rw-r--r--source/blender/editors/space_info/info_ops.c2
-rw-r--r--source/blender/editors/space_node/node_add.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c20
8 files changed, 27 insertions, 21 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);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5acc1cd0c6a..540882aa022 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4203,6 +4203,7 @@ static void sculpt_update_cache_invariants(
wmOperator *op, const float mouse[2])
{
StrokeCache *cache = MEM_callocN(sizeof(StrokeCache), "stroke cache");
+ Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
Brush *brush = BKE_paint_brush(&sd->paint);
@@ -4274,7 +4275,7 @@ static void sculpt_update_cache_invariants(
BLI_strncpy(cache->saved_active_brush_name, brush->id.name + 2,
sizeof(cache->saved_active_brush_name));
- br = (Brush *)BKE_libblock_find_name(ID_BR, "Smooth");
+ br = (Brush *)BKE_libblock_find_name(bmain, ID_BR, "Smooth");
if (br) {
BKE_paint_brush_set(p, br);
brush = br;
@@ -5012,6 +5013,7 @@ static void sculpt_brush_exit_tex(Sculpt *sd)
static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(stroke))
{
+ Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
SculptSession *ss = ob->sculpt;
@@ -5033,7 +5035,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
}
else {
BKE_brush_size_set(scene, brush, ss->cache->saved_smooth_size);
- brush = (Brush *)BKE_libblock_find_name(ID_BR, ss->cache->saved_active_brush_name);
+ brush = (Brush *)BKE_libblock_find_name(bmain, ID_BR, ss->cache->saved_active_brush_name);
if (brush) {
BKE_paint_brush_set(&sd->paint, brush);
}
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index b87a0de23b9..1cd3fef979b 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -301,7 +301,7 @@ static int unpack_item_exec(bContext *C, wmOperator *op)
int method = RNA_enum_get(op->ptr, "method");
RNA_string_get(op->ptr, "id_name", idname);
- id = BKE_libblock_find_name(type, idname);
+ id = BKE_libblock_find_name(bmain, type, idname);
if (id == NULL) {
BKE_report(op->reports, RPT_WARNING, "No packed file");
diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c
index c200c5a7612..956fea9b44a 100644
--- a/source/blender/editors/space_node/node_add.c
+++ b/source/blender/editors/space_node/node_add.c
@@ -400,6 +400,7 @@ static int node_add_mask_poll(bContext *C)
static int node_add_mask_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
SpaceNode *snode = CTX_wm_space_node(C);
bNode *node;
ID *mask = NULL;
@@ -407,7 +408,7 @@ static int node_add_mask_exec(bContext *C, wmOperator *op)
/* check input variables */
char name[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "name", name);
- mask = BKE_libblock_find_name(ID_MSK, name);
+ mask = BKE_libblock_find_name(bmain, ID_MSK, name);
if (!mask) {
BKE_reportf(op->reports, RPT_ERROR, "Mask '%s' not found", name);
return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index c3d4c769ae8..5f63836871d 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -307,7 +307,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
Library *lib = (Library *)tselem->id;
char expanded[FILE_MAX];
- BKE_library_filepath_set(lib, lib->name);
+ BKE_library_filepath_set(bmain, lib, lib->name);
BLI_strncpy(expanded, lib->name, sizeof(expanded));
BLI_path_abs(expanded, bmain->name);
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index ca26c9be9f2..aae855a7da4 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1887,9 +1887,9 @@ static int parent_drop_exec(bContext *C, wmOperator *op)
partype = RNA_enum_get(op->ptr, "type");
RNA_string_get(op->ptr, "parent", parname);
- par = (Object *)BKE_libblock_find_name(ID_OB, parname);
+ par = (Object *)BKE_libblock_find_name(bmain, ID_OB, parname);
RNA_string_get(op->ptr, "child", childname);
- ob = (Object *)BKE_libblock_find_name(ID_OB, childname);
+ ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, childname);
if (ID_IS_LINKED(ob)) {
BKE_report(op->reports, RPT_INFO, "Can't edit library linked object");
@@ -1928,9 +1928,9 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
RNA_string_set(op->ptr, "parent", te->name);
/* Identify parent and child */
RNA_string_get(op->ptr, "child", childname);
- ob = (Object *)BKE_libblock_find_name(ID_OB, childname);
+ ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, childname);
RNA_string_get(op->ptr, "parent", parname);
- par = (Object *)BKE_libblock_find_name(ID_OB, parname);
+ par = (Object *)BKE_libblock_find_name(bmain, ID_OB, parname);
if (ELEM(NULL, ob, par)) {
if (par == NULL) printf("par==NULL\n");
@@ -2085,7 +2085,7 @@ static int parent_clear_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
char obname[MAX_ID_NAME];
RNA_string_get(op->ptr, "dragged_obj", obname);
- ob = (Object *)BKE_libblock_find_name(ID_OB, obname);
+ ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, obname);
/* search forwards to find the object */
outliner_find_id(soops, &soops->tree, (ID *)ob);
@@ -2136,10 +2136,10 @@ static int scene_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
if (te) {
RNA_string_set(op->ptr, "scene", te->name);
- scene = (Scene *)BKE_libblock_find_name(ID_SCE, te->name);
+ scene = (Scene *)BKE_libblock_find_name(bmain, ID_SCE, te->name);
RNA_string_get(op->ptr, "object", obname);
- ob = (Object *)BKE_libblock_find_name(ID_OB, obname);
+ ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, obname);
if (ELEM(NULL, ob, scene) || ID_IS_LINKED(scene)) {
return OPERATOR_CANCELLED;
@@ -2215,10 +2215,10 @@ static int material_drop_invoke(bContext *C, wmOperator *op, const wmEvent *even
if (te) {
RNA_string_set(op->ptr, "object", te->name);
- ob = (Object *)BKE_libblock_find_name(ID_OB, te->name);
+ ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, te->name);
RNA_string_get(op->ptr, "material", mat_name);
- ma = (Material *)BKE_libblock_find_name(ID_MA, mat_name);
+ ma = (Material *)BKE_libblock_find_name(bmain, ID_MA, mat_name);
if (ELEM(NULL, ob, ma)) {
return OPERATOR_CANCELLED;
@@ -2311,7 +2311,7 @@ static int collection_drop_invoke(bContext *C, wmOperator *op, const wmEvent *ev
Scene *scene = BKE_scene_find_from_collection(bmain, collection);
BLI_assert(scene);
RNA_string_get(op->ptr, "child", childname);
- Object *ob = (Object *)BKE_libblock_find_name(ID_OB, childname);
+ Object *ob = (Object *)BKE_libblock_find_name(bmain, ID_OB, childname);
BKE_collection_object_add(bmain, collection, ob);
DEG_relations_tag_update(bmain);