- removed BLO_findstruct_offset (obsolete)
- remove python access to Optimal and Subsurf flags (they don't work this way anymore, I suppose need to replace with python access to modifiers but not going to do right now). - removed interface access to OPTIMAL mode, needs to be rethough... this means at the moment subsurfs outside editmode always draw and render all edges
This commit is contained in:
parent
1db88bd065
commit
74820841df
@ -479,7 +479,7 @@ static DerivedMesh *getMeshDerivedMesh(Mesh *me, Object *ob, float (*vertCos)[3]
|
||||
// XXX this is kinda hacky because we shouldn't really be editing
|
||||
// the mesh here, however, we can't just call mesh_build_faceNormals(ob)
|
||||
// because in the case when a key is applied to a mesh the vertex normals
|
||||
// would never be correctly computed (and renderer makes this assumption.
|
||||
// would never be correctly computed (and renderer makes this assumption).
|
||||
mesh_calc_normals(mdm->verts, me->totvert, me->mface, me->totface, &mdm->nors);
|
||||
mdm->freeNors = 1;
|
||||
}
|
||||
@ -868,7 +868,6 @@ static void emDM_release(DerivedMesh *dm)
|
||||
MEM_freeN(emdm);
|
||||
}
|
||||
|
||||
// XXX face and vertex normals are wrong with vertexcos
|
||||
static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, float (*vertexCos)[3])
|
||||
{
|
||||
EditMeshDerivedMesh *emdm = MEM_callocN(sizeof(*emdm), "emdm");
|
||||
|
@ -772,7 +772,6 @@ void mesh_create_shadedColors(Object *ob, int onlyForMesh, unsigned int **col1_r
|
||||
vidx[2]= mf->v3;
|
||||
vidx[3]= mf->v4;
|
||||
|
||||
// XXX, should all DLM's have normals?
|
||||
if (dlm->nors) {
|
||||
VECCOPY(nor, &dlm->nors[i*3]);
|
||||
} else {
|
||||
|
@ -767,7 +767,7 @@ static void *decimateModifier_applyModifier(ModifierData *md, Object *ob, void *
|
||||
float *vbCo = &lod.vertex_buffer[a*3];
|
||||
float *vbNo = &lod.vertex_normal_buffer[a*3];
|
||||
|
||||
if (vertexCos) { // XXX normals wrong
|
||||
if (vertexCos) {
|
||||
VECCOPY(vbCo, vertexCos[a]);
|
||||
} else {
|
||||
VECCOPY(vbCo, mv->co);
|
||||
|
@ -34,7 +34,5 @@
|
||||
#ifndef BLO_GENFILE_H
|
||||
#define BLO_GENFILE_H
|
||||
|
||||
int BLO_findstruct_offset(char *structname, char *member);// used by py_main.c
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -483,47 +483,6 @@ struct SDNA *dna_sdna_from_data(void *data, int datalen, int do_endian_swap)
|
||||
|
||||
return sdna;
|
||||
}
|
||||
/* XXX, this routine was added because at one
|
||||
* point I thought using the dna more would be
|
||||
* nice, but really thats a flawed idea, you
|
||||
* already know about your memory structures when
|
||||
* you are compiling no need to redirect that
|
||||
* through the DNA, the python stuff should be
|
||||
* changed to not use this routine (a bit
|
||||
* o' work). - zr
|
||||
*/
|
||||
int BLO_findstruct_offset(char *structname, char *member)
|
||||
{
|
||||
extern char DNAstr[]; /* DNA.c */
|
||||
extern int DNAlen;
|
||||
|
||||
struct SDNA *sdna;
|
||||
int a, offset;
|
||||
short *sp;
|
||||
|
||||
sdna= dna_sdna_from_data(DNAstr, DNAlen, 0);
|
||||
|
||||
sp= findstruct_name(sdna, structname);
|
||||
|
||||
if(sp) {
|
||||
a= sp[1]; /* nr of elems */
|
||||
sp+= 2;
|
||||
offset= 0;
|
||||
|
||||
while(a--) {
|
||||
if(strcmp(sdna->names[sp[1]], member)==0) {
|
||||
dna_freestructDNA(sdna);
|
||||
return offset;
|
||||
}
|
||||
|
||||
offset+= elementsize(sdna, sp[0], sp[1]);
|
||||
sp+= 2;
|
||||
}
|
||||
}
|
||||
|
||||
dna_freestructDNA(sdna);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ******************** END READ DNA ********************** */
|
||||
|
||||
|
@ -1548,10 +1548,6 @@ static PyObject *NMesh_setMode( PyObject * self, PyObject * args )
|
||||
mode |= ME_TWOSIDED;
|
||||
else if( strcmp( m[i], "AutoSmooth" ) == 0 )
|
||||
mode |= ME_AUTOSMOOTH;
|
||||
else if( strcmp( m[i], "SubSurf" ) == 0 )
|
||||
mode |= ME_SUBSURF;
|
||||
else if( strcmp( m[i], "Optimal" ) == 0 )
|
||||
mode |= ME_OPT_EDGES;
|
||||
else if( m[i][0] == '\0' )
|
||||
mode = 0;
|
||||
else
|
||||
@ -3243,10 +3239,6 @@ static PyObject *M_NMesh_Modes( void )
|
||||
constant_insert( d, "AUTOSMOOTH",
|
||||
PyInt_FromLong
|
||||
( ME_AUTOSMOOTH ) );
|
||||
constant_insert( d, "SUBSURF",
|
||||
PyInt_FromLong( ME_SUBSURF ) );
|
||||
constant_insert( d, "OPTIMAL",
|
||||
PyInt_FromLong( ME_OPT_EDGES ) );
|
||||
}
|
||||
|
||||
return Modes;
|
||||
|
@ -1493,32 +1493,29 @@ static void init_render_mesh(Object *ob)
|
||||
medge= dlm?dlm->medge:me->medge;
|
||||
|
||||
for(a1=0; a1<end; a1++, medge++) {
|
||||
|
||||
if( (me->flag & ME_OPT_EDGES)==0 || (medge->flag & ME_EDGEDRAW)) {
|
||||
MVert *v0 = &mvert[medge->v1];
|
||||
MVert *v1 = &mvert[medge->v2];
|
||||
MVert *v0 = &mvert[medge->v1];
|
||||
MVert *v1 = &mvert[medge->v2];
|
||||
|
||||
vlr= RE_findOrAddVlak(R.totvlak++);
|
||||
vlr->ob= vlr_set_ob(ob);
|
||||
vlr->v1= RE_findOrAddVert(vertofs+medge->v1);
|
||||
vlr->v2= RE_findOrAddVert(vertofs+medge->v2);
|
||||
vlr->v3= vlr->v2;
|
||||
vlr->v4= NULL;
|
||||
|
||||
xn= (v0->no[0]+v1->no[0]);
|
||||
yn= (v0->no[1]+v1->no[1]);
|
||||
zn= (v0->no[2]+v1->no[2]);
|
||||
/* transpose ! */
|
||||
vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||
vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||
vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||
Normalise(vlr->n);
|
||||
|
||||
vlr->mat= ma;
|
||||
vlr->flag= 0;
|
||||
vlr->ec= ME_V1V2;
|
||||
vlr->lay= ob->lay;
|
||||
}
|
||||
vlr= RE_findOrAddVlak(R.totvlak++);
|
||||
vlr->ob= vlr_set_ob(ob);
|
||||
vlr->v1= RE_findOrAddVert(vertofs+medge->v1);
|
||||
vlr->v2= RE_findOrAddVert(vertofs+medge->v2);
|
||||
vlr->v3= vlr->v2;
|
||||
vlr->v4= NULL;
|
||||
|
||||
xn= (v0->no[0]+v1->no[0]);
|
||||
yn= (v0->no[1]+v1->no[1]);
|
||||
zn= (v0->no[2]+v1->no[2]);
|
||||
/* transpose ! */
|
||||
vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||
vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||
vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||
Normalise(vlr->n);
|
||||
|
||||
vlr->mat= ma;
|
||||
vlr->flag= 0;
|
||||
vlr->ec= ME_V1V2;
|
||||
vlr->lay= ob->lay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -445,9 +445,6 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me)
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefButBitS(block, TOG, ME_OPT_EDGES, B_SUBSURFTYPE, "Optimal", 10, 94,154,19, &me->flag, 0, 0, 0, 0, "Only draws optimal wireframe");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
|
||||
if(me->medge) val= 1.0; else val= 0.0;
|
||||
uiDefBut(block, LABEL, 0, "Edges", 10,70,70,20, 0, val, 0, 0, 0, "");
|
||||
|
@ -1839,12 +1839,7 @@ static void draw_mesh_fancy(Object *ob, DerivedMesh *baseDM, DerivedMesh *dm, in
|
||||
glDepthMask(0); // disable write in zbuffer, selected edge wires show better
|
||||
}
|
||||
|
||||
if (me->flag&ME_OPT_EDGES) {
|
||||
dm->drawMappedEdges(dm);
|
||||
}
|
||||
else {
|
||||
dm->drawEdges(dm);
|
||||
}
|
||||
dm->drawEdges(dm);
|
||||
|
||||
if (dt!=OB_WIRE) {
|
||||
glDepthMask(1);
|
||||
|
@ -500,7 +500,6 @@ void count_object(Object *ob, int sel)
|
||||
if(me) {
|
||||
int totvert, totface;
|
||||
|
||||
// XXX fixme for modifier stack
|
||||
totvert= me->totvert;
|
||||
totface= me->totface;
|
||||
|
||||
|
@ -1808,7 +1808,6 @@ static void tb_do_mesh(void *arg, int event){
|
||||
case 3: G.f ^= G_DRAWFACES; break;
|
||||
case 4: G.f ^= G_DRAWNORMALS; break;
|
||||
case 5: flip_subdivison(OBACT, -1); break;
|
||||
case 6: me->flag ^= ME_OPT_EDGES; DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); break;
|
||||
}
|
||||
addqueue(curarea->win, REDRAW, 1);
|
||||
}
|
||||
@ -1821,7 +1820,6 @@ static TBitem tb_mesh[]= {
|
||||
{ 0, "Show/Hide Normals", 4, NULL},
|
||||
{ 0, "SEPR", 0, NULL},
|
||||
{ 0, "Subdivision Surface", 5, NULL},
|
||||
{ 0, "SubSurf Optimal", 6, NULL},
|
||||
{ 0, "SEPR", 0, NULL},
|
||||
{ 0, "Show/Hide Vertices", 0, tb_obdata_hide},
|
||||
{ -1, "", 0, tb_do_mesh}};
|
||||
|
Loading…
Reference in New Issue
Block a user