Partial fix of T44881: Fix for missing particles update when changing seed

Was only visible with new dependency graph.

Changing emit_from still doesn't behave fully reliably tho, that needs some
closer investigation.
This commit is contained in:
Sergey Sharybin
2015-08-28 17:16:50 +02:00
parent a08d039e59
commit a0a7d92cc4
4 changed files with 7 additions and 4 deletions

View File

@@ -464,6 +464,7 @@ typedef struct ParticleRenderData {
struct EvaluationContext;
void BKE_particle_system_eval(struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob,
struct ParticleSystem *psys);

View File

@@ -4212,10 +4212,12 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
/* **** Depsgraph evaluation **** */
void BKE_particle_system_eval(EvaluationContext *UNUSED(eval_ctx),
Scene *scene,
Object *ob,
ParticleSystem *psys)
{
if (G.debug & G_DEBUG_DEPSGRAPH) {
printf("%s on %s:%s\n", __func__, ob->id.name, psys->name);
}
BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH);
}

View File

@@ -108,7 +108,7 @@ struct DepsgraphNodeBuilder {
void build_object_constraints(Scene *scene, Object *ob);
void build_pose_constraints(Object *ob, bPoseChannel *pchan);
void build_rigidbody(Scene *scene);
void build_particles(Object *ob);
void build_particles(Scene *scene, Object *ob);
void build_animdata(ID *id);
OperationDepsNode *build_driver(ID *id, FCurve *fcurve);
void build_ik_pose(Scene *scene, Object *ob, bPoseChannel *pchan, bConstraint *con);

View File

@@ -448,7 +448,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
/* particle systems */
if (ob->particlesystem.first) {
build_particles(ob);
build_particles(scene, ob);
}
/* grease pencil */
@@ -676,7 +676,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
}
}
void DepsgraphNodeBuilder::build_particles(Object *ob)
void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob)
{
/**
* Particle Systems Nodes
@@ -707,7 +707,7 @@ void DepsgraphNodeBuilder::build_particles(Object *ob)
/* this particle system */
// TODO: for now, this will just be a placeholder "ubereval" node
add_operation_node(psys_comp,
DEPSOP_TYPE_EXEC, function_bind(BKE_particle_system_eval, _1, ob, psys),
DEPSOP_TYPE_EXEC, function_bind(BKE_particle_system_eval, _1, scene, ob, psys),
DEG_OPCODE_PSYS_EVAL,
psys->name);
}