[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49909] branches/soc-2012-bratwurst/extern /assimp: - merge https://github.com/acgessler/ assimp-gsoc2012-fbx - this exposes the import settings of the fbx importer via the regular aiConfig interface .
Alexander Gessler
alexander.gessler at gmx.net
Wed Aug 15 04:42:41 CEST 2012
Revision: 49909
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49909
Author: aramis_acg
Date: 2012-08-15 02:42:38 +0000 (Wed, 15 Aug 2012)
Log Message:
-----------
- merge https://github.com/acgessler/assimp-gsoc2012-fbx - this exposes the import settings of the fbx importer via the regular aiConfig interface.
Modified Paths:
--------------
branches/soc-2012-bratwurst/extern/assimp/code/FBXConverter.cpp
branches/soc-2012-bratwurst/extern/assimp/code/FBXImporter.cpp
branches/soc-2012-bratwurst/extern/assimp/code/FBXTokenizer.h
branches/soc-2012-bratwurst/extern/assimp/include/assimp/config.h
branches/soc-2012-bratwurst/extern/assimp/include/assimp/postprocess.h
Modified: branches/soc-2012-bratwurst/extern/assimp/code/FBXConverter.cpp
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/code/FBXConverter.cpp 2012-08-14 23:37:19 UTC (rev 49908)
+++ branches/soc-2012-bratwurst/extern/assimp/code/FBXConverter.cpp 2012-08-15 02:42:38 UTC (rev 49909)
@@ -231,9 +231,14 @@
// attach sub-nodes
ConvertNodes(model->ID(), *nodes_chain.back(), new_abs_transform);
- ConvertLights(*model);
- ConvertCameras(*model);
+ if(doc.Settings().readLights) {
+ ConvertLights(*model);
+ }
+ if(doc.Settings().readCameras) {
+ ConvertCameras(*model);
+ }
+
nodes.push_back(nodes_chain.front());
nodes_chain.clear();
}
Modified: branches/soc-2012-bratwurst/extern/assimp/code/FBXImporter.cpp
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/code/FBXImporter.cpp 2012-08-14 23:37:19 UTC (rev 49908)
+++ branches/soc-2012-bratwurst/extern/assimp/code/FBXImporter.cpp 2012-08-15 02:42:38 UTC (rev 49909)
@@ -123,7 +123,15 @@
// Setup configuration properties for the loader
void FBXImporter::SetupProperties(const Importer* pImp)
{
- // no tweakables yet
+ settings.readAllLayers = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS, true);
+ settings.readAllMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS, false);
+ settings.readMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_MATERIALS, true);
+ settings.readCameras = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_CAMERAS, true);
+ settings.readLights = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_LIGHTS, true);
+ settings.readAnimations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS, true);
+ settings.strictMode = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_STRICT_MODE, false);
+ settings.preservePivots = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, true);
+ settings.optimizeEmptyAnimationCurves = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, true);
}
Modified: branches/soc-2012-bratwurst/extern/assimp/code/FBXTokenizer.h
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/code/FBXTokenizer.h 2012-08-14 23:37:19 UTC (rev 49908)
+++ branches/soc-2012-bratwurst/extern/assimp/code/FBXTokenizer.h 2012-08-15 02:42:38 UTC (rev 49909)
@@ -83,18 +83,18 @@
class Token
{
-private:
-
- static const unsigned int BINARY_MARKER = static_cast<unsigned int>(-1);
-
+private:
+
+ static const unsigned int BINARY_MARKER = static_cast<unsigned int>(-1);
+
public:
- /** construct a textual token */
+ /** construct a textual token */
Token(const char* sbegin, const char* send, TokenType type, unsigned int line, unsigned int column);
-
- /** construct a binary token */
- Token(const char* sbegin, const char* send, TokenType type, unsigned int offset);
-
+
+ /** construct a binary token */
+ Token(const char* sbegin, const char* send, TokenType type, unsigned int offset);
+
~Token();
public:
@@ -105,10 +105,10 @@
public:
- bool IsBinary() const {
- return column == BINARY_MARKER;
- }
-
+ bool IsBinary() const {
+ return column == BINARY_MARKER;
+ }
+
const char* begin() const {
return sbegin;
}
@@ -121,18 +121,18 @@
return type;
}
- unsigned int Offset() const {
- ai_assert(IsBinary());
- return offset;
- }
-
+ unsigned int Offset() const {
+ ai_assert(IsBinary());
+ return offset;
+ }
+
unsigned int Line() const {
- ai_assert(!IsBinary());
+ ai_assert(!IsBinary());
return line;
}
unsigned int Column() const {
- ai_assert(!IsBinary());
+ ai_assert(!IsBinary());
return column;
}
@@ -149,11 +149,11 @@
const char* const send;
const TokenType type;
- union {
- const unsigned int line;
- unsigned int offset;
- };
- const unsigned int column;
+ union {
+ const unsigned int line;
+ unsigned int offset;
+ };
+ const unsigned int column;
};
// XXX should use C++11's unique_ptr - but assimp's need to keep working with 03
@@ -173,17 +173,17 @@
void Tokenize(TokenList& output_tokens, const char* input);
-/** Tokenizer function for binary FBX files.
- *
- * Emits a token list suitable for direct parsing.
- *
- * @param output_tokens Receives a list of all tokens in the input data.
- * @param input_buffer Binary input buffer to be processed.
- * @param length Length of input buffer, in bytes. There is no 0-terminal.
- * @throw DeadlyImportError if something goes wrong */
-void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int length);
-
-
+/** Tokenizer function for binary FBX files.
+ *
+ * Emits a token list suitable for direct parsing.
+ *
+ * @param output_tokens Receives a list of all tokens in the input data.
+ * @param input_buffer Binary input buffer to be processed.
+ * @param length Length of input buffer, in bytes. There is no 0-terminal.
+ * @throw DeadlyImportError if something goes wrong */
+void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int length);
+
+
} // ! FBX
} // ! Assimp
Modified: branches/soc-2012-bratwurst/extern/assimp/include/assimp/config.h
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/include/assimp/config.h 2012-08-14 23:37:19 UTC (rev 49908)
+++ branches/soc-2012-bratwurst/extern/assimp/include/assimp/config.h 2012-08-15 02:42:38 UTC (rev 49909)
@@ -512,6 +512,100 @@
// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will merge all geometry layers present
+ * in the source file or take only the first.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS \
+ "IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will read all materials present in the
+ * source file or take only the referenced materials.
+ *
+ * This is void unless IMPORT_FBX_READ_MATERIALS=1.
+ *
+ * The default value is false (0)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS \
+ "IMPORT_FBX_READ_ALL_MATERIALS"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will read materials.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_READ_MATERIALS \
+ "IMPORT_FBX_READ_MATERIALS"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will read cameras.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_READ_CAMERAS \
+ "IMPORT_FBX_READ_CAMERAS"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will read light sources.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_READ_LIGHTS \
+ "IMPORT_FBX_READ_LIGHTS"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will read animations.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS \
+ "IMPORT_FBX_READ_ANIMATIONS"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will act in strict mode in which only
+ * FBX 2013 is supported and any other sub formats are rejected. FBX 2013
+ * is the primary target for the importer, so this format is best
+ * supported and well-tested.
+ *
+ * The default value is false (0)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_STRICT_MODE \
+ "IMPORT_FBX_STRICT_MODE"
+
+// ---------------------------------------------------------------------------
+/** @brief Set whether the fbx importer will preserve pivot points for
+ * transformations (as extra nodes). If set to false, pivots and offsets
+ * will be evaluated whenever possible.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS \
+ "IMPORT_FBX_PRESERVE_PIVOTS"
+
+// ---------------------------------------------------------------------------
+/** @brief Specifies whether the importer will drop empty animation curves or
+ * animation curves which match the bind pose transformation over their
+ * entire defined range.
+ *
+ * The default value is true (1)
+ * Property type: bool
+ */
+#define AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES \
+ "IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES"
+
+
+
+// ---------------------------------------------------------------------------
/** @brief Set the vertex animation keyframe to be imported
*
* ASSIMP does not support vertex keyframes (only bone animation is supported).
Modified: branches/soc-2012-bratwurst/extern/assimp/include/assimp/postprocess.h
===================================================================
--- branches/soc-2012-bratwurst/extern/assimp/include/assimp/postprocess.h 2012-08-14 23:37:19 UTC (rev 49908)
+++ branches/soc-2012-bratwurst/extern/assimp/include/assimp/postprocess.h 2012-08-15 02:42:38 UTC (rev 49909)
@@ -620,7 +620,6 @@
aiProcess_FindInstances | \
aiProcess_ValidateDataStructure | \
aiProcess_OptimizeMeshes | \
- aiProcess_Debone | \
0 )
More information about the Bf-blender-cvs
mailing list