Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-09-26 10:46:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-09-26 10:46:08 +0400
commitc2331e06cbc6707967f2786a89c9a5d1e065a6c5 (patch)
tree6c8587f842069427b72c7f676c5e7ae5f1f75edd /source
parentcac6bb259e589999fad0c7471ddc3bb4575bc342 (diff)
re-arranged buttons from matts suggestions. removed some unused vars and added some constants to replaced magick numbers for draw types.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesdna/DNA_space_types.h5
-rw-r--r--source/blender/src/drawimage.c60
-rw-r--r--source/blender/src/header_image.c35
-rw-r--r--source/blender/src/transform_snap.c13
4 files changed, 40 insertions, 73 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index b93c4b7c504..4c6cecba070 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -466,6 +466,11 @@ typedef struct SpaceImaSel {
#define SI_TEXTURE 0
#define SI_SHOW 1
+#define SI_UVDT_DASH 0
+#define SI_UVDT_BLACK 1
+#define SI_UVDT_WHITE 2
+#define SI_UVDT_OUTLINE 3
+
/* SpaceImage->flag */
#define SI_BE_SQUARE 1<<0
#define SI_EDITTILE 1<<1
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
index b95452b0342..86b6e8bcaaa 100644
--- a/source/blender/src/drawimage.c
+++ b/source/blender/src/drawimage.c
@@ -583,8 +583,16 @@ void draw_uvs_sima(void)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
+
+#define SI_UVDT_DASH 0
+#define SI_UVDT_BLACK 1
+#define SI_UVDT_WHITE 2
+#define SI_UVDT_OUTLINE 3
+
+
+
switch (G.sima->dt_uv) {
- case 0:
+ case SI_UVDT_DASH:
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
// if (SIMA_FACEDRAW_CHECK(efa, tface)) {
@@ -622,8 +630,8 @@ void draw_uvs_sima(void)
}
}
break;
- case 1: /* black/white */
- case 2:
+ case SI_UVDT_BLACK: /* black/white */
+ case SI_UVDT_WHITE:
cpack((G.sima->dt_uv==1) ? 0x0 : 0xFFFFFF);
for (efa= em->faces.first; efa; efa= efa->next) {
// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -641,7 +649,7 @@ void draw_uvs_sima(void)
}
}
break;
- case 3:
+ case SI_UVDT_OUTLINE:
glLineWidth(3);
cpack(0x0);
@@ -685,42 +693,6 @@ void draw_uvs_sima(void)
glDisable( GL_LINE_SMOOTH);
glDisable(GL_BLEND);
}
-
-
- /* draw active face edges */
-
- if (activetface) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
/* unselected uv's */
BIF_ThemeColor(TH_VERTEX);
@@ -1200,10 +1172,10 @@ static void image_panel_view_properties(short cntrl) // IMAGE_HANDLER_VIEW_PROPE
if (EM_texFaceCheck()) {
uiDefBut(block, LABEL, B_NOP, "Draw Type:", 10, 20,120,19, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- uiDefButC(block, ROW, B_REDR, "Dash", 10, 0,58,19, &G.sima->dt_uv, 0.0, 0.0, 0, 0, "Dashed Wire UV drawtype");
- uiDefButC(block, ROW, B_REDR, "Black", 68, 0,58,19, &G.sima->dt_uv, 0.0, 1.0, 0, 0, "Black Wire UV drawtype");
- uiDefButC(block, ROW, B_REDR, "White", 126,0,58,19, &G.sima->dt_uv, 0.0, 2.0, 0, 0, "White Wire UV drawtype");
- uiDefButC(block, ROW, B_REDR, "Outline", 184,0,58,19, &G.sima->dt_uv, 0.0, 3.0, 0, 0, "Outline Wire UV drawtype");
+ uiDefButC(block, ROW, B_REDR, "Dash", 10, 0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_DASH, 0, 0, "Dashed Wire UV drawtype");
+ uiDefButC(block, ROW, B_REDR, "Black", 68, 0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_WHITE, 0, 0, "Black Wire UV drawtype");
+ uiDefButC(block, ROW, B_REDR, "White", 126,0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_BLACK, 0, 0, "White Wire UV drawtype");
+ uiDefButC(block, ROW, B_REDR, "Outline", 184,0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_OUTLINE, 0, 0, "Outline Wire UV drawtype");
uiBlockBeginAlign(block);
uiDefButBitI(block, TOG, SI_SMOOTH_UV, B_REDR, "Smooth", 250,0,60,19, &G.sima->flag, 0, 0, 0, 0, "Display smooth lines in the UV view");
}
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
index a44a9ecb2cf..c9cde5436e8 100644
--- a/source/blender/src/header_image.c
+++ b/source/blender/src/header_image.c
@@ -1159,13 +1159,25 @@ void image_buttons(void)
if (is_render)
allow_pin = 0;
- xco= std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
+ xco= 8 + std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0);
+
+ if( ima && !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) {
+ if (ima->packedfile) {
+ headerbuttons_packdummy = 1;
+ }
+ if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
+ uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
+ else
+ uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
+
+ xco+= XIC+8;
+ }
+
/* 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_NOP, ICON_ROTATE,
"Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1",
@@ -1174,7 +1186,7 @@ void image_buttons(void)
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 (vert & face selection mode override sticky)");
+ uiDefIconButBitI(block, TOGN, SI_SYNC_UVSEL, B_REDR, ICON_NO_GO_LEFT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Mesh independant selection");
xco+= XIC;
if ((G.sima->flag & SI_SYNC_UVSEL)==0) {
ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC,
@@ -1217,11 +1229,11 @@ void image_buttons(void)
str_pt = str_menu;
str_pt[0]='\0';
mesh_layers_menu_concat(&G.editMesh->fdata, CD_MTFACE, str_pt);
- ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,115,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing");
+ ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,85,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing");
uiButSetFunc(ubut, do_image_buttons_set_uvlayer_callback, &act, NULL);
/*MEM_freeN(str);*/
- xco+= 120;
+ xco+= 90;
}
}
@@ -1236,19 +1248,6 @@ void image_buttons(void)
uiBlockEndAlign(block);
xco+= 166;
}
- if( !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) {
-
- if (ima->packedfile) {
- headerbuttons_packdummy = 1;
- }
- if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY))
- uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG");
- else
- uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image");
-
- xco+= XIC+8;
- }
-
uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button");
xco+= XIC+8;
diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c
index 3b632e8c467..d62d49c2de8 100644
--- a/source/blender/src/transform_snap.c
+++ b/source/blender/src/transform_snap.c
@@ -400,17 +400,10 @@ void CalcSnapGeometry(TransInfo *t, float *vec)
}
}
else if (t->spacetype == SPACE_IMAGE)
- {
-
+ { /* same as above but for UV's */
MTFace *nearesttf=NULL;
- unsigned int face_corner;
+ int face_corner;
- float vec[3];
- int found = 0;
- int dist = 40; // Use a user defined value here
-
- // use findnearestverts in vert mode, others in other modes
- //nearest = findnearestvert(&dist, SELECT, 1);
find_nearest_uv(&nearesttf, NULL, NULL, &face_corner);
if (nearesttf != NULL)
@@ -424,8 +417,6 @@ void CalcSnapGeometry(TransInfo *t, float *vec)
{
t->tsnap.status &= ~POINT_INIT;
}
-
-
}