* Fix Makefiles to compile python.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 29 Nov 2008 15:43:53 +0000 (15:43 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 29 Nov 2008 15:43:53 +0000 (15:43 +0000)
* Tweak SConscript priorities to link ed_util.
* Added RNA_struct_is_ID function for python.

source/blender/editors/util/SConscript
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_access.c
source/blender/python/intern/Makefile

index 604ebeebab747dcb168b262d137c9dad2f4248ad..48b0a99d88952192acf3fdbf9e3df2d97a96d1bb 100644 (file)
@@ -7,4 +7,4 @@ incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
 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] )
index e79c4351f4019aa1d4e69ca448ca070290cc9890..84d77adb6ee1e9ccf272dd16560780b41a6fe476 100644 (file)
@@ -104,6 +104,8 @@ const char *RNA_struct_ui_name(PointerRNA *ptr);
 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
index 4d29baa7926360d9a0c0494ad086d649fcfad813..3fbc2090cd448af4d5c22e65d2aba644957bf03f 100644 (file)
@@ -242,6 +242,11 @@ PropertyRNA *RNA_struct_iterator_property(PointerRNA *ptr)
        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 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co
                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);
-
-                               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);
+                               nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name));
 
                                if(strcmp(nameptr, key) == 0) {
                                        *r_ptr= iter.ptr;
                                        found= 1;
                                }
 
-                               if(alloc)
+                               if(nameptr != name);
                                        MEM_freeN(nameptr);
 
                                if(found)
index ea507febc2bbad765cd7f6f4f7e7370dfd0f8810..3d6ce51c9bdb86d7c015369ab4a05cfbbea166e7 100644 (file)
@@ -49,6 +49,7 @@ CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS)
 CPPFLAGS += -I../../editors/include
 CPPFLAGS += -I../../python
 CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
 CPPFLAGS += -I../../blenlib
 CPPFLAGS += -I../../blenkernel
 CPPFLAGS += -I../../nodes