forked from bartvdbraak/blender
fix [#28356] Import export STL files, problem in script in version r39307
& correct some bad comments.
This commit is contained in:
parent
f9bffb3ca0
commit
82e622f158
@ -1,4 +1,4 @@
|
||||
# turn everything OFF CACHE FORCE BOOL) except for python which defaults to ON
|
||||
# turn everything OFF except for python which defaults to ON
|
||||
# and is needed for the UI
|
||||
#
|
||||
# Example usage:
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user