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:
authorMartin Poirier <theeth@yahoo.com>2009-11-27 19:15:34 +0300
committerMartin Poirier <theeth@yahoo.com>2009-11-27 19:15:34 +0300
commit20a2100a365da94182f3e90174a7a043cfba3a12 (patch)
tree3ccf11d69893c72203640ce1ffab85b2673bfd05 /source/blender/editors/transform/transform_generics.c
parent994776811f06d5c0b19242bf8d5ca49ae38ae0a6 (diff)
Add missing snap properties to transform operator.
This is used to force snap on and off when needed. Also, when transform is not run modal, it will use default values for PET and snap properties (False) instead of scene settings. No need to force them off when calling transform with Exec.
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r--source/blender/editors/transform/transform_generics.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 7fa4f8b0ffc..8b7c4b7503b 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -930,6 +930,11 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
unit_m3(t->mat);
+ /* if there's an event, we're modal */
+ if (event) {
+ t->flag |= T_MODAL;
+ }
+
t->spacetype = sa->spacetype;
if(t->spacetype == SPACE_VIEW3D)
{
@@ -1010,11 +1015,15 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
}
else
{
- if ((t->options & CTX_NO_PET) == 0 && (ts->proportional != PROP_EDIT_OFF)) {
- t->flag |= T_PROP_EDIT;
-
- if(ts->proportional == PROP_EDIT_CONNECTED)
- t->flag |= T_PROP_CONNECTED;
+ /* use settings from scene only if modal */
+ if (t->flag & T_MODAL)
+ {
+ if ((t->options & CTX_NO_PET) == 0 && (ts->proportional != PROP_EDIT_OFF)) {
+ t->flag |= T_PROP_EDIT;
+
+ if(ts->proportional == PROP_EDIT_CONNECTED)
+ t->flag |= T_PROP_CONNECTED;
+ }
}
}
@@ -1048,11 +1057,6 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->options |= CTX_NO_PET;
}
- /* Snapping */
- if (ts->snap_flag & SCE_SNAP) {
- t->modifiers |= MOD_SNAP;
- }
-
setTransformViewMatrices(t);
initNumInput(&t->num);
initNDofInput(&t->ndof);