Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-11-20 16:25:28 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-11-20 16:25:28 +0400
commit616eb844525759cbb491a6bcd0de0dfce37be346 (patch)
treefe996b25ce06369dc9f9bc0c938a3a8abaf3535b /source/blender/makesrna
parent7c05359b66a5326aaab9747d3f5aaecb527bb2df (diff)
Support for type callbacks on IDProperty pointers. Before this the type of the type of a PropertyGroup pointer would be fixed to the default RNA type. This is fine in most cases, but it may be necessary to define the property group subtype dynamically in some cases. Now the returned RNA pointer uses the typef callback if it exists.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_access.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 81e738ed82f..deb4094cb45 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2551,7 +2551,10 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
pprop = (PointerPropertyRNA *)prop;
/* for groups, data is idprop itself */
- return rna_pointer_inherit_refine(ptr, pprop->type, idprop);
+ if (pprop->typef)
+ return rna_pointer_inherit_refine(ptr, pprop->typef(ptr), idprop);
+ else
+ return rna_pointer_inherit_refine(ptr, pprop->type, idprop);
}
else if (pprop->get) {
return pprop->get(ptr);