diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-03-21 22:37:00 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-03-21 22:37:21 +0400 |
commit | 0da3e974338b3971e9a4982b2fbf59579b232cff (patch) | |
tree | a6128387516f760b5b2f55523f7ba99863782b27 /source/blender/editors/sculpt_paint/paint_intern.h | |
parent | 44dc72334d7a93acda7415425c89699c926da376 (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.h | 10 |
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 */ |