diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-08 17:58:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-08 17:59:37 +0300 |
commit | 2e6fcd9aadd54bc02f0efdc42e56159fa18f3450 (patch) | |
tree | e50a311ce1ed4be905861f1df68f47c68debf7fe /intern/cycles | |
parent | b72eddac6190353714745756dcc335f98cda1369 (diff) |
Fix Cycles crash after recent bugfix for image saving
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/shader.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/blender/util.h | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/intern/cycles/blender/shader.cpp b/intern/cycles/blender/shader.cpp index 4218a9a8a68..113a8e47b6d 100644 --- a/intern/cycles/blender/shader.cpp +++ b/intern/cycles/blender/shader.cpp @@ -794,7 +794,7 @@ static ShaderNode *add_node(Scene *scene, } else { ustring filename = ustring( - image_user_file_path(b_image_user, b_image, b_scene.frame_current())); + image_user_file_path(b_data, b_image_user, b_image, b_scene.frame_current())); image->set_filename(filename); } } @@ -831,7 +831,7 @@ static ShaderNode *add_node(Scene *scene, } else { env->set_filename( - ustring(image_user_file_path(b_image_user, b_image, b_scene.frame_current()))); + ustring(image_user_file_path(b_data, b_image_user, b_image, b_scene.frame_current()))); } } node = env; diff --git a/intern/cycles/blender/util.h b/intern/cycles/blender/util.h index 49cecb6d0f3..dbdfbaddaf1 100644 --- a/intern/cycles/blender/util.h +++ b/intern/cycles/blender/util.h @@ -21,7 +21,8 @@ extern "C" { void BKE_image_user_frame_calc(void *ima, void *iuser, int cfra); -void BKE_image_user_file_path_ex(void *iuser, void *ima, char *path, bool resolve_udim); +void BKE_image_user_file_path_ex( + void *bmain, void *iuser, void *ima, char *path, bool resolve_udim, bool resolve_multiview); unsigned char *BKE_image_get_pixels_for_frame(void *image, int frame, int tile); float *BKE_image_get_float_pixels_for_frame(void *image, int frame, int tile); } @@ -281,12 +282,15 @@ static inline int render_resolution_y(BL::RenderSettings &b_render) return b_render.resolution_y() * b_render.resolution_percentage() / 100; } -static inline string image_user_file_path(BL::ImageUser &iuser, BL::Image &ima, int cfra) +static inline string image_user_file_path(BL::BlendData &data, + BL::ImageUser &iuser, + BL::Image &ima, + int cfra) { char filepath[1024]; iuser.tile(0); BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra); - BKE_image_user_file_path_ex(iuser.ptr.data, ima.ptr.data, filepath, false); + BKE_image_user_file_path_ex(data.ptr.data, iuser.ptr.data, ima.ptr.data, filepath, false, true); return string(filepath); } |