diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-07 01:59:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-07 01:59:16 +0400 |
commit | bf0102ffa405027ed4111d6c1635c3995241bb20 (patch) | |
tree | 8aa84da260321e462e1bd8e947618a788201b81d /source/blender | |
parent | 759e96164a8d3f0f3f5606ab5f4801859899dd50 (diff) |
fix for texture_slot path, would give incorrect path when used with brushes which only have one texture slot.
also quiet float/double warning.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 31 |
2 files changed, 19 insertions, 14 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2c3d3f631bd..902d75ee67e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8346,7 +8346,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (clip = main->movieclip.first; clip; clip = clip->id.next) { if (clip->tracking.settings.reconstruction_success_threshold == 0.0f) { - clip->tracking.settings.reconstruction_success_threshold = 1e-3; + clip->tracking.settings.reconstruction_success_threshold = 1e-3f; } } } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index b212879512e..bdf9fa4e436 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -264,19 +264,24 @@ char *rna_TextureSlot_path(PointerRNA *ptr) * may be used multiple times in the same stack */ if (ptr->id.data) { - PointerRNA id_ptr; - PropertyRNA *prop; - - /* find the 'textures' property of the ID-struct */ - RNA_id_pointer_create(ptr->id.data, &id_ptr); - prop = RNA_struct_find_property(&id_ptr, "texture_slots"); - - /* get an iterator for this property, and try to find the relevant index */ - if (prop) { - int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr); - - if (index >= 0) - return BLI_sprintfN("texture_slots[%d]", index); + if (GS(((ID *)ptr->id.data)->name) == ID_BR) { + return BLI_strdup("texture_slot"); + } + else { + PointerRNA id_ptr; + PropertyRNA *prop; + + /* find the 'textures' property of the ID-struct */ + RNA_id_pointer_create(ptr->id.data, &id_ptr); + prop = RNA_struct_find_property(&id_ptr, "texture_slots"); + + /* get an iterator for this property, and try to find the relevant index */ + if (prop) { + int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr); + + if (index >= 0) + return BLI_sprintfN("texture_slots[%d]", index); + } } } |