Fix #29292: cycles not loading linked image datablocks correctly.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Nov 2011 16:10:11 +0000 (16:10 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Nov 2011 16:10:11 +0000 (16:10 +0000)
intern/cycles/blender/blender_util.h

index c5cceff6242f8fa4f47713c215384333e72d7b7c..ff6d55c6f3ed663ad486e79d66e91ca9232c2a90 100644 (file)
@@ -176,7 +176,13 @@ static inline string get_enum_identifier(PointerRNA& ptr, const char *name)
 static inline string blender_absolute_path(BL::BlendData b_data, BL::ID b_id, const string& path)
 {
        if(path.size() >= 2 && path[0] == '/' && path[1] == '/') {
-               string dirname = (b_id.library())? b_id.library().filepath(): b_data.filepath();
+               string dirname;
+               
+               if(b_id.library())
+                       dirname = blender_absolute_path(b_data, b_id.library(), b_id.library().filepath());
+               else
+                       dirname = b_data.filepath();
+
                return path_join(path_dirname(dirname), path.substr(2));
        }