-
Parameter |
Long parameter |
@@ -432,13 +431,13 @@ more information can be found in the aiPostProcess.h header.
Improve the cache locality of the vertex buffer by reordering the index buffer
to achieve a lower ACMR (average post-transform vertex cache miss ratio) |
-
+
-sbpt |
--sort-by-ptype |
Splits meshes which consist of more than one kind of primitives (e.g. lines and triangles mixed up)
in 'clean' submeshes. |
-
+
-lh |
--convert-to-lh |
Converts the imported data to left-handed coordinate space |
@@ -479,19 +478,47 @@ more information can be found in the aiPostProcess.h header.
Search the data structure for instanced meshes and replace them by references. This can
reduce vertex/face counts but the postprocessing-step takes some time. |
-
-
+
-og |
--optimize-graph |
Simplify and optimize the scenegraph. Use it with care, all hierarchy information could be lost.
Animations remain untouched. |
-
-
+
-om |
- --optimize-mesh |
+ --optimize-meshes |
Optimize mesh usage. Meshes are merged, if possible. Very effective in combination with --optimize-graph |
+
+ -tuv |
+ --transform-uv-coords |
+ Will transform uv-coordinates if possible. |
+
+
+ -guv |
+ --gen-uvcoords |
+ Will generate uv-coordinates for textures if possible. |
+
+
+ -fid |
+ --find-invalid-data |
+ Will look for invalid data in the imported model structure. |
+
+
+ -fixn |
+ --fix normals |
+ Imported normal vector will be fixed. |
+
+
+ -db |
+ --debone |
+ Removes nearly losslessly or according to a configured threshold bones from the model. |
+
+
+ -sbc |
+ --split-by-bone-count |
+ Split meshes with too many bones. Necessary for our (limited) hardware skinning shader. |
+
For convenience some default postprocessing configurations are provided.
diff --git a/include/assimp/material.h b/include/assimp/material.h
index 4fb20edd5..9eb76a80f 100644
--- a/include/assimp/material.h
+++ b/include/assimp/material.h
@@ -714,30 +714,33 @@ public:
// -------------------------------------------------------------------
/** Helper function to get all parameters pertaining to a
* particular texture slot from a material.
- *
- * This function is provided just for convenience, you could also
- * read the single material properties manually.
- * @param type Specifies the type of the texture to be retrieved (
- * e.g. diffuse, specular, height map ...)
- * @param index Index of the texture to be retrieved. The function fails
- * if there is no texture of that type with this index.
- * #GetTextureCount() can be used to determine the number of textures
- * per texture type.
- * @param path Receives the path to the texture.
- * NULL is a valid value.
- * @param mapping The texture mapping.
- * NULL is allowed as value.
- * @param uvindex Receives the UV index of the texture.
- * NULL is a valid value.
- * @param blend Receives the blend factor for the texture
- * NULL is a valid value.
- * @param op Receives the texture operation to be performed between
- * this texture and the previous texture. NULL is allowed as value.
- * @param mapmode Receives the mapping modes to be used for the texture.
- * The parameter may be NULL but if it is a valid pointer it MUST
- * point to an array of 3 aiTextureMapMode's (one for each
- * axis: UVW order (=XYZ)).
- */
+ *
+ * This function is provided just for convenience, you could also
+ * read the single material properties manually.
+ * @param type Specifies the type of the texture to be retrieved (
+ * e.g. diffuse, specular, height map ...)
+ * @param index Index of the texture to be retrieved. The function fails
+ * if there is no texture of that type with this index.
+ * #GetTextureCount() can be used to determine the number of textures
+ * per texture type.
+ * @param path Receives the path to the texture.
+ * If the texture is embedded, receives a '*' followed by the id of
+ * the texture (for the textures stored in the corresponding scene) which
+ * can be converted to an int using a function like atoi.
+ * NULL is a valid value.
+ * @param mapping The texture mapping.
+ * NULL is allowed as value.
+ * @param uvindex Receives the UV index of the texture.
+ * NULL is a valid value.
+ * @param blend Receives the blend factor for the texture
+ * NULL is a valid value.
+ * @param op Receives the texture operation to be performed between
+ * this texture and the previous texture. NULL is allowed as value.
+ * @param mapmode Receives the mapping modes to be used for the texture.
+ * The parameter may be NULL but if it is a valid pointer it MUST
+ * point to an array of 3 aiTextureMapMode's (one for each
+ * axis: UVW order (=XYZ)).
+ */
// -------------------------------------------------------------------
aiReturn GetTexture(aiTextureType type,
unsigned int index,
@@ -1506,7 +1509,10 @@ ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMa
* #aiGetMaterialTextureCount() can be used to determine the number of
* textures in a particular texture stack.
* @param[out] path Receives the output path
- * This parameter must be non-null.
+ * If the texture is embedded, receives a '*' followed by the id of
+ * the texture (for the textures stored in the corresponding scene) which
+ * can be converted to an int using a function like atoi.
+ * This parameter must be non-null.
* @param mapping The texture mapping mode to be used.
* Pass NULL if you're not interested in this information.
* @param[out] uvindex For UV-mapped textures: receives the index of the UV
diff --git a/test/unit/utDefaultIOStream.cpp b/test/unit/utDefaultIOStream.cpp
index a4461ea5f..7d3c07f20 100644
--- a/test/unit/utDefaultIOStream.cpp
+++ b/test/unit/utDefaultIOStream.cpp
@@ -48,7 +48,12 @@ class utDefaultIOStream : public ::testing::Test {
class TestDefaultIOStream : public DefaultIOStream {
public:
TestDefaultIOStream()
- : DefaultIOStream() {
+ : DefaultIOStream() {
+ // empty
+ }
+
+ TestDefaultIOStream( FILE* pFile, const std::string &strFilename )
+ : DefaultIOStream( pFile, strFilename ) {
// empty
}
@@ -58,7 +63,14 @@ public:
};
TEST_F( utDefaultIOStream, FileSizeTest ) {
- TestDefaultIOStream myStream;
+ char buffer[ L_tmpnam ];
+ tmpnam( buffer );
+ std::FILE *fs( std::fopen( buffer, "w+" ) );
+ size_t written( std::fwrite( buffer, 1, sizeof( char ) * L_tmpnam, fs ) );
+ std::fflush( fs );
+
+ TestDefaultIOStream myStream( fs, buffer );
size_t size = myStream.FileSize();
- EXPECT_EQ( size, 0 );
+ EXPECT_EQ( size, sizeof( char ) * L_tmpnam );
+ remove( buffer );
}
diff --git a/tools/assimp_cmd/Main.cpp b/tools/assimp_cmd/Main.cpp
index cb6f32834..9c5368bf5 100644
--- a/tools/assimp_cmd/Main.cpp
+++ b/tools/assimp_cmd/Main.cpp
@@ -378,7 +378,6 @@ int ProcessStandardArguments(
// -fixn --fix normals
// -tri --triangulate
// -fi --find-instances
- // -fi --find-instances
// -og --optimize-graph
// -om --optimize-meshes
// -db --debone
diff --git a/tools/assimp_view/assimp_view.h b/tools/assimp_view/assimp_view.h
index 7676b57f9..6300c1a87 100644
--- a/tools/assimp_view/assimp_view.h
+++ b/tools/assimp_view/assimp_view.h
@@ -71,14 +71,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../../code/MaterialSystem.h" // aiMaterial class
#include "../../code/StringComparison.h" // ASSIMP_stricmp and ASSIMP_strincmp
-// in order for std::min and std::max to behave properly
-/*#ifndef max
-#define max(a,b) (((a) > (b)) ? (a) : (b))
-#endif // max
-#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-#endif // min
-*/
#include