forked from bartvdbraak/blender
Fix reseting of particle lifetime and unborn feature when adding smoke - reported by blendernation
This commit is contained in:
parent
ba7d24559d
commit
7a95d4333a
@ -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))
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user