[Bf-blender-cvs] [9fbef5d5d5c] blender2.8: Merge branch 'master' into blender2.8

Sergey Sharybin noreply at git.blender.org
Fri Jul 21 11:19:02 CEST 2017


Commit: 9fbef5d5d5cd172aa8225134213fb0c3eeea1009
Author: Sergey Sharybin
Date:   Fri Jul 21 11:16:37 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB9fbef5d5d5cd172aa8225134213fb0c3eeea1009

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/blenkernel/BKE_particle.h
index f318787d954,470e2e468f0..22a0290f364
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@@ -473,21 -473,8 +473,20 @@@ typedef struct ParticleRenderData 
  
  struct EvaluationContext;
  
 +void BKE_particle_system_settings_eval(struct EvaluationContext *eval_ctx,
 +                                       struct ParticleSystem *psys);
 +void BKE_particle_system_settings_recalc_clear(struct EvaluationContext *UNUSED(eval_ctx),
 +                                               struct ParticleSettings *particle_settings);
 +
- void BKE_particle_system_eval(struct EvaluationContext *eval_ctx,
-                               struct Scene *scene,
-                               struct Object *ob,
-                               struct ParticleSystem *psys);
+ void BKE_particle_system_eval_init(struct EvaluationContext *eval_ctx,
+                                    struct Scene *scene,
+                                    struct Object *ob);
  
  #endif
 +
 +/* Draw Cache */
 +enum {
 +	BKE_PARTICLE_BATCH_DIRTY_ALL = 0,
 +};
 +void BKE_particle_batch_cache_dirty(struct ParticleSystem *psys, int mode);
 +void BKE_particle_batch_cache_free(struct ParticleSystem *psys);
diff --cc source/blender/blenkernel/intern/particle_system.c
index 3a7ca2caaa4,b61f6792c89..79440b79d5c
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@@ -4353,31 -4350,12 +4353,30 @@@ void BKE_particlesystem_id_loop(Particl
  
  /* **** Depsgraph evaluation **** */
  
 -void BKE_particle_system_eval_init(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_particle_system_settings_eval(struct EvaluationContext *UNUSED(eval_ctx),
 +                                       ParticleSystem *psys)
 +{
 +	if (G.debug & G_DEBUG_DEPSGRAPH) {
 +		printf("%s on %s (%p)\n", __func__, psys->name, psys);
 +	}
 +	psys->recalc |= psys->part->recalc;
 +}
 +
 +void BKE_particle_system_settings_recalc_clear(struct EvaluationContext *UNUSED(eval_ctx),
 +                                               ParticleSettings *particle_settings)
 +{
 +	if (G.debug & G_DEBUG_DEPSGRAPH) {
 +		printf("%s on %s (%p)\n", __func__, particle_settings->id.name, particle_settings);
 +	}
 +	particle_settings->recalc = 0;
 +}
 +
- void BKE_particle_system_eval(struct EvaluationContext *UNUSED(eval_ctx),
-                               Scene *scene,
-                               Object *ob,
-                               ParticleSystem *psys)
++void BKE_particle_system_eval_init(struct EvaluationContext *UNUSED(eval_ctx),
+                                    Scene *scene,
+                                    Object *ob)
  {
  	if (G.debug & G_DEBUG_DEPSGRAPH) {
- 		printf("%s on %s:%s (%p)\n", __func__, ob->id.name, psys->name, psys);
 -		printf("%s on %s\n", __func__, ob->id.name);
++		printf("%s on %s (%p)\n", __func__, ob->id.name, ob);
  	}
  	BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH);
  }
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 5a552414cd3,a90f8ff02b6..93db8724dce
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -707,36 -671,26 +707,39 @@@ void DepsgraphNodeBuilder::build_partic
  	ComponentDepsNode *psys_comp =
  	        add_component_node(&ob->id, DEG_NODE_TYPE_EVAL_PARTICLES);
  
 +	/* TODO(sergey): Need to get COW of PSYS. */
 +	Scene *scene_cow = get_cow_datablock(scene);
 +	Object *ob_cow = get_cow_datablock(ob);
 +
+ 	add_operation_node(psys_comp,
+ 	                   function_bind(BKE_particle_system_eval_init,
+ 	                                 _1,
 -	                                 scene,
 -	                                 ob),
 -	                   DEG_OPCODE_PSYS_EVAL_INIT);
++	                                 scene_cow,
++	                                 ob_cow),
++	                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
+ 
  	/* particle systems */
  	LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
  		ParticleSettings *part = psys->part;
  
 -		/* particle settings */
 -		// XXX: what if this is used more than once!
 -		build_animdata(&part->id);
 +		/* Build particle settings operations.
 +		 *
 +		 * NOTE: The call itself ensures settings are only build once.
 +		 */
 +		build_particle_settings(part);
  
 -		/* this particle system */
 -		// TODO: for now, this will just be a placeholder "ubereval" node
 +		/* Update on particle settings change. */
 +		add_operation_node(psys_comp,
 +		                   function_bind(BKE_particle_system_settings_eval,
 +		                                 _1,
 +		                                 psys),
 +		                   DEG_OPCODE_PARTICLE_SETTINGS_EVAL,
 +		                   psys->name);
 +
 +		/* Particle system evaluation. */
  		add_operation_node(psys_comp,
- 		                   function_bind(BKE_particle_system_eval,
- 		                                 _1,
- 		                                 scene_cow,
- 		                                 ob_cow,
- 		                                 psys),
+ 		                   NULL,
 -		                   DEG_OPCODE_PSYS_EVAL,
 +		                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL,
  		                   psys->name);
  	}
  
diff --cc source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 03cae598d24,a1abcb96411..93d9aab1898
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@@ -1244,6 -1239,13 +1244,13 @@@ void DepsgraphRelationBuilder::build_pa
  	OperationKey obdata_ubereval_key(&ob->id,
  	                                 DEG_NODE_TYPE_GEOMETRY,
  	                                 DEG_OPCODE_GEOMETRY_UBEREVAL);
+ 	OperationKey eval_init_key(&ob->id,
+ 	                           DEG_NODE_TYPE_EVAL_PARTICLES,
 -	                           DEG_OPCODE_PSYS_EVAL_INIT);
++	                           DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
+ 	/* TODO(sergey): Are all particle systems depends on time?
+ 	 * Hair without dynamics i.e.
+ 	 */
+ 	add_relation(time_src_key, eval_init_key, "TimeSrc -> PSys");
  
  	/* particle systems */
  	LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
diff --cc source/blender/depsgraph/intern/depsgraph_type_defines.cc
index be2630384ea,e5033affe2f..405c8e87339
--- a/source/blender/depsgraph/intern/depsgraph_type_defines.cc
+++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cc
@@@ -129,20 -118,8 +129,21 @@@ static const char *stringify_opcode(eDe
  		STRINGIFY_OPCODE(BONE_CONSTRAINTS);
  		STRINGIFY_OPCODE(BONE_READY);
  		STRINGIFY_OPCODE(BONE_DONE);
 -		STRINGIFY_OPCODE(PSYS_EVAL);
 -		STRINGIFY_OPCODE(PSYS_EVAL_INIT);
 +		/* Particles. */
++		STRINGIFY_OPCODE(PARTICLE_SYSTEM_EVAL_INIT);
 +		STRINGIFY_OPCODE(PARTICLE_SYSTEM_EVAL);
 +		STRINGIFY_OPCODE(PARTICLE_SETTINGS_EVAL);
 +		STRINGIFY_OPCODE(PARTICLE_SETTINGS_RECALC_CLEAR);
 +		/* Collections. */
 +		STRINGIFY_OPCODE(SCENE_LAYER_INIT);
 +		STRINGIFY_OPCODE(SCENE_LAYER_EVAL);
 +		STRINGIFY_OPCODE(SCENE_LAYER_DONE);
 +		/* Copy on write. */
 +		STRINGIFY_OPCODE(COPY_ON_WRITE);
 +		/* Shading. */
 +		STRINGIFY_OPCODE(SHADING);
 +		STRINGIFY_OPCODE(MATERIAL_UPDATE);
 +		STRINGIFY_OPCODE(WORLD_UPDATE);
  
  		case DEG_NUM_OPCODES: return "SpecialCase";
  #undef STRINGIFY_OPCODE
diff --cc source/blender/depsgraph/intern/depsgraph_types.h
index af18abdb684,f05f82caa3d..ba776d5ebd5
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@@ -208,24 -216,11 +208,25 @@@ typedef enum eDepsOperation_Code 
  	DEG_OPCODE_BONE_READY,
  	DEG_OPCODE_BONE_DONE,
  
 -	/* Particles --------------------------------------- */
 -
 -	/* XXX: placeholder - Particle System eval */
 -	DEG_OPCODE_PSYS_EVAL_INIT,
 -	DEG_OPCODE_PSYS_EVAL,
 +	/* Particles. --------------------------------------- */
 +	/* Particle System evaluation. */
++	DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT,
 +	DEG_OPCODE_PARTICLE_SYSTEM_EVAL,
 +	DEG_OPCODE_PARTICLE_SETTINGS_EVAL,
 +	DEG_OPCODE_PARTICLE_SETTINGS_RECALC_CLEAR,
 +
 +	/* Collections. ------------------------------------- */
 +	DEG_OPCODE_SCENE_LAYER_INIT,
 +	DEG_OPCODE_SCENE_LAYER_EVAL,
 +	DEG_OPCODE_SCENE_LAYER_DONE,
 +
 +	/* Copy on Write. ------------------------------------ */
 +	DEG_OPCODE_COPY_ON_WRITE,
 +
 +	/* Shading. ------------------------------------------- */
 +	DEG_OPCODE_SHADING,
 +	DEG_OPCODE_MATERIAL_UPDATE,
 +	DEG_OPCODE_WORLD_UPDATE,
  
  	DEG_NUM_OPCODES,
  } eDepsOperation_Code;




More information about the Bf-blender-cvs mailing list