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 15:39:38 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-11 15:39:38 +0300
commit160cb9a28477ccd1d8bdbf5265464dfdbea09d2c (patch)
treed8e6b778752a7bbf2ceb7929c305b4569578cf83 /source/blender/editors/sculpt_paint
parentb7bf8b375767cec527b5659613dbff1903963f3c (diff)
parentd0956e9cb3077971a9ae6c1ba9560604d5ad1ef7 (diff)
Merge branch 'master' into blender2.8
Conflicts: intern/cycles/blender/blender_object.cpp source/blender/alembic/intern/abc_exporter.cc source/blender/alembic/intern/abc_mball.cc source/blender/alembic/intern/abc_mball.h source/blender/blenkernel/BKE_anim.h source/blender/blenkernel/BKE_displist.h source/blender/blenkernel/BKE_dynamicpaint.h source/blender/blenkernel/BKE_group.h source/blender/blenkernel/BKE_mball.h source/blender/blenkernel/BKE_mball_tessellate.h source/blender/blenkernel/BKE_object.h source/blender/blenkernel/BKE_scene.h source/blender/blenkernel/intern/anim.c source/blender/blenkernel/intern/depsgraph.c source/blender/blenkernel/intern/displist.c source/blender/blenkernel/intern/dynamicpaint.c source/blender/blenkernel/intern/group.c source/blender/blenkernel/intern/mball.c source/blender/blenkernel/intern/mball_tessellate.c source/blender/blenkernel/intern/mesh_convert.c source/blender/blenkernel/intern/object.c source/blender/blenkernel/intern/object_dupli.c source/blender/blenkernel/intern/object_update.c source/blender/blenkernel/intern/pointcache.c source/blender/blenkernel/intern/scene.c source/blender/blenkernel/intern/smoke.c source/blender/depsgraph/intern/builder/deg_builder_nodes.cc source/blender/depsgraph/intern/builder/deg_builder_relations.cc source/blender/editors/include/ED_object.h source/blender/editors/object/object_add.c source/blender/editors/object/object_edit.c source/blender/editors/object/object_modifier.c source/blender/editors/physics/dynamicpaint_ops.c source/blender/editors/sculpt_paint/paint_vertex.c source/blender/editors/sculpt_paint/sculpt_uv.c source/blender/editors/space_view3d/drawobject.c source/blender/editors/space_view3d/view3d_draw.c source/blender/editors/transform/transform_conversions.c source/blender/editors/transform/transform_snap_object.c source/blender/editors/util/ed_util.c source/blender/gpu/intern/gpu_material.c source/blender/makesrna/intern/rna_meta.c source/blender/makesrna/intern/rna_object_api.c source/blender/modifiers/intern/MOD_dynamicpaint.c source/blenderplayer/bad_level_call_stubs/stubs.c
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.c28
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c9
4 files changed, 25 insertions, 20 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 2921faf8a5a..61b673afc9f 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -739,7 +739,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;
ImagePaintSettings *imapaint = &settings->imapaint;
@@ -758,7 +758,7 @@ void ED_space_image_paint_update(wmWindowManager *wm, Scene *scene)
}
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);
}
@@ -1119,7 +1119,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 02dae51c594..ac6bfe019a1 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -55,7 +55,6 @@
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_deform.h"
-#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
@@ -1062,7 +1061,8 @@ static void vertex_paint_init_session_data(const ToolSettings *ts, Object *ob)
* \{ */
static void ed_vwpaintmode_enter_generic(
- Depsgraph *depsgraph, wmWindowManager *wm, Scene *scene,
+ Main *bmain, Depsgraph *depsgraph,
+ wmWindowManager *wm, Scene *scene,
Object *ob, const eObjectMode mode_flag)
{
ob->mode |= mode_flag;
@@ -1083,7 +1083,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;
@@ -1094,7 +1094,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');
@@ -1120,35 +1120,37 @@ static void ed_vwpaintmode_enter_generic(
}
void ED_object_vpaintmode_enter_ex(
- Depsgraph *depsgraph, wmWindowManager *wm,
+ Main *bmain, Depsgraph *depsgraph, wmWindowManager *wm,
Scene *scene, Object *ob)
{
ed_vwpaintmode_enter_generic(
- depsgraph, wm, scene, ob, OB_MODE_VERTEX_PAINT);
+ bmain, depsgraph, wm, scene, ob, OB_MODE_VERTEX_PAINT);
}
void ED_object_vpaintmode_enter(struct bContext *C)
{
+ Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(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(depsgraph, wm, scene, ob);
+ ED_object_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
}
void ED_object_wpaintmode_enter_ex(
- Depsgraph *depsgraph, wmWindowManager *wm,
+ Main *bmain, Depsgraph *depsgraph, wmWindowManager *wm,
Scene *scene, Object *ob)
{
ed_vwpaintmode_enter_generic(
- depsgraph, wm, scene, ob, OB_MODE_WEIGHT_PAINT);
+ bmain, depsgraph, wm, scene, ob, OB_MODE_WEIGHT_PAINT);
}
void ED_object_wpaintmode_enter(struct bContext *C)
{
+ Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(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(depsgraph, wm, scene, ob);
+ ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
}
/** \} */
@@ -1234,6 +1236,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);
struct wmMsgBus *mbus = CTX_wm_message_bus(C);
Object *ob = CTX_data_active_object(C);
const int mode_flag = OB_MODE_WEIGHT_PAINT;
@@ -1254,7 +1257,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
else {
Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C);
wmWindowManager *wm = CTX_wm_manager(C);
- ED_object_wpaintmode_enter_ex(depsgraph, wm, scene, ob);
+ ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
}
/* Weightpaint works by overriding colors in mesh,
@@ -2371,6 +2374,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot)
*/
static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
struct wmMsgBus *mbus = CTX_wm_message_bus(C);
Object *ob = CTX_data_active_object(C);
const int mode_flag = OB_MODE_VERTEX_PAINT;
@@ -2392,7 +2396,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
else {
Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C);
wmWindowManager *wm = CTX_wm_manager(C);
- ED_object_vpaintmode_enter_ex(depsgraph, wm, scene, ob);
+ ED_object_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
}
BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 3475aadd171..1c76f20d45c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5687,7 +5687,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 46d704e8f74..cf9feae62b5 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -43,12 +43,13 @@
#include "DNA_meshdata_types.h"
#include "BKE_brush.h"
-#include "BKE_paint.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
-#include "BKE_mesh_mapping.h"
#include "BKE_customdata.h"
#include "BKE_editmesh.h"
+#include "BKE_main.h"
+#include "BKE_mesh_mapping.h"
+#include "BKE_paint.h"
#include "DEG_depsgraph.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);