forked from bartvdbraak/blender
made sticky UV editing options more accessible by adding them to a popup in the header.
Changed how the sticky setting is stored in DNA - (as a char rather then 2 flags). replaced the UV/FACE icon with another needed for the sticky menu. removed 2 unused icons. commented the UV transform panel since it only had 2 buttons in it. depgraph update calls needed to be added to Ctrl+V/E/F menu's because some commands were crashing.
This commit is contained in:
parent
2244d19bc2
commit
0ed3e0bb4f
Binary file not shown.
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
@ -6101,20 +6101,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
sce->toolsettings->unwrapper = 1;
|
||||
}
|
||||
|
||||
/* enable uv editor local sticky by default */
|
||||
for (sc= main->screen.first; sc; sc= sc->id.next) {
|
||||
ScrArea *sa;
|
||||
for (sa= sc->areabase.first; sa; sa= sa->next) {
|
||||
SpaceLink *sl;
|
||||
for (sl= sa->spacedata.first; sl; sl= sl->next) {
|
||||
if(sl->spacetype==SPACE_IMAGE) {
|
||||
SpaceImage *sima= (SpaceImage*)sl;
|
||||
if(!(sima->flag & SI_STICKYUVS))
|
||||
sima->flag |= SI_LOCALSTICKY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(sce->r.mode & R_PANORAMA) {
|
||||
/* all these checks to ensure saved files with cvs version keep working... */
|
||||
if(sce->r.xsch < sce->r.ysch) {
|
||||
|
@ -94,7 +94,6 @@ void reveal_tface_uv(void);
|
||||
void stitch_uv_tface(int mode);
|
||||
void unlink_selection(void);
|
||||
void select_linked_tface_uv(int mode);
|
||||
void toggle_uv_select(int mode);
|
||||
void pin_tface_uv(int mode);
|
||||
void weld_align_menu_tface_uv(void);
|
||||
void weld_align_tface_uv(char tool);
|
||||
|
@ -123,9 +123,9 @@ typedef enum {
|
||||
ICON_AXIS_SIDE,
|
||||
ICON_AXIS_FRONT,
|
||||
ICON_AXIS_TOP,
|
||||
ICON_DRAW_UVFACES,
|
||||
ICON_STICKY_UVS,
|
||||
ICON_STICKY2_UVS,
|
||||
ICON_STICKY_UVS_LOC,
|
||||
ICON_STICKY_UVS_DISABLE,
|
||||
ICON_STICKY_UVS_VERT,
|
||||
ICON_PREV_KEYFRAME,
|
||||
ICON_NEXT_KEYFRAME,
|
||||
ICON_ENVMAP,
|
||||
@ -317,8 +317,8 @@ typedef enum {
|
||||
ICON_HOME,
|
||||
ICON_CLIPUV_DEHLT,
|
||||
ICON_CLIPUV_HLT,
|
||||
ICON_SOME_WACKY_VERTS_AND_LINES,
|
||||
ICON_A_WACKY_VERT_AND_SOME_LINES,
|
||||
ICON_BLANK2,
|
||||
ICON_BLANK3,
|
||||
ICON_VPAINT_COL,
|
||||
ICON_RESTRICT_SELECT_OFF,
|
||||
ICON_RESTRICT_SELECT_ON,
|
||||
|
@ -65,8 +65,8 @@ struct SpaceOops;
|
||||
#define IMAGE_HANDLER_CURVES 32
|
||||
#define IMAGE_HANDLER_PREVIEW 33
|
||||
#define IMAGE_HANDLER_GAME_PROPERTIES 34
|
||||
#define IMAGE_HANDLER_TRANSFORM_PROPERTIES 35
|
||||
#define IMAGE_HANDLER_VIEW_PROPERTIES 36
|
||||
#define IMAGE_HANDLER_VIEW_PROPERTIES 35
|
||||
/*#define IMAGE_HANDLER_TRANSFORM_PROPERTIES 36*/
|
||||
|
||||
/* action handler codes */
|
||||
#define ACTION_HANDLER_PROPERTIES 40
|
||||
|
@ -238,7 +238,9 @@ typedef struct SpaceImage {
|
||||
short imtypenr, lock;
|
||||
short showspare, pin;
|
||||
float zoom;
|
||||
char dt_uv; char pad[7]; /* UV draw type */
|
||||
char dt_uv; /* UV draw type */
|
||||
char sticky; /* sticky selection type */
|
||||
char pad[6];
|
||||
|
||||
float xof, yof; /* user defined offset, image is centered */
|
||||
float centx, centy; /* storage for offset while render drawing */
|
||||
@ -468,11 +470,11 @@ typedef struct SpaceImaSel {
|
||||
#define SI_EDITTILE 1<<1
|
||||
#define SI_CLIP_UV 1<<2
|
||||
#define SI_DRAWTOOL 1<<3
|
||||
#define SI_STICKYUVS 1<<4
|
||||
#define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */
|
||||
#define SI_DRAWSHADOW 1<<5
|
||||
#define SI_SELACTFACE 1<<6
|
||||
#define SI_DEPRECATED 1<<7
|
||||
#define SI_LOCALSTICKY 1<<8
|
||||
#define SI_DEPRECATED2 1<<7
|
||||
#define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */
|
||||
#define SI_COORDFLOATS 1<<9
|
||||
#define SI_PIXELSNAP 1<<10
|
||||
#define SI_LIVE_UNWRAP 1<<11
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -805,30 +805,14 @@ static void draw_image_view_icon(void)
|
||||
|
||||
if (G.sima->flag & SI_SYNC_UVSEL) {
|
||||
/* take settings from the editmesh */
|
||||
if (G.scene->selectmode == SCE_SELECT_FACE) {
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_STICKY_UVS, 1.0f);
|
||||
} else {
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_STICKY2_UVS, 1.0f);
|
||||
}
|
||||
xPos = 25.0;
|
||||
|
||||
if (G.scene->selectmode == SCE_SELECT_FACE || G.sima->flag & SI_SELACTFACE) {
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_DRAW_UVFACES, 1.0f);
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_FACESEL_HLT, 1.0f);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* use the flags for UV mode - normal operation */
|
||||
if(G.sima->flag & SI_STICKYUVS) {
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_STICKY2_UVS, 1.0f);
|
||||
xPos = 25.0;
|
||||
}
|
||||
else if(!(G.sima->flag & SI_LOCALSTICKY)) {
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_STICKY_UVS, 1.0f);
|
||||
xPos = 25.0;
|
||||
}
|
||||
|
||||
/* use the flags for UV mode - normal operation */
|
||||
if(G.sima->flag & SI_SELACTFACE) {
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_DRAW_UVFACES, 1.0f);
|
||||
BIF_icon_draw_aspect(xPos, 5.0, ICON_FACESEL_HLT, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -940,16 +924,16 @@ void image_editvertex_buts(uiBlock *block)
|
||||
ocent[1] *= imy;
|
||||
}
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
//uiBlockBeginAlign(block);
|
||||
if(nactive==1) {
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex X:", 10, 40, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex Y:", 10, 20, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex X:", 10, 10, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex Y:", 165, 10, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
|
||||
}
|
||||
else {
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Median X:", 10, 40, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Median Y:", 10, 20, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Median X:", 10, 10, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, "");
|
||||
uiDefButF(block, NUM, B_TRANS_IMAGE, "Median Y:", 165, 10, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, "");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
//uiBlockEndAlign(block);
|
||||
}
|
||||
}
|
||||
else { // apply event
|
||||
@ -1088,6 +1072,7 @@ static void image_panel_properties(short cntrl) // IMAGE_HANDLER_PROPERTIES
|
||||
|
||||
/* note, it draws no bottom half in facemode, for vertex buttons */
|
||||
uiblock_image_panel(block, &G.sima->image, &G.sima->iuser, B_REDR, B_REDR);
|
||||
image_editvertex_buts(block);
|
||||
}
|
||||
|
||||
static void image_panel_game_properties(short cntrl) // IMAGE_HANDLER_GAME_PROPERTIES
|
||||
@ -1127,19 +1112,18 @@ static void image_panel_game_properties(short cntrl) // IMAGE_HANDLER_GAME_PROPE
|
||||
}
|
||||
}
|
||||
|
||||
static void image_panel_transform_properties(short cntrl) // IMAGE_HANDLER_TRANSFORM_PROPERTIES
|
||||
{
|
||||
uiBlock *block;
|
||||
|
||||
block= uiNewBlock(&curarea->uiblocks, "image_transform_properties", UI_EMBOSS, UI_HELV, curarea->win);
|
||||
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
|
||||
uiSetPanelHandler(IMAGE_HANDLER_TRANSFORM_PROPERTIES); // for close and esc
|
||||
if(uiNewPanel(curarea, block, "Transform Properties", "Image", 10, 10, 318, 204)==0)
|
||||
return;
|
||||
|
||||
image_editvertex_buts(block);
|
||||
|
||||
}
|
||||
//static void image_panel_transform_properties(short cntrl) // IMAGE_HANDLER_TRANSFORM_PROPERTIES
|
||||
//{
|
||||
// uiBlock *block;
|
||||
//
|
||||
// block= uiNewBlock(&curarea->uiblocks, "image_transform_properties", UI_EMBOSS, UI_HELV, curarea->win);
|
||||
// uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
|
||||
// uiSetPanelHandler(IMAGE_HANDLER_TRANSFORM_PROPERTIES); // for close and esc
|
||||
// if(uiNewPanel(curarea, block, "Transform Properties", "Image", 10, 10, 318, 204)==0)
|
||||
// return;
|
||||
//
|
||||
// image_editvertex_buts(block);
|
||||
//}
|
||||
|
||||
static void image_panel_view_properties(short cntrl) // IMAGE_HANDLER_VIEW_PROPERTIES
|
||||
{
|
||||
@ -1491,10 +1475,10 @@ static void image_blockhandlers(ScrArea *sa)
|
||||
case IMAGE_HANDLER_GAME_PROPERTIES:
|
||||
image_panel_game_properties(sima->blockhandler[a+1]);
|
||||
break;
|
||||
case IMAGE_HANDLER_TRANSFORM_PROPERTIES:
|
||||
if (EM_texFaceCheck())
|
||||
image_panel_transform_properties(sima->blockhandler[a+1]);
|
||||
break;
|
||||
// case IMAGE_HANDLER_TRANSFORM_PROPERTIES:
|
||||
// if (EM_texFaceCheck())
|
||||
// image_panel_transform_properties(sima->blockhandler[a+1]);
|
||||
// break;
|
||||
case IMAGE_HANDLER_VIEW_PROPERTIES:
|
||||
image_panel_view_properties(sima->blockhandler[a+1]);
|
||||
break;
|
||||
|
@ -3347,8 +3347,9 @@ void Vertex_Menu() {
|
||||
case 6:
|
||||
shape_propagate();
|
||||
break;
|
||||
|
||||
}
|
||||
/* some items crashed because this is in the original W menu but not here. should really manage this better */
|
||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
|
||||
@ -3402,6 +3403,8 @@ void Edge_Menu() {
|
||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||
break;
|
||||
}
|
||||
/* some items crashed because this is in the original W menu but not here. should really manage this better */
|
||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
void Face_Menu() {
|
||||
@ -3463,6 +3466,8 @@ void Face_Menu() {
|
||||
mesh_mirror_colors();
|
||||
break;
|
||||
}
|
||||
/* some items crashed because this is in the original W menu but not here. should really manage this better */
|
||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||
}
|
||||
|
||||
|
||||
|
@ -531,7 +531,8 @@ void mouse_select_sima(void) /* TODO - SYNCSEL */
|
||||
EditFace *efa;
|
||||
MTFace *tf, *nearesttf;
|
||||
EditFace *nearestefa=NULL;
|
||||
int a, selectsticky, sticky, actface, nearestuv, i;
|
||||
int a, selectsticky, actface, nearestuv, i;
|
||||
char sticky;
|
||||
short flush = 0; /* 0 == dont flush, 1 == sel, -1 == desel; only use when selection sync is enabled */
|
||||
unsigned int hitv[4], nearestv;
|
||||
float *hituv[4], limit[2];
|
||||
@ -553,14 +554,20 @@ void mouse_select_sima(void) /* TODO - SYNCSEL */
|
||||
/* normal operation */
|
||||
actface= (G.qual & LR_ALTKEY || G.sima->flag & SI_SELACTFACE);
|
||||
|
||||
if(G.qual & LR_CTRLKEY) {
|
||||
if(G.sima->flag & SI_STICKYUVS) sticky= 0;
|
||||
else sticky= 1;
|
||||
}
|
||||
else {
|
||||
if(G.sima->flag & SI_STICKYUVS) sticky= 1;
|
||||
else if(G.sima->flag & SI_LOCALSTICKY) sticky= 2;
|
||||
else sticky= 0;
|
||||
switch(G.sima->sticky) {
|
||||
case 0:
|
||||
sticky=2;
|
||||
break;
|
||||
case 1:
|
||||
sticky=0;
|
||||
break;
|
||||
case 2:
|
||||
if(G.qual & LR_CTRLKEY) {
|
||||
sticky=0;
|
||||
} else {
|
||||
sticky=1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1356,6 +1363,7 @@ void unlink_selection(void)
|
||||
scrarea_queue_winredraw(curarea);
|
||||
}
|
||||
|
||||
/*
|
||||
void toggle_uv_select(int mode)
|
||||
{
|
||||
switch(mode){
|
||||
@ -1363,21 +1371,21 @@ void toggle_uv_select(int mode)
|
||||
G.sima->flag ^= SI_SELACTFACE;
|
||||
break;
|
||||
case 's':
|
||||
G.sima->flag ^= SI_STICKYUVS;
|
||||
if (G.sima->flag & SI_STICKYUVS) G.sima->flag &= ~SI_LOCALSTICKY;
|
||||
else G.sima->flag |= SI_LOCALSTICKY;
|
||||
G.sima->flag &= ~SI_LOCALSTICKY;
|
||||
G.sima->flag |= SI_STICKYUVS;
|
||||
break;
|
||||
case 'l':
|
||||
G.sima->flag ^= SI_LOCALSTICKY;
|
||||
if (G.sima->flag & SI_LOCALSTICKY) G.sima->flag &= ~SI_STICKYUVS;
|
||||
case 'l':
|
||||
G.sima->flag &= ~SI_STICKYUVS;
|
||||
G.sima->flag &= ~SI_LOCALSTICKY;
|
||||
break;
|
||||
case 'o':
|
||||
G.sima->flag &= ~SI_STICKYUVS;
|
||||
G.sima->flag &= ~SI_LOCALSTICKY;
|
||||
G.sima->flag &= ~SI_STICKYUVS;
|
||||
G.sima->flag |= SI_LOCALSTICKY;
|
||||
break;
|
||||
}
|
||||
allqueue(REDRAWIMAGE, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
void pin_tface_uv(int mode)
|
||||
{
|
||||
|
@ -476,7 +476,7 @@ static uiBlock *image_viewmenu(void *arg_unused)
|
||||
uiBlockSetButmFunc(block, do_image_viewmenu, NULL);
|
||||
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Image Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Image Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Real-time Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Curves Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
|
||||
@ -549,26 +549,6 @@ static void do_image_selectmenu(void *arg, int event)
|
||||
case 3: /* Linked UVs */
|
||||
select_linked_tface_uv(2);
|
||||
break;
|
||||
case 4: /* Toggle Local UVs Stick to Vertex in Mesh */
|
||||
if(G.sima->flag & SI_LOCALSTICKY)
|
||||
G.sima->flag &= ~SI_LOCALSTICKY;
|
||||
else {
|
||||
G.sima->flag |= SI_LOCALSTICKY;
|
||||
G.sima->flag &= ~SI_STICKYUVS;
|
||||
}
|
||||
allqueue(REDRAWIMAGE, 0);
|
||||
break;
|
||||
case 5: /* Toggle UVs Stick to Vertex in Mesh */
|
||||
if(G.sima->flag & SI_STICKYUVS) {
|
||||
G.sima->flag &= ~SI_STICKYUVS;
|
||||
G.sima->flag |= SI_LOCALSTICKY;
|
||||
}
|
||||
else {
|
||||
G.sima->flag |= SI_STICKYUVS;
|
||||
G.sima->flag &= ~SI_LOCALSTICKY;
|
||||
}
|
||||
allqueue(REDRAWIMAGE, 0);
|
||||
break;
|
||||
case 6: /* Toggle Active Face Select */
|
||||
if(G.sima->flag & SI_SELACTFACE)
|
||||
G.sima->flag &= ~SI_SELACTFACE;
|
||||
@ -598,16 +578,6 @@ static uiBlock *image_selectmenu(void *arg_unused)
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
}
|
||||
|
||||
if ((G.sima->flag & SI_SYNC_UVSEL)==0) {
|
||||
if(G.sima->flag & SI_LOCALSTICKY) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
|
||||
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
|
||||
|
||||
if(G.sima->flag & SI_STICKYUVS) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
|
||||
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
|
||||
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
}
|
||||
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Pinned|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
|
||||
|
||||
@ -988,9 +958,9 @@ static void do_image_uvsmenu(void *arg, int event)
|
||||
{
|
||||
|
||||
switch(event) {
|
||||
case 0: /* UV Transform Properties Panel... */
|
||||
add_blockhandler(curarea, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_UNSTOW);
|
||||
break;
|
||||
// case 0: /* UV Transform Properties Panel... */
|
||||
// add_blockhandler(curarea, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_UNSTOW);
|
||||
// break;
|
||||
case 1: /* UVs Constrained Rectangular */
|
||||
if(G.sima->flag & SI_BE_SQUARE) G.sima->flag &= ~SI_BE_SQUARE;
|
||||
else G.sima->flag |= SI_BE_SQUARE;
|
||||
@ -1044,7 +1014,7 @@ static uiBlock *image_uvsmenu(void *arg_unused)
|
||||
block= uiNewBlock(&curarea->uiblocks, "image_uvsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
|
||||
uiBlockSetButmFunc(block, do_image_uvsmenu, NULL);
|
||||
|
||||
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
|
||||
//uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
|
||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||
if(G.sima->flag & SI_PIXELSNAP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap to Pixels|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
|
||||
else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap to Pixels|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
|
||||
@ -1106,18 +1076,6 @@ static uiBlock *image_uvsmenu(void *arg_unused)
|
||||
return block;
|
||||
}
|
||||
|
||||
static char *around_pup(void)
|
||||
{
|
||||
static char string[512];
|
||||
char *str = string;
|
||||
|
||||
str += sprintf(str, "%s", "Pivot: %t");
|
||||
str += sprintf(str, "%s", "|Bounding Box Center %x0");
|
||||
str += sprintf(str, "%s", "|Median Point %x3");
|
||||
str += sprintf(str, "%s", "|2D Cursor %x1");
|
||||
return string;
|
||||
}
|
||||
|
||||
void image_buttons(void)
|
||||
{
|
||||
Image *ima;
|
||||
@ -1205,19 +1163,33 @@ void image_buttons(void)
|
||||
|
||||
/* UV EditMode buttons, not painting or rencering or compositing */
|
||||
if ( EM_texFaceCheck() && (G.sima->flag & SI_DRAWTOOL)==0 && !is_render) {
|
||||
uiBut *ubut;
|
||||
int layercount;
|
||||
xco+=10;
|
||||
uiDefIconTextButS(block, ICONTEXTROW,B_AROUND, ICON_ROTATE, around_pup(), xco,0,XIC+10,YIC, &(G.v2d->around), 0, 3.0, 0, 0, "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period) ");
|
||||
xco+= XIC + 12;
|
||||
uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_MESH_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync Mesh Selection");
|
||||
|
||||
uiDefIconTextButS(block, ICONTEXTROW, B_NOP, ICON_ROTATE,
|
||||
"Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1",
|
||||
xco,0,XIC+10,YIC, &(G.v2d->around), 0, 3.0, 0, 0,
|
||||
"Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period)");
|
||||
xco+= XIC + 18;
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_MESH_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync Mesh Selection");
|
||||
if ((G.sima->flag & SI_SYNC_UVSEL)==0) {
|
||||
xco+= XIC;
|
||||
ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC,
|
||||
"Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2",
|
||||
xco,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0,
|
||||
"Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* Layer Menu */
|
||||
layercount = CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE);
|
||||
if (layercount>1 && layercount < 12) { /* could allow any number but limit of 11 means no malloc needed */
|
||||
uiBut *ubut;
|
||||
char str_menu[384], *str_pt; /*384 allows for 11 layers */
|
||||
static int act;
|
||||
char str_menu[384], *str_pt; /*384 allows for 11 layers */
|
||||
|
||||
|
||||
act = CustomData_get_active_layer(&G.editMesh->fdata, CD_MTFACE);
|
||||
|
||||
@ -1230,7 +1202,7 @@ void image_buttons(void)
|
||||
uiButSetFunc(ubut, do_image_buttons_set_uvlayer_callback, &act, NULL);
|
||||
|
||||
/*MEM_freeN(str);*/
|
||||
xco+= 120;
|
||||
xco+= 80;
|
||||
|
||||
} else {
|
||||
xco+= XIC+16;
|
||||
|
@ -4820,21 +4820,28 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
if (G.sima->flag & SI_SYNC_UVSEL) {
|
||||
/* operate on the editmesh */
|
||||
if (G.qual==0) {
|
||||
if (G.scene->selectmode != SCE_SELECT_FACE)
|
||||
toggle_uv_select('f');
|
||||
if (G.scene->selectmode != SCE_SELECT_FACE) {
|
||||
G.sima->flag ^= SI_SELACTFACE;
|
||||
scrarea_queue_winredraw(curarea);
|
||||
}
|
||||
} else {
|
||||
error("Sync selection to Edit Mesh disables UV select options");
|
||||
}
|
||||
} else {
|
||||
/* normal operaton */
|
||||
if(G.qual==LR_CTRLKEY)
|
||||
toggle_uv_select('s');
|
||||
else if(G.qual==LR_SHIFTKEY)
|
||||
toggle_uv_select('l');
|
||||
else if(G.qual==LR_ALTKEY)
|
||||
toggle_uv_select('o');
|
||||
else
|
||||
toggle_uv_select('f');
|
||||
if(G.qual==LR_CTRLKEY) {
|
||||
G.sima->sticky = 2;
|
||||
scrarea_do_headdraw(curarea);
|
||||
} else if(G.qual==LR_SHIFTKEY) {
|
||||
G.sima->sticky = 1;
|
||||
scrarea_do_headdraw(curarea);
|
||||
} else if(G.qual==LR_ALTKEY) {
|
||||
G.sima->sticky = 0;
|
||||
scrarea_do_headdraw(curarea);
|
||||
} else {
|
||||
G.sima->flag ^= SI_SELACTFACE;
|
||||
scrarea_queue_winredraw(curarea);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EKEY :
|
||||
@ -5000,13 +5007,13 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
case NKEY:
|
||||
if(G.qual==LR_ALTKEY) {
|
||||
new_image_sima();
|
||||
}
|
||||
else if(G.qual==0) {
|
||||
if (EM_texFaceCheck()) {
|
||||
} else if(G.qual==0) {
|
||||
/*if (EM_texFaceCheck()) {
|
||||
toggle_blockhandler(sa, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_TO_MOUSE);
|
||||
} else {
|
||||
} else {
|
||||
toggle_blockhandler(sa, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
||||
}
|
||||
}*/
|
||||
toggle_blockhandler(sa, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
||||
scrarea_queue_winredraw(sa);
|
||||
}
|
||||
break;
|
||||
@ -5058,7 +5065,6 @@ static void init_imagespace(ScrArea *sa)
|
||||
sima->spacetype= SPACE_IMAGE;
|
||||
sima->zoom= 1;
|
||||
sima->blockscale= 0.7;
|
||||
sima->flag = SI_LOCALSTICKY;
|
||||
|
||||
sima->iuser.ok= 1;
|
||||
sima->iuser.fie_ima= 2;
|
||||
|
Loading…
Reference in New Issue
Block a user