diff options
author | over0219 <over0219@umn.edu> | 2020-06-16 03:56:00 +0300 |
---|---|---|
committer | over0219 <over0219@umn.edu> | 2020-06-16 03:56:00 +0300 |
commit | 5b09a54b41084857af4fc00426df9d1e0539e0bd (patch) | |
tree | 4cd7b44334cd259f5d315e383e2acf05fbcc8490 /source | |
parent | adc3d113f248ca036fcb8e530aba31edc24cb5f2 (diff) |
debugging uniform lattice
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 29e37c67a9c..38cb9f0db08 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -949,7 +949,7 @@ static void free_softbody_intern(SoftBody *sb) sb->bpoint = NULL; sb->bspring = NULL; - if (sb->admmpd) { + if (sb->admmpd != NULL) { admmpd_dealloc(sb->admmpd); MEM_freeN(sb->admmpd); sb->admmpd = NULL; @@ -3579,6 +3579,12 @@ static void init_admmpd_interface(Object *ob, float (*vertexCos)[3]) Mesh *me = ob->data; SoftBody *sb = ob->soft; + if (sb->admmpd != NULL) + { + admmpd_dealloc(sb->admmpd); + MEM_freeN(sb->admmpd); + sb->admmpd = NULL; + } sb->admmpd = (ADMMPDInterfaceData*)MEM_callocN(sizeof(ADMMPDInterfaceData), "SoftBody_ADMMPD"); // Resize data @@ -3615,6 +3621,7 @@ static void init_admmpd_interface(Object *ob, float (*vertexCos)[3]) looptri = NULL; // Initalize solver and free tmp data + sb->admmpd->init_mode = 1; admmpd_init(sb->admmpd, in_verts, in_faces); MEM_freeN(in_verts); MEM_freeN(in_faces); @@ -3686,7 +3693,7 @@ void sbObjectStep_admmpd( } // If it's the first frame we reset the cache and data - if (framenr == startframe) { + if (framenr == startframe || sb->admmpd == NULL) { BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); init_admmpd_interface(ob,vertexCos); BKE_ptcache_validate(cache, framenr); @@ -3696,13 +3703,6 @@ void sbObjectStep_admmpd( return; } - // Initialize simulation data if needed. - if (sb->admmpd == NULL) - { - printf("\n\n\n\n\n**ADMMPD data null!\n\n\n\n\n"); - return; - } - // Read from cache { bool can_write_cache = DEG_is_active(depsgraph); |