[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52405] trunk/blender/source/blender/ makesrna/intern/rna_access.c: Support for type callbacks on IDProperty pointers.

Lukas Toenne lukas.toenne at googlemail.com
Tue Nov 20 13:25:33 CET 2012


Revision: 52405
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52405
Author:   lukastoenne
Date:     2012-11-20 12:25:28 +0000 (Tue, 20 Nov 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_access.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2012-11-20 12:10:54 UTC (rev 52404)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2012-11-20 12:25:28 UTC (rev 52405)
@@ -2551,7 +2551,10 @@
 		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);




More information about the Bf-blender-cvs mailing list