forked from bartvdbraak/blender
Fix for crash in Mesh EditMode "Join triangles" (JKEY). Found & code
provided by Campbell Barton, thanks mate! :) Note; this tool gives quickly bad results... also errors printed in the give_quad_verts call. Who likes to attack this!
This commit is contained in:
parent
799d7e3f98
commit
c68c3c253f
@ -2307,24 +2307,26 @@ void join_triangles(void)
|
|||||||
1-----2 1-----2
|
1-----2 1-----2
|
||||||
*/
|
*/
|
||||||
/* make new faces */
|
/* make new faces */
|
||||||
if( convex(v1->co, v2->co, v3->co, v4->co) ) {
|
if(v1 && v2 && v3 && v4) {
|
||||||
if(exist_face(v1, v2, v3, v4)==0) {
|
if( convex(v1->co, v2->co, v3->co, v4->co) ) {
|
||||||
w = addfacelist(v1, v2, v3, v4, efaa[0], NULL); /* seam edge may get broken */
|
if(exist_face(v1, v2, v3, v4)==0) {
|
||||||
w->f= efaa[0]->f; /* copy selection flag */
|
w = addfacelist(v1, v2, v3, v4, efaa[0], NULL); /* seam edge may get broken */
|
||||||
untag_edges(w);
|
w->f= efaa[0]->f; /* copy selection flag */
|
||||||
|
untag_edges(w);
|
||||||
|
|
||||||
UVCOPY(w->tf.uv[0], uv[0]);
|
UVCOPY(w->tf.uv[0], uv[0]);
|
||||||
UVCOPY(w->tf.uv[1], uv[1]);
|
UVCOPY(w->tf.uv[1], uv[1]);
|
||||||
UVCOPY(w->tf.uv[2], uv[2]);
|
UVCOPY(w->tf.uv[2], uv[2]);
|
||||||
UVCOPY(w->tf.uv[3], uv[3]);
|
UVCOPY(w->tf.uv[3], uv[3]);
|
||||||
|
|
||||||
memcpy(w->tf.col, col, sizeof(w->tf.col));
|
memcpy(w->tf.col, col, sizeof(w->tf.col));
|
||||||
}
|
}
|
||||||
/* tag as to-be-removed */
|
/* tag as to-be-removed */
|
||||||
FACE_MARKCLEAR(efaa[0]);
|
FACE_MARKCLEAR(efaa[0]);
|
||||||
FACE_MARKCLEAR(efaa[1]);
|
FACE_MARKCLEAR(efaa[1]);
|
||||||
eed->f1 = 1;
|
eed->f1 = 1;
|
||||||
} /* endif test convex */
|
} /* endif test convex */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eed= nexted;
|
eed= nexted;
|
||||||
|
Loading…
Reference in New Issue
Block a user