misc small changes.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 30 Nov 2010 18:07:44 +0000 (18:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 30 Nov 2010 18:07:44 +0000 (18:07 +0000)
- commented unused View3D->flag's
- popup dialog now centers over the mouse
- only overwrite image alpha with render settings on save if saving the render result.

source/blender/editors/screen/screen_ops.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/makesdna/DNA_view3d_types.h
source/blender/windowmanager/intern/wm_operators.c

index 67ca31fbfff8b6b425346ebdcee8baf4abf2ca12..2f9028d819cd8b81cefc453c2011bfdeef2c6019 100644 (file)
@@ -307,7 +307,7 @@ int ED_operator_posemode(bContext *C)
 {
        Object *obact= CTX_data_active_object(C);
 
-       if ((obact != CTX_data_edit_object(C))) {
+       if (!(obact->mode & OB_MODE_EDIT)) {
                Object *obpose;
                if((obpose= ED_object_pose_armature(obact))) {
                        if((obact == obpose) || (obact->mode & OB_MODE_WEIGHT_PAINT)) {
index 7dae17ff9e057ce89b5374246190acc525f36f04..d2cf3365423822d02dc5574c35ade4955b39af28 100644 (file)
@@ -876,15 +876,19 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera
                short ok= FALSE;
 
                BLI_path_abs(path, bmain->name);
-               
+
                WM_cursor_wait(1);
 
-               /* enforce user setting for RGB or RGBA, but skip BW */
-               if(scene->r.planes==32)
-                       ibuf->depth= 32;
-               else if(scene->r.planes==24)
-                       ibuf->depth= 24;
-               
+               if(ima->type == IMA_TYPE_R_RESULT) {
+                       /* enforce user setting for RGB or RGBA, but skip BW */
+                       if(scene->r.planes==32) {
+                               ibuf->depth= 32;
+                       }
+                       else if(scene->r.planes==24) {
+                               ibuf->depth= 24;
+                       }
+               }
+
                if(scene->r.scemode & R_EXTENSION)  {
                        BKE_add_image_extension(path, sima->imtypenr);
                }
@@ -946,9 +950,8 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera
                else {
                        BKE_reportf(op->reports, RPT_ERROR, "Couldn't write image: %s", path);
                }
-               
-               
-               
+
+
                WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, sima->image);
 
                WM_cursor_wait(0);
index 746c6acae1c9680f975153b5c728276df491132f..5a7616bb2eca465d5514eaf7093a3701240587f5 100644 (file)
@@ -446,16 +446,6 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                v3d->modeselect = ob->mode;
        else
                v3d->modeselect = OB_MODE_OBJECT;
-               
-       v3d->flag &= ~V3D_MODE;
-       
-       /* not sure what the v3d->flag is useful for now... modeselect is confusing */
-       if(obedit) v3d->flag |= V3D_EDITMODE;
-       if(ob && (ob->mode & OB_MODE_POSE)) v3d->flag |= V3D_POSEMODE;
-       if(ob && (ob->mode & OB_MODE_VERTEX_PAINT)) v3d->flag |= V3D_VERTEXPAINT;
-       if(ob && (ob->mode & OB_MODE_WEIGHT_PAINT)) v3d->flag |= V3D_WEIGHTPAINT;
-       if(ob && (ob->mode & OB_MODE_TEXTURE_PAINT)) v3d->flag |= V3D_TEXTUREPAINT;
-       if(paint_facesel_test(ob)) v3d->flag |= V3D_FACESELECT;
 
        uiBlockBeginAlign(block);
        uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) , 
index dcc620463c928f01199decf844b46a330169b9f1..00e5db0a63973fbbfed3404ac0ca3591f48d834f 100644 (file)
@@ -203,20 +203,22 @@ typedef struct View3D {
 
 } View3D;
 
-/* XXX this needs cleaning */
 
 /* View3D->flag (short) */
-#define V3D_MODE                       (16+32+64+128+256+512)
 #define V3D_DISPIMAGE          1
 #define V3D_DISPBGPICS         2
 #define V3D_HIDE_HELPLINES     4
 #define V3D_INVALID_BACKBUF    8
+/* deprecated */
+/*
+#define V3D_MODE                       (16+32+64+128+256+512)
 #define V3D_EDITMODE           16
 #define V3D_VERTEXPAINT                32
 #define V3D_FACESELECT         64
 #define V3D_POSEMODE           128
 #define V3D_TEXTUREPAINT       256
 #define V3D_WEIGHTPAINT                512
+*/
 #define V3D_ALIGN                      1024
 #define V3D_SELECT_OUTLINE     2048
 #define V3D_ZBUF_SELECT                4096
index 74eaeed0ac06e110694dcb5dd3a011b3efade34e..6a0b04346dcacaf3874e96ec0528150cc15091e3 100644 (file)
@@ -987,7 +987,8 @@ static uiBlock *wm_block_create_dialog(bContext *C, ARegion *ar, void *userData)
        btn= uiDefBut(block, BUT, 0, "OK", 0, 0, 0, 20, NULL, 0, 0, 0, 0, "");
        uiButSetFunc(btn, dialog_exec_cb, op, block);
 
-       uiPopupBoundsBlock(block, 4.0f, 0, 0);
+       /* center around the mouse */
+       uiPopupBoundsBlock(block, 4.0f, data->width/-2, data->height/2);
        uiEndBlock(C, block);
 
        return block;