Fixes for bugs #4450, #4451 and #4452.

- Unwrapper setting got reset unnecessarily in do_versions.
- UV pixel snapping did floor rounding, nearest pixel is nicer.
- Draw Faces button didn't trigger UV editor redraw.
This commit is contained in:
Brecht Van Lommel
2006-06-24 14:16:36 +00:00
parent a4315376da
commit 2c72f5d5d6
5 changed files with 19 additions and 12 deletions

View File

@@ -5427,12 +5427,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ntree_version_241(sce->nodetree);
/* uv calculation options moved to toolsettings */
sce->toolsettings->uvcalc_radius = 1.0f;
sce->toolsettings->uvcalc_cubesize = 1.0f;
sce->toolsettings->uvcalc_mapdir = 1;
sce->toolsettings->uvcalc_mapalign = 1;
sce->toolsettings->uvcalc_flag = 1;
sce->toolsettings->unwrapper = 1;
if (sce->toolsettings->uvcalc_radius == 0.0) {
sce->toolsettings->uvcalc_radius = 1.0f;
sce->toolsettings->uvcalc_cubesize = 1.0f;
sce->toolsettings->uvcalc_mapdir = 1;
sce->toolsettings->uvcalc_mapalign = 1;
sce->toolsettings->uvcalc_flag = 1;
sce->toolsettings->unwrapper = 1;
}
/* enable uv editor local sticky by default */
for (sc= main->screen.first; sc; sc= sc->id.next) {

View File

@@ -38,7 +38,6 @@ void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index);
void unwrap_lscm(short seamcut); /* unwrap faces selected in 3d view */
void minimize_stretch_tface_uv(void); /* optimize faces selected in uv editor */
void smooth_area_tface_uv(void);
/* for live mode: no undo pushes, caching for quicky re-unwrap */
void unwrap_lscm_live_begin(void);

View File

@@ -636,7 +636,8 @@ enum {
B_UVAUTO_OBJECT,
B_UVAUTO_ALIGNX,
B_UVAUTO_ALIGNY,
B_UVAUTO_UNWRAP
B_UVAUTO_UNWRAP,
B_UVAUTO_DRAWFACES
};
#define B_EFFECTSBUTS 3500

View File

@@ -3972,7 +3972,12 @@ static void editing_panel_mesh_texface(void)
void do_uvcalculationbuts(unsigned short event)
{
/* nothing to do here */
switch(event) {
case B_UVAUTO_DRAWFACES:
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWIMAGE, 0);
break;
}
}
static void editing_panel_mesh_uvautocalculation(void)
@@ -3987,7 +3992,7 @@ static void editing_panel_mesh_uvautocalculation(void)
return;
uiBlockBeginAlign(block);
uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D, "Draw Faces", 100,row,200,butH, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
uiDefButBitI(block, TOG, G_DRAWFACES, B_UVAUTO_DRAWFACES, "Draw Faces", 100,row,200,butH, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
uiDefButBitI(block,TOG, G_DRAWEDGES, REDRAWVIEW3D,"Draw Edges",100,row-butHB,200,butH,&G.f, 2.0, 0, 0, 0, "Displays edges of visible faces");
uiDefButBitI(block,TOG, G_HIDDENEDGES, REDRAWVIEW3D,"Draw Hidden Edges",100,row-2*butHB,200,butH,&G.f, 2.0, 1.0, 0, 0, "Displays edges of hidden faces");
uiDefButBitI(block,TOG, G_DRAWSEAMS, REDRAWVIEW3D,"Draw Seams",100,row-3*butHB,200,butH,&G.f, 2.0, 2.0, 0, 0, "Displays UV unwrapping seams");

View File

@@ -1829,8 +1829,8 @@ void flushTransUVs(TransInfo *t)
td->loc2d[1]= td->loc[1]*invy;
if((G.sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) {
td->loc2d[0]= floor(width*td->loc2d[0])/width;
td->loc2d[1]= floor(height*td->loc2d[1])/height;
td->loc2d[0]= floor(width*td->loc2d[0] + 0.5f)/width;
td->loc2d[1]= floor(height*td->loc2d[1] + 0.5f)/height;
}
}