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.

This commit is contained in:
Lukas Toenne
2012-11-20 12:25:28 +00:00
parent 7c05359b66
commit 616eb84452

View File

@@ -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);