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:
authorTon Roosendaal <ton@blender.org>2009-01-02 22:10:35 +0300
committerTon Roosendaal <ton@blender.org>2009-01-02 22:10:35 +0300
commita6721c60d9bc0897e3ce0dc87264fbc705284397 (patch)
tree12dd77160bcfaa4b37e85a5e8ed29496bb6c0705 /source/blender/blenkernel/intern/lattice.c
parent16ca4b572e07aa0f83158c187a7c64b27675d4c9 (diff)
2.5
From the anti-globalization department: G.obedit terminated! Wherever possible, use CTX_data_edit_object(C) to get this now. It's stored in scene now, and the screen context has it defined.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r--source/blender/blenkernel/intern/lattice.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 3f9143bb405..d397279e63e 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -297,14 +297,17 @@ void make_local_lattice(Lattice *lt)
void init_latt_deform(Object *oblatt, Object *ob)
{
/* we make an array with all differences */
- Lattice *lt = deformLatt = (oblatt==G.obedit)?editLatt:oblatt->data;
- BPoint *bp = lt->def;
+ Lattice *lt= oblatt->data;
+ BPoint *bp;
DispList *dl = find_displist(&oblatt->disp, DL_VERTS);
float *co = dl?dl->verts:NULL;
float *fp, imat[4][4];
float fu, fv, fw;
int u, v, w;
+ if(lt->editlatt) lt= lt->editlatt;
+ bp = lt->def;
+
fp= latticedata= MEM_mallocN(sizeof(float)*3*deformLatt->pntsu*deformLatt->pntsv*deformLatt->pntsw, "latticedata");
/* for example with a particle system: ob==0 */
@@ -868,10 +871,13 @@ void outside_lattice(Lattice *lt)
float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
{
- Lattice *lt = (G.obedit==ob)?editLatt:ob->data;
- int i, numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
+ Lattice *lt = ob->data;
+ int i, numVerts;
float (*vertexCos)[3] = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
+ if(lt->editlatt) lt= lt->editlatt;
+ numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
+
for (i=0; i<numVerts; i++) {
VECCOPY(vertexCos[i], lt->def[i].vec);
}
@@ -891,9 +897,10 @@ void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3])
void lattice_calc_modifiers(Object *ob)
{
- float (*vertexCos)[3] = NULL;
+ Lattice *lt= ob->data;
ModifierData *md = modifiers_getVirtualModifierList(ob);
- int numVerts, editmode = G.obedit==ob;
+ float (*vertexCos)[3] = NULL;
+ int numVerts, editmode = (lt->editlatt!=NULL);
freedisplist(&ob->disp);
@@ -931,7 +938,8 @@ struct MDeformVert* lattice_get_deform_verts(struct Object *oblatt)
{
if(oblatt->type == OB_LATTICE)
{
- Lattice *lt = (oblatt==G.obedit)?editLatt:(Lattice*)oblatt->data;
+ Lattice *lt = (Lattice*)oblatt->data;
+ if(lt->editlatt) lt= lt->editlatt;
return lt->dvert;
}