def _import_multiple_stages_btn_clicked(self):
    file_dialog = QFileDialog()
    file_dialog.setParent(self.sender())
    stages_folder_path = QFileDialog.getExistingDirectory(file_dialog, 'import folder with multiple objs/mtls/configs', get_mbreplacer_dir())
    stages_folder_path = QtCore.QDir.toNativeSeparators(stages_folder_path)
    obj_filepaths = [os.path.join(dp, f) for (dp, dn, filenames) in os.walk(stages_folder_path) for f in filenames if (os.path.splitext(f)[1] == '.obj')]
    for obj_filepath in obj_filepaths:
        if (obj_filepath in self._imported_obj_filepaths):
            duplicate_idx = self._imported_obj_filepaths.index(obj_filepath)
            duplicate_item = self._imported_stages_list.item(duplicate_idx)
            self._imported_stages_list.takeItem(self._imported_stages_list.row(duplicate_item))
            del self._imported_obj_filepaths[duplicate_idx]
        self._add_single_stage(obj_filepath)
        self._imported_obj_filepaths.append(obj_filepath)
    if obj_filepaths:
        self._imported_stages_list.sortItems()
    return Status.OK
def _import_multiple_stages_btn_clicked(self):
    file_dialog = QFileDialog()
    file_dialog.setParent(self.sender())
    stages_folder_path = QFileDialog.getExistingDirectory(file_dialog, 'import folder with multiple objs/mtls/configs', get_mbreplacer_dir())
    stages_folder_path = QtCore.QDir.toNativeSeparators(stages_folder_path)
    obj_filepaths = [os.path.join(dp, f) for (dp, dn, filenames) in os.walk(stages_folder_path) for f in filenames if (os.path.splitext(f)[1] == '.obj')]
    for obj_filepath in obj_filepaths:
        if (obj_filepath in self._imported_obj_filepaths):
            duplicate_idx = self._imported_obj_filepaths.index(obj_filepath)
            duplicate_item = self._imported_stages_list.item(duplicate_idx)
            self._imported_stages_list.takeItem(self._imported_stages_list.row(duplicate_item))
            del self._imported_obj_filepaths[duplicate_idx]
        self._add_single_stage(obj_filepath)
        self._imported_obj_filepaths.append(obj_filepath)
    if obj_filepaths:
        self._imported_stages_list.sortItems()
    return Status.OK