Fix #28226: Selection highlighting is wrong when Solidify Modifier is used
Set origindices for edges/faces created for rim to ORIGINDEX_NONE. Also discovered error in recent editmode VBO fix -- it used to crash when comparing faces with ORIGINDEX_NONE original index.
This commit is contained in:
@@ -981,9 +981,13 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
|
|||||||
if(!flush && compareDrawOptions) {
|
if(!flush && compareDrawOptions) {
|
||||||
int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace];
|
int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace];
|
||||||
|
|
||||||
/* also compare draw options and flush buffer if they're different
|
if(orig==ORIGINDEX_NONE || next_orig==ORIGINDEX_NONE) {
|
||||||
need for face selection highlight in edit mode */
|
flush= 1;
|
||||||
flush|= compareDrawOptions(userData, orig, next_orig) == 0;
|
} else {
|
||||||
|
/* also compare draw options and flush buffer if they're different
|
||||||
|
need for face selection highlight in edit mode */
|
||||||
|
flush|= compareDrawOptions(userData, orig, next_orig) == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flush) {
|
if(flush) {
|
||||||
|
@@ -524,7 +524,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(smd->flag & MOD_SOLIDIFY_RIM) {
|
if(smd->flag & MOD_SOLIDIFY_RIM) {
|
||||||
|
int *origindex;
|
||||||
|
|
||||||
/* bugger, need to re-calculate the normals for the new edge faces.
|
/* bugger, need to re-calculate the normals for the new edge faces.
|
||||||
* This could be done in many ways, but probably the quickest way is to calculate the average normals for side faces only.
|
* This could be done in many ways, but probably the quickest way is to calculate the average normals for side faces only.
|
||||||
@@ -551,18 +551,22 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
{0, 3, 3, 0}};
|
{0, 3, 3, 0}};
|
||||||
|
|
||||||
/* add faces & edges */
|
/* add faces & edges */
|
||||||
|
origindex= result->getEdgeDataArray(result, CD_ORIGINDEX);
|
||||||
ed= medge + (numEdges * 2);
|
ed= medge + (numEdges * 2);
|
||||||
for(i=0; i<newEdges; i++, ed++) {
|
for(i=0; i<newEdges; i++, ed++) {
|
||||||
ed->v1= new_vert_arr[i];
|
ed->v1= new_vert_arr[i];
|
||||||
ed->v2= new_vert_arr[i] + numVerts;
|
ed->v2= new_vert_arr[i] + numVerts;
|
||||||
ed->flag |= ME_EDGEDRAW;
|
ed->flag |= ME_EDGEDRAW;
|
||||||
|
|
||||||
|
origindex[numEdges * 2 + i]= ORIGINDEX_NONE;
|
||||||
|
|
||||||
if(crease_rim)
|
if(crease_rim)
|
||||||
ed->crease= crease_rim;
|
ed->crease= crease_rim;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* faces */
|
/* faces */
|
||||||
mf= mface + (numFaces * 2);
|
mf= mface + (numFaces * 2);
|
||||||
|
origindex= result->getFaceDataArray(result, CD_ORIGINDEX);
|
||||||
for(i=0; i<newFaces; i++, mf++) {
|
for(i=0; i<newFaces; i++, mf++) {
|
||||||
int eidx= new_edge_arr[i];
|
int eidx= new_edge_arr[i];
|
||||||
int fidx= edge_users[eidx];
|
int fidx= edge_users[eidx];
|
||||||
@@ -623,6 +627,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
add_v3_v3(edge_vert_nos[ed->v1], nor);
|
add_v3_v3(edge_vert_nos[ed->v1], nor);
|
||||||
add_v3_v3(edge_vert_nos[ed->v2], nor);
|
add_v3_v3(edge_vert_nos[ed->v2], nor);
|
||||||
#endif
|
#endif
|
||||||
|
origindex[numFaces * 2 + i]= ORIGINDEX_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SOLIDIFY_SIDE_NORMALS
|
#ifdef SOLIDIFY_SIDE_NORMALS
|
||||||
|
Reference in New Issue
Block a user