Fixed invalid RNA access in radial brush operators (like strength/size abjustment)
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 3 Apr 2011 20:00:19 +0000 (20:00 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 3 Apr 2011 20:00:19 +0000 (20:00 +0000)
source/blender/blenkernel/intern/brush.c
source/blender/windowmanager/intern/wm_operators.c

index be73ee0656bb16604b29de42df81ebcedd7e43c1..96b6ec357f9c3fe3efcb63032cd4c947624eaaf5 100644 (file)
@@ -1210,7 +1210,7 @@ static struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
 
 void brush_radial_control_invoke(wmOperator *op, Brush *br, float size_weight)
 {
 
 void brush_radial_control_invoke(wmOperator *op, Brush *br, float size_weight)
 {
-       int mode = RNA_int_get(op->ptr, "mode");
+       int mode = RNA_enum_get(op->ptr, "mode");
        float original_value= 0;
 
        if(mode == WM_RADIALCONTROL_SIZE)
        float original_value= 0;
 
        if(mode == WM_RADIALCONTROL_SIZE)
@@ -1229,7 +1229,7 @@ void brush_radial_control_invoke(wmOperator *op, Brush *br, float size_weight)
 
 int brush_radial_control_exec(wmOperator *op, Brush *br, float size_weight)
 {
 
 int brush_radial_control_exec(wmOperator *op, Brush *br, float size_weight)
 {
-       int mode = RNA_int_get(op->ptr, "mode");
+       int mode = RNA_enum_get(op->ptr, "mode");
        float new_value = RNA_float_get(op->ptr, "new_value");
        const float conv = 0.017453293;
 
        float new_value = RNA_float_get(op->ptr, "new_value");
        const float conv = 0.017453293;
 
index 53a4af8731a5810fefb481754880161842b5ca37..093899954ff1e3a373971038022e2bfe16758b5b 100644 (file)
@@ -2742,7 +2742,7 @@ int WM_radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
        int ret = OPERATOR_RUNNING_MODAL;
        // float initial_value = RNA_float_get(op->ptr, "initial_value");
 
        int ret = OPERATOR_RUNNING_MODAL;
        // float initial_value = RNA_float_get(op->ptr, "initial_value");
 
-       mode = RNA_int_get(op->ptr, "mode");
+       mode = RNA_enum_get(op->ptr, "mode");
        RNA_int_get_array(op->ptr, "initial_mouse", initial_mouse);
 
        switch(event->type) {
        RNA_int_get_array(op->ptr, "initial_mouse", initial_mouse);
 
        switch(event->type) {
@@ -2818,7 +2818,7 @@ int WM_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
        wmRadialControl *rc = MEM_callocN(sizeof(wmRadialControl), "radial control");
        // wmWindow *win = CTX_wm_window(C);
 {
        wmRadialControl *rc = MEM_callocN(sizeof(wmRadialControl), "radial control");
        // wmWindow *win = CTX_wm_window(C);
-       int mode = RNA_int_get(op->ptr, "mode");
+       int mode = RNA_enum_get(op->ptr, "mode");
        float initial_value = RNA_float_get(op->ptr, "initial_value");
        //float initial_size = RNA_float_get(op->ptr, "initial_size");
        int mouse[2];
        float initial_value = RNA_float_get(op->ptr, "initial_value");
        //float initial_size = RNA_float_get(op->ptr, "initial_size");
        int mouse[2];
@@ -2881,7 +2881,7 @@ int WM_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
 /* Gets a descriptive string of the operation */
 void WM_radial_control_string(wmOperator *op, char str[], int maxlen)
 {
 /* Gets a descriptive string of the operation */
 void WM_radial_control_string(wmOperator *op, char str[], int maxlen)
 {
-       int mode = RNA_int_get(op->ptr, "mode");
+       int mode = RNA_enum_get(op->ptr, "mode");
        float v = RNA_float_get(op->ptr, "new_value");
 
        if(mode == WM_RADIALCONTROL_SIZE)
        float v = RNA_float_get(op->ptr, "new_value");
 
        if(mode == WM_RADIALCONTROL_SIZE)