Revision: 21012
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21012
Author:   yukishiro
Date:     2009-06-19 18:10:28 +0200 (Fri, 19 Jun 2009)

Log Message:
-----------
move lightpaint display to solid mode and add hand cursor

Modified Paths:
--------------
    
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
===================================================================
--- 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c   
    2009-06-19 15:14:24 UTC (rev 21011)
+++ 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c   
    2009-06-19 16:10:28 UTC (rev 21012)
@@ -280,13 +280,7 @@
                ScrArea *sa= CTX_wm_area(C);
                if(sa->spacetype==SPACE_VIEW3D) {
                        ARegion *ar= CTX_wm_region(C);
-                        Object *ob = CTX_data_active_object(C);
-                        View3D *v3d= CTX_wm_view3d(C);
-                        short dt;
 
-                        dt = v3d->drawtype < ob->dt ? v3d->drawtype : ob->dt;
-                        if (dt != OB_SHADED) return 0;
-
                        if(ar->regiontype==RGN_TYPE_WINDOW)
                                return 1;
                }
@@ -702,6 +696,9 @@
        RotateOperation *rop = op->customdata;
        MEM_freeN(rop);
        op->customdata = NULL;
+
+       toggle_paint_cursor(C);
+       WM_cursor_restore(CTX_wm_window(C));
 }
 
 static int light_paint_rotate_modal(bContext *C, wmOperator *op, wmEvent 
*event)
@@ -758,7 +755,8 @@
 
        calctrackballvec(&rop->ar->winrct, event->x, event->y, rop->trackvec);
 
-       /* add temp handler */
+       toggle_paint_cursor(C);
+       WM_cursor_modal(CTX_wm_window(C), BC_HANDCURSOR);
        WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
 
        return OPERATOR_RUNNING_MODAL;

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- 
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c    
    2009-06-19 15:14:24 UTC (rev 21011)
+++ 
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c    
    2009-06-19 16:10:28 UTC (rev 21012)
@@ -2422,16 +2422,40 @@
                if((v3d->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && 
!draw_wire)
                        draw_mesh_object_outline(v3d, ob, dm);
 
-               glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED );
+               if (G.f & G_LIGHTPAINT) {
+                       if (rv3d->rflag & RV3D_SHRESULT) {
+                               unsigned char *shcol= 
DM_get_face_data_layer(dm, CD_SH_MCOL);
+                               if (shcol == NULL) shcol = 
add_sh_mcol_dm(scene, ob, dm);
+                               
+                               if (rv3d->rflag & RV3D_RECALCMCOL) {
+                                       calc_sh_color(scene, ob, dm, shcol);
+                               }
+                               
+                               glDisable(GL_LIGHTING);
+                               
+                               glColorMaterial(GL_FRONT,GL_DIFFUSE);
+                               glEnable(GL_COLOR_MATERIAL); 
+                               
+                               dm->drawFacesColored(dm, me->flag, shcol, NULL);
+                               glDisable(GL_COLOR_MATERIAL);
+                               GPU_disable_material();
+                       } 
+                       else {
+                               printf("in progress\n"); // TODO: progess bar
+                       }
+               }
+               else {
+                       glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & 
ME_TWOSIDED );
 
-               glEnable(GL_LIGHTING);
-               glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+                       glEnable(GL_LIGHTING);
+                       glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
 
-               dm->drawFacesSolid(dm, GPU_enable_material);
-               GPU_disable_material();
+                       dm->drawFacesSolid(dm, GPU_enable_material);
+                       GPU_disable_material();
 
-               glFrontFace(GL_CCW);
-               glDisable(GL_LIGHTING);
+                       glFrontFace(GL_CCW);
+                       glDisable(GL_LIGHTING);
+               }
 
                if(base->flag & SELECT) {
                        UI_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT);
@@ -2489,31 +2513,7 @@
                                draw_mesh_object_outline(v3d, ob, dm);
                        }
 
-                        if(G.f & G_LIGHTPAINT) {
-
-                                if (rv3d->rflag & RV3D_SHRESULT) { 
-                                        unsigned char *shcol= 
DM_get_face_data_layer(dm, CD_SH_MCOL);
-                                        if (shcol == NULL) shcol = 
add_sh_mcol_dm(scene, ob, dm);
-
-                                        if (rv3d->rflag & RV3D_RECALCMCOL) {
-                                                calc_sh_color(scene, ob, dm, 
shcol);
-                                        }
-
-                                        glDisable(GL_LIGHTING);
-
-                                        glColorMaterial(GL_FRONT,GL_DIFFUSE);
-                                        glEnable(GL_COLOR_MATERIAL); 
-
-                                        dm->drawFacesColored(dm, me->flag, 
shcol, NULL);
-                                       glDisable(GL_COLOR_MATERIAL);
-                                       GPU_disable_material();
-                                }
-                                else {
-                                       printf("in progress\n");
-                                        // progress bar
-                                }
-                        }
-                        else if (dl) { /* False for dupliframe objects */
+                        if (dl) { /* False for dupliframe objects */
                                unsigned int *obCol1 = dl->col1;
                                unsigned int *obCol2 = dl->col2;
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to