diff options
author | Matt Ebb <matt@mke3.net> | 2010-05-14 11:09:15 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-05-14 11:09:15 +0400 |
commit | 279885290367b8ddb7570452b664ce4df796c192 (patch) | |
tree | 5d30fe8c43f7f336557f07bf3f2b8c9727e668c4 /source/blender/blenkernel | |
parent | d8856352164d1118f46eae59a60bf1c0abb36516 (diff) |
Fix:
[#22310] Duplicate Does Not Propogate SimpleDeform's VGroup
[#22321] duplicating object with smoke settings doesnt duplicate smoke settings
^ Genscher, you may want to check that but I thought it was pretty straightforward.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_smoke.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h index 4547f869439..088d61061b2 100644 --- a/source/blender/blenkernel/BKE_smoke.h +++ b/source/blender/blenkernel/BKE_smoke.h @@ -40,6 +40,7 @@ void smokeModifier_free (struct SmokeModifierData *smd); void smokeModifier_reset(struct SmokeModifierData *smd); void smokeModifier_reset_turbulence(struct SmokeModifierData *smd); void smokeModifier_createType(struct SmokeModifierData *smd); +void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData *tsmd); long long smoke_get_mem_req(int xres, int yres, int zres, int amplify); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index ccb83c760f0..7424026354a 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -753,6 +753,41 @@ void smokeModifier_createType(struct SmokeModifierData *smd) } } +void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData *tsmd) +{ + tsmd->type = smd->type; + tsmd->time = smd->time; + + smokeModifier_createType(tsmd); + + if (tsmd->domain) { + tsmd->domain->maxres = smd->domain->maxres; + tsmd->domain->amplify = smd->domain->amplify; + tsmd->domain->omega = smd->domain->omega; + tsmd->domain->alpha = smd->domain->alpha; + tsmd->domain->beta = smd->domain->beta; + tsmd->domain->flags = smd->domain->flags; + tsmd->domain->strength = smd->domain->strength; + tsmd->domain->noise = smd->domain->noise; + tsmd->domain->diss_speed = smd->domain->diss_speed; + tsmd->domain->viewsettings = smd->domain->viewsettings; + tsmd->domain->fluid_group = smd->domain->fluid_group; + tsmd->domain->coll_group = smd->domain->coll_group; + + MEM_freeN(tsmd->domain->effector_weights); + tsmd->domain->effector_weights = MEM_dupallocN(smd->domain->effector_weights); + } else if (tsmd->flow) { + tsmd->flow->density = smd->flow->density; + tsmd->flow->temp = smd->flow->temp; + tsmd->flow->psys = smd->flow->psys; + tsmd->flow->type = smd->flow->type; + } else if (tsmd->coll) { + ; + /* leave it as initialised, collision settings is mostly caches */ + } +} + + // forward decleration static void smoke_calc_transparency(float *result, float *input, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb, float correct); static float calc_voxel_transp(float *result, float *input, int res[3], int *pixel, float *tRay, float correct); |