[Bf-blender-cvs] [e9bb018a4ae] blender2.8: Merge branch 'master' into blender2.8

Bastien Montagne noreply at git.blender.org
Wed Apr 5 10:02:45 CEST 2017


Commit: e9bb018a4aea1b4aeb692cdadce158496a270e32
Author: Bastien Montagne
Date:   Wed Apr 5 10:02:25 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBe9bb018a4aea1b4aeb692cdadce158496a270e32

Merge branch 'master' into blender2.8

Conflicts:
	source/blender/alembic/intern/abc_exporter.h

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



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

diff --cc source/blender/alembic/intern/abc_exporter.h
index 80fee067c04,f9fde99acd4..cf2a3432da9
--- a/source/blender/alembic/intern/abc_exporter.h
+++ b/source/blender/alembic/intern/abc_exporter.h
@@@ -43,7 -43,7 +45,8 @@@ struct ExportSettings 
  	ExportSettings();
  
  	Scene *scene;
 +	SceneLayer *sl;  // Scene layer to export; all its objects will be exported, unless selected_only=true
+ 	SimpleLogger logger;
  
  	bool selected_only;
  	bool visible_layers_only;
diff --cc source/blender/alembic/intern/alembic_capi.cc
index ee8ec0fa68c,6c6f64e1669..20bdeeb96a7
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@@ -331,14 -336,23 +336,30 @@@ void ABC_export
  	job->bmain = CTX_data_main(C);
  	BLI_strncpy(job->filename, filepath, 1024);
  
+ 	/* Alright, alright, alright....
+ 	 *
+ 	 * ExportJobData contains an ExportSettings containing a SimpleLogger.
+ 	 *
+ 	 * Since ExportJobData is a C-style struct dynamically allocated with
+ 	 * MEM_mallocN (see above), its construtor is never called, therefore the
+ 	 * ExportSettings constructor is not called which implies that the
+ 	 * SimpleLogger one is not called either. SimpleLogger in turn does not call
+ 	 * the constructor of its data members which ultimately means that its
+ 	 * std::ostringstream member has a NULL pointer. To be able to properly use
+ 	 * the stream's operator<<, the pointer needs to be set, therefore we have
+ 	 * to properly construct everything. And this is done using the placement
+ 	 * new operator as here below. It seems hackish, but I'm too lazy to
+ 	 * do bigger refactor and maybe there is a better way which does not involve
+ 	 * hardcore refactoring. */
+ 	new (&job->settings) ExportSettings();
  	job->settings.scene = job->scene;
 +
 +	/* Sybren: for now we only export the active scene layer.
 +	 * Later in the 2.8 development process this may be replaced by using
 +	 * a specific collection for Alembic I/O, which can then be toggled
 +	 * between "real" objects and cached Alembic files. */
 +	job->settings.sl = CTX_data_scene_layer(C);
 +
  	job->settings.frame_start = params->frame_start;
  	job->settings.frame_end = params->frame_end;
  	job->settings.frame_step_xform = params->frame_step_xform;




More information about the Bf-blender-cvs mailing list