From 452a52575cbc33551017d940ba86dda7a2c8c30b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 30 Jan 2013 13:42:12 +0000 Subject: Cycles material preview: fix for generated/packed/movie files Issue was caused by cycles trying to find builtin images in a main database and in case of preview render images are not in database, they're just referenced by shader node tree. Now builtin images in cycles have got void* pointer to store data needed to load builtin images. In case ob blender session, this pointer will store pointer from PointerRNA for image datablock and used later to construct Image class based on this pointer. This also saves database lookup for final render which is nice :) Reviewed by Brecht. --- intern/cycles/render/image.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'intern/cycles/render/image.h') diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index e39ac14b60f..464b87ff530 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -51,9 +51,9 @@ public: ImageManager(); ~ImageManager(); - int add_image(const string& filename, bool is_builtin, bool animated, bool& is_float); - void remove_image(const string& filename, bool is_builtin); - bool is_float_image(const string& filename, bool is_builtin); + int add_image(const string& filename, void *builtin_data, bool animated, bool& is_float); + void remove_image(const string& filename, void *builtin_data); + bool is_float_image(const string& filename, void *builtin_data); void device_update(Device *device, DeviceScene *dscene, Progress& progress); void device_free(Device *device, DeviceScene *dscene); @@ -65,9 +65,9 @@ public: bool need_update; - boost::function builtin_image_info_cb; - boost::function builtin_image_pixels_cb; - boost::function builtin_image_float_pixels_cb; + boost::function builtin_image_info_cb; + boost::function builtin_image_pixels_cb; + boost::function builtin_image_float_pixels_cb; private: int tex_num_images; int tex_num_float_images; @@ -77,7 +77,7 @@ private: struct Image { string filename; - bool is_builtin; + void *builtin_data; bool need_load; bool animated; -- cgit v1.2.3