Commit: a0a7d92cc40fe025e04bc7b4aaca6ffac52899af
Author: Sergey Sharybin
Date:   Fri Aug 28 17:16:50 2015 +0200
Branches: master
https://developer.blender.org/rBa0a7d92cc40fe025e04bc7b4aaca6ffac52899af

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.

===================================================================

M       source/blender/blenkernel/BKE_particle.h
M       source/blender/blenkernel/intern/particle_system.c
M       source/blender/depsgraph/intern/depsgraph_build.h
M       source/blender/depsgraph/intern/depsgraph_build_nodes.cc

===================================================================

diff --git a/source/blender/blenkernel/BKE_particle.h 
b/source/blender/blenkernel/BKE_particle.h
index 3232570..89cfb3a 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -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);
 
diff --git a/source/blender/blenkernel/intern/particle_system.c 
b/source/blender/blenkernel/intern/particle_system.c
index dd43e63..9c72012 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -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);
 }
diff --git a/source/blender/depsgraph/intern/depsgraph_build.h 
b/source/blender/depsgraph/intern/depsgraph_build.h
index 4088a32..c5b04ec 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -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);
diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc 
b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
index 31e32ac..4463df6 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
@@ -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);
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to