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-06-12 02:43:38 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-06-12 02:43:38 +0400
commit7b5fe4f316234022a0ab761b694cd459ce98db2d (patch)
tree587707ad84568a05c07dccde0ae45c86c034e23e /source/blender/editors/include
parentfb6cb25c1c8797d239ca8f6c5d775eef50cc801f (diff)
Fix flickering when transform snapping in edit mode and cursor is
slightly outside the mesh. Reported by Thomas Beck on irc. Issue here is that the mesh bounding box changes as we are transforming the vertices. Solution is to collide against the initial bounding box. Unfortunately the snapping functions are made in a way that a lot of code needed to be tweaked here, but the change should be straightforward and harmless (famous last words, I know). Ideally we might want to even increase the size of the bounding box a little (as seen in screen space) to allow snapping even in cases where, cursor is slightly outside the bounding box, but since this is not so straightforward to do for all cases, at least for me, leaving this as a TODO.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/ED_transform.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 41ff9b88da9..cfe6a7b166d 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -110,6 +110,7 @@ struct ScrArea;
struct Base;
struct Scene;
struct Object;
+struct BoundBox;
/* UNUSED */
// int BIF_snappingSupported(struct Object *obedit);
@@ -180,15 +181,15 @@ typedef enum SnapMode {
bool peelObjectsTransForm(struct TransInfo *t, struct ListBase *depth_peels, const float mval[2], SnapMode mode);
bool peelObjectsContext(struct bContext *C, struct ListBase *depth_peels, const float mval[2], SnapMode mode);
bool snapObjectsTransform(struct TransInfo *t, const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode);
-bool snapObjectsContext(struct bContext *C, const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode);
+bool snapObjectsContext(struct bContext *C, const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode, struct BoundBox *bb_init);
/* taks args for all settings */
bool snapObjectsEx(struct Scene *scene, struct Base *base_act, struct View3D *v3d, struct ARegion *ar, struct Object *obedit, short snap_mode,
const float mval[2], float *r_dist_px,
- float r_loc[3], float r_no[3], float *r_ray_dist, SnapMode mode);
+ float r_loc[3], float r_no[3], float *r_ray_dist, SnapMode mode, struct BoundBox *bb_init);
bool snapObjectsRayEx(struct Scene *scene, struct Base *base_act, struct View3D *v3d, struct ARegion *ar, struct Object *obedit, short snap_mode,
struct Object **r_ob, float r_obmat[4][4],
const float ray_start[3], const float ray_normal[3], float *r_ray_dist,
- const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode);
+ const float mval[2], float *r_dist_px, float r_loc[3], float r_no[3], SnapMode mode, struct BoundBox *bb_init);
bool snapNodesTransform(struct TransInfo *t, const int mval[2], float *r_dist_px, float r_loc[2], char *r_node_border, SnapMode mode);
bool snapNodesContext(struct bContext *C, const int mval[2], float *r_dist_px, float r_loc[2], char *r_node_border, SnapMode mode);