diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-26 13:41:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-26 14:17:45 +0300 |
commit | 9dd25a6b2a8d2cc60bc459d61c51a121e31520e1 (patch) | |
tree | 11269300915fa42587919a7818935cbb85571161 /source/blender/depsgraph | |
parent | e5be16175e50cb35529e76b82003f314b01b6faf (diff) |
Depsgraph: Make parameters exit dependent on ID properties
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 33 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.h | 1 |
2 files changed, 34 insertions, 0 deletions
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); |