[Bf-blender-cvs] [0267ae9] openvdb: Cleanups:

Kévin Dietrich noreply at git.blender.org
Sun Jun 7 11:38:46 CEST 2015


Commit: 0267ae96a24975df7f7b8978eaf6739127fbf792
Author: Kévin Dietrich
Date:   Sun Jun 7 02:29:40 2015 +0200
Branches: openvdb
https://developer.blender.org/rB0267ae96a24975df7f7b8978eaf6739127fbf792

Cleanups:

- automatically add an underscore to the filename before the frame
number in the filename instead.
- rename "string" -> "r_filename" argument
- removed useless NULL check

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

M	source/blender/blenkernel/BKE_smoke.h
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/editors/object/object_modifier.c

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

diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h
index eca5a45..74cc1c2 100644
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -66,6 +66,6 @@ void smokeModifier_OpenVDB_update_transform(struct SmokeModifierData *smd,
 void smokeModifier_OpenVDB_import(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob);
 
 struct OpenVDBCache *BKE_openvdb_get_current_cache(struct SmokeDomainSettings *sds);
-void BKE_openvdb_cache_filename(char *string, const char *path, const char *fname, const char *relbase, int frame);
+void BKE_openvdb_cache_filename(char *r_filename, const char *path, const char *fname, const char *relbase, int frame);
 
 #endif /* __BKE_SMOKE_H__ */
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 0e75f0e..f15fb01 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -3123,14 +3123,10 @@ static void OpenVDB_write_fluid_settings(SmokeDomainSettings *sds, struct OpenVD
 	OpenVDBWriter_add_meta_mat4(writer, "obmat", sds->obmat);
 }
 
-void BKE_openvdb_cache_filename(char *string, const char *path, const char *fname, const char *relbase, int frame)
+void BKE_openvdb_cache_filename(char *r_filename, const char *path, const char *fname, const char *relbase, int frame)
 {
 	char cachepath[FILE_MAX];
 
-	if (string == NULL) {
-		return;
-	}
-
 	BLI_strncpy(cachepath, path, FILE_MAX - 10);
 	BLI_path_abs(cachepath, relbase);
 
@@ -3138,9 +3134,10 @@ void BKE_openvdb_cache_filename(char *string, const char *path, const char *fnam
 		BLI_dir_create_recursive(cachepath);
 	}
 
-	BLI_join_dirfile(string, sizeof(cachepath), cachepath, fname);
-	BLI_path_frame(string, frame, 4);
-	BLI_ensure_extension(string, FILE_MAX, ".vdb");
+	BLI_join_dirfile(r_filename, sizeof(cachepath), cachepath, fname);
+	BLI_path_suffix(r_filename, FILE_MAX, "", "_");
+	BLI_path_frame(r_filename, frame, 4);
+	BLI_ensure_extension(r_filename, FILE_MAX, ".vdb");
 }
 
 static void OpenVDB_export_smoke(SmokeDomainSettings *sds, struct OpenVDBWriter *writer)
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 5ab677d..ddf5cd8 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2548,7 +2548,7 @@ static OpenVDBCache *openvdb_cache_new(void)
 	cache->endframe = 250;
 	cache->compression = VDB_COMPRESSION_ZIP;
 
-	BLI_strncpy(cache->name, "openvdb_smoke_export_", sizeof(cache->name));
+	BLI_strncpy(cache->name, "openvdb_smoke_export", sizeof(cache->name));
 
 	return cache;
 }




More information about the Bf-blender-cvs mailing list