index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
3 changed files with 17 additions and 1 deletions
Showing only changes of commit 91a29c9b9a - Show all commits

View File

@ -84,6 +84,19 @@ RNAPathKey::RNAPathKey(ID *id, const PointerRNA &ptr, PropertyRNA *prop, RNAPoin
{
}
RNAPathKey::RNAPathKey(const PointerRNA &target_prop,
const char *rna_path_from_target_prop,
const RNAPointerSource source)
: id(target_prop.owner_id), source(source)
{
/* Try to resolve path. */
int index;
if (!RNA_path_resolve_full(&target_prop, rna_path_from_target_prop, &ptr, &prop, &index)) {
ptr = PointerRNA_NULL;
prop = nullptr;
}
}
string RNAPathKey::identifier() const
{
const char *id_name = (id) ? id->name : "<No ID>";

View File

@ -188,6 +188,9 @@ struct PersistentOperationKey : public OperationKey {
struct RNAPathKey {
RNAPathKey(ID *id, const char *path, RNAPointerSource source);
RNAPathKey(const PointerRNA &target_prop,
const char *rna_path_from_target_prop,
RNAPointerSource source);
RNAPathKey(ID *id, const PointerRNA &ptr, PropertyRNA *prop, RNAPointerSource source);
string identifier() const;

View File

@ -1807,7 +1807,7 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
add_relation(target_key, driver_key, "Target -> Driver");
}
else if (dtar->rna_path != nullptr && dtar->rna_path[0] != '\0') {
RNAPathKey variable_exit_key(target_id, dtar->rna_path, RNAPointerSource::EXIT);
RNAPathKey variable_exit_key(target_prop, dtar->rna_path, RNAPointerSource::EXIT);
if (RNA_pointer_is_null(&variable_exit_key.ptr)) {
continue;
}