[Bf-blender-cvs] [4c1ee477070] blender2.8: Merge branch 'master' into blender2.8

Sergey Sharybin noreply at git.blender.org
Mon Sep 18 12:55:06 CEST 2017


Commit: 4c1ee477070083f12bf802e551b14179e0c4579a
Author: Sergey Sharybin
Date:   Mon Sep 18 15:54:56 2017 +0500
Branches: blender2.8
https://developer.blender.org/rB4c1ee477070083f12bf802e551b14179e0c4579a

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 4cd316678a8,40f6901de33..676df7d6335
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@@ -55,6 -54,29 +55,12 @@@ extern "C" 
  
  namespace DEG {
  
+ enum {
+ 	COMPONENT_STATE_NONE      = 0,
+ 	COMPONENT_STATE_SCHEDULED = 1,
+ 	COMPONENT_STATE_DONE      = 2,
+ };
+ 
 -namespace {
 -
 -// TODO(sergey): De-duplicate with depsgraph_tag,cc
 -void lib_id_recalc_tag(Main *bmain, ID *id)
 -{
 -	id->tag |= LIB_TAG_ID_RECALC;
 -	DEG_id_type_tag(bmain, GS(id->name));
 -}
 -
 -void lib_id_recalc_data_tag(Main *bmain, ID *id)
 -{
 -	id->tag |= LIB_TAG_ID_RECALC_DATA;
 -	DEG_id_type_tag(bmain, GS(id->name));
 -}
 -
 -}  /* namespace */
 -
  typedef std::deque<OperationDepsNode *> FlushQueue;
  
  static void flush_init_func(void *data_v, int i)
@@@ -122,39 -144,18 +128,39 @@@ void deg_graph_flush_updates(Main *bmai
  			ComponentDepsNode *comp_node = node->owner;
  			IDDepsNode *id_node = comp_node->owner;
  
 -			ID *id = id_node->id;
 +			/* TODO(sergey): Do we need to pass original or evaluated ID here? */
 +			ID *id_orig = id_node->id_orig;
 +			ID *id_cow = id_node->id_cow;
  			if (id_node->done == 0) {
 -				deg_editors_id_update(bmain, id);
 -				lib_id_recalc_tag(bmain, id);
 +				/* Copy tag from original data to CoW storage.
 +				 * This is because DEG_id_tag_update() sets tags on original
 +				 * data.
 +				 */
 +				id_cow->tag |= (id_orig->tag & LIB_TAG_ID_RECALC_ALL);
 +				if (deg_copy_on_write_is_expanded(id_cow)) {
 +					deg_editors_id_update(bmain, id_cow);
 +				}
 +				lib_id_recalc_tag(bmain, id_orig);
  				/* TODO(sergey): For until we've got proper data nodes in the graph. */
 -				lib_id_recalc_data_tag(bmain, id);
 +				lib_id_recalc_data_tag(bmain, id_orig);
  			}
  
- 			if (comp_node->done == 0) {
 -			if (comp_node->done != COMPONENT_STATE_DONE) {
++			if (comp_node->done == COMPONENT_STATE_DONE) {
 +#ifdef WITH_COPY_ON_WRITE
 +				/* Currently this is needed to get ob->mesh to be replaced with
 +				 * original mesh (rather than being evaluated_mesh).
 +				 *
 +				 * TODO(sergey): This is something we need to avoid.
 +				 */
 +				if (comp_node->depends_on_cow()) {
 +					ComponentDepsNode *cow_comp =
 +					        id_node->find_component(DEG_NODE_TYPE_COPY_ON_WRITE);
 +					cow_comp->tag_update(graph);
 +				}
 +#endif
  				Object *object = NULL;
 -				if (GS(id->name) == ID_OB) {
 -					object = (Object *)id;
 +				if (GS(id_orig->name) == ID_OB) {
 +					object = (Object *)id_orig;
  					if (id_node->done == 0) {
  						++num_flushed_objects;
  					}
@@@ -203,16 -194,23 +209,28 @@@
  						case DEG_NODE_TYPE_PROXY:
  							object->recalc |= OB_RECALC_DATA;
  							break;
 +						case DEG_NODE_TYPE_SHADING_PARAMETERS:
 +							break;
  					}
 +
 +					/* TODO : replace with more granular flags */
 +					object->deg_update_flag |= DEG_RUNTIME_DATA_UPDATE;
  				}
+ 				/* When some target changes bone, we might need to re-run the
+ 				 * whole IK solver, otherwise result might be unpredictable.
+ 				 */
+ 				if (comp_node->type == DEG_NODE_TYPE_BONE) {
+ 					ComponentDepsNode *pose_comp =
+ 					        id_node->find_component(DEG_NODE_TYPE_EVAL_POSE);
+ 					BLI_assert(pose_comp != NULL);
+ 					if (pose_comp->done == COMPONENT_STATE_NONE) {
+ 						queue.push_front(pose_comp->get_entry_operation());
+ 						pose_comp->done = COMPONENT_STATE_SCHEDULED;
+ 					}
+ 				}
  			}
  
- 			id_node->done = 1;
+ 			id_node->done = COMPONENT_STATE_DONE;
  			comp_node->done = 1;
  
  			/* Flush to nodes along links... */



More information about the Bf-blender-cvs mailing list