Implement Viewport render with material preview #56

Merged
Bogdan Nagirniak merged 22 commits from BLEN-421 into hydra-render 2023-06-30 09:03:28 +02:00
Showing only changes of commit 296bfa55e3 - Show all commits

View File

@ -67,19 +67,21 @@ static std::string cache_image_file(Image *image,
std::string cache_or_get_image_file(Image *image, bContext *context, ImageUser *iuser)
{
char file_path[FILE_MAX];
std::string file_path;
if (image->source == IMA_SRC_GENERATED) {
strcpy(file_path, cache_image_file(image, context, iuser, false).c_str());
file_path = cache_image_file(image, context, iuser, false);
}
else if (BKE_image_has_packedfile(image)) {
strcpy(file_path, cache_image_file(image, context, iuser, true).c_str());
file_path = cache_image_file(image, context, iuser, true);
}
else {
char str[FILE_MAX];
Main *main = CTX_data_main(context);
BogdanNagirniak marked this conversation as resolved Outdated

Revert changes in this function and add

char str[FILE_MAX];
BKE_image_user_file_path_ex(main, iuser, image, str, false, true);
file_path = str;
Revert changes in this function and add ``` char str[FILE_MAX]; BKE_image_user_file_path_ex(main, iuser, image, str, false, true); file_path = str; ```
BKE_image_user_file_path_ex(main, iuser, image, file_path, false, true);
BKE_image_user_file_path_ex(main, iuser, image, str, false, true);
file_path = str;
if (!pxr::HioImageRegistry::GetInstance().IsSupportedImageFile(file_path)) {
strcpy(file_path, cache_image_file(image, context, iuser, true).c_str());
file_path = cache_image_file(image, context, iuser, true);
}
}