fix for bad array access in transform operator, was assigning an array to a single...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 18 Aug 2011 12:09:53 +0000 (12:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 18 Aug 2011 12:09:53 +0000 (12:09 +0000)
source/blender/editors/transform/transform.c

index c1c812e8c68d3f6121a647e5b59e6977d43cafb4..03a98bf30d8d2932bfdb2ee4e4fe4e41909d6a08 100644 (file)
@@ -1356,16 +1356,15 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
        ToolSettings *ts = CTX_data_tool_settings(C);
        int constraint_axis[3] = {0, 0, 0};
        int proportional = 0;
+       PropertyRNA *prop;
 
-       if (RNA_struct_find_property(op->ptr, "value"))
-       {
-               if (t->flag & T_AUTOVALUES)
-               {
-                       RNA_float_set_array(op->ptr, "value", t->auto_values);
+       if ((prop= RNA_struct_find_property(op->ptr, "value"))) {
+               float *values= (t->flag & T_AUTOVALUES) ? t->auto_values : t->values;
+               if (RNA_property_array_check(prop)) {
+                       RNA_property_float_set_array(op->ptr, prop, values);
                }
-               else
-               {
-                       RNA_float_set_array(op->ptr, "value", t->values);
+               else {
+                       RNA_property_float_set(op->ptr, prop, values[0]);
                }
        }