WIP: Experiment: Drop import operator helper and file drop type #111242

Closed
Guillermo Venegas wants to merge 23 commits from guishe/blender:drop-helper into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 863d8fbdae - Show all commits

View File

@ -80,11 +80,11 @@ static int wm_drop_import_helper_exec(bContext *C, wmOperator *op)
char extension[MAX_NAME];
RNA_string_get(op->ptr, "extension", extension);
blender::Vector<wmOperatorType *> operators = poll_operators_for_extension(C, extension);
if (operators.size() == 0) {
return OPERATOR_CANCELLED;
}
wmOperatorType *ot = operators[0];
PointerRNA op_props = copy_file_properties_to_operator_type_pointer(op, ot);
@ -190,7 +190,7 @@ static char *tooltip(bContext *C, wmDrag *drag, const int /*xy*/[2], wmDropBox *
return nullptr;
}
if (operators.size() == 1) {
return BLI_strdup(operators[0]->name);
return BLI_strdup(operators[0]->name ? operators[0]->name : operators[0]->idname);
}
return BLI_strdup("Multiple operators can handle this file(s), drop to pick which to use");