Import settings persistence

Adds new settings to ColladaUtils::ImportSettings and TSShapeConstructor::ImportSettings for persistence. Shape will now be re-imported with the original settings if the source art is newer or the cached.dts file has been deleted.
Fixes material transparency blend mode assignment.
Adds implementation for override scale, material prefix and always/never import options.
Reads and applies metadata fields for scale and up axis from formats that provide it.
Eliminates the assimp.log file and redirects log messages to console.log. Verbose logging is enabled in debug builds.
This commit is contained in:
OTHGMars 2019-05-21 01:18:27 -04:00
parent 45f631b5e5
commit 2eaa917e00
10 changed files with 575 additions and 141 deletions

View file

@ -81,6 +81,13 @@ namespace ColladaUtils
NumLodTypes
};
enum eAnimTimingType
{
FrameCount = 0,
Seconds = 1,
Milliseconds = 1000
};
domUpAxisType upAxis; // Override for the collada <up_axis> element
F32 unit; // Override for the collada <unit> element
eLodType lodType; // LOD type option
@ -96,6 +103,22 @@ namespace ColladaUtils
bool forceUpdateMaterials; // Force update of materials.cs
bool useDiffuseNames; // Use diffuse texture as the material name
// Assimp specific preprocess import options
bool convertLeftHanded; // Convert to left handed coordinate system.
bool calcTangentSpace; // Calculate tangents and bitangents, if possible.
bool genUVCoords; // Convert spherical, cylindrical, box and planar mapping to proper UVs.
bool transformUVCoords; // Preprocess UV transformations (scaling, translation ...)
bool flipUVCoords; // This step flips all UV coordinates along the y-axis and adjusts material settings
// and bitangents accordingly.\nAssimp uses TL(0,0):BR(1,1). T3D uses TL(0,1):BR(1,0).
bool findInstances; // Search for instanced meshes and remove them by references to one master.
bool limitBoneWeights; // Limit bone weights to 4 per vertex.
bool joinIdenticalVerts; // Identifies and joins identical vertex data sets within all imported meshes.
bool reverseWindingOrder; // This step adjusts the output face winding order to be clockwise. The default face winding order is counter clockwise.
bool invertNormals; // Reverse the normal vector direction for all normals.
bool removeRedundantMats; // Removes redundant materials.
eAnimTimingType animTiming; // How to import timing data as frames, seconds or milliseconds
S32 animFPS; // FPS value to use if timing is set in frames and the animations does not have an fps set
ImportOptions()
{
reset();
@ -117,6 +140,20 @@ namespace ColladaUtils
adjustFloor = false;
forceUpdateMaterials = false;
useDiffuseNames = false;
convertLeftHanded = false;
calcTangentSpace = false;
genUVCoords = false;
transformUVCoords = false;
flipUVCoords = true;
findInstances = false;
limitBoneWeights = false;
joinIdenticalVerts = true;
reverseWindingOrder = true;
invertNormals = false;
removeRedundantMats = true;
animTiming = Seconds;
animFPS = 30;
}
};