Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-11-29 18:43:53 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-11-29 18:43:53 +0300
commitcc0fdf24a9352b40c2dfe370a3017e28df923726 (patch)
treebe23fb28e05cdae72687bc145709845be7c2513f /source/blender
parent78218d89d68861cf96884ce6553ea587b4f6eeb4 (diff)
* Fix Makefiles to compile python.
* Tweak SConscript priorities to link ed_util. * Added RNA_struct_is_ID function for python.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/util/SConscript2
-rw-r--r--source/blender/makesrna/RNA_access.h2
-rw-r--r--source/blender/makesrna/intern/rna_access.c22
-rw-r--r--source/blender/python/intern/Makefile1
4 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript
index 604ebeebab7..48b0a99d889 100644
--- a/source/blender/editors/util/SConscript
+++ b/source/blender/editors/util/SConscript
@@ -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] )
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index e79c4351f40..84d77adb6ee 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -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
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 4d29baa7926..3fbc2090cd4 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -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)
diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile
index ea507febc2b..3d6ce51c9bd 100644
--- a/source/blender/python/intern/Makefile
+++ b/source/blender/python/intern/Makefile
@@ -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