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:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user