Revision: 23785
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23785
Author:   theeth
Date:     2009-10-12 15:37:07 +0200 (Mon, 12 Oct 2009)

Log Message:
-----------
Following up on revision 23783

Transform saves back tool settings only when they weren't set as operator 
argument (and only when running modal).

Revision Links:
--------------
    
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23783

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform_generics.c

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c  2009-10-12 
13:12:45 UTC (rev 23784)
+++ trunk/blender/source/blender/editors/transform/transform.c  2009-10-12 
13:37:07 UTC (rev 23785)
@@ -1288,6 +1288,36 @@
                proportional = 0;
        }
 
+       // If modal, save settings back in scene if not set as operator argument
+       if (t->flag & T_MODAL)
+       {
+               /* save settings if not set in operator */
+               if (RNA_struct_find_property(op->ptr, "proportional") && 
!RNA_property_is_set(op->ptr, "proportional"))
+               {
+                       ts->proportional = proportional;
+               }
+
+               if (RNA_struct_find_property(op->ptr, "proportional_size") && 
!RNA_property_is_set(op->ptr, "proportional_size"))
+               {
+                       ts->proportional_size = t->prop_size;
+               }
+                       
+               if (RNA_struct_find_property(op->ptr, 
"proportional_editing_falloff") && !RNA_property_is_set(op->ptr, 
"proportional_editing_falloff"))
+               {
+                       ts->prop_mode = t->prop_mode;
+               }
+               
+               if(t->spacetype == SPACE_VIEW3D)
+               {
+                       if (RNA_struct_find_property(op->ptr, 
"constraint_orientation") && !RNA_property_is_set(op->ptr, 
"constraint_orientation"))
+                       {
+                               View3D *v3d = t->view;
+       
+                               v3d->twmode = t->current_orientation;
+                       }
+               }
+       }
+       
        if (RNA_struct_find_property(op->ptr, "proportional"))
        {
                RNA_enum_set(op->ptr, "proportional", proportional);
@@ -1319,26 +1349,6 @@
 
                RNA_boolean_set_array(op->ptr, "constraint_axis", 
constraint_axis);
        }
-
-       // XXX If modal, save settings back in scene
-       if (t->flag & T_MODAL)
-       {
-               ts->prop_mode = t->prop_mode;
-               
-               /* only save back if it wasn't automatically disabled */
-               if ((t->options & CTX_NO_PET) == 0)
-               {
-                       ts->proportional = proportional;
-                       ts->proportional_size = t->prop_size;
-               }
-
-               if(t->spacetype == SPACE_VIEW3D)
-               {
-                       View3D *v3d = t->view;
-
-                       v3d->twmode = t->current_orientation;
-               }
-       }
 }
 
 int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, 
int mode)

Modified: trunk/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_generics.c 
2009-10-12 13:12:45 UTC (rev 23784)
+++ trunk/blender/source/blender/editors/transform/transform_generics.c 
2009-10-12 13:37:07 UTC (rev 23785)
@@ -934,7 +934,7 @@
                if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
                t->around = v3d->around;
                
-               if (op && RNA_struct_find_property(op->ptr, "constraint_axis") 
&& RNA_property_is_set(op->ptr, "constraint_orientation"))
+               if (op && RNA_struct_find_property(op->ptr, 
"constraint_orientation") && RNA_property_is_set(op->ptr, 
"constraint_orientation"))
                {
                        t->current_orientation = RNA_enum_get(op->ptr, 
"constraint_orientation");
                        


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to