[Bf-blender-cvs] [e1570e4] alembic_basic_io: Ensure paths handed to Alembic are absolute.

Kévin Dietrich noreply at git.blender.org
Tue Jun 14 16:58:53 CEST 2016


Commit: e1570e4beac9d1e72c00df07ef7bd97b11d94c68
Author: Kévin Dietrich
Date:   Tue Jun 14 16:20:14 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBe1570e4beac9d1e72c00df07ef7bd97b11d94c68

Ensure paths handed to Alembic are absolute.

===================================================================

M	source/blender/blenkernel/intern/cachefile.c

===================================================================

diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index 0548264..08e40d8 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -35,6 +35,7 @@
 #include "BLI_string.h"
 
 #include "BKE_cachefile.h"
+#include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_scene.h"
@@ -56,6 +57,11 @@ bool BKE_cachefile_filepath_get(Scene *scene, CacheFile *cache_file, char *r_fil
 	const float frame = BKE_scene_frame_get(scene);
 	BLI_strncpy(r_filepath, cache_file->filepath, 1024);
 
+	/* Ensure absolute paths. */
+	if (BLI_path_is_rel(r_filepath)) {
+		BLI_path_abs(r_filepath, G.main->name);
+	}
+
 	int fframe;
 	int frame_len;
 
@@ -64,9 +70,12 @@ bool BKE_cachefile_filepath_get(Scene *scene, CacheFile *cache_file, char *r_fil
 		BLI_path_frame_strip(r_filepath, true, ext);
 		BLI_path_frame(r_filepath, frame, frame_len);
 		BLI_ensure_extension(r_filepath, 1024, ext);
+
+		/* TODO(kevin): store sequence range? */
+		return BLI_exists(r_filepath);
 	}
 
-	return BLI_exists(r_filepath);
+	return true;
 }
 
 float BKE_cachefile_time_offset(CacheFile *cache_file, float time)




More information about the Bf-blender-cvs mailing list