- Bugfix: XFileImporter now throws an error if the file is ill-formatted and thus perceived as empty

- documented data structure updated
- added WIN32 define to all project configurations to fix Win32Logger compilation error.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@14 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
ulfjorensen 2008-05-11 12:54:16 +00:00
parent d499823c67
commit 47d16d33b4
3 changed files with 45 additions and 23 deletions

View File

@ -103,6 +103,10 @@ void XFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, I
// and create the proper return structures out of it // and create the proper return structures out of it
CreateDataRepresentationFromImport( pScene, parser.GetImportedData()); CreateDataRepresentationFromImport( pScene, parser.GetImportedData());
// if nothing came from it, report it as error
if( !pScene->mRootNode)
throw new ImportErrorException( "XFile is ill-formatted - no content imported.");
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -136,7 +140,8 @@ void XFileImporter::CreateDataRepresentationFromImport( aiScene* pScene, const X
} }
// convert the root node's transformation to OGL coords // convert the root node's transformation to OGL coords
ConvertToLHProcess::ConvertToOGL( pScene->mRootNode->mTransformation); if( pScene->mRootNode)
ConvertToLHProcess::ConvertToOGL( pScene->mRootNode->mTransformation);
// finally: create a dummy material if not material was imported // finally: create a dummy material if not material was imported
if( pScene->mNumMaterials == 0) if( pScene->mNumMaterials == 0)

View File

@ -1,41 +1,52 @@
<importedScene alias data alias Model?> <importedScene>
<version 1.2 /> <smiley code=":-)" /> <version 1.2 /> <smiley code=":-)" />
<frame alias object> <node>
<name/> <name/>
<transformation matrix4x4 /> <transformation matrix4x4 />
<mesh id="1" /> <mesh refid="0" />
<mesh ... /> <mesh ... />
<childframe alias childobject as type frame alias object /> <childnode/>
<childframe... /> <childnode... />
</frame> </node>
<meshes> <meshes>
<mesh id="1"> <mesh id="0">
<meshheader with MatID, Vertexcount, Facecount, a.s.o. /> <meshheader MatID, Vertexcount, Facecount, a.s.o. />
<vertice> <vertices>
<vertex xyzw /> <vertex xyz />
<vertex ... /> <vertex ... />
</vertice> </vertices>
<texturecoords> <texturecoords index="0">
<texturecoord uv /> <texturecoord uv />
<texturecoord ... /> <texturecoord ... />
</texturcoords> </texturecoords>
<vertexcolors> <texturecoords index="..." />
<vertexcolors index="0">
<color rgba /> <color rgba />
<color ... /> <color ... />
</vertexcolors> </vertexcolors>
<vertexcolors index="..." />
<normals> <normals>
<normal xyz /> <normal xyz />
<normal ... /> <normal ... />
</normals> </normals>
<tangents>
<tangent xyz />
<tangent ... />
</tangents>
<bitangents>
<bitangent xyz />
<bitangent ... />
</tangents>
<faces> <faces>
<face p1, p2, p3 /> <face numIndices="3" indices="p1, p2, p3" />
<face ... /> <face ... />
</faces> </faces>
<bones> <bones>
<bone> <bone>
<name /> <name />
<offset matrix4x4 />
<weights> <weights>
<weight v, w /> <weight v, w />
<weight... /> <weight... />
@ -48,7 +59,7 @@
</meshes> </meshes>
<anims> <anims>
<anim name="rudern" duration="4500" ticksPerSecond="50"> <anim name="rudern" duration="4500" ticksPerSecond="50">
<animbone name="bla"> <animbone nameOfAnimatedNode="bla">
<rotation> <rotation>
<rotkey time="0" rot="xyzw" /> <rotkey time="0" rot="xyzw" />
<rotkey time="100" rot="xyzw" /> <rotkey time="100" rot="xyzw" />
@ -65,7 +76,7 @@
... ...
<scaling> <scaling>
</animbone> </animbone>
<animbone name="blubb"> <animbone nameOfAnimatedNode="blubb">
... ...
</animbone> </animbone>
</anim> </anim>
@ -80,4 +91,10 @@
</material> </material>
<material ... /> <material ... />
</materials> </materials>
</importedScene alias data alias model?> <textures>
</texture width, height, formatHint>
<data />
</texture>
<texture ... />
</textures>
</importedScene>

View File

@ -39,7 +39,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../../include" AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="DEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="DEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS,WIN32"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
SmallerTypeCheck="true" SmallerTypeCheck="true"
RuntimeLibrary="1" RuntimeLibrary="1"
@ -103,7 +103,7 @@
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../../include" AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="NDEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="NDEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS,WIN32"
StringPooling="true" StringPooling="true"
BufferSecurityCheck="false" BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2" EnableEnhancedInstructionSet="2"
@ -165,7 +165,7 @@
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../../include" AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="NDEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="NDEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS,WIN32"
StringPooling="true" StringPooling="true"
BufferSecurityCheck="false" BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2" EnableEnhancedInstructionSet="2"
@ -234,7 +234,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../../include" AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="DEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="DEBUG, _SCL_SECURE_NO_WARNINGS, _CRT_SECURE_NO_WARNINGS,WIN32"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
SmallerTypeCheck="true" SmallerTypeCheck="true"
RuntimeLibrary="1" RuntimeLibrary="1"