[Bf-blender-cvs] [fd23284] alembic_basic_io: From review: pass a frame instead of scene to BKE_cachefile_filepath_get.

Kévin Dietrich noreply at git.blender.org
Mon Jun 20 18:59:35 CEST 2016


Commit: fd2328413d145c00ad7e2b0c528a9a3cd97cf4ed
Author: Kévin Dietrich
Date:   Mon Jun 20 16:48:27 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBfd2328413d145c00ad7e2b0c528a9a3cd97cf4ed

>From review: pass a frame instead of scene to
BKE_cachefile_filepath_get.

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

M	source/blender/blenkernel/BKE_cachefile.h
M	source/blender/blenkernel/intern/cachefile.c
M	source/blender/blenkernel/intern/constraint.c
M	source/blender/modifiers/intern/MOD_meshsequencecache.c

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

diff --git a/source/blender/blenkernel/BKE_cachefile.h b/source/blender/blenkernel/BKE_cachefile.h
index c35a676..9b5b22d 100644
--- a/source/blender/blenkernel/BKE_cachefile.h
+++ b/source/blender/blenkernel/BKE_cachefile.h
@@ -38,8 +38,7 @@ struct Main;
 
 void *BKE_cachefile_add(struct Main *bmain, const char *name);
 
-bool BKE_cachefile_filepath_get(struct Scene *scene,
-                                struct CacheFile *cache_file,
+bool BKE_cachefile_filepath_get(struct CacheFile *cache_file, float frame,
                                 char *r_filename);
 
 float BKE_cachefile_time_offset(struct CacheFile *cache_file, float time);
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index 08e40d8..93eb81d 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -52,9 +52,8 @@ void *BKE_cachefile_add(Main *bmain, const char *name)
 	return cache_file;
 }
 
-bool BKE_cachefile_filepath_get(Scene *scene, CacheFile *cache_file, char *r_filepath)
+bool BKE_cachefile_filepath_get(CacheFile *cache_file, float frame, char *r_filepath)
 {
-	const float frame = BKE_scene_frame_get(scene);
 	BLI_strncpy(r_filepath, cache_file->filepath, 1024);
 
 	/* Ensure absolute paths. */
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index bc0660f..851b092 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -4356,7 +4356,7 @@ static void transformcache_evaluate(bConstraint *con, bConstraintOb *cob, ListBa
 	const float time = BKE_cachefile_time_offset(data->cache_file, frame / FPS);
 
 	char filepath[FILE_MAX];
-	BKE_cachefile_filepath_get(scene, data->cache_file, filepath);
+	BKE_cachefile_filepath_get(data->cache_file, frame, filepath);
 
 	ABC_get_transform(cob->ob, filepath, data->abc_object_path,
 	                  cob->matrix, time, data->scale);
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index 8954074..743c96e 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -73,13 +73,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 	MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
 
 	Scene *scene = md->scene;
+	const float frame = BKE_scene_frame_get(scene);
 
 	char filepath[1024];
-	if (!BKE_cachefile_filepath_get(scene, mcmd->cache_file, filepath)) {
+	if (!BKE_cachefile_filepath_get(mcmd->cache_file, frame, filepath)) {
 		return dm;
 	}
 
-	const float frame = BKE_scene_frame_get(scene);
 	const float time = BKE_cachefile_time_offset(mcmd->cache_file, frame / FPS);
 
 	DerivedMesh *result = ABC_read_mesh(dm,




More information about the Bf-blender-cvs mailing list