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
parent13d238729bed899a9a7e190ba38406846c485230 (diff)
Cleanup: remove some G.main usages...
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c26
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c11
4 files changed, 26 insertions, 19 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index c2b1fcaf460..cee7801a9cb 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -708,7 +708,7 @@ static void toggle_paint_cursor(bContext *C, int enable)
* purpose is to make sure the paint cursor is shown if paint
* mode is enabled in the image editor. the paint poll will
* ensure that the cursor is hidden when not in paint mode */
-void ED_space_image_paint_update(wmWindowManager *wm, Scene *scene)
+void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene)
{
ToolSettings *settings = scene->toolsettings;
wmWindow *win;
@@ -723,7 +723,7 @@ void ED_space_image_paint_update(wmWindowManager *wm, Scene *scene)
enabled = true;
if (enabled) {
- BKE_paint_init(scene, ePaintTexture2D, PAINT_CURSOR_TEXTURE_PAINT);
+ BKE_paint_init(bmain, scene, ePaintTexture2D, PAINT_CURSOR_TEXTURE_PAINT);
paint_cursor_start_explicit(&imapaint->paint, wm, image_paint_poll);
}
@@ -1086,7 +1086,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
ob->mode |= mode_flag;
- BKE_paint_init(scene, ePaintTextureProjective, PAINT_CURSOR_TEXTURE_PAINT);
+ BKE_paint_init(bmain, scene, ePaintTextureProjective, PAINT_CURSOR_TEXTURE_PAINT);
if (U.glreslimit != 0)
GPU_free_images();
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 */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index d5bdd4c8b98..bef705a29b1 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5672,7 +5672,7 @@ void ED_object_sculptmode_enter_ex(
}
Paint *paint = BKE_paint_get_active_from_paintmode(scene, ePaintSculpt);
- BKE_paint_init(scene, ePaintSculpt, PAINT_CURSOR_SCULPT);
+ BKE_paint_init(bmain, scene, ePaintSculpt, PAINT_CURSOR_SCULPT);
paint_cursor_start_explicit(paint, bmain->wm.first, sculpt_poll_view3d);
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index e93a68b9350..78274332660 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -43,13 +43,14 @@
#include "DNA_meshdata_types.h"
#include "BKE_brush.h"
-#include "BKE_paint.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
-#include "BKE_depsgraph.h"
-#include "BKE_mesh_mapping.h"
#include "BKE_customdata.h"
+#include "BKE_depsgraph.h"
#include "BKE_editmesh.h"
+#include "BKE_main.h"
+#include "BKE_mesh_mapping.h"
+#include "BKE_paint.h"
#include "ED_screen.h"
#include "ED_image.h"
@@ -230,7 +231,7 @@ static void brush_drawcursor_uvsculpt(bContext *C, int x, int y, void *UNUSED(cu
}
-void ED_space_image_uv_sculpt_update(wmWindowManager *wm, Scene *scene)
+void ED_space_image_uv_sculpt_update(Main *bmain, wmWindowManager *wm, Scene *scene)
{
ToolSettings *settings = scene->toolsettings;
if (settings->use_uv_sculpt) {
@@ -243,7 +244,7 @@ void ED_space_image_uv_sculpt_update(wmWindowManager *wm, Scene *scene)
settings->uvsculpt->paint.flags |= PAINT_SHOW_BRUSH;
}
- BKE_paint_init(scene, ePaintSculptUV, PAINT_CURSOR_SCULPT);
+ BKE_paint_init(bmain, scene, ePaintSculptUV, PAINT_CURSOR_SCULPT);
settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
brush_drawcursor_uvsculpt, NULL);