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:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-08-10 10:36:42 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2010-08-10 10:36:42 +0400
commitc0e39df6ac42d137fd51eeea463aace856bf97d4 (patch)
tree86be54ecb6f01b8192905a05707b12402970d5a4 /source/blender/blenkernel/intern/lattice.c
parent41531e4fb6547df543a80d62b473c250d5b78753 (diff)
- Enable shape key switching in edit mode for curves, surfaces and latticies
- Disable changing of lattice size if there are shape keys
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r--source/blender/blenkernel/intern/lattice.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 1eb7b5d2021..1390f0dbd56 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -225,8 +225,12 @@ void free_lattice(Lattice *lt)
if(lt->def) MEM_freeN(lt->def);
if(lt->dvert) free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
if(lt->editlatt) {
- if(lt->editlatt->def) MEM_freeN(lt->editlatt->def);
- if(lt->editlatt->dvert) free_dverts(lt->editlatt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
+ Lattice *editlt= lt->editlatt->latt;
+
+ if(editlt->def) MEM_freeN(editlt->def);
+ if(editlt->dvert) free_dverts(editlt->dvert, lt->pntsu*lt->pntsv*lt->pntsw);
+
+ MEM_freeN(editlt);
MEM_freeN(lt->editlatt);
}
}
@@ -295,7 +299,7 @@ void init_latt_deform(Object *oblatt, Object *ob)
float fu, fv, fw;
int u, v, w;
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
bp = lt->def;
fp= lt->latticedata= MEM_mallocN(sizeof(float)*3*lt->pntsu*lt->pntsv*lt->pntsw, "latticedata");
@@ -350,7 +354,7 @@ void calc_latt_deform(Object *ob, float *co, float weight)
MDeformVert *dvert= lattice_get_deform_verts(ob);
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
if(lt->latticedata==NULL) return;
if(lt->vgroup[0] && dvert) {
@@ -446,7 +450,7 @@ void end_latt_deform(Object *ob)
{
Lattice *lt= ob->data;
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
if(lt->latticedata)
MEM_freeN(lt->latticedata);
@@ -1002,7 +1006,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
int i, numVerts;
float (*vertexCos)[3];
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
@@ -1066,7 +1070,7 @@ struct MDeformVert* lattice_get_deform_verts(struct Object *oblatt)
if(oblatt->type == OB_LATTICE)
{
Lattice *lt = (Lattice*)oblatt->data;
- if(lt->editlatt) lt= lt->editlatt;
+ if(lt->editlatt) lt= lt->editlatt->latt;
return lt->dvert;
}