diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-24 18:22:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-24 18:22:41 +0400 |
commit | 82e622f1585ff615cc9607f1f9492b961842ce1b (patch) | |
tree | dc50de7877fb383c7277bfe887eedd9c6394fb46 /source | |
parent | f9bffb3ca0ca88a7e774b0ee0da1d384707f0495 (diff) |
fix [#28356] Import export STL files, problem in script in version r39307
& correct some bad comments.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 16 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 1 |
2 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 4dd97c63d40..a34335a031d 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -621,25 +621,31 @@ void file_sfile_to_operator(wmOperator *op, SpaceFile *sfile, char *filepath) } /* some ops have multiple files to select */ + /* this is called on operators check() so clear collections first since + * they may be already set. */ { PointerRNA itemptr; + PropertyRNA *prop_files= RNA_struct_find_property(op->ptr, "files"); + PropertyRNA *prop_dirs= RNA_struct_find_property(op->ptr, "dirs"); int i, numfiles = filelist_numfiles(sfile->files); - if(RNA_struct_find_property(op->ptr, "files")) { + if(prop_files) { + RNA_property_collection_clear(op->ptr, prop_files); for (i=0; i<numfiles; i++) { if (filelist_is_selected(sfile->files, i, CHECK_FILES)) { struct direntry *file= filelist_file(sfile->files, i); - RNA_collection_add(op->ptr, "files", &itemptr); + RNA_property_collection_add(op->ptr, prop_files, &itemptr); RNA_string_set(&itemptr, "name", file->relname); } } } - - if(RNA_struct_find_property(op->ptr, "dirs")) { + + if(prop_dirs) { + RNA_property_collection_clear(op->ptr, prop_dirs); for (i=0; i<numfiles; i++) { if (filelist_is_selected(sfile->files, i, CHECK_DIRS)) { struct direntry *file= filelist_file(sfile->files, i); - RNA_collection_add(op->ptr, "dirs", &itemptr); + RNA_property_collection_add(op->ptr, prop_dirs, &itemptr); RNA_string_set(&itemptr, "name", file->relname); } } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 72553872057..831d6a281ee 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4320,7 +4320,6 @@ static PyObject *small_dict_get_item_string(PyObject *dict, const char *key_look Py_ssize_t pos = 0; PyObject *value = NULL; - /* case not, search for it in the script's global dictionary */ while (PyDict_Next(dict, &pos, &key, &value)) { if(PyUnicode_Check(key)) { if(strcmp(key_lookup, _PyUnicode_AsString(key))==0) { |