Fix #109561: Overwrite existing imagepath based on relativepath property #109815

Merged
Pratik Borhade merged 5 commits from PratikPB2123/blender:109561-overrite-image-path into main 2023-09-02 07:20:01 +02:00
Showing only changes of commit c50d6ea4c7 - Show all commits

View File

@ -1268,12 +1268,8 @@ static void image_open_cancel(bContext * /*C*/, wmOperator *op)
op->customdata = nullptr;
}
static Image *image_open_single(Main *bmain,
wmOperator *op,
ImageFrameRange *range,
const char *relbase,
bool is_relative_path,
bool use_multiview)
static Image *image_open_single(
Main *bmain, wmOperator *op, ImageFrameRange *range, const char *relbase, bool use_multiview)
{
bool exists = false;
Image *ima = nullptr;
@ -1300,11 +1296,6 @@ static Image *image_open_single(Main *bmain,
return ima;
}
/* only image path after save, never ibuf */
if (is_relative_path) {
BLI_path_rel(ima->filepath, relbase);
}
/* handle multiview images */
if (use_multiview) {
ImageOpenData *iod = static_cast<ImageOpenData *>(op->customdata);
@ -1357,7 +1348,7 @@ static int image_open_exec(bContext *C, wmOperator *op)
ListBase ranges = ED_image_filesel_detect_sequences(bmain, op, use_udim);
LISTBASE_FOREACH (ImageFrameRange *, range, &ranges) {
Image *ima_range = image_open_single(
bmain, op, range, BKE_main_blendfile_path(bmain), is_relative_path, use_multiview);
bmain, op, range, BKE_main_blendfile_path(bmain), use_multiview);
/* take the first image */
if ((ima == nullptr) && ima_range) {