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:
authorAntony Riakiotakis <kalast@gmail.com>2014-03-21 22:37:00 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-03-21 22:37:21 +0400
commit0da3e974338b3971e9a4982b2fbf59579b232cff (patch)
treea6128387516f760b5b2f55523f7ba99863782b27 /source/blender/editors/sculpt_paint/paint_intern.h
parent44dc72334d7a93acda7415425c89699c926da376 (diff)
Fix T39279 Vertex paint modes do not work well with mirror modifier
Issue here is that coordinates used for projection would not fit the closest candidate. So it was possible to paint against the mirrored part of the mesh, which would get clipped on reprojection. Fix avoids reprojection by storing squared distance, and screen space coordinates, which we will need again later anyway. Also we now always paint against the closest vertex always. This is ensured because squared distances for uninitialized vertices will be MAXFLOAT, thus failing the strength test.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_intern.h')
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 6dd42380a11..e95632ef8c4 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -118,12 +118,16 @@ void PAINT_OT_vertex_paint(struct wmOperatorType *ot);
unsigned int vpaint_get_current_col(struct VPaint *vp);
+typedef struct VertProjData {
+ struct DMCoNo *vcosnos;
+ float *dists_sq;
+ float (*ss_co)[2];
+} VertProjData;
/* paint_vertex_proj.c */
struct VertProjHandle;
-struct VertProjHandle *ED_vpaint_proj_handle_create(
- struct Scene *scene, struct Object *ob,
- struct DMCoNo **r_vcosnos);
+struct VertProjHandle *ED_vpaint_proj_handle_create(struct Scene *scene, struct Object *ob,
+ VertProjData **r_vcosnos);
void ED_vpaint_proj_handle_update(
struct VertProjHandle *vp_handle,
/* runtime vars */