[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17622] branches/blender2.5/blender/source /blender:

Brecht Van Lommel brecht at blender.org
Sat Nov 29 16:43:54 CET 2008


Revision: 17622
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17622
Author:   blendix
Date:     2008-11-29 16:43:53 +0100 (Sat, 29 Nov 2008)

Log Message:
-----------

* Fix Makefiles to compile python.
* Tweak SConscript priorities to link ed_util.
* Added RNA_struct_is_ID function for python.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/util/SConscript
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
    branches/blender2.5/blender/source/blender/python/intern/Makefile

Modified: branches/blender2.5/blender/source/blender/editors/util/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/util/SConscript	2008-11-29 15:21:15 UTC (rev 17621)
+++ branches/blender2.5/blender/source/blender/editors/util/SConscript	2008-11-29 15:43:53 UTC (rev 17622)
@@ -7,4 +7,4 @@
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 incs += ' ../../makesrna'
 
-env.BlenderLib ( 'bf_editors_util', sources, Split(incs), [], libtype=['core','intern'], priority=[35, 40] )
+env.BlenderLib ( 'bf_editors_util', sources, Split(incs), [], libtype=['core','intern'], priority=[40, 45] )

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-11-29 15:21:15 UTC (rev 17621)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-11-29 15:43:53 UTC (rev 17622)
@@ -104,6 +104,8 @@
 PropertyRNA *RNA_struct_name_property(PointerRNA *ptr);
 PropertyRNA *RNA_struct_iterator_property(PointerRNA *ptr);
 
+int RNA_struct_is_ID(PointerRNA *ptr);
+
 PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier);
 
 /* Properties

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c	2008-11-29 15:21:15 UTC (rev 17621)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c	2008-11-29 15:43:53 UTC (rev 17622)
@@ -242,6 +242,11 @@
 	return ptr->type->iteratorproperty;
 }
 
+int RNA_struct_is_ID(PointerRNA *ptr)
+{
+	return (ptr->type->flag & STRUCT_ID) != 0;
+}
+
 PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
 {
 	CollectionPropertyIterator iter;
@@ -977,32 +982,21 @@
 		CollectionPropertyIterator iter;
 		PropertyRNA *nameprop;
 		char name[256], *nameptr;
-		int length, alloc, found= 0;
+		int found= 0;
 
 		RNA_property_collection_begin(ptr, prop, &iter);
 		for(; iter.valid; RNA_property_collection_next(&iter)) {
 			if(iter.ptr.data && iter.ptr.type->nameproperty) {
 				nameprop= iter.ptr.type->nameproperty;
 
-				length= RNA_property_string_length(&iter.ptr, nameprop);
+				nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name));
 
-				if(sizeof(name)-1 < length) {
-					nameptr= name;
-					alloc= 0;
-				}
-				else {
-					nameptr= MEM_mallocN(sizeof(char)*length+1, "RNA_lookup_string");
-					alloc= 1;
-				}
-
-				RNA_property_string_get(&iter.ptr, nameprop, nameptr);
-
 				if(strcmp(nameptr, key) == 0) {
 					*r_ptr= iter.ptr;
 					found= 1;
 				}
 
-				if(alloc)
+				if(nameptr != name);
 					MEM_freeN(nameptr);
 
 				if(found)

Modified: branches/blender2.5/blender/source/blender/python/intern/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/Makefile	2008-11-29 15:21:15 UTC (rev 17621)
+++ branches/blender2.5/blender/source/blender/python/intern/Makefile	2008-11-29 15:43:53 UTC (rev 17622)
@@ -49,6 +49,7 @@
 CPPFLAGS += -I../../editors/include
 CPPFLAGS += -I../../python
 CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
 CPPFLAGS += -I../../blenlib
 CPPFLAGS += -I../../blenkernel
 CPPFLAGS += -I../../nodes





More information about the Bf-blender-cvs mailing list