[Bf-blender-cvs] [9dd25a6b2a8] master: Depsgraph: Make parameters exit dependent on ID properties

Sergey Sharybin noreply at git.blender.org
Tue Feb 26 12:18:42 CET 2019


Commit: 9dd25a6b2a8d2cc60bc459d61c51a121e31520e1
Author: Sergey Sharybin
Date:   Tue Feb 26 11:41:22 2019 +0100
Branches: master
https://developer.blender.org/rB9dd25a6b2a8d2cc60bc459d61c51a121e31520e1

Depsgraph: Make parameters exit dependent on ID properties

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

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

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index dfd940a176f..35ec6269572 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1551,6 +1551,7 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
 				continue;
 			}
 			build_id(dtar->id);
+			build_driver_id_property(dtar->id, dtar->rna_path);
 			/* Initialize relations coming to proxy_from. */
 			Object *proxy_from = NULL;
 			if ((GS(dtar->id->name) == ID_OB) &&
@@ -1627,6 +1628,38 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
 	}
 }
 
+void DepsgraphRelationBuilder::build_driver_id_property(ID *id,
+                                                        const char *rna_path)
+{
+	if (id == NULL || rna_path == NULL) {
+		return;
+	}
+	PointerRNA id_ptr, ptr;
+	PropertyRNA *prop;
+	RNA_id_pointer_create(id, &id_ptr);
+	if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, NULL)) {
+		return;
+	}
+	if (prop == NULL) {
+		return;
+	}
+	if (!RNA_property_is_idprop(prop)) {
+		return;
+	}
+	const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop);
+	OperationKey id_property_key(id,
+	                             NodeType::PARAMETERS,
+	                             OperationCode::ID_PROPERTY,
+	                             prop_identifier);
+	OperationKey parameters_exit_key(id,
+	                                 NodeType::PARAMETERS,
+	                                 OperationCode::PARAMETERS_EXIT);
+	add_relation(id_property_key,
+	             parameters_exit_key,
+	             "ID Property -> Done",
+	             RELATION_CHECK_BEFORE_ADD);
+}
+
 void DepsgraphRelationBuilder::build_parameters(ID *id)
 {
 	OperationKey parameters_entry_key(
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index 164f83fdaeb..f81f079dbb6 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -243,6 +243,7 @@ struct DepsgraphRelationBuilder
 	void build_driver(ID *id, FCurve *fcurve);
 	void build_driver_data(ID *id, FCurve *fcurve);
 	void build_driver_variables(ID *id, FCurve *fcurve);
+	void build_driver_id_property(ID *id, const char *rna_path);
 	void build_parameters(ID *id);
 	void build_world(World *world);
 	void build_rigidbody(Scene *scene);



More information about the Bf-blender-cvs mailing list