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:
authorDaniel Genrich <daniel.genrich@gmx.net>2012-05-08 15:39:32 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2012-05-08 15:39:32 +0400
commit7a95d4333afe9e56322abe46da95556001549288 (patch)
treeb9711d54dc59a7ad65b30df4abe8d4ce74e346d6 /source/blender
parentba7d24559def198917b220618e2b914cbc5b84ed (diff)
Fix reseting of particle lifetime and unborn feature when adding smoke - reported by blendernation
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/smoke.c23
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c1
3 files changed, 1 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index f98b6366e97..4b814a5b22b 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -279,29 +279,6 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
smd->time = scene->r.cfra;
- if (smd->flow->psys && smd->flow->psys->part && !(smd->flow->flags & MOD_SMOKE_FLOW_INIT))
- {
- // update particle lifetime to be one frame
- smd->flow->psys->part->lifetime = 1; // scene->r.efra + 1;
-
- // use "unborn" flag as standard setting
- smd->flow->psys->part->flag |= PART_UNBORN;
-
- smd->flow->flags |= MOD_SMOKE_FLOW_INIT;
- }
-
-/*
- if(!smd->flow->bvh)
- {
- // smd->flow->bvh = MEM_callocN(sizeof(BVHTreeFromMesh), "smoke_bvhfromfaces");
- // bvhtree_from_mesh_faces(smd->flow->bvh, dm, 0.0, 2, 6);
-
- // copy obmat
- // copy_m4_m4(smd->flow->mat, ob->obmat);
- // copy_m4_m4(smd->flow->mat_old, ob->obmat);
- }
-*/
-
return 1;
}
else if((smd->type & MOD_SMOKE_TYPE_COLL))
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 3e20b353856..50e48a13835 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -115,8 +115,6 @@ typedef struct SmokeDomainSettings {
/* flags */
#define MOD_SMOKE_FLOW_ABSOLUTE (1<<1) /*old style emission*/
#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to the smoke */
-#define MOD_SMOKE_FLOW_INIT (1 << 3) /* is the flow object already initialized? */
-
typedef struct SmokeFlowSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 8c000e522ba..4f045788561 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -282,6 +282,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
part->sta = 1.0f;
part->end = 250.0f;
part->ren_as = PART_DRAW_NOT;
+ part->flag |= PART_UNBORN;
part->draw_as = PART_DRAW_DOT;
BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name));
psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);