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-06-11 12:05:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-11 13:15:14 +0300
commit8055ed2741d1da48f2bf84c75ccb37b54cef1ab8 (patch)
treec9ec424a22afda1e40bc635280795b6d35d5f9e1 /source/blender/editors/sculpt_paint/paint_vertex.c
parent13d238729bed899a9a7e190ba38406846c485230 (diff)
Cleanup: remove some G.main usages...
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 7bbb4467f6f..93c8b1c8fea 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -56,6 +56,7 @@
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_deform.h"
+#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_object_deform.h"
@@ -1031,6 +1032,7 @@ static void vertex_paint_init_session_data(const ToolSettings *ts, Object *ob)
* \{ */
static void ed_vwpaintmode_enter_generic(
+ Main *bmain,
wmWindowManager *wm,
Scene *scene,
Object *ob, const eObjectMode mode_flag)
@@ -1048,7 +1050,7 @@ static void ed_vwpaintmode_enter_generic(
Paint *paint = BKE_paint_get_active_from_paintmode(scene, paint_mode);
paint_cursor_start_explicit(paint, wm, vertex_paint_poll);
- BKE_paint_init(scene, paint_mode, PAINT_CURSOR_VERTEX_PAINT);
+ BKE_paint_init(bmain, scene, paint_mode, PAINT_CURSOR_VERTEX_PAINT);
}
else if (mode_flag == OB_MODE_WEIGHT_PAINT) {
const ePaintMode paint_mode = ePaintWeight;
@@ -1059,7 +1061,7 @@ static void ed_vwpaintmode_enter_generic(
Paint *paint = BKE_paint_get_active_from_paintmode(scene, paint_mode);
paint_cursor_start_explicit(paint, wm, weight_paint_poll);
- BKE_paint_init(scene, paint_mode, PAINT_CURSOR_WEIGHT_PAINT);
+ BKE_paint_init(bmain, scene, paint_mode, PAINT_CURSOR_WEIGHT_PAINT);
/* weight paint specific */
ED_mesh_mirror_spatial_table(ob, NULL, NULL, NULL, 's');
@@ -1082,33 +1084,35 @@ static void ed_vwpaintmode_enter_generic(
}
void ED_object_vpaintmode_enter_ex(
- wmWindowManager *wm,
+ Main *bmain, wmWindowManager *wm,
Scene *scene, Object *ob)
{
ed_vwpaintmode_enter_generic(
- wm, scene, ob, OB_MODE_VERTEX_PAINT);
+ bmain, wm, scene, ob, OB_MODE_VERTEX_PAINT);
}
void ED_object_vpaintmode_enter(struct bContext *C)
{
+ Main *bmain = CTX_data_main(C);
wmWindowManager *wm = CTX_wm_manager(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
- ED_object_vpaintmode_enter_ex(wm, scene, ob);
+ ED_object_vpaintmode_enter_ex(bmain, wm, scene, ob);
}
void ED_object_wpaintmode_enter_ex(
- wmWindowManager *wm,
+ Main *bmain, wmWindowManager *wm,
Scene *scene, Object *ob)
{
ed_vwpaintmode_enter_generic(
- wm, scene, ob, OB_MODE_WEIGHT_PAINT);
+ bmain, wm, scene, ob, OB_MODE_WEIGHT_PAINT);
}
void ED_object_wpaintmode_enter(struct bContext *C)
{
+ Main *bmain = CTX_data_main(C);
wmWindowManager *wm = CTX_wm_manager(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
- ED_object_wpaintmode_enter_ex(wm, scene, ob);
+ ED_object_wpaintmode_enter_ex(bmain, wm, scene, ob);
}
/** \} */
@@ -1188,6 +1192,7 @@ void ED_object_wpaintmode_exit(struct bContext *C)
*/
static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_active_object(C);
const int mode_flag = OB_MODE_WEIGHT_PAINT;
const bool is_mode_set = (ob->mode & mode_flag) != 0;
@@ -1206,7 +1211,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
}
else {
wmWindowManager *wm = CTX_wm_manager(C);
- ED_object_wpaintmode_enter_ex(wm, scene, ob);
+ ED_object_wpaintmode_enter_ex(bmain, wm, scene, ob);
}
/* Weightpaint works by overriding colors in mesh,
@@ -2315,6 +2320,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot)
*/
static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_active_object(C);
const int mode_flag = OB_MODE_VERTEX_PAINT;
const bool is_mode_set = (ob->mode & mode_flag) != 0;
@@ -2334,7 +2340,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
}
else {
wmWindowManager *wm = CTX_wm_manager(C);
- ED_object_vpaintmode_enter_ex(wm, scene, ob);
+ ED_object_vpaintmode_enter_ex(bmain, wm, scene, ob);
}
/* update modifier stack for mapping requirements */