diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
commit | 90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch) | |
tree | e88cab4fb1358e962b19f658064ca8c9f8d29f5b /source/blender/editors/transform/transform_snap.c | |
parent | 08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff) | |
parent | b0b787ef38f9947b3176642556f5282eb3518f69 (diff) |
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'source/blender/editors/transform/transform_snap.c')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index b49e1b05de3..778698d3060 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -36,6 +36,7 @@ #include "DNA_armature_types.h" #include "DNA_scene_types.h" +#include "DNA_object_types.h" #include "DNA_meshdata_types.h" // Temporary, for snapping to other unselected meshes #include "DNA_space_types.h" #include "DNA_screen_types.h" @@ -53,15 +54,12 @@ //#include "editmesh.h" //#include "BIF_editsima.h" #include "BIF_gl.h" -#include "BIF_glutil.h" //#include "BIF_mywindow.h" //#include "BIF_screen.h" //#include "BIF_editsima.h" //#include "BIF_drawimage.h" //#include "BIF_editmesh.h" -#include "BKE_global.h" -#include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" #include "BKE_object.h" #include "BKE_anim.h" /* for duplis */ @@ -279,7 +277,7 @@ void applyProject(TransInfo *t) mul_m3_v3(td->smtx, tvec); - add_v3_v3v3(td->loc, td->loc, tvec); + add_v3_v3(td->loc, tvec); } //XXX constraintTransLim(t, td); @@ -442,9 +440,9 @@ void initSnapping(TransInfo *t, wmOperator *op) normalize_v3(t->tsnap.snapNormal); } - if (RNA_struct_find_property(op->ptr, "snap_project")) + if (RNA_struct_find_property(op->ptr, "use_snap_project")) { - t->tsnap.project = RNA_boolean_get(op->ptr, "snap_project"); + t->tsnap.project = RNA_boolean_get(op->ptr, "use_snap_project"); } } } @@ -912,7 +910,7 @@ void TargetSnapMedian(TransInfo *t) for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) { - add_v3_v3v3(t->tsnap.snapTarget, t->tsnap.snapTarget, td->center); + add_v3_v3(t->tsnap.snapTarget, td->center); } mul_v3_fl(t->tsnap.snapTarget, 1.0 / i); @@ -1030,7 +1028,7 @@ int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], float *v4 VECCOPY(intersect, ray_normal_local); mul_v3_fl(intersect, lambda); - add_v3_v3v3(intersect, intersect, ray_start_local); + add_v3_v3(intersect, ray_start_local); VECCOPY(location, intersect); @@ -1730,7 +1728,7 @@ int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta VECCOPY(intersect, ray_normal_local); mul_v3_fl(intersect, lambda); - add_v3_v3v3(intersect, intersect, ray_start_local); + add_v3_v3(intersect, ray_start_local); VECCOPY(location, intersect); @@ -1760,7 +1758,7 @@ int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], float ray_sta VECCOPY(intersect, ray_normal_local); mul_v3_fl(intersect, lambda); - add_v3_v3v3(intersect, intersect, ray_start_local); + add_v3_v3(intersect, ray_start_local); VECCOPY(location, intersect); @@ -1897,26 +1895,13 @@ void snapGridAction(TransInfo *t, float *val, GearsType action) { void snapGrid(TransInfo *t, float *val) { - int invert; GearsType action; // Only do something if using Snap to Grid if (t->tsnap.mode != SCE_SNAP_MODE_INCREMENT) return; - if(t->mode==TFM_ROTATION || t->mode==TFM_WARP || t->mode==TFM_TILT || t->mode==TFM_TRACKBALL || t->mode==TFM_BONE_ROLL) - invert = U.flag & USER_AUTOROTGRID; - else if(t->mode==TFM_RESIZE || t->mode==TFM_SHEAR || t->mode==TFM_BONESIZE || t->mode==TFM_SHRINKFATTEN || t->mode==TFM_CURVE_SHRINKFATTEN) - invert = U.flag & USER_AUTOSIZEGRID; - else - invert = U.flag & USER_AUTOGRABGRID; - - if(invert) { - action = activeSnap(t) ? NO_GEARS: BIG_GEARS; - } - else { - action = activeSnap(t) ? BIG_GEARS : NO_GEARS; - } + action = activeSnap(t) ? BIG_GEARS : NO_GEARS; if (action == BIG_GEARS && (t->modifiers & MOD_PRECISION)) { action = SMALL_GEARS; |