diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-22 23:06:41 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-22 23:06:41 +0400 |
commit | 2bfd10131e7bcd5926c65c381a3e987145b02ad9 (patch) | |
tree | b88f9d4cc842a78db4f555d23c1412a950569661 /source/blender/makesrna/intern | |
parent | 83a44e48e7cb5cc6c794b50bb168a21144baeb06 (diff) | |
parent | 726fa618172733f3c4dc5ee85642829400e68f7b (diff) |
Cycles: svn merge -r41182:41205 ^/trunk/blender
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 21 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_armature_api.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve_api.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fluidsim.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 3 |
8 files changed, 16 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 149497c85fb..c1c22afcf75 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -748,12 +748,12 @@ void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type) srna->blender_type= blender_type; } -char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen) +char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len) { PropertyRNA *nameprop; if(ptr->data && (nameprop = RNA_struct_name_property(ptr->type))) - return RNA_property_string_get_alloc(ptr, nameprop, fixedbuf, fixedlen); + return RNA_property_string_get_alloc(ptr, nameprop, fixedbuf, fixedlen, r_len); return NULL; } @@ -2276,7 +2276,8 @@ void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value) strcpy(value, sprop->defaultvalue); } -char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen) +char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, + char *fixedbuf, int fixedlen, int *r_len) { char *buf; int length; @@ -2301,6 +2302,10 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fi BLI_assert(buf[length] == '\0'); #endif + if (r_len) { + *r_len= length; + } + return buf; } @@ -2836,15 +2841,17 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co PropertyRNA *nameprop; char name[256], *nameptr; int found= 0; + int keylen= strlen(key); + int namelen; 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; - nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); + nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name), &namelen); - if(strcmp(nameptr, key) == 0) { + if((keylen == namelen) && (strcmp(nameptr, key) == 0)) { *r_ptr= iter.ptr; found= 1; } @@ -4254,7 +4261,7 @@ char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, in PropertyRNA *prop= RNA_struct_find_property(ptr, name); if(prop) { - return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen); + return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen, NULL); /* TODO, pass length */ } else { printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name); @@ -5442,7 +5449,7 @@ int RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, i } case PROP_STRING: { - char *value= RNA_property_string_get_alloc(fromptr, prop, NULL, 0); + char *value= RNA_property_string_get_alloc(fromptr, prop, NULL, 0, NULL); RNA_property_string_set(ptr, prop, value); MEM_freeN(value); return 1; diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c index b65122835f1..fa079486b95 100644 --- a/source/blender/makesrna/intern/rna_armature_api.c +++ b/source/blender/makesrna/intern/rna_armature_api.c @@ -40,7 +40,6 @@ #include <stddef.h> -#include "BLI_blenlib.h" #include "BKE_armature.h" void rna_EditBone_align_roll(EditBone *ebo, float no[3]) diff --git a/source/blender/makesrna/intern/rna_fcurve_api.c b/source/blender/makesrna/intern/rna_fcurve_api.c index a1b84f5bcfe..50698757ecb 100644 --- a/source/blender/makesrna/intern/rna_fcurve_api.c +++ b/source/blender/makesrna/intern/rna_fcurve_api.c @@ -42,8 +42,6 @@ #include <stddef.h> -#include "BLI_blenlib.h" - #include "BKE_animsys.h" #include "BKE_fcurve.h" diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index c114c44ad77..13e9c88bfe3 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -96,7 +96,7 @@ static int fluidsim_find_lastframe(FluidsimSettings *fss) do { BLI_strncpy(targetFile, targetDir, sizeof(targetFile)); BLI_path_frame(targetFile, curFrame++, 0); - } while(BLI_exist(targetFile)); + } while(BLI_exists(targetFile)); return curFrame - 1; } diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 371c387e871..eacd814c926 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -40,8 +40,6 @@ #ifdef RNA_RUNTIME -#include "BLI_path_util.h" - static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr) { bGPDlayer *gpl= (bGPDlayer *)ptr->data; diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 597f8730e72..4ac29d8a881 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -98,8 +98,6 @@ static EnumPropertyItem empty_vortex_shape_items[] = { #include "BKE_pointcache.h" #include "BKE_depsgraph.h" -#include "BLI_blenlib.h" - #include "ED_object.h" static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index a1d156a2b2a..4b27e025fa3 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -120,7 +120,6 @@ EnumPropertyItem part_hair_ren_as_items[] = { #ifdef RNA_RUNTIME #include "BLI_math.h" -#include "BLI_listbase.h" #include "BKE_context.h" #include "BKE_cloth.h" diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 911dd6ac396..d525af29d6b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -178,7 +178,6 @@ EnumPropertyItem image_color_mode_items[] ={ #include "BLI_threads.h" #include "BLI_editVert.h" -#include "BLI_blenlib.h" #include "BKE_context.h" #include "BKE_global.h" @@ -203,7 +202,7 @@ EnumPropertyItem image_color_mode_items[] ={ #include "ED_mesh.h" #include "ED_keyframing.h" -#include "RE_pipeline.h" +#include "RE_engine.h" static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr) { |