Depsgraph: Make parameters exit dependent on ID properties
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user