2.5 / RNA

Added RNA_pointer_set as counterpart for RNA_pointer_get (i.e. sets pointer property by name lookup)
This commit is contained in:
2009-07-25 19:10:24 +00:00
parent 24d39c0de4
commit 6502b927f8
2 changed files with 13 additions and 0 deletions

View File

@@ -717,6 +717,7 @@ int RNA_string_length(PointerRNA *ptr, const char *name);
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value);
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name);
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value);
void RNA_pointer_add(PointerRNA *ptr, const char *name);
void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter);

View File

@@ -2524,6 +2524,18 @@ PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
}
}
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, name);
if(prop) {
RNA_property_pointer_set(ptr, prop, ptr_value);
}
else {
printf("RNA_pointer_set: %s.%s not found.\n", ptr->type->identifier, name);
}
}
void RNA_pointer_add(PointerRNA *ptr, const char *name)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, name);