[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50042] branches/soc-2012-bratwurst/source /blender: - bf_fbx: expose more of assimp's fbx import settings to Blender.

Alexander Gessler alexander.gessler at gmx.net
Mon Aug 20 14:50:32 CEST 2012


Revision: 50042
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50042
Author:   aramis_acg
Date:     2012-08-20 12:50:31 +0000 (Mon, 20 Aug 2012)
Log Message:
-----------
- bf_fbx: expose more of assimp's fbx import settings to Blender.

Modified Paths:
--------------
    branches/soc-2012-bratwurst/source/blender/fbx/bfbx.cpp
    branches/soc-2012-bratwurst/source/blender/fbx/bfbx.h
    branches/soc-2012-bratwurst/source/blender/windowmanager/intern/wm_operators.c

Modified: branches/soc-2012-bratwurst/source/blender/fbx/bfbx.cpp
===================================================================
--- branches/soc-2012-bratwurst/source/blender/fbx/bfbx.cpp	2012-08-20 12:41:46 UTC (rev 50041)
+++ branches/soc-2012-bratwurst/source/blender/fbx/bfbx.cpp	2012-08-20 12:50:31 UTC (rev 50042)
@@ -56,9 +56,13 @@
 
 		bassimp::SceneImporter imp(filepath,*C,settings->assimp_settings);
 
-		//Assimp::Importer& ai_imp = imp.get_importer();
-		//importer.SetPropertyInteger(AI_CONFIG_IMPORT_FBX_STRICT_MODE,settings->strict_mode);
+		Assimp::Importer& ai_imp = imp.get_importer();
+		ai_imp.SetPropertyInteger(AI_CONFIG_IMPORT_FBX_STRICT_MODE,settings->strict_mode);
 
+		ai_imp.SetPropertyInteger(AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS,settings->all_geo_layers);
+		ai_imp.SetPropertyInteger(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES,settings->drop_dummy_anims);
+		ai_imp.SetPropertyInteger(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS,settings->preserve_pivot_nodes);
+
 		return imp.import() != 0 && imp.apply() != 0;
 	}
 

Modified: branches/soc-2012-bratwurst/source/blender/fbx/bfbx.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/fbx/bfbx.h	2012-08-20 12:41:46 UTC (rev 50041)
+++ branches/soc-2012-bratwurst/source/blender/fbx/bfbx.h	2012-08-20 12:50:31 UTC (rev 50042)
@@ -44,6 +44,18 @@
 		 * mode the importer attempts to make the best out of the data it gets.*/
 		int strict_mode;
 
+		/* specifies that the importer will attempt to read all geometry layers
+		 * present in the source file. Some fbx files may only contain useful
+		 * data in their first geometry channel. */
+		int all_geo_layers;
+
+		/* drop dummy/empty animation curves */
+		int drop_dummy_anims;
+
+		/* always preserve the pivot points from the input file, even if
+		 * this involves creating dummy nodes. */
+		int preserve_pivot_nodes;
+
 	} bfbx_import_settings;
 
 

Modified: branches/soc-2012-bratwurst/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/windowmanager/intern/wm_operators.c	2012-08-20 12:41:46 UTC (rev 50041)
+++ branches/soc-2012-bratwurst/source/blender/windowmanager/intern/wm_operators.c	2012-08-20 12:50:31 UTC (rev 50042)
@@ -2257,6 +2257,9 @@
 	settings.assimp_settings.enableAssimpLog = 1;
 
 	settings.strict_mode = 0;
+	settings.all_geo_layers = 1;
+	settings.drop_dummy_anims = 1;
+	settings.preserve_pivot_nodes = 0;
 
 	if (bfbx_import(C, filename, &settings)) { 
 		return OPERATOR_FINISHED;




More information about the Bf-blender-cvs mailing list