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:
-rw-r--r--source/blender/blenkernel/BKE_smoke.h1
-rw-r--r--source/blender/blenkernel/intern/smoke.c35
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c2
-rw-r--r--source/blender/modifiers/intern/MOD_smoke.c12
4 files changed, 49 insertions, 1 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);
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index b71a598e24e..79190c409cc 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -283,8 +283,10 @@ static void copyData(ModifierData *md, ModifierData *target)
tsmd->mode = smd->mode;
tsmd->axis = smd->axis;
tsmd->origin= smd->origin;
+ tsmd->originOpts= smd->originOpts;
tsmd->factor= smd->factor;
memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit));
+ strcpy(tsmd->vgroup_name, smd->vgroup_name);
}
static CustomDataMask requiredDataMask(Object *ob, ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c
index 32d908a5552..df8372876bd 100644
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@ -32,6 +32,8 @@
#include "stddef.h"
+#include "MEM_guardedalloc.h"
+
#include "BKE_cdderivedmesh.h"
#include "BKE_modifier.h"
#include "BKE_smoke.h"
@@ -52,6 +54,14 @@ static void initData(ModifierData *md)
smd->time = -1;
}
+static void copyData(ModifierData *md, ModifierData *target)
+{
+ SmokeModifierData *smd = (SmokeModifierData*)md;
+ SmokeModifierData *tsmd = (SmokeModifierData*)target;
+
+ smokeModifier_copy(smd, tsmd);
+}
+
static void freeData(ModifierData *md)
{
SmokeModifierData *smd = (SmokeModifierData*) md;
@@ -117,7 +127,7 @@ ModifierTypeInfo modifierType_Smoke = {
| eModifierTypeFlag_UsesPointCache
| eModifierTypeFlag_Single,
- /* copyData */ 0,
+ /* copyData */ copyData,
/* deformVerts */ deformVerts,
/* deformVertsEM */ 0,
/* deformMatricesEM */ 0,