[Bf-blender-cvs] [2392ee9] alembic_pointcache: Test for NULL archive pointer when writing as well.

Lukas Tönne noreply at git.blender.org
Wed Mar 18 14:13:20 CET 2015


Commit: 2392ee950504513bfebaa596298b9b01a52a17c0
Author: Lukas Tönne
Date:   Wed Mar 18 14:12:16 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB2392ee950504513bfebaa596298b9b01a52a17c0

Test for NULL archive pointer when writing as well.

This should not usually happen because the operator asks for permission
to delete the file prior to writing, but should be checked nevertheless.

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

M	source/blender/editors/io/io_cache_library.c

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

diff --git a/source/blender/editors/io/io_cache_library.c b/source/blender/editors/io/io_cache_library.c
index 87fe9d7..b42f70c 100644
--- a/source/blender/editors/io/io_cache_library.c
+++ b/source/blender/editors/io/io_cache_library.c
@@ -284,15 +284,17 @@ static void cache_library_bake_startjob(void *customdata, short *stop, short *do
 	BKE_cache_archive_path(data->cachelib->filepath, (ID *)data->cachelib, data->cachelib->id.lib, filename, sizeof(filename));
 	data->archive = PTC_open_writer_archive(scene, filename);
 	
-	data->writer = PTC_writer_dupligroup(data->group->id.name, &data->eval_ctx, scene, data->group);
-	PTC_writer_init(data->writer, data->archive);
-	
-	G.is_break = false;
-	
-	/* XXX where to get this from? */
-	start_frame = scene->r.sfra;
-	end_frame = scene->r.efra;
-	PTC_bake(data->bmain, scene, &data->eval_ctx, data->writer, start_frame, end_frame, stop, do_update, progress);
+	if (data->archive) {
+		data->writer = PTC_writer_dupligroup(data->group->id.name, &data->eval_ctx, scene, data->group);
+		PTC_writer_init(data->writer, data->archive);
+		
+		G.is_break = false;
+		
+		/* XXX where to get this from? */
+		start_frame = scene->r.sfra;
+		end_frame = scene->r.efra;
+		PTC_bake(data->bmain, scene, &data->eval_ctx, data->writer, start_frame, end_frame, stop, do_update, progress);
+	}
 	
 	*do_update = true;
 	*stop = 0;




More information about the Bf-blender-cvs mailing list