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/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c16
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c11
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c6
3 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 5cca61d4c78..0ee55f0f062 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -694,13 +694,13 @@ static void paint_draw_tex_overlay(
immUniform1i("image", GL_TEXTURE0);
immBegin(GPU_PRIM_TRI_FAN, 4);
- immAttrib2f(texCoord, 0.0f, 0.0f);
+ immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, quad.xmin, quad.ymin);
- immAttrib2f(texCoord, 1.0f, 0.0f);
+ immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, quad.xmax, quad.ymin);
- immAttrib2f(texCoord, 1.0f, 1.0f);
+ immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, quad.xmax, quad.ymax);
- immAttrib2f(texCoord, 0.0f, 1.0f);
+ immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, quad.xmin, quad.ymax);
immEnd();
@@ -777,13 +777,13 @@ static void paint_draw_cursor_overlay(
immUniform1i("image", 0);
immBegin(GPU_PRIM_TRI_FAN, 4);
- immAttrib2f(texCoord, 0.0f, 0.0f);
+ immAttr2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, quad.xmin, quad.ymin);
- immAttrib2f(texCoord, 1.0f, 0.0f);
+ immAttr2f(texCoord, 1.0f, 0.0f);
immVertex2f(pos, quad.xmax, quad.ymin);
- immAttrib2f(texCoord, 1.0f, 1.0f);
+ immAttr2f(texCoord, 1.0f, 1.0f);
immVertex2f(pos, quad.xmax, quad.ymax);
- immAttrib2f(texCoord, 0.0f, 1.0f);
+ immAttr2f(texCoord, 0.0f, 1.0f);
immVertex2f(pos, quad.xmin, quad.ymax);
immEnd();
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index e914a24092e..9057c3b0609 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -53,6 +53,7 @@
#include "BKE_customdata.h"
#include "BKE_image.h"
#include "BKE_material.h"
+#include "BKE_mesh_runtime.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_report.h"
@@ -285,13 +286,15 @@ static void imapaint_tri_weights(
/* compute uv coordinates of mouse in face */
static void imapaint_pick_uv(Mesh *me_eval, Scene *scene, Object *ob_eval, unsigned int faceindex, const int xy[2], float uv[2])
{
- const int tottri = me_eval->runtime.looptris.len;
int i, findex;
float p[2], w[3], absw, minabsw;
float matrix[4][4], proj[4][4];
GLint view[4];
const eImagePaintMode mode = scene->toolsettings->imapaint.mode;
- const MLoopTri *lt = me_eval->runtime.looptris.array;
+
+ const MLoopTri *lt = BKE_mesh_runtime_looptri_ensure(me_eval);
+ const int tottri = me_eval->runtime.looptris.len;
+
const MVert *mvert = me_eval->mvert;
const MPoly *mpoly = me_eval->mpoly;
const MLoop *mloop = me_eval->mloop;
@@ -327,7 +330,7 @@ static void imapaint_pick_uv(Mesh *me_eval, Scene *scene, Object *ob_eval, unsig
const Material *ma;
const TexPaintSlot *slot;
- ma = give_current_material(ob_eval, mp->mat_nr);
+ ma = give_current_material(ob_eval, mp->mat_nr + 1);
slot = &ma->texpaintslot[ma->paint_active_slot];
if (!(slot && slot->uvname &&
@@ -466,7 +469,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr
if (ob) {
Mesh *me = (Mesh *)ob->data;
- Mesh *me_eval = BKE_object_get_evaluated_mesh(depsgraph, ob); /* Or shall we just do ob_eval->mesh_eval ? */
+ Mesh *me_eval = ob_eval->runtime.mesh_eval;
ViewContext vc;
const int mval[2] = {x, y};
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 139986fa1c1..7b3cfe184f5 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -173,12 +173,12 @@ static MDeformVert *defweight_prev_init(MDeformVert *dvert_prev, MDeformVert *dv
* (without rebuilding the 'derivedFinal') */
static bool vertex_paint_use_fast_update_check(Object *ob)
{
- DerivedMesh *dm = ob->derivedFinal;
+ Mesh *me_eval = ob->runtime.mesh_eval;
- if (dm) {
+ if (me_eval != NULL) {
Mesh *me = BKE_mesh_from_object(ob);
if (me && me->mloopcol) {
- return (me->mloopcol == CustomData_get_layer(&dm->loopData, CD_MLOOPCOL));
+ return (me->mloopcol == CustomData_get_layer(&me_eval->ldata, CD_MLOOPCOL));
}
}