Fix for undo... it didn't do the UV coords (tface) nor the vertexpaint
colors. This because of the pretty weird (ab)use of load & make editmesh... For each added undo step, the load_editmesh was fed with an empty mesh to assign data to, without knowledge of what was in the original mesh. That way UV and color data got lost. Solved it in 2 steps: 1. removing the ->tface pointer from EditVlak, and make TFace a builtin struct inside EditVlak. This didnt cost much extra mem, since it already stored UV and color. This enabled some pretty cleanup in editmesh.c as well, storing tface pointers was cumbersome. 2. for each undo step, it then generates always a tface and mcol block to link to the undo Mesh. Even when it wasn't in the actual Mesh, at exit editmode the original Mesh is used as reference anyway, and undo-meshes are freed correctly. The enormous commit is because I had to change the BLI_editVert.h file, and found it was included in about every file unnecessary. I removed it there. ALso found out that subsurf has code ready (unfinished) to make UV coords for the displaylist in EditMode as well, nice to know for later...
This commit is contained in:
@@ -63,9 +63,7 @@ typedef struct EditVlak
|
||||
struct EditVert *v1, *v2, *v3, *v4;
|
||||
struct EditEdge *e1, *e2, *e3, *e4;
|
||||
float n[3];
|
||||
float uv[4][2];
|
||||
unsigned int col[4];
|
||||
struct TFace *tface; /* a pointer to original tface. */
|
||||
struct TFace tf; /* a copy of original tface. */
|
||||
unsigned char mat_nr, flag;
|
||||
unsigned char f, f1;
|
||||
} EditVlak;
|
||||
|
Reference in New Issue
Block a user