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:
Diffstat (limited to 'source/blender/draw/modes/paint_vertex_mode.c')
-rw-r--r--source/blender/draw/modes/paint_vertex_mode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c
index 9cf6ea52d33..236f76367d4 100644
--- a/source/blender/draw/modes/paint_vertex_mode.c
+++ b/source/blender/draw/modes/paint_vertex_mode.c
@@ -36,6 +36,8 @@
#include "DNA_mesh_types.h"
#include "DNA_view3d_types.h"
+#include "DEG_depsgraph_query.h"
+
extern struct GPUUniformBuffer *globals_ubo; /* draw_common.c */
extern struct GlobalsUboStorage ts; /* draw_common.c */
@@ -125,6 +127,7 @@ static void PAINT_VERTEX_cache_init(void *vedata)
DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL);
stl->g_data->lwire_shgrp = DRW_shgroup_create(e_data.wire_overlay_shader, psl->wire_overlay);
+ DRW_shgroup_uniform_block(stl->g_data->lwire_shgrp, "globalsBlock", globals_ubo);
}
{
@@ -146,11 +149,13 @@ static void PAINT_VERTEX_cache_populate(void *vedata, Object *ob)
const View3D *v3d = draw_ctx->v3d;
if ((ob->type == OB_MESH) && (ob == draw_ctx->obact)) {
+ /* We're always painting on original, display original data. */
+ ob = DEG_get_original_object(ob);
const Mesh *me = ob->data;
const bool use_wire = (v3d->overlay.paint_flag & V3D_OVERLAY_PAINT_WIRE) != 0;
const bool use_surface = v3d->overlay.vertex_paint_mode_opacity != 0.0f;
const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
- struct Gwn_Batch *geom;
+ struct GPUBatch *geom;
if (use_surface) {
geom = DRW_cache_mesh_surface_vert_colors_get(ob);