Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-04 23:49:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-04 23:49:35 +0400
commitbf77a177d406c378a74bf4572717159994d1faaf (patch)
treed2358b5a6ea8905e494104ecbdbe6db13a86a3d3
parent229dd30f37d222845f2902148d50070dcc12246d (diff)
remove mesh PartialVisibility, it wasnt being version patches or used anywhere, other then save/load/free.
-rw-r--r--source/blender/blenkernel/BKE_mesh.h6
-rw-r--r--source/blender/blenkernel/intern/mesh.c79
-rw-r--r--source/blender/blenloader/intern/readfile.c19
-rw-r--r--source/blender/blenloader/intern/writefile.c24
-rw-r--r--source/blender/editors/object/object_edit.c3
-rw-r--r--source/blender/editors/object/object_modifier.c3
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h2
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h8
8 files changed, 8 insertions, 136 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 900835940c7..232aa46575e 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -132,12 +132,6 @@ void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *m
void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge,
const int totvert, const int totedge);
-/* Partial Mesh Visibility */
-struct PartialVisibility *mesh_pmv_copy(struct PartialVisibility *);
-void mesh_pmv_free(struct PartialVisibility *);
-void mesh_pmv_revert(struct Mesh *me);
-void mesh_pmv_off(struct Mesh *me);
-
/* functions for making menu's from customdata layers */
int mesh_layers_menu_charlen(struct CustomData *data, int type); /* use this to work out how many chars to allocate */
void mesh_layers_menu_concat(struct CustomData *data, int type, char *str);
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 736c24e2c06..43958457edb 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -113,23 +113,11 @@ void unlink_mesh(Mesh *me)
if(me->texcomesh) me->texcomesh= NULL;
}
-
/* do not free mesh itself */
void free_mesh(Mesh *me)
{
unlink_mesh(me);
- if(me->pv) {
- if(me->pv->vert_map) MEM_freeN(me->pv->vert_map);
- if(me->pv->edge_map) MEM_freeN(me->pv->edge_map);
- if(me->pv->old_faces) MEM_freeN(me->pv->old_faces);
- if(me->pv->old_edges) MEM_freeN(me->pv->old_edges);
- me->totvert= me->pv->totvert;
- me->totedge= me->pv->totedge;
- me->totface= me->pv->totface;
- MEM_freeN(me->pv);
- }
-
CustomData_free(&me->vdata, me->totvert);
CustomData_free(&me->edata, me->totedge);
CustomData_free(&me->fdata, me->totface);
@@ -230,7 +218,6 @@ Mesh *copy_mesh(Mesh *me)
men->mselect= NULL;
men->edit_mesh= NULL;
- men->pv= NULL; /* looks like this is no-longer supported but NULL just incase */
men->bb= MEM_dupallocN(men->bb);
@@ -1456,72 +1443,6 @@ void create_vert_edge_map(ListBase **map, IndexNode **mem, const MEdge *medge, c
}
}
-/* Partial Mesh Visibility */
-PartialVisibility *mesh_pmv_copy(PartialVisibility *pmv)
-{
- PartialVisibility *n= MEM_dupallocN(pmv);
- n->vert_map= MEM_dupallocN(pmv->vert_map);
- n->edge_map= MEM_dupallocN(pmv->edge_map);
- n->old_edges= MEM_dupallocN(pmv->old_edges);
- n->old_faces= MEM_dupallocN(pmv->old_faces);
- return n;
-}
-
-void mesh_pmv_free(PartialVisibility *pv)
-{
- MEM_freeN(pv->vert_map);
- MEM_freeN(pv->edge_map);
- MEM_freeN(pv->old_faces);
- MEM_freeN(pv->old_edges);
- MEM_freeN(pv);
-}
-
-void mesh_pmv_revert(Mesh *me)
-{
- if(me->pv) {
- unsigned i;
- MVert *nve, *old_verts;
-
- /* Reorder vertices */
- nve= me->mvert;
- old_verts = MEM_mallocN(sizeof(MVert)*me->pv->totvert,"PMV revert verts");
- for(i=0; i<me->pv->totvert; ++i)
- old_verts[i]= nve[me->pv->vert_map[i]];
-
- /* Restore verts, edges and faces */
- CustomData_free_layer_active(&me->vdata, CD_MVERT, me->totvert);
- CustomData_free_layer_active(&me->edata, CD_MEDGE, me->totedge);
- CustomData_free_layer_active(&me->fdata, CD_MFACE, me->totface);
-
- CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, old_verts, me->pv->totvert);
- CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, me->pv->old_edges, me->pv->totedge);
- CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, me->pv->old_faces, me->pv->totface);
- mesh_update_customdata_pointers(me);
-
- me->totvert= me->pv->totvert;
- me->totedge= me->pv->totedge;
- me->totface= me->pv->totface;
-
- me->pv->old_edges= NULL;
- me->pv->old_faces= NULL;
-
- /* Free maps */
- MEM_freeN(me->pv->edge_map);
- me->pv->edge_map= NULL;
- MEM_freeN(me->pv->vert_map);
- me->pv->vert_map= NULL;
- }
-}
-
-void mesh_pmv_off(Mesh *me)
-{
- if(me->pv) {
- mesh_pmv_revert(me);
- MEM_freeN(me->pv);
- me->pv= NULL;
- }
-}
-
/* basic vertex data functions */
int minmax_mesh(Mesh *me, float min[3], float max[3])
{
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1759fa67569..e352e783c24 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3718,22 +3718,13 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
mesh->adt= newdataadr(fd, mesh->adt);
direct_link_animdata(fd, mesh->adt);
- /* Partial-mesh visibility (do this before using totvert, totface, or totedge!) */
- mesh->pv= newdataadr(fd, mesh->pv);
- if(mesh->pv) {
- mesh->pv->vert_map= newdataadr(fd, mesh->pv->vert_map);
- mesh->pv->edge_map= newdataadr(fd, mesh->pv->edge_map);
- mesh->pv->old_faces= newdataadr(fd, mesh->pv->old_faces);
- mesh->pv->old_edges= newdataadr(fd, mesh->pv->old_edges);
- }
-
/* normally direct_link_dverts should be called in direct_link_customdata,
but for backwards compat in do_versions to work we do it here */
- direct_link_dverts(fd, mesh->pv ? mesh->pv->totvert : mesh->totvert, mesh->dvert);
+ direct_link_dverts(fd, mesh->totvert, mesh->dvert);
- direct_link_customdata(fd, &mesh->vdata, mesh->pv ? mesh->pv->totvert : mesh->totvert);
- direct_link_customdata(fd, &mesh->edata, mesh->pv ? mesh->pv->totedge : mesh->totedge);
- direct_link_customdata(fd, &mesh->fdata, mesh->pv ? mesh->pv->totface : mesh->totface);
+ direct_link_customdata(fd, &mesh->vdata, mesh->totvert);
+ direct_link_customdata(fd, &mesh->edata, mesh->totedge);
+ direct_link_customdata(fd, &mesh->fdata, mesh->totface);
mesh->bb= NULL;
mesh->mselect = NULL;
@@ -3787,7 +3778,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
TFace *tf= mesh->tface;
unsigned int i;
- for (i=0; i< (mesh->pv ? mesh->pv->totface : mesh->totface); i++, tf++) {
+ for (i=0; i< (mesh->totface); i++, tf++) {
SWITCH_INT(tf->col[0]);
SWITCH_INT(tf->col[1]);
SWITCH_INT(tf->col[2]);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ad5eda03872..00710e67cf2 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1691,27 +1691,9 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
writedata(wd, DATA, sizeof(void *)*mesh->totcol, mesh->mat);
- if(mesh->pv) {
- write_customdata(wd, &mesh->id, mesh->pv->totvert, &mesh->vdata, -1, 0);
- write_customdata(wd, &mesh->id, mesh->pv->totedge, &mesh->edata,
- CD_MEDGE, mesh->totedge);
- write_customdata(wd, &mesh->id, mesh->pv->totface, &mesh->fdata,
- CD_MFACE, mesh->totface);
- }
- else {
- write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0);
- write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0);
- write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0);
- }
-
- /* PMV data */
- if(mesh->pv) {
- writestruct(wd, DATA, "PartialVisibility", 1, mesh->pv);
- writedata(wd, DATA, sizeof(unsigned int)*mesh->pv->totvert, mesh->pv->vert_map);
- writedata(wd, DATA, sizeof(int)*mesh->pv->totedge, mesh->pv->edge_map);
- writestruct(wd, DATA, "MFace", mesh->pv->totface, mesh->pv->old_faces);
- writestruct(wd, DATA, "MEdge", mesh->pv->totedge, mesh->pv->old_edges);
- }
+ write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0);
+ write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0);
+ write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0);
}
mesh= mesh->id.next;
}
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index fc6f0937c3d..07ab80f6d15 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -439,9 +439,6 @@ void ED_object_enter_editmode(bContext *C, int flag)
ob->mode= OB_MODE_EDIT;
if(ob->type==OB_MESH) {
- Mesh *me= ob->data;
-
- if(me->pv) mesh_pmv_off(me);
ok= 1;
scene->obedit= ob; // context sees this
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 86477eb9dbd..240fb8017f2 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -456,7 +456,6 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M
BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to Shapes");
return 0;
}
- mesh_pmv_off(me);
dm = mesh_create_derived_for_modifier(scene, ob, md);
if (!dm) {
@@ -506,8 +505,6 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
return 0;
}
- mesh_pmv_off(me);
-
/* Multires: ensure that recent sculpting is applied */
if(md->type == eModifierType_Multires)
multires_force_update(ob);
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index b7d9208e595..7d57e2c295c 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -48,7 +48,6 @@ struct MSticky;
struct Mesh;
struct OcInfo;
struct Multires;
-struct PartialVisibility;
struct EditMesh;
struct AnimData;
@@ -100,7 +99,6 @@ typedef struct Mesh {
short totcol;
struct Multires *mr DNA_DEPRECATED; /* deprecated multiresolution modeling data, only keep for loading old files */
- struct PartialVisibility *pv;
} Mesh;
/* deprecated by MTFace, only here for file reading */
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index b6fc8106ba0..d772324cd72 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -174,14 +174,6 @@ typedef struct Multires {
/** End Multires **/
-typedef struct PartialVisibility {
- unsigned int *vert_map; /* vert_map[Old Index]= New Index */
- int *edge_map; /* edge_map[Old Index]= New Index, -1= hidden */
- MFace *old_faces;
- MEdge *old_edges;
- unsigned int totface, totedge, totvert, pad;
-} PartialVisibility;
-
typedef struct MRecast{
int i;
} MRecast;