Fix T98875: Adding camera background image shows error

Don't show an error if no operator property is set at all that can be
used to find an image file or ID for dropping. The caller can decide if
this is an error that needs reporting or a valid case, like it is here.
This commit is contained in:
Julian Eisel 2022-06-14 17:03:27 +02:00
parent 06780aa4e6
commit b690f4c2e6
Notes: blender-bot 2023-02-14 06:42:53 +01:00
Referenced by issue #98875, Regression: Adding Camera background image immediately pops an "Image not found" error
2 changed files with 5 additions and 0 deletions

View File

@ -738,6 +738,7 @@ void WM_operator_last_properties_ensure(struct wmOperatorType *ot, struct Pointe
wmOperator *WM_operator_last_redo(const struct bContext *C);
/**
* Use for drag & drop a path or name with operators invoke() function.
* Returns null if no operator property is set to identify the file or ID to use.
*/
ID *WM_operator_drop_load_path(struct bContext *C, struct wmOperator *op, short idcode);

View File

@ -1308,6 +1308,10 @@ ID *WM_operator_drop_load_path(struct bContext *C, wmOperator *op, const short i
return id;
}
if (!WM_operator_properties_id_lookup_is_set(op->ptr)) {
return NULL;
}
/* Lookup an already existing ID. */
id = WM_operator_properties_id_lookup_from_name_or_session_uuid(bmain, op->ptr, idcode);