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:
authorJanne Karhu <jhkarh@gmail.com>2010-12-15 20:05:34 +0300
committerJanne Karhu <jhkarh@gmail.com>2010-12-15 20:05:34 +0300
commit6b2b56c35eaf1ea8d2b0d0edd2412288f0e67e19 (patch)
tree6149ab8b1d83bf4856c535eca1c823ae637b6791 /source/blender/modifiers/intern/MOD_smoke.c
parent2c55dd96adee33962b2a618e7678ed61c07d1446 (diff)
Fix for [#25218] No smoke is emitted when particle system starts and ends on same frame
* Depsgraph wasn't updated properly for smoke flow collision object dependencies. * Smoke also wasn't properly using the actual emission frame of the flow particles. * There was a lot of bloated logic in some parts of particle code so this fix turned into a small scale cleanup operation. ** As a result particle updating and cache usage should be a bit more stable too.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_smoke.c')
-rw-r--r--source/blender/modifiers/intern/MOD_smoke.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c
index a183018da30..91197376ae9 100644
--- a/source/blender/modifiers/intern/MOD_smoke.c
+++ b/source/blender/modifiers/intern/MOD_smoke.c
@@ -34,7 +34,10 @@
#include "MEM_guardedalloc.h"
+#include "DNA_group_types.h"
#include "DNA_object_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
#include "BKE_utildefines.h"
#include "BKE_cdderivedmesh.h"
@@ -93,12 +96,13 @@ static int dependsOnTime(ModifierData *UNUSED(md))
return 1;
}
-static void updateDepgraph(ModifierData *UNUSED(md), DagForest *UNUSED(forest),
- struct Scene *UNUSED(scene),
- Object *UNUSED(ob),
- DagNode *UNUSED(obNode))
+static void updateDepgraph(ModifierData *md, DagForest *forest,
+ struct Scene *scene,
+ Object *ob,
+ DagNode *obNode)
{
- /*SmokeModifierData *smd = (SmokeModifierData *) md;
+ SmokeModifierData *smd = (SmokeModifierData *) md;
+
if(smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
{
if(smd->domain->fluid_group)
@@ -112,7 +116,7 @@ static void updateDepgraph(ModifierData *UNUSED(md), DagForest *UNUSED(forest),
SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(go->ob, eModifierType_Smoke);
// check for initialized smoke object
- if(smd2 && (smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)))
{
DagNode *curNode = dag_get_node(forest, go->ob);
dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
@@ -120,8 +124,20 @@ static void updateDepgraph(ModifierData *UNUSED(md), DagForest *UNUSED(forest),
}
}
}
+ else {
+ Base *base = scene->base.first;
+
+ for(; base; base = base->next) {
+ SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(base->object, eModifierType_Smoke);
+
+ if(smd2 && (((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) || ((smd->type & MOD_SMOKE_TYPE_COLL) && smd2->coll)))
+ {
+ DagNode *curNode = dag_get_node(forest, base->object);
+ dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Smoke Flow");
+ }
+ }
+ }
}
- */
}