Revision: 39020
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39020
Author:   psy-fi
Date:     2011-08-04 13:55:38 +0000 (Thu, 04 Aug 2011)
Log Message:
-----------
revert commit 38904 +fix for reason keymap was not being handled: I had not 
added a handler for the new keymap name for the region initializer.

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/include/ED_screen.h
    branches/soc-2011-onion/source/blender/editors/screen/screen_ops.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_intern.h
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_ops.c
    branches/soc-2011-onion/source/blender/editors/space_image/image_ops.c
    branches/soc-2011-onion/source/blender/editors/space_image/space_image.c
    branches/soc-2011-onion/source/blender/editors/uvedit/CMakeLists.txt
    branches/soc-2011-onion/source/blender/editors/uvedit/SConscript
    branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c

Modified: branches/soc-2011-onion/source/blender/editors/include/ED_screen.h
===================================================================
--- branches/soc-2011-onion/source/blender/editors/include/ED_screen.h  
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/include/ED_screen.h  
2011-08-04 13:55:38 UTC (rev 39020)
@@ -168,6 +168,7 @@
 int            ED_operator_editlattice(struct bContext *C);
 int            ED_operator_editmball(struct bContext *C);
 int            ED_operator_uvedit(struct bContext *C);
+int            ED_operator_uvedit_no_smooth(struct bContext *C);
 int            ED_operator_uvmap(struct bContext *C);
 int            ED_operator_uvmap_mesh(struct bContext *C);
 int            ED_operator_uv_seam_tag_active(struct bContext *C);

Modified: branches/soc-2011-onion/source/blender/editors/screen/screen_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/screen/screen_ops.c  
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/screen/screen_ops.c  
2011-08-04 13:55:38 UTC (rev 39020)
@@ -364,6 +364,14 @@
        return ED_space_image_show_uvedit(sima, obedit);
 }
 
+int    ED_operator_uvedit_no_smooth(struct bContext *C)
+{
+       SpaceImage *sima= CTX_wm_space_image(C);
+       Object *obedit= CTX_data_edit_object(C);
+       return ED_space_image_show_uvedit(sima, obedit) && !(sima->flag & 
SI_SMOOTH_BRUSH);
+}
+
+
 int ED_operator_uvmap(bContext *C)
 {
        Object *obedit= CTX_data_edit_object(C);

Modified: 
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c   
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c   
2011-08-04 13:55:38 UTC (rev 39020)
@@ -4529,10 +4529,11 @@
        return 0;
 }
 
-int uv_smooth_poll(bContext *C)
+static int uv_smooth_brush_poll(const bContext *C)
 {
 //     Object *obact = CTX_data_active_object(C);
        SpaceImage *sima= CTX_wm_space_image(C);
+
        if(!image_paint_brush(C))
                return 0;
 
@@ -5085,7 +5086,7 @@
                wm,
                &(settings->imapaint.paint),
                OB_MODE_TEXTURE_PAINT,
-               uv_smooth_poll,
+               uv_smooth_brush_poll,
                brush_drawcursor,
                NULL);
 }
@@ -5415,6 +5416,11 @@
        return (texture_paint_poll(C) || image_paint_poll(C));
 }
 
+int uv_smooth_poll(bContext *C)
+{
+       return uv_smooth_brush_poll(C);
+}
+
 int facemask_paint_poll(bContext *C)
 {
        return paint_facesel_test(CTX_data_active_object(C));

Modified: 
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_intern.h
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_intern.h  
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_intern.h  
2011-08-04 13:55:38 UTC (rev 39020)
@@ -240,7 +240,6 @@
 void PAINT_OT_vpaint_stroke(struct wmOperatorType *ot);
 
 unsigned int vpaint_get_current_col(struct VPaint *vp);
-void UV_OT_uv_smooth_stroke(struct wmOperatorType *ot);
 
 /* paint_image.c */
 int image_texture_paint_poll(struct bContext *C);

Modified: 
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_ops.c     
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_ops.c     
2011-08-04 13:55:38 UTC (rev 39020)
@@ -359,7 +359,29 @@
        ot->prop= RNA_def_enum(ot->srna, "tool", brush_image_tool_items, 0, 
"Tool", "");
 }
 
+static int uv_smooth_stroke_exec(bContext *C, wmOperator *op)
+{
+       printf("little ducks\n");
+       return OPERATOR_FINISHED;
+}
 
+static void UV_OT_uv_smooth_stroke(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Smooth UVs";
+       ot->description= "Smooth UVs using a brush";
+       ot->idname= "UV_OT_uv_smooth_stroke";
+
+       /* api callbacks */
+       ot->exec= uv_smooth_stroke_exec;
+       ot->poll= uv_smooth_poll;
+
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;//|OPTYPE_UNDO;
+
+       /* props */
+}
+
 /**************************** registration **********************************/
 
 void ED_operatortypes_paint(void)
@@ -395,6 +417,9 @@
        WM_operatortype_append(PAINT_OT_weight_layers_images_from_view);
        WM_operatortype_append(PAINT_OT_weight_layers_to_uv_images);
 
+       /* uv */
+       WM_operatortype_append(UV_OT_uv_smooth_stroke);
+
        /* vertex */
        WM_operatortype_append(PAINT_OT_vertex_paint_toggle);
        WM_operatortype_append(PAINT_OT_vpaint_stroke);
@@ -681,6 +706,11 @@
        WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, 
KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, 
KM_PRESS, 0, 0);
 
+       keymap= WM_keymap_find(keyconf, "UV Smooth", 0, 0);
+       keymap->poll= uv_smooth_poll;
+
+       WM_keymap_add_item(keymap, "UV_OT_uv_smooth_stroke", LEFTMOUSE, 
KM_PRESS, 0, 0);
+
        /* paint stroke */
        {
                wmKeyMap* keymap= paint_stroke_modal_keymap(keyconf);

Modified: branches/soc-2011-onion/source/blender/editors/space_image/image_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/space_image/image_ops.c      
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/space_image/image_ops.c      
2011-08-04 13:55:38 UTC (rev 39020)
@@ -171,6 +171,16 @@
        return 0;
 }
 
+static int space_image_image_sample_poll(bContext *C)
+{
+       SpaceImage *sima= CTX_wm_space_image(C);
+       Object *obedit= CTX_data_edit_object(C);
+       if(obedit){
+               if(ED_space_image_show_uvedit(sima, obedit) && (sima->flag & 
SI_SMOOTH_BRUSH))
+                       return 0;
+       }
+       return space_image_main_area_poll(C);
+}
 /********************** view pan operator *********************/
 
 typedef struct ViewPanData {
@@ -1820,7 +1830,7 @@
        ot->invoke= sample_invoke;
        ot->modal= sample_modal;
        ot->cancel= sample_cancel;
-       ot->poll= space_image_main_area_poll;
+       ot->poll= space_image_image_sample_poll;
 
        /* flags */
        ot->flag= OPTYPE_BLOCKING;

Modified: 
branches/soc-2011-onion/source/blender/editors/space_image/space_image.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/space_image/space_image.c    
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/space_image/space_image.c    
2011-08-04 13:55:38 UTC (rev 39020)
@@ -759,6 +759,9 @@
        keymap= WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
        
+       keymap= WM_keymap_find(wm->defaultconf, "UV Smooth", 0, 0);
+       WM_event_add_keymap_handler(&ar->handlers, keymap);
+
        /* own keymaps */
        keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 
0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/CMakeLists.txt
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/CMakeLists.txt        
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/CMakeLists.txt        
2011-08-04 13:55:38 UTC (rev 39020)
@@ -27,7 +27,6 @@
        ../../makesdna
        ../../makesrna
        ../../windowmanager
-       ../sculpt_paint
        ../../../../intern/guardedalloc
        ../../../../intern/opennl/extern
 )

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/SConscript
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/SConscript    
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/SConscript    
2011-08-04 13:55:38 UTC (rev 39020)
@@ -3,7 +3,7 @@
 
 sources = env.Glob('*.c')
 
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf 
../sculpt_paint'
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../makesrna #/intern/opennl/extern ../../gpu ../../blenloader'
 

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c  
2011-08-04 13:47:15 UTC (rev 39019)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c  
2011-08-04 13:55:38 UTC (rev 39020)
@@ -73,7 +73,6 @@
 #include "UI_resources.h"
 
 #include "uvedit_intern.h"
-#include "paint_intern.h"
 
 /************************* state testing ************************/
 
@@ -4440,55 +4439,6 @@
                "Location", "Mouse location in normalized coordinates, 0.0 to 
1.0 is within the image bounds.", -100.0f, 100.0f);
 }
 
-
-static int uv_smooth_stroke_exec(bContext *C, wmOperator *op)
-{
-       printf("little ducks\n");
-       return OPERATOR_FINISHED;
-}
-
-
-static int uv_smooth_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
-       return OPERATOR_RUNNING_MODAL;
-}
-
-static int uv_smooth_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
-{
-       printf("little ducks\n");
-       switch(event->type){
-               case ESCKEY:
-                       return OPERATOR_FINISHED;
-       }
-       return OPERATOR_RUNNING_MODAL;
-}
-
-static int uv_smooth_cancel(bContext *C, wmOperator *op){
-       return OPERATOR_CANCELLED;
-}
-
-void UV_OT_uv_smooth_stroke(wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name= "Smooth UVs";
-       ot->description= "Smooth UVs using a brush";
-       ot->idname= "UV_OT_uv_smooth_stroke";
-
-       /* api callbacks */
-//     ot->invoke = uv_smooth_stroke_invoke;
-       ot->exec= uv_smooth_stroke_exec;
-//     ot->modal= uv_smooth_stroke_modal;
-//     ot->cancel= uv_smooth_cancel;
-       ot->poll= uv_smooth_poll;
-
-       /* flags */
-       ot->flag= OPTYPE_REGISTER;//|OPTYPE_UNDO;
-
-       /* props */
-}
-
-
-
 /* ************************** registration **********************************/
 
 void ED_operatortypes_uvedit(void)
@@ -4528,22 +4478,16 @@
 
        WM_operatortype_append(UV_OT_cursor_set);
        WM_operatortype_append(UV_OT_tile_set);
-
-       WM_operatortype_append(UV_OT_uv_smooth_stroke);
-
 }
 
-
 void ED_keymap_uvedit(wmKeyConfig *keyconf)
 {
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
-
+       
        keymap= WM_keymap_find(keyconf, "UV Editor", 0, 0);
-       keymap->poll= ED_operator_uvedit;
+       keymap->poll= ED_operator_uvedit_no_smooth;
 
-       WM_keymap_add_item(keymap, "UV_OT_uv_smooth_stroke", LEFTMOUSE, 
KM_PRESS, 0, 0);
-
        /* Mark edge seam */

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to