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
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2005-07-15 01:57:18 +0400
committerDaniel Dunbar <daniel@zuster.org>2005-07-15 01:57:18 +0400
commit8da29921baccb4898cd986072d72b2ecdc295a11 (patch)
treeb1416db64989d64318ce614a88990e5e6355c618 /source/blender/src
parent0b890467901a32543b874be8eb93a55dff6d3538 (diff)
- added mesh_get_texspace (should be used instead of direct access)
which calculates texspace on demand if need be. - removed almost all calls to tex_space_mesh There may be a few corner cases where this goes wrong (meshes with vertex keys) but these should get ironed out by coming modifier system.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/booleanops.c5
-rw-r--r--source/blender/src/booleanops_mesh.c3
-rw-r--r--source/blender/src/buttons_editing.c5
-rw-r--r--source/blender/src/drawobject.c56
-rw-r--r--source/blender/src/editmesh.c2
-rw-r--r--source/blender/src/editobject.c15
6 files changed, 29 insertions, 57 deletions
diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c
index 644813c0e01..bd706dd592b 100644
--- a/source/blender/src/booleanops.c
+++ b/source/blender/src/booleanops.c
@@ -544,9 +544,6 @@ NewBooleanMesh(
&vd_o,
inv_mat
);
-
- // initialize the object
- tex_space_mesh(me_new);
// free up the memory
@@ -785,7 +782,7 @@ ConvertCSGDescriptorsToMeshObject(
me->totface = face_it->num_elements;
mesh_calculate_vertex_normals(me);
-
+
// thats it!
if (user_face_vertex_data) {
MEM_freeN(user_face_vertex_data);
diff --git a/source/blender/src/booleanops_mesh.c b/source/blender/src/booleanops_mesh.c
index 152c1391d71..88f2cb98aac 100644
--- a/source/blender/src/booleanops_mesh.c
+++ b/source/blender/src/booleanops_mesh.c
@@ -187,9 +187,6 @@ CSG_AddMeshToBlender(
inv_mat
);
- // initialize the object
- tex_space_mesh(me_new);
-
return 1;
}
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 1458ab1b35b..d1db3b5de7e 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -381,7 +381,6 @@ static void decimate_apply(void)
load_editMesh();
free_editMesh(G.editMesh);
G.obedit= NULL;
- tex_space_mesh(me);
BIF_undo_push("Apply decimation");
}
@@ -560,9 +559,7 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
case B_AUTOTEX:
ob= OBACT;
if(ob && G.obedit==0) {
- if(ob->type==OB_MESH) tex_space_mesh(ob->data);
- else if(ob->type==OB_MBALL) ;
- else tex_space_curve(ob->data);
+ if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) tex_space_curve(ob->data);
}
break;
case B_DOCENTRE:
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 97a4a9d5f59..0b8c52863ac 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -3322,60 +3322,46 @@ static void draw_bounding_volume(Object *ob)
static void drawtexspace(Object *ob)
{
- Mesh *me;
- MetaBall *mb;
- Curve *cu;
- BoundBox bb;
- float *vec, *loc, *size;
+ float vec[8][3], loc[3], size[3];
if(ob->type==OB_MESH) {
- me= ob->data;
- size= me->size;
- loc= me->loc;
+ mesh_get_texspace(ob->data, loc, NULL, size);
}
else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) {
- cu= ob->data;
- size= cu->size;
- loc= cu->loc;
+ Curve *cu= ob->data;
+ VECCOPY(size, cu->size);
+ VECCOPY(loc, cu->loc);
}
else if(ob->type==OB_MBALL) {
- mb= ob->data;
- size= mb->size;
- loc= mb->loc;
+ MetaBall *mb= ob->data;
+ VECCOPY(size, mb->size);
+ VECCOPY(loc, mb->loc);
}
else return;
- bb.vec[0][0]=bb.vec[1][0]=bb.vec[2][0]=bb.vec[3][0]= loc[0]-size[0];
- bb.vec[4][0]=bb.vec[5][0]=bb.vec[6][0]=bb.vec[7][0]= loc[0]+size[0];
+ vec[0][0]=vec[1][0]=vec[2][0]=vec[3][0]= loc[0]-size[0];
+ vec[4][0]=vec[5][0]=vec[6][0]=vec[7][0]= loc[0]+size[0];
- bb.vec[0][1]=bb.vec[1][1]=bb.vec[4][1]=bb.vec[5][1]= loc[1]-size[1];
- bb.vec[2][1]=bb.vec[3][1]=bb.vec[6][1]=bb.vec[7][1]= loc[1]+size[1];
+ vec[0][1]=vec[1][1]=vec[4][1]=vec[5][1]= loc[1]-size[1];
+ vec[2][1]=vec[3][1]=vec[6][1]=vec[7][1]= loc[1]+size[1];
- bb.vec[0][2]=bb.vec[3][2]=bb.vec[4][2]=bb.vec[7][2]= loc[2]-size[2];
- bb.vec[1][2]=bb.vec[2][2]=bb.vec[5][2]=bb.vec[6][2]= loc[2]+size[2];
+ vec[0][2]=vec[3][2]=vec[4][2]=vec[7][2]= loc[2]-size[2];
+ vec[1][2]=vec[2][2]=vec[5][2]=vec[6][2]= loc[2]+size[2];
setlinestyle(2);
-
- vec= bb.vec[0];
-
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec); glVertex3fv(vec+3);glVertex3fv(vec+6); glVertex3fv(vec+9);
- glVertex3fv(vec); glVertex3fv(vec+12);glVertex3fv(vec+15); glVertex3fv(vec+18);
- glVertex3fv(vec+21); glVertex3fv(vec+12);
- glEnd();
glBegin(GL_LINE_STRIP);
- glVertex3fv(vec+3); glVertex3fv(vec+15);
+ glVertex3fv(vec[0]); glVertex3fv(vec[1]);glVertex3fv(vec[2]); glVertex3fv(vec[3]);
+ glVertex3fv(vec[0]); glVertex3fv(vec[4]);glVertex3fv(vec[5]); glVertex3fv(vec[6]);
+ glVertex3fv(vec[7]); glVertex3fv(vec[4]);
glEnd();
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec+6); glVertex3fv(vec+18);
+ glBegin(GL_LINES);
+ glVertex3fv(vec[1]); glVertex3fv(vec[5]);
+ glVertex3fv(vec[2]); glVertex3fv(vec[6]);
+ glVertex3fv(vec[3]); glVertex3fv(vec[7]);
glEnd();
- glBegin(GL_LINE_STRIP);
- glVertex3fv(vec+9); glVertex3fv(vec+21);
- glEnd();
-
setlinestyle(0);
}
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index 9d942b62b44..f080baa88d6 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -1126,8 +1126,6 @@ void load_editMesh(void)
}
}
- tex_space_mesh(me);
-
/* tface block */
if( me->tface && me->totface ) {
TFace *tfn, *tf;
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index 5714764b694..e25350046ba 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -1703,8 +1703,6 @@ void docentre(int centremode)
ob= ob->id.next;
}
}
- /* DO: check all users... */
- tex_space_mesh(me);
}
else if ELEM(base->object->type, OB_CURVE, OB_SURF) {
@@ -2313,7 +2311,6 @@ void convertmenu(void)
}
mball_to_mesh(&ob->disp, ob1->data);
- tex_space_mesh(me);
}
}
}
@@ -2572,7 +2569,7 @@ void copy_attr(short event)
if(poin1) {
memcpy(poin1, poin2, 4+12+12+12);
- if(obt->type==OB_MESH) tex_space_mesh(obt->data);
+ if(obt->type==OB_MESH) ;
else if(obt->type==OB_MBALL) tex_space_mball(obt);
else tex_space_curve(obt->data);
}
@@ -4293,8 +4290,6 @@ void image_aspect(void)
Object *ob;
Material *ma;
Tex *tex;
- Mesh *me;
- Curve *cu;
float x, y, space;
int a, b, done;
@@ -4314,14 +4309,16 @@ void image_aspect(void)
if(ma->mtex[b] && ma->mtex[b]->tex) {
tex= ma->mtex[b]->tex;
if(tex->type==TEX_IMAGE && tex->ima && tex->ima->ibuf) {
+
/* texturespace */
space= 1.0;
if(ob->type==OB_MESH) {
- me= ob->data;
- space= me->size[0]/me->size[1];
+ float size[3];
+ mesh_get_texspace(ob->data, NULL, NULL, size);
+ space= size[0]/size[1];
}
else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) {
- cu= ob->data;
+ Curve *cu= ob->data;
space= cu->size[0]/cu->size[1];
}