Found a bug where "make dupes real" would crash, when the group was an extternal link. - 1 liner fix from Ton.

Also added "sort faces by selection" to the sort menu.


DNA_meshdata_types use C comments for GCC verbose warnings to be quiet
This commit is contained in:
2007-04-10 11:45:07 +00:00
parent a64339d319
commit 5a3ab0e32e
3 changed files with 39 additions and 26 deletions

View File

@@ -57,7 +57,7 @@ typedef struct MDeformWeight {
typedef struct MDeformVert {
struct MDeformWeight *dw;
int totweight;
int flag; // flag only in use for weightpaint now
int flag; /* flag only in use for weightpaint now */
} MDeformVert;
typedef struct MVert {
@@ -150,7 +150,7 @@ typedef struct PartialVisibility {
#define ME_EDGEDRAW (1<<1)
#define ME_SEAM (1<<2)
#define ME_FGON (1<<3)
// reserve 16 for ME_HIDE
/* reserve 16 for ME_HIDE */
#define ME_EDGERENDER (1<<5)
#define ME_LOOSEEDGE (1<<7)
#define ME_SEAM_LAST (1<<8)

View File

@@ -4938,6 +4938,8 @@ void make_duplilist_real()
if(okee("Make dupli objects real")==0) return;
clear_id_newpoins();
base= FIRSTBASE;
while(base) {
if TESTBASELIB(base) {

View File

@@ -477,7 +477,7 @@ void sort_faces(void)
if(G.obedit) return;
if(ob->type!=OB_MESH) return;
event = pupmenu("Sort Faces by%t|View Axis (back to front)%x1|View Axis (front to back)%x2|Cursor Distance (near to far)%x3|Cursor Distance (far to near)%x4|Randomize%x5");
event = pupmenu("Sort Faces by%t|View Axis (back to front)%x1|View Axis (front to back)%x2|Cursor Distance (near to far)%x3|Cursor Distance (far to near)%x4|Selected First%x5|Selected Last%x6|Randomize%x7");
if (event==-1) return;
me= ob->data;
@@ -493,7 +493,7 @@ void sort_faces(void)
/* sort index list instead of faces itself
and apply this permutation to all face layers */
if (event == 5) {
if (event == 7) {
/* Random */
for(i=0; i<me->totface; i++) {
face_sort_floats[i] = BLI_frand();
@@ -521,28 +521,39 @@ void sort_faces(void)
mf= me->mface;
for(i=0; i<me->totface; i++, mf++) {
/* find the faces center */
VECADD(vec, (me->mvert+mf->v1)->co, (me->mvert+mf->v2)->co);
if (mf->v4) {
VECADD(vec, vec, (me->mvert+mf->v3)->co);
VECADD(vec, vec, (me->mvert+mf->v4)->co);
VECMUL(vec, 0.25f);
} else {
VECADD(vec, vec, (me->mvert+mf->v3)->co);
VECMUL(vec, 1.0f/3.0f);
} /* done */
if (event == 1 || event == 2) { /* sort on view axis */
Mat4MulVecfl(mat, vec);
if (event==2)
face_sort_floats[i] = -vec[2]; /* front to back */
else
face_sort_floats[i] = vec[2]; /* back to front */
} else { /* distance from cursor*/
if (event==3)
face_sort_floats[i] = VecLenf(cur, vec); /* back to front */
else if (event==4)
face_sort_floats[i] = -VecLenf(cur, vec); /* front to back*/
if (event==5) {
/*selected first*/
if (mf->flag & ME_FACE_SEL) face_sort_floats[i] = 0.0;
else face_sort_floats[i] = 1.0;
} else if (event==6) {
/*selected last*/
if (mf->flag & ME_FACE_SEL) face_sort_floats[i] = 1.0;
else face_sort_floats[i] = 0.0;
} else {
/* find the faces center */
VECADD(vec, (me->mvert+mf->v1)->co, (me->mvert+mf->v2)->co);
if (mf->v4) {
VECADD(vec, vec, (me->mvert+mf->v3)->co);
VECADD(vec, vec, (me->mvert+mf->v4)->co);
VECMUL(vec, 0.25f);
} else {
VECADD(vec, vec, (me->mvert+mf->v3)->co);
VECMUL(vec, 1.0f/3.0f);
} /* done */
if (event == 1 || event == 2) { /* sort on view axis */
Mat4MulVecfl(mat, vec);
if (event==2)
face_sort_floats[i] = -vec[2]; /* front to back */
else
face_sort_floats[i] = vec[2]; /* back to front */
} else { /* distance from cursor*/
if (event==3)
face_sort_floats[i] = VecLenf(cur, vec); /* back to front */
else if (event==4)
face_sort_floats[i] = -VecLenf(cur, vec); /* front to back*/
}
}
}
qsort(index, me->totface, sizeof(int), float_sort);