forked from blender/blender
Implement Viewport render with material preview #56
@ -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)
|
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) {
|
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)) {
|
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 {
|
else {
|
||||||
|
char str[FILE_MAX];
|
||||||
Main *main = CTX_data_main(context);
|
Main *main = CTX_data_main(context);
|
||||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
|||||||
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)) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user
Revert changes in this function and add