diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-23 04:41:55 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-23 04:41:55 +0400 |
commit | e2b6cea3b95ca41854661726ccea684421738c8f (patch) | |
tree | 8f0feed0ee4e3af460145984f183f24ef111d044 /source/blender/editors/transform/transform_snap.c | |
parent | 272fac8fd6e8c64472c856b85994f841678f172c (diff) |
2.5: Tool Settings
* Moved proportional edit, snap, autokey mode, and a few others
from Scene to ToolSettings.
* RNA wrapped properties in ToolSettings for the UV editor:
proportional edit, snap settings, selection modes.
Diffstat (limited to 'source/blender/editors/transform/transform_snap.c')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 72901110388..0b9a176dbdf 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -210,7 +210,7 @@ int handleSnapping(TransInfo *t, wmEvent *event) if (BIF_snappingSupported(t->obedit) && event->type == TABKEY && event->shift) { /* toggle snap and reinit */ - t->scene->snap_flag ^= SCE_SNAP; + t->settings->snap_flag ^= SCE_SNAP; initSnapping(t, NULL); status = 1; } @@ -282,10 +282,10 @@ int validSnappingNormal(TransInfo *t) void initSnapping(TransInfo *t, wmOperator *op) { - Scene *scene = t->scene; + ToolSettings *ts = t->settings; Object *obedit = t->obedit; int snapping = 0; - short snap_mode = t->scene->snap_target; + short snap_mode = t->settings->snap_target; resetSnapping(t); @@ -310,8 +310,8 @@ void initSnapping(TransInfo *t, wmOperator *op) } else { - snapping = ((scene->snap_flag & SCE_SNAP) == SCE_SNAP); - t->tsnap.align = ((t->scene->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE); + snapping = ((ts->snap_flag & SCE_SNAP) == SCE_SNAP); + t->tsnap.align = ((t->settings->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE); } if ((t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) && // Only 3D view or UV @@ -542,7 +542,7 @@ void CalcSnapGeometry(TransInfo *t, float *vec) int dist = SNAP_MIN_DISTANCE; // Use a user defined value here SnapMode mode; - if (t->scene->snap_mode == SCE_SNAP_MODE_VOLUME) + if (t->settings->snap_mode == SCE_SNAP_MODE_VOLUME) { ListBase depth_peels; DepthPeel *p1, *p2; @@ -575,7 +575,7 @@ void CalcSnapGeometry(TransInfo *t, float *vec) p1->flag = 1; /* if peeling objects, take the first and last from each object */ - if (t->scene->snap_flag & SCE_SNAP_PEEL_OBJECT) + if (t->settings->snap_flag & SCE_SNAP_PEEL_OBJECT) { DepthPeel *peel; for (peel = p1->next; peel; peel = peel->next) @@ -1346,6 +1346,7 @@ int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh *dm, E int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obmat[][4], float ray_start[3], float ray_normal[3], short mval[2], float *loc, float *no, int *dist, float *depth) { + ToolSettings *ts= scene->toolsettings; int retval = 0; if (ob->type == OB_MESH) { @@ -1363,13 +1364,13 @@ int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obma dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); } - retval = snapDerivedMesh(scene->snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); + retval = snapDerivedMesh(ts->snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); dm->release(dm); } else if (ob->type == OB_ARMATURE) { - retval = snapArmature(scene->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); + retval = snapArmature(ts->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); } return retval; |