At last... this merge should finally do the trick!
[blender.git] / source / blender / editors / transform / transform_generics.c
index a60135107bc71bb0a48286289f8fa1c5e91a1ef8..db7c6d6ee99b3d4a000cbded1ec9ea3dd5e2bc32 100644 (file)
@@ -622,6 +622,7 @@ void resetTransRestrictions(TransInfo *t)
 int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
 {
        Scene *sce = CTX_data_scene(C);
+       ToolSettings *ts = CTX_data_tool_settings(C);
        ARegion *ar = CTX_wm_region(C);
        ScrArea *sa = CTX_wm_area(C);
        Object *obedit = CTX_data_edit_object(C);
@@ -636,6 +637,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        t->sa = sa;
        t->ar = ar;
        t->obedit = obedit;
+       t->settings = ts;
 
        t->data = NULL;
        t->ext = NULL;
@@ -709,9 +711,10 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
        else if(t->spacetype==SPACE_IMAGE || t->spacetype==SPACE_NODE)
        {
+               SpaceImage *sima = sa->spacedata.first;
                // XXX for now, get View2D  from the active region
                t->view = &ar->v2d;
-               t->around = ar->v2d.around;
+               t->around = sima->around;
        }
        else
        {
@@ -731,7 +734,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        // Need stuff to take it from edit mesh or whatnot here
        else
        {
-               if (t->obedit && t->obedit->type == OB_MESH && sce->toolsettings->editbutflag & B_MESH_X_MIRROR)
+               if (t->obedit && t->obedit->type == OB_MESH && ts->editbutflag & B_MESH_X_MIRROR)
                {
                        t->flag |= T_MIRROR;
                }
@@ -751,10 +754,10 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
        else
        {
-               if ((t->options & CTX_NO_PET) == 0 && (sce->proportional)) {
+               if ((t->options & CTX_NO_PET) == 0 && (ts->proportional)) {
                        t->flag |= T_PROP_EDIT;
                        
-                       if(sce->proportional == 2)
+                       if(ts->proportional == 2)
                                t->flag |= T_PROP_CONNECTED;    // yes i know, has to become define
                }
        }
@@ -765,7 +768,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
        else
        {
-               t->prop_size = sce->toolsettings->proportional_size;
+               t->prop_size = ts->proportional_size;
        }
        
        if (op && RNA_struct_find_property(op->ptr, "proportional_editing_falloff") && RNA_property_is_set(op->ptr, "proportional_editing_falloff"))
@@ -774,7 +777,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
        else
        {
-               t->prop_mode = sce->prop_mode;
+               t->prop_mode = ts->prop_mode;
        }
 
        /* TRANSFORM_FIX_ME rna restrictions */