[Bf-blender-cvs] [8614f282348] master: Depsgraph: Special relation for instances and metaballs

Sergey Sharybin noreply at git.blender.org
Tue Feb 12 16:47:29 CET 2019


Commit: 8614f282348981d63fea7230826a22e179605219
Author: Sergey Sharybin
Date:   Tue Feb 12 15:58:45 2019 +0100
Branches: master
https://developer.blender.org/rB8614f282348981d63fea7230826a22e179605219

Depsgraph: Special relation for instances and metaballs

Ensures that object which is set for instance-vert or instance-face
is evaluated prior to metaball. This is because metaball will request
list of instances during evaluation.

This should fix issue reported T61431 in release build. The assert is
still there and is to be addressed separately.

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

M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 879ad5b5826..1f679cda191 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -836,6 +836,7 @@ void DepsgraphRelationBuilder::build_object_data_speaker(Object *object)
 
 void DepsgraphRelationBuilder::build_object_parent(Object *object)
 {
+	Object *parent = object->parent;
 	ID *parent_id = &object->parent->id;
 	ComponentKey ob_key(&object->id, NodeType::TRANSFORM);
 	/* Type-specific links/ */
@@ -911,6 +912,16 @@ void DepsgraphRelationBuilder::build_object_parent(Object *object)
 			break;
 		}
 	}
+	/* Metaballs are the odd balls here (no pun intended): they will request
+	 * instance-list (formerly known as dupli-list) during evaluation. This is
+	 * their way of interacting with all instanced surfaces, making a nice
+	 * effect when is used form particle system. */
+	if (object->type == OB_MBALL && parent->transflag & OB_DUPLI) {
+		ComponentKey parent_geometry_key(parent_id, NodeType::GEOMETRY);
+		/* NOTE: Metaballs are evaluating geometry only after their transform,
+		 * so we onl;y hook up to transform channel here. */
+		add_relation(parent_geometry_key, ob_key, "Parent");
+	}
 }
 
 void DepsgraphRelationBuilder::build_object_pointcache(Object *object)



More information about the Bf-blender-cvs mailing list