misc small changes.

- 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.
This commit is contained in:
Campbell Barton
2010-11-30 18:07:44 +00:00
parent 61c0de3f48
commit 236a11ca63
5 changed files with 20 additions and 24 deletions

View 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)) {

View 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);

View 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) ,

View 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

View 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;