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