properties were being used with wrong type functions, this resulted in bad memory...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 22 Mar 2011 12:53:36 +0000 (12:53 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 22 Mar 2011 12:53:36 +0000 (12:53 +0000)
13 files changed:
release/scripts/startup/bl_operators/vertexpaint_dirt.py
source/blender/editors/armature/armature_ops.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/metaball/mball_ops.c
source/blender/editors/physics/physics_ops.c
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/transform/transform_ops.c

index ca8a3dedd0d5bb13539f941d96bd89a5d006b195..672db71e361edf866f3b3719af401c2a559e040b 100644 (file)
@@ -162,8 +162,8 @@ class VertexPaintDirt(bpy.types.Operator):
         obj = context.object
 
         if not obj or obj.type != 'MESH':
-            print('Error, no active mesh object, aborting')
-            return('CANCELLED',)
+            self.report({'ERROR'}, "Error, no active mesh object, aborting")
+            return {'CANCELLED'}
 
         mesh = obj.data
 
index 254174dc090c4ff1270160bc724434f0fa5f6b3f..34942a2edc11db2e000c9e96217bd0dfd891b239 100644 (file)
@@ -180,7 +180,7 @@ void ED_operatormacros_armature(void)
        ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
        if(ot) {
                otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
-               RNA_enum_set(otmacro->ptr, "forked", 0);
+               RNA_boolean_set(otmacro->ptr, "forked", 0);
                otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
                RNA_enum_set(otmacro->ptr, "proportional", 0);
        }
@@ -190,7 +190,7 @@ void ED_operatormacros_armature(void)
        ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
        if(ot) {
                otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
-               RNA_enum_set(otmacro->ptr, "forked", 1);
+               RNA_boolean_set(otmacro->ptr, "forked", 1);
                otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
                RNA_enum_set(otmacro->ptr, "proportional", 0);
        }
index b1d499162eb5b4727d36b799a18a0dcef90944c6..c8aabdfe033f18ee86dbc0a4c6c038d28d2cf0f8 100644 (file)
@@ -231,7 +231,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
 
        WM_keymap_add_item(keymap, "CURVE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, 0, 0);
-       RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+       RNA_boolean_set(WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
 
        WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
        
index d4b96762ab8be2b7d6f49c041245339db24f52cd..a14a75fc545607b4e4c31c48eab010d0e24b57c8 100644 (file)
@@ -4731,7 +4731,7 @@ static int extrude_exec(bContext *C, wmOperator *UNUSED(op))
 static int extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
        if(extrude_exec(C, op) == OPERATOR_FINISHED) {
-               RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
+               RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION);
                WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
 
                return OPERATOR_FINISHED;
@@ -5608,7 +5608,7 @@ static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
        duplicate_exec(C, op);
 
-       RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
+       RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION);
        WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
 
        return OPERATOR_FINISHED;
index 28c2a74f5b2204cff18a178d3e8486c74e8555c0..43871285ee5cda28f5abaac7c25acd5974eb7384 100644 (file)
@@ -302,7 +302,7 @@ static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *UNUS
        int retv= duplicate_metaelems_exec(C, op);
        
        if (retv == OPERATOR_FINISHED) {
-               RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
+               RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION);
                WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
        }
        
index 615dc37016a4e7f2edc70b596e3907684c3d43f6..1b50cc6523a72fbedcb570c4c2763dc657c141b9 100644 (file)
@@ -65,7 +65,7 @@ void ED_keymap_metaball(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "MBALL_OT_reveal_metaelems", HKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, 0, 0);
-       RNA_enum_set(WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+       RNA_boolean_set(WM_keymap_add_item(keymap, "MBALL_OT_hide_metaelems", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
        
        WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", XKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "MBALL_OT_delete_metaelems", DELKEY, KM_PRESS, 0, 0);
index 889ee2c9740a576e31bab86717ae0437d887914f..02b2fad7a00cd7e5600e9dad7d3269d818315e68 100644 (file)
@@ -108,7 +108,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
 
        WM_keymap_add_item(keymap, "PARTICLE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, 0, 0);
-       RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+       RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
 
        WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
index 38d221858b36b0f11ab3a7f5eec071c7cf698953..e07efcadb6591fc211d57d04a61feb846d1fe21b 100644 (file)
@@ -98,7 +98,7 @@ void ED_operatormacros_action(void)
        if (ot) {
                WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
                otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
-                       RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+               RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
        }
        
 }
index e2550bcf477bdad7f79d93a9d60fb05274a4e8bd..674d28091887f86a689e345fbfbef258987f06d9 100644 (file)
@@ -279,7 +279,7 @@ void ED_operatormacros_graph(void)
        if (ot) {
                WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
                otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
-                       RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+               RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
        }
 }
 
index 300d38732ecb99654aed5002c77188a710b223af..d9cd11b751f52d8bd7fe366ff4bcfe0c37d2aff1 100644 (file)
@@ -656,7 +656,7 @@ static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
 {
        nlaedit_duplicate_exec(C, op);
        
-       RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
+       RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION);
        WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
 
        return OPERATOR_FINISHED;
index b14904672d0f5db4ec3feffe9d32b7fd2cb44905..7a94ed2e6b65990099516fcfec507af729288789 100644 (file)
@@ -1656,7 +1656,7 @@ static int sequencer_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *
 {
        sequencer_add_duplicate_exec(C, op);
 
-       RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
+       RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION);
        WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
 
        return OPERATOR_FINISHED;
index f476f911ab6f680ba9743a00d1095fb7a15b0955..f5c26cb17d3308818fb6a63673db555ae1d22caf 100644 (file)
@@ -180,7 +180,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
                int i;
 
                for (i = 1; i <= 10; i++) {
-                       RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut_multicam", keys[i-1], KM_PRESS, 0, 0)->ptr, "camera", i);
+                       RNA_int_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut_multicam", keys[i-1], KM_PRESS, 0, 0)->ptr, "camera", i);
                }
        }
 
index a97d9e861bad374b7c7f9da5a405c60e3bff5f45..963fe2ffa8b7bc7c9501b51ca5ec78b2c82a2761 100644 (file)
@@ -882,19 +882,19 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                        break;
                case SPACE_ACTION:
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_SCALE);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_SLIDE);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_SLIDE);
                        break;
                case SPACE_IPO:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
@@ -902,7 +902,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                        WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
                        
                        WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
                        
@@ -910,24 +910,24 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                        break;
                case SPACE_NLA:
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
+                       RNA_enum_set(km->ptr, "mode", TFM_TRANSLATION);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
+                       RNA_enum_set(km->ptr, "mode", TFM_TRANSLATION);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
                        
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_SCALE);
                        break;
                case SPACE_NODE:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
 
                        km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0);
-                       RNA_enum_set(km->ptr, "release_confirm", 1);
+                       RNA_boolean_set(km->ptr, "release_confirm", 1);
                        km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
-                       RNA_enum_set(km->ptr, "release_confirm", 1);
+                       RNA_boolean_set(km->ptr, "release_confirm", 1);
 
                        WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
 
@@ -939,7 +939,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                        WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0);
 
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
-                       RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
+                       RNA_enum_set(km->ptr, "mode", TFM_TIME_EXTEND);
                        break;
                case SPACE_IMAGE:
                        WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);