diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-07-19 06:36:21 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-07-19 06:36:21 +0400 |
commit | 09b527263951781290af8461476dcd9ed5394c37 (patch) | |
tree | 85435546528e215ebf92fb3e2053ee2280fca217 /source/blender/python/api2_2x/Lattice.c | |
parent | 8962195f21bc7bb1b7ea70290fff93176c03eb9f (diff) |
- split mesh_deform off from object_deform
- changed mesh_modifier, sbObjectStep, object_deform to take vertexCo
argument instead of operating on mesh
- fixed bug where a derived mesh would not be returned in editmode
- removed object_wave, replaced by init_wave_deform and calc_wave_deform
- moved cached DerivedMesh to Object, not Mesh... fixes heisenbugs
with linked objects
Diffstat (limited to 'source/blender/python/api2_2x/Lattice.c')
-rw-r--r-- | source/blender/python/api2_2x/Lattice.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Lattice.c b/source/blender/python/api2_2x/Lattice.c index 16e3d704eb8..efb19794e39 100644 --- a/source/blender/python/api2_2x/Lattice.c +++ b/source/blender/python/api2_2x/Lattice.c @@ -32,6 +32,7 @@ #include "Lattice.h" /*This must come first*/ +#include "BKE_utildefines.h" #include "BKE_main.h" #include "BKE_global.h" #include "BKE_library.h" @@ -39,6 +40,8 @@ #include "BLI_blenlib.h" #include "DNA_object_types.h" #include "DNA_key_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" #include "DNA_curve_types.h" #include "DNA_scene_types.h" #include "BIF_editkey.h" @@ -702,8 +705,26 @@ static PyObject *Lattice_applyDeform( BPy_Lattice * self, PyObject *args ) * method is needed. Or for users who actually want to apply the * deformation n times. */ if((self->Lattice == par->data)) { - if ((base->object->type != OB_MESH) || forced) - object_deform( base->object ); + if ((base->object->type != OB_MESH) || forced) { + + if (base->object->type==OB_MESH) { + Mesh *me = base->object->data; + float (*vcos)[3] = malloc(sizeof(*vcos)*me->totvert); + int a; + + for (a=0; a<me->totvert; a++) { + VECCOPY(vcos[a], me->mvert[a].co); + } + mesh_deform( base->object, vcos ); + for (a=0; a<me->totvert; a++) { + VECCOPY(me->mvert[a].co, vcos[a]); + } + + free(vcos); + } else { + object_deform( base->object ); + } + } } } base = base->next; |