diff --git a/16-Assimp_Data_Display/16-Assimp_Data_Display.cpp b/16-Assimp_Data_Display/16-Assimp_Data_Display.cpp index 1a7bc1f7eb7466303e5194d3b913201b82781018..7bf4dde9e8fd132f1e615ecb8c1b38ca4f1a1f31 100644 --- a/16-Assimp_Data_Display/16-Assimp_Data_Display.cpp +++ b/16-Assimp_Data_Display/16-Assimp_Data_Display.cpp @@ -41,249 +41,265 @@ using namespace DirectX; #define ASSIMP_LOAD_FLAGS 0 -VOID GRSPrintfMX(const aiMatrix4x4& aiMatrix) +VOID GRSPrintfMX( const aiMatrix4x4& aiMatrix ) { - GRSPrintfA( - "\n%0.8f\t%0.8f\t%0.8f\t%0.8f\n%0.8f\t%0.8f\t%0.8f\t%0.8f\n%0.8f\t%0.8f\t%0.8f\t%0.8f\n%0.8f\t%0.8f\t%0.8f\t%0.8f\n" - , aiMatrix.a1, aiMatrix.a2, aiMatrix.a3, aiMatrix.a4 - , aiMatrix.b1, aiMatrix.b2, aiMatrix.b3, aiMatrix.b4 - , aiMatrix.c1, aiMatrix.c2, aiMatrix.c3, aiMatrix.c4 - , aiMatrix.d1, aiMatrix.d2, aiMatrix.d3, aiMatrix.d4 - ); + GRSPrintfA( + "\n%11.6f, %11.6f, %11.6f, %11.6f;\n\ +%11.6f, %11.6f, %11.6f, %11.6f;\n\ +%11.6f, %11.6f, %11.6f, %11.6f;\n\ +%11.6f, %11.6f, %11.6f, %11.6f;\n" + , aiMatrix.a1, aiMatrix.a2, aiMatrix.a3, aiMatrix.a4 + , aiMatrix.b1, aiMatrix.b2, aiMatrix.b3, aiMatrix.b4 + , aiMatrix.c1, aiMatrix.c2, aiMatrix.c3, aiMatrix.c4 + , aiMatrix.d1, aiMatrix.d2, aiMatrix.d3, aiMatrix.d4 + ); } -VOID GRSPrintfMX(const aiMatrix4x4& aiMatrix, int iBlank) +VOID GRSPrintfMX( const aiMatrix4x4& aiMatrix, int iBlank ) { - GRSPrintBlank(iBlank); - GRSPrintfA( - "%0.8f\t%0.8f\t%0.8f\t%0.8f\n" - , aiMatrix.a1, aiMatrix.a2, aiMatrix.a3, aiMatrix.a4 - ); - GRSPrintBlank(iBlank); - GRSPrintfA( - "%0.8f\t%0.8f\t%0.8f\t%0.8f\n" - , aiMatrix.b1, aiMatrix.b2, aiMatrix.b3, aiMatrix.b4 - ); - GRSPrintBlank(iBlank); - GRSPrintfA( - "%0.8f\t%0.8f\t%0.8f\t%0.8f\n" - , aiMatrix.c1, aiMatrix.c2, aiMatrix.c3, aiMatrix.c4 - ); - GRSPrintBlank(iBlank); - GRSPrintfA( - "%0.8f\t%0.8f\t%0.8f\t%0.8f\n" - , aiMatrix.d1, aiMatrix.d2, aiMatrix.d3, aiMatrix.d4 - ); + GRSPrintBlank( iBlank ); + GRSPrintfA( + "%11.6f, %11.6f, %11.6f, %11.6f;\n" + , aiMatrix.a1, aiMatrix.a2, aiMatrix.a3, aiMatrix.a4 + ); + GRSPrintBlank( iBlank ); + GRSPrintfA( + "%11.6f, %11.6f, %11.6f, %11.6f;\n" + , aiMatrix.b1, aiMatrix.b2, aiMatrix.b3, aiMatrix.b4 + ); + GRSPrintBlank( iBlank ); + GRSPrintfA( + "%11.6f, %11.6f, %11.6f, %11.6f;\n" + , aiMatrix.c1, aiMatrix.c2, aiMatrix.c3, aiMatrix.c4 + ); + GRSPrintBlank( iBlank ); + GRSPrintfA( + "%11.6f, %11.6f, %11.6f, %11.6f;\n" + , aiMatrix.d1, aiMatrix.d2, aiMatrix.d3, aiMatrix.d4 + ); } -void ShowSceneFlags(const unsigned int& nFlags); -void ShowMesh(const UINT& nIndex, const aiMesh*& paiMesh); -void ShowMaterial(const UINT& nIndex, const aiMaterial*& paiMaterial); -void ShowAnimations(const aiScene* pModel); -void ShowChannleInfo(const aiNodeAnim* pChannle); -void TraverseNodeTree(const aiNode* pNode, int iBlank); -void ShowTextures(const UINT& nIndex, const aiTexture* paiTexture); -void ShowLights(const UINT& nIndex, const aiLight* paiLight); -void ShowCamera(const UINT& nIndex, const aiCamera* paiCamera); - -int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) +void ShowSceneFlags( const unsigned int& nFlags ); +void ShowMesh( const UINT& nIndex, const aiMesh*& paiMesh ); +void ShowMaterial( const UINT& nIndex, const aiMaterial*& paiMaterial ); +void ShowAnimations( const aiScene* pModel ); +void ShowChannleInfo( const aiNodeAnim* pChannle ); +void TraverseNodeTree( const aiNode* pNode, int iBlank ); +void ShowTextures( const UINT& nIndex, const aiTexture* paiTexture ); +void ShowLights( const UINT& nIndex, const aiLight* paiLight ); +void ShowCamera( const UINT& nIndex, const aiCamera* paiCamera ); +void ShowMetadata( const aiMetadata* paiMetaData ); + +int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) { - try - { - GRSInitConsole(GRS_WND_TITLE); - USES_CONVERSION; - //调整命令行窗口大小 最大化显示 - GRSSetConsoleMax(); - - WCHAR pszAppPath[MAX_PATH] = {}; - // 得到当前的工作目录,方便我们使用相对路径来访问各种资源文件 - { - if (0 == ::GetModuleFileNameW(nullptr, pszAppPath, MAX_PATH)) - { - GRSPrintfW(L"获取当前路径(GetModuleFileNameA)调用失败(%U)!\n", GetLastError()); - AtlThrowLastWin32(); - } - - WCHAR* lastSlash = wcsrchr(pszAppPath, L'\\'); - if (lastSlash) - {//删除Exe文件名 - *(lastSlash) = L'\0'; - } - - lastSlash = wcsrchr(pszAppPath, L'\\'); - if (lastSlash) - {//删除x64路径 - *(lastSlash) = L'\0'; - } - - lastSlash = wcsrchr(pszAppPath, L'\\'); - if (lastSlash) - {//删除Debug 或 Release路径 - *(lastSlash + 1) = L'\0'; - } - } - - CHAR pszAppPathA[MAX_PATH] = {}; - StringCchCopyA(pszAppPathA, MAX_PATH, T2A(pszAppPath)); - GRSPrintfA("当前程序运行环境路径为:\"%s\"\n", pszAppPathA); - - CHAR pXFile[MAX_PATH] = {}; - StringCchPrintfA(pXFile, MAX_PATH, "%Assets\\The3DModel\\hero.x", pszAppPathA); - - OPENFILENAMEA ofn; - RtlZeroMemory(&ofn, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = ::GetConsoleWindow(); - ofn.lpstrFilter = "x 文件\0*.x;*.X\0OBJ文件\0*.obj\0FBX文件\0*.fbx\0所有文件\0*.*\0"; - ofn.lpstrFile = pXFile; - ofn.nMaxFile = MAX_PATH; - ofn.lpstrTitle = "请选择一个x文件..."; - ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; - - if (!GetOpenFileNameA(&ofn)) - { - StringCchPrintfA(pXFile, MAX_PATH, "%Assets\\The3DModel\\hero.x", pszAppPathA); - } - - Assimp::Importer aiImporter; - // 读取x文件 - const aiScene* pModel = aiImporter.ReadFile(pXFile, ASSIMP_LOAD_FLAGS); - if (nullptr == pModel) - { - GRSPrintfA("无法解析文件(%s):%s (%d)\n", pXFile, aiImporter.GetErrorString(), ::GetLastError()); - AtlThrowLastWin32(); - } - - GRSPrintfA("\n开始解析模型文件:\"%s\"", pXFile); - GRSPrintfW(L"\nAssimp File Flags:"); - ShowSceneFlags(pModel->mFlags); - - if (pModel->HasMeshes()) - { - GRSPrintfW(L"\n网格:\nMesh Count[%u]:\n", pModel->mNumMeshes); - GRSConsolePause(); - // 网格 - const aiMesh* paiSubMesh = nullptr; - for (UINT i = 0; i < pModel->mNumMeshes; i++) - { - paiSubMesh = pModel->mMeshes[i]; - ShowMesh(i + 1, paiSubMesh); - GRSConsolePause(); - } - } - else - { - GRSPrintfW(L"该模型中没有网格信息!\n"); - } - - if (pModel->HasMaterials()) - { - GRSPrintfW(L"\n材质:\n"); - GRSConsolePause(); - GRSPrintfW(L"\n"); - - // 材质 - for (UINT i = 0; i < pModel->mNumMaterials; i++) - { - const aiMaterial* paiMaterial = pModel->mMaterials[i]; - ShowMaterial(i, paiMaterial); - } - } - else - { - GRSPrintfW(L"该模型中没有材质信息!\n"); - } - - if (nullptr != pModel->mRootNode) - { - GRSPrintfW(L"\n骨骼:\n"); - GRSConsolePause(); - GRSPrintfW(L"\n"); - // 骨骼 - TraverseNodeTree(pModel->mRootNode, 0); - } - else - { - GRSPrintfW(L"该模型中没有骨骼信息!\n"); - } - - if (pModel->HasAnimations()) - { - GRSPrintfW(L"\n关键帧动画:\n"); - GRSConsolePause(); - GRSPrintfW(L"\n"); - // 动画序列 - ShowAnimations(pModel); - } - else - { - GRSPrintfW(L"该模型中没有关键帧动画信息!\n"); - } - - if (pModel->HasTextures()) - { - GRSPrintfW(L"\n内嵌纹理:\n"); - GRSConsolePause(); - GRSPrintfW(L"\n"); - // 内嵌纹理 - aiTexture* paiTexture = nullptr; - for (UINT i = 0; i < pModel->mNumTextures; i++) - { - paiTexture = pModel->mTextures[i]; - ShowTextures(i, paiTexture); - } - } - else - { - GRSPrintfW(L"该模型中没有内嵌纹理信息!\n"); - } - - // 光源 - if (pModel->HasLights()) - { - GRSPrintfW(L"\n光源:\n"); - GRSConsolePause(); - GRSPrintfW(L"\n"); - for (UINT i = 0; i < pModel->mNumLights; i++) - { - aiLight* paiLight = pModel->mLights[i]; - ShowLights(i, paiLight); - } - } - else - { - GRSPrintfW(L"该模型中没有光源信息!\n"); - } - - - if (pModel->HasCameras()) - { - GRSPrintfW(L"\n相机:\n"); - GRSConsolePause(); - GRSPrintfW(L"\n"); - // 相机 - for (UINT i = 0; i < pModel->mNumCameras; i++) - { - aiCamera* parCamera = pModel->mCameras[i]; - ShowCamera(i, parCamera); - } - } - else - { - GRSPrintfW(L"该模型中没有摄像机信息!\n"); - } - GRSPrintfW(L"解析显示完毕!\n\n"); - } - catch (CAtlException& e) - {//发生了COM异常 - e; - } - catch (...) - { - - } - GRSUninitConsole(); - return 0; + try + { + GRSInitConsole( GRS_WND_TITLE ); + USES_CONVERSION; + //调整命令行窗口大小 最大化显示 + GRSSetConsoleMax(); + + WCHAR pszAppPath[MAX_PATH] = {}; + // 得到当前的工作目录,方便我们使用相对路径来访问各种资源文件 + { + if ( 0 == ::GetModuleFileNameW( nullptr, pszAppPath, MAX_PATH ) ) + { + GRSPrintfW( L"获取当前路径(GetModuleFileNameA)调用失败(%U)!\n", GetLastError() ); + AtlThrowLastWin32(); + } + + WCHAR* lastSlash = wcsrchr( pszAppPath, L'\\' ); + if ( lastSlash ) + {//删除Exe文件名 + *( lastSlash ) = L'\0'; + } + + lastSlash = wcsrchr( pszAppPath, L'\\' ); + if ( lastSlash ) + {//删除x64路径 + *( lastSlash ) = L'\0'; + } + + lastSlash = wcsrchr( pszAppPath, L'\\' ); + if ( lastSlash ) + {//删除Debug 或 Release路径 + *( lastSlash + 1 ) = L'\0'; + } + } + + CHAR pszAppPathA[MAX_PATH] = {}; + StringCchCopyA( pszAppPathA, MAX_PATH, T2A( pszAppPath ) ); + GRSPrintfA( "当前程序运行环境路径为:\"%s\"\n", pszAppPathA ); + + CHAR pXFile[MAX_PATH] = {}; + StringCchPrintfA( pXFile, MAX_PATH, "%Assets\\The3DModel\\hero.x", pszAppPathA ); + + OPENFILENAMEA ofn; + RtlZeroMemory( &ofn, sizeof( ofn ) ); + ofn.lStructSize = sizeof( ofn ); + ofn.hwndOwner = ::GetConsoleWindow(); + ofn.lpstrFilter = "x 文件\0*.x;*.X\0OBJ文件\0*.obj\0FBX文件\0*.fbx\0所有文件\0*.*\0"; + ofn.lpstrFile = pXFile; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrTitle = "请选择一个x文件..."; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; + + if ( !GetOpenFileNameA( &ofn ) ) + { + StringCchPrintfA( pXFile, MAX_PATH, "%Assets\\The3DModel\\hero.x", pszAppPathA ); + } + + Assimp::Importer aiImporter; + // 读取x文件 + const aiScene* pModel = aiImporter.ReadFile( pXFile, ASSIMP_LOAD_FLAGS ); + if ( nullptr == pModel ) + { + GRSPrintfA( "无法解析文件(%s):%s (%d)\n", pXFile, aiImporter.GetErrorString(), ::GetLastError() ); + AtlThrowLastWin32(); + } + + GRSPrintfA( "\n开始解析模型文件:\"%s\"", pXFile ); + GRSPrintfW( L"\nAssimp File Flags:" ); + ShowSceneFlags( pModel->mFlags ); + + if ( pModel->mMetaData ) + { + GRSPrintfW( L"\nMetaData:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + ShowMetadata( pModel->mMetaData ); + } + else + { + GRSPrintfW( L"该模型中没有MetaData信息!\n" ); + } + + if ( pModel->HasMeshes() ) + { + GRSPrintfW( L"\n网格:\nMesh Count[%u]:\n", pModel->mNumMeshes ); + GRSConsolePause(); + // 网格 + const aiMesh* paiSubMesh = nullptr; + for ( UINT i = 0; i < pModel->mNumMeshes; i++ ) + { + paiSubMesh = pModel->mMeshes[i]; + ShowMesh( i + 1, paiSubMesh ); + GRSConsolePause(); + } + } + else + { + GRSPrintfW( L"该模型中没有网格信息!\n" ); + } + + if ( pModel->HasMaterials() ) + { + GRSPrintfW( L"\n材质:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + + // 材质 + for ( UINT i = 0; i < pModel->mNumMaterials; i++ ) + { + const aiMaterial* paiMaterial = pModel->mMaterials[i]; + ShowMaterial( i, paiMaterial ); + } + } + else + { + GRSPrintfW( L"该模型中没有材质信息!\n" ); + } + + if ( nullptr != pModel->mRootNode ) + { + GRSPrintfW( L"\n骨骼:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + // 骨骼 + TraverseNodeTree( pModel->mRootNode, 0 ); + } + else + { + GRSPrintfW( L"该模型中没有骨骼信息!\n" ); + } + + if ( pModel->HasAnimations() ) + { + GRSPrintfW( L"\n关键帧动画:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + // 动画序列 + ShowAnimations( pModel ); + } + else + { + GRSPrintfW( L"该模型中没有关键帧动画信息!\n" ); + } + + if ( pModel->HasTextures() ) + { + GRSPrintfW( L"\n内嵌纹理:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + // 内嵌纹理 + aiTexture* paiTexture = nullptr; + for ( UINT i = 0; i < pModel->mNumTextures; i++ ) + { + paiTexture = pModel->mTextures[i]; + ShowTextures( i, paiTexture ); + } + } + else + { + GRSPrintfW( L"该模型中没有内嵌纹理信息!\n" ); + } + + // 光源 + if ( pModel->HasLights() ) + { + GRSPrintfW( L"\n光源:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + for ( UINT i = 0; i < pModel->mNumLights; i++ ) + { + aiLight* paiLight = pModel->mLights[i]; + ShowLights( i, paiLight ); + } + } + else + { + GRSPrintfW( L"该模型中没有光源信息!\n" ); + } + + + if ( pModel->HasCameras() ) + { + GRSPrintfW( L"\n相机:\n" ); + GRSConsolePause(); + GRSPrintfW( L"\n" ); + // 相机 + for ( UINT i = 0; i < pModel->mNumCameras; i++ ) + { + aiCamera* parCamera = pModel->mCameras[i]; + ShowCamera( i, parCamera ); + } + } + else + { + GRSPrintfW( L"该模型中没有摄像机信息!\n" ); + } + GRSPrintfW( L"解析显示完毕!\n\n" ); + } + catch ( CAtlException& e ) + {//发生了COM异常 + e; + } + catch ( ... ) + { + + } + GRSUninitConsole(); + return 0; } #define GRS_NAME_ANONYMITY "匿名" @@ -291,952 +307,1035 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR l #define GRS_SHOW_VECTOR_2D_FORMAT "(%11.6f,%11.6f)" #define GRS_SHOW_VECTOR_3D_FORMAT "(%11.6f,%11.6f,%11.6f)" #define GRS_SHOW_VECTOR_4D_FORMAT "(%11.6f,%11.6f,%11.6f,%11.6f)" -#define GRS_SHOW_VECTOR_COLS 6 +#define GRS_SHOW_VECTOR_COLS 4 -void ShowSceneFlags(const unsigned int& nFlags) +void ShowSceneFlags( const unsigned int& nFlags ) { - if (nFlags & AI_SCENE_FLAGS_INCOMPLETE) - { - GRSPrintfW(L"AI_SCENE_FLAGS_INCOMPLETE "); - } - - if (nFlags & AI_SCENE_FLAGS_VALIDATED) - { - GRSPrintfW(L"AI_SCENE_FLAGS_VALIDATED "); - } - - if (nFlags & AI_SCENE_FLAGS_VALIDATION_WARNING) - { - GRSPrintfW(L"AI_SCENE_FLAGS_VALIDATION_WARNING "); - } - - if (nFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) - { - GRSPrintfW(L"AI_SCENE_FLAGS_NON_VERBOSE_FORMAT "); - } - - if (nFlags & AI_SCENE_FLAGS_TERRAIN) - { - GRSPrintfW(L"AI_SCENE_FLAGS_TERRAIN "); - } - - if (nFlags & AI_SCENE_FLAGS_ALLOW_SHARED) - { - GRSPrintfW(L"AI_SCENE_FLAGS_ALLOW_SHARED "); - } + if ( nFlags & AI_SCENE_FLAGS_INCOMPLETE ) + { + GRSPrintfW( L"AI_SCENE_FLAGS_INCOMPLETE " ); + } + + if ( nFlags & AI_SCENE_FLAGS_VALIDATED ) + { + GRSPrintfW( L"AI_SCENE_FLAGS_VALIDATED " ); + } + + if ( nFlags & AI_SCENE_FLAGS_VALIDATION_WARNING ) + { + GRSPrintfW( L"AI_SCENE_FLAGS_VALIDATION_WARNING " ); + } + + if ( nFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT ) + { + GRSPrintfW( L"AI_SCENE_FLAGS_NON_VERBOSE_FORMAT " ); + } + + if ( nFlags & AI_SCENE_FLAGS_TERRAIN ) + { + GRSPrintfW( L"AI_SCENE_FLAGS_TERRAIN " ); + } + + if ( nFlags & AI_SCENE_FLAGS_ALLOW_SHARED ) + { + GRSPrintfW( L"AI_SCENE_FLAGS_ALLOW_SHARED " ); + } } -void ShowMeshPrimitive(const unsigned int& emPT) +void ShowMeshPrimitive( const unsigned int& emPT ) { - if (emPT & aiPrimitiveType_POINT) - { - GRSPrintfA("aiPrimitiveType_POINT "); - } - if (emPT & aiPrimitiveType_LINE) - { - GRSPrintfA("aiPrimitiveType_LINE "); - } - if (emPT & aiPrimitiveType_TRIANGLE) - { - GRSPrintfA("aiPrimitiveType_TRIANGLE "); - } - if (emPT & aiPrimitiveType_TRIANGLE) - { - GRSPrintfA("aiPrimitiveType_POLYGON "); - } + if ( emPT & aiPrimitiveType_POINT ) + { + GRSPrintfA( "aiPrimitiveType_POINT " ); + } + if ( emPT & aiPrimitiveType_LINE ) + { + GRSPrintfA( "aiPrimitiveType_LINE " ); + } + if ( emPT & aiPrimitiveType_TRIANGLE ) + { + GRSPrintfA( "aiPrimitiveType_TRIANGLE " ); + } + if ( emPT & aiPrimitiveType_TRIANGLE ) + { + GRSPrintfA( "aiPrimitiveType_POLYGON " ); + } } -void ShowMesh(const UINT& nIndex, const aiMesh*& paiMesh) +void ShowMesh( const UINT& nIndex, const aiMesh*& paiMesh ) { - GRSPrintfA("\nMesh[%u]:\"%s\", Primitive: <" - , nIndex - , paiMesh->mName.length > 0 ? paiMesh->mName.C_Str() : GRS_NAME_ANONYMITY - ); - - ShowMeshPrimitive(paiMesh->mPrimitiveTypes); - GRSPrintfW(L">, 关联 Material Index:[%u]:\n", paiMesh->mMaterialIndex); - - GRSPrintfW(L"AABB:Min" GRS_SHOW_VECTOR_3D_FORMAT L",Max" GRS_SHOW_VECTOR_3D_FORMAT L"\n\n" - , paiMesh->mAABB.mMin.x - , paiMesh->mAABB.mMin.y - , paiMesh->mAABB.mMin.z - , paiMesh->mAABB.mMax.x - , paiMesh->mAABB.mMax.y - , paiMesh->mAABB.mMax.z - ); - - if (paiMesh->mNumVertices > 0) - { - GRSPrintfW(L"Vertex Count[%u]:\n", paiMesh->mNumVertices); - } - - const UINT nCol = GRS_SHOW_VECTOR_COLS; - if (paiMesh->HasPositions()) - { - GRSPrintfW(L"Positions[%u]:\n", paiMesh->mNumVertices); - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " - , i - , paiMesh->mVertices[i].x - , paiMesh->mVertices[i].y - , paiMesh->mVertices[i].z - ); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n"); - } - } - GRSPrintfW(L"\n"); - } - - if (paiMesh->HasNormals()) - { - GRSPrintfW(L"\nNormals[%u]:\n", paiMesh->mNumVertices); - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " - , i - , paiMesh->mNormals[i].x - , paiMesh->mNormals[i].y - , paiMesh->mNormals[i].z); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n"); - } - } - GRSPrintfW(L"\n"); - } - - if (paiMesh->HasTangentsAndBitangents()) - { - GRSPrintfW(L"\nTangents[%u]:\n", paiMesh->mNumVertices); - - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " - , i - , paiMesh->mTangents[i].x - , paiMesh->mTangents[i].y - , paiMesh->mTangents[i].z); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfA("\n"); - } - } - - GRSPrintfW(L"\n"); - - GRSPrintfW(L"\nBitangents[%u]:\n", paiMesh->mNumVertices); - - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " - , i - , paiMesh->mBitangents[i].x - , paiMesh->mBitangents[i].y - , paiMesh->mBitangents[i].z); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n"); - } - } - GRSPrintfW(L"\n"); - } - - UINT nColorChannels = 0; - for (UINT nChannel = 0; nChannel < AI_MAX_NUMBER_OF_COLOR_SETS; nChannel++) - { - if (!paiMesh->HasVertexColors(nChannel)) - { - continue; - } - - ++nColorChannels; - - GRSPrintfW(L"\nColors Channel[%u]|Colors Count[%u]:):\n", nChannel, paiMesh->mNumVertices); - - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_4D_FORMAT L", " - , i - , paiMesh->mColors[nChannel][i].r - , paiMesh->mColors[nChannel][i].g - , paiMesh->mColors[nChannel][i].b - , paiMesh->mColors[nChannel][i].a); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n"); - } - } - - GRSPrintfW(L"\n"); - } - - nColorChannels = 0; - for (UINT nChannel = 0; nChannel < AI_MAX_NUMBER_OF_COLOR_SETS; nChannel++) - { - if (!paiMesh->HasTextureCoords(nChannel)) - { - continue; - } - - ++nColorChannels; - - GRSPrintfW(L"\nTexture Coords Channel:[%u]|Coords Count[%u] UV Components[%u]:\n" - , nChannel - , paiMesh->mNumVertices - , paiMesh->mNumUVComponents[nChannel]); - - if (2 == paiMesh->mNumUVComponents[nChannel]) - {// (u,v) - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_2D_FORMAT L", " - , i - , paiMesh->mTextureCoords[nChannel][i].x - , paiMesh->mTextureCoords[nChannel][i].y); - - if (((i + 1) % 8) == 0) - { - GRSPrintfW(L"\n"); - } - } - } - else - {// (u,v,w) - for (UINT i = 0; i < paiMesh->mNumVertices; i++) - { - GRSPrintfW(L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " - , i - , paiMesh->mTextureCoords[nChannel][i].x - , paiMesh->mTextureCoords[nChannel][i].y - , paiMesh->mTextureCoords[nChannel][i].z); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n"); - } - } - } - - GRSPrintfW(L"\n"); - } - - if (paiMesh->HasFaces()) - { - GRSPrintfW(L"\nFaces Count[%u]:\n", paiMesh->mNumFaces); - for (UINT i = 0; i < paiMesh->mNumFaces; i++) - { - GRSPrintfW(L"Face[%4u]:{<%u>(" - , i - , paiMesh->mFaces[i].mNumIndices); - - if (paiMesh->mFaces[i].mNumIndices > 0) - { - GRSPrintfW(L"%4u", paiMesh->mFaces[i].mIndices[0]); - } - - for (UINT j = 1; j < paiMesh->mFaces[i].mNumIndices; j++) - { - GRSPrintfW(L",%4u", paiMesh->mFaces[i].mIndices[j]); - } - - GRSPrintfW(L")}, "); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n"); - } - } - - GRSPrintfW(L"\n"); - } - - if (paiMesh->HasBones()) - { - GRSPrintfW(L"\nBones[%u]:\n", paiMesh->mNumBones); - for (UINT i = 0; i < paiMesh->mNumBones; i++) - { - aiBone* paiBone = paiMesh->mBones[i]; - GRSPrintfA("\nBone[%u]:\"%s\" - 逆绑定位姿矩阵(Inverse bind pose matrix):\n" - , i - , paiBone->mName.C_Str() - ); - - GRSPrintfMX(paiBone->mOffsetMatrix); - - GRSPrintfW(L"\nWeights[%u]:\n", paiBone->mNumWeights); - - for (UINT j = 0; j < paiBone->mNumWeights; j++) - { - GRSPrintfW(L"[%4u](%4u,%11.6f), " - , j - , paiBone->mWeights[j].mVertexId - , paiBone->mWeights[j].mWeight); - - if (((j + 1) % 10) == 0) - { - GRSPrintfW(L"\n"); - } - } - GRSPrintfW(L"\n\n"); - } - GRSPrintfW(L"\n"); - } - - //if ( paiMesh->mNumAnimMeshes > 0 ) - //{// 网格动画,这种情况就不细究了,基本上就是进行网格数据替换 - // paiMesh->mMethod - //} + GRSPrintfA( "\nMesh[%u]:\"%s\", Primitive: <" + , nIndex + , paiMesh->mName.length > 0 ? paiMesh->mName.C_Str() : GRS_NAME_ANONYMITY + ); + + ShowMeshPrimitive( paiMesh->mPrimitiveTypes ); + GRSPrintfW( L">, 关联 Material Index:[%u]:\n", paiMesh->mMaterialIndex ); + + GRSPrintfW( L"AABB:Min" GRS_SHOW_VECTOR_3D_FORMAT L",Max" GRS_SHOW_VECTOR_3D_FORMAT L"\n\n" + , paiMesh->mAABB.mMin.x + , paiMesh->mAABB.mMin.y + , paiMesh->mAABB.mMin.z + , paiMesh->mAABB.mMax.x + , paiMesh->mAABB.mMax.y + , paiMesh->mAABB.mMax.z + ); + + if ( paiMesh->mNumVertices > 0 ) + { + GRSPrintfW( L"Vertex Count[%u]:\n", paiMesh->mNumVertices ); + } + + const UINT nCol = GRS_SHOW_VECTOR_COLS; + if ( paiMesh->HasPositions() ) + { + GRSPrintfW( L"Positions[%u]:\n", paiMesh->mNumVertices ); + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " + , i + , paiMesh->mVertices[i].x + , paiMesh->mVertices[i].y + , paiMesh->mVertices[i].z + ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + GRSPrintfW( L"\n" ); + } + + if ( paiMesh->HasNormals() ) + { + GRSPrintfW( L"\nNormals[%u]:\n", paiMesh->mNumVertices ); + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " + , i + , paiMesh->mNormals[i].x + , paiMesh->mNormals[i].y + , paiMesh->mNormals[i].z ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + GRSPrintfW( L"\n" ); + } + + if ( paiMesh->HasTangentsAndBitangents() ) + { + GRSPrintfW( L"\nTangents[%u]:\n", paiMesh->mNumVertices ); + + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " + , i + , paiMesh->mTangents[i].x + , paiMesh->mTangents[i].y + , paiMesh->mTangents[i].z ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfA( "\n" ); + } + } + + GRSPrintfW( L"\n" ); + + GRSPrintfW( L"\nBitangents[%u]:\n", paiMesh->mNumVertices ); + + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " + , i + , paiMesh->mBitangents[i].x + , paiMesh->mBitangents[i].y + , paiMesh->mBitangents[i].z ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + GRSPrintfW( L"\n" ); + } + + UINT nColorChannels = 0; + for ( UINT nChannel = 0; nChannel < AI_MAX_NUMBER_OF_COLOR_SETS; nChannel++ ) + { + if ( !paiMesh->HasVertexColors( nChannel ) ) + { + continue; + } + + ++nColorChannels; + + GRSPrintfW( L"\nColors Channel[%u]|Colors Count[%u]:):\n", nChannel, paiMesh->mNumVertices ); + + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_4D_FORMAT L", " + , i + , paiMesh->mColors[nChannel][i].r + , paiMesh->mColors[nChannel][i].g + , paiMesh->mColors[nChannel][i].b + , paiMesh->mColors[nChannel][i].a ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + + GRSPrintfW( L"\n" ); + } + + nColorChannels = 0; + for ( UINT nChannel = 0; nChannel < AI_MAX_NUMBER_OF_COLOR_SETS; nChannel++ ) + { + if ( !paiMesh->HasTextureCoords( nChannel ) ) + { + continue; + } + + ++nColorChannels; + + GRSPrintfW( L"\nTexture Coords Channel:[%u]|Coords Count[%u] UV Components[%u]:\n" + , nChannel + , paiMesh->mNumVertices + , paiMesh->mNumUVComponents[nChannel] ); + + if ( 2 == paiMesh->mNumUVComponents[nChannel] ) + {// (u,v) + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_2D_FORMAT L", " + , i + , paiMesh->mTextureCoords[nChannel][i].x + , paiMesh->mTextureCoords[nChannel][i].y ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + } + else + {// (u,v,w) + for ( UINT i = 0; i < paiMesh->mNumVertices; i++ ) + { + GRSPrintfW( L"[%4u]" GRS_SHOW_VECTOR_3D_FORMAT L", " + , i + , paiMesh->mTextureCoords[nChannel][i].x + , paiMesh->mTextureCoords[nChannel][i].y + , paiMesh->mTextureCoords[nChannel][i].z ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + } + + GRSPrintfW( L"\n" ); + } + + if ( paiMesh->HasFaces() ) + { + GRSPrintfW( L"\nFaces Count[%u]:\n", paiMesh->mNumFaces ); + for ( UINT i = 0; i < paiMesh->mNumFaces; i++ ) + { + GRSPrintfW( L"Face[%4u]:{<%u>(" + , i + , paiMesh->mFaces[i].mNumIndices ); + + if ( paiMesh->mFaces[i].mNumIndices > 0 ) + { + GRSPrintfW( L"%4u", paiMesh->mFaces[i].mIndices[0] ); + } + + for ( UINT j = 1; j < paiMesh->mFaces[i].mNumIndices; j++ ) + { + GRSPrintfW( L",%4u", paiMesh->mFaces[i].mIndices[j] ); + } + + GRSPrintfW( L")}, " ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + + GRSPrintfW( L"\n" ); + } + + if ( paiMesh->HasBones() ) + { + UINT nCol = GRS_SHOW_VECTOR_COLS + 4; + + GRSPrintfW( L"\nBones[%u]:\n", paiMesh->mNumBones ); + for ( UINT i = 0; i < paiMesh->mNumBones; i++ ) + { + aiBone* paiBone = paiMesh->mBones[i]; + GRSPrintfA( "\nBone[%u]:\"%s\" - 逆绑定位姿矩阵(Inverse bind pose matrix):\n" + , i + , paiBone->mName.C_Str() + ); + + GRSPrintfMX( paiBone->mOffsetMatrix ); + + GRSPrintfW( L"\nWeights[%u]:\n", paiBone->mNumWeights ); + + for ( UINT j = 0; j < paiBone->mNumWeights; j++ ) + { + GRSPrintfW( L"[%4u](%4u,%11.6f), " + , j + , paiBone->mWeights[j].mVertexId + , paiBone->mWeights[j].mWeight ); + + if ( ( ( j + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + GRSPrintfW( L"\n\n" ); + } + GRSPrintfW( L"\n" ); + } + + //if ( paiMesh->mNumAnimMeshes > 0 ) + //{// 网格动画,这种情况就不细究了,基本上就是进行网格数据替换 + // paiMesh->mMethod + //} } -void ShowTextureType(const aiTextureType& emTextureType) +void ShowTextureType( const aiTextureType& emTextureType ) { - switch (emTextureType) - { - case aiTextureType_NONE: - { - GRSPrintfW(L"aiTextureType_NONE (Not Texture)"); - } - break; - case aiTextureType_DIFFUSE: - { - GRSPrintfW(L"aiTextureType_DIFFUSE"); - } - break; - case aiTextureType_SPECULAR: - { - GRSPrintfW(L"aiTextureType_SPECULAR"); - } - break; - case aiTextureType_AMBIENT: - { - GRSPrintfW(L"aiTextureType_AMBIENT"); - } - break; - case aiTextureType_EMISSIVE: - { - GRSPrintfW(L"aiTextureType_EMISSIVE"); - } - break; - case aiTextureType_HEIGHT: - { - GRSPrintfW(L"aiTextureType_HEIGHT"); - } - break; - case aiTextureType_NORMALS: - { - GRSPrintfW(L"aiTextureType_NORMALS"); - } - break; - case aiTextureType_SHININESS: - { - GRSPrintfW(L"aiTextureType_SHININESS"); - } - break; - case aiTextureType_OPACITY: - { - GRSPrintfW(L"aiTextureType_OPACITY"); - } - break; - case aiTextureType_DISPLACEMENT: - { - GRSPrintfW(L"aiTextureType_DISPLACEMENT"); - } - break; - case aiTextureType_LIGHTMAP: - { - GRSPrintfW(L"aiTextureType_LIGHTMAP"); - } - break; - case aiTextureType_REFLECTION: - { - GRSPrintfW(L"aiTextureType_REFLECTION"); - } - break; - - case aiTextureType_BASE_COLOR: - { - GRSPrintfW(L"aiTextureType_BASE_COLOR (PBR Materials)"); - } - break; - case aiTextureType_NORMAL_CAMERA: - { - GRSPrintfW(L"aiTextureType_NORMAL_CAMERA (PBR Materials)"); - } - break; - case aiTextureType_EMISSION_COLOR: - { - GRSPrintfW(L"aiTextureType_EMISSION_COLOR (PBR Materials)"); - } - break; - case aiTextureType_METALNESS: - { - GRSPrintfW(L"aiTextureType_METALNESS (PBR Materials)"); - } - break; - case aiTextureType_DIFFUSE_ROUGHNESS: - { - GRSPrintfW(L"aiTextureType_DIFFUSE_ROUGHNESS (PBR Materials)"); - } - break; - case aiTextureType_AMBIENT_OCCLUSION: - { - GRSPrintfW(L"aiTextureType_AMBIENT_OCCLUSION (PBR Materials)"); - } - break; - case aiTextureType_UNKNOWN: - { - GRSPrintfW(L"aiTextureType_UNKNOWN (PBR Materials)"); - } - break; - default: - break; - } + switch ( emTextureType ) + { + case aiTextureType_NONE: + { + GRSPrintfW( L"aiTextureType_NONE (Not Texture)" ); + } + break; + case aiTextureType_DIFFUSE: + { + GRSPrintfW( L"aiTextureType_DIFFUSE" ); + } + break; + case aiTextureType_SPECULAR: + { + GRSPrintfW( L"aiTextureType_SPECULAR" ); + } + break; + case aiTextureType_AMBIENT: + { + GRSPrintfW( L"aiTextureType_AMBIENT" ); + } + break; + case aiTextureType_EMISSIVE: + { + GRSPrintfW( L"aiTextureType_EMISSIVE" ); + } + break; + case aiTextureType_HEIGHT: + { + GRSPrintfW( L"aiTextureType_HEIGHT" ); + } + break; + case aiTextureType_NORMALS: + { + GRSPrintfW( L"aiTextureType_NORMALS" ); + } + break; + case aiTextureType_SHININESS: + { + GRSPrintfW( L"aiTextureType_SHININESS" ); + } + break; + case aiTextureType_OPACITY: + { + GRSPrintfW( L"aiTextureType_OPACITY" ); + } + break; + case aiTextureType_DISPLACEMENT: + { + GRSPrintfW( L"aiTextureType_DISPLACEMENT" ); + } + break; + case aiTextureType_LIGHTMAP: + { + GRSPrintfW( L"aiTextureType_LIGHTMAP" ); + } + break; + case aiTextureType_REFLECTION: + { + GRSPrintfW( L"aiTextureType_REFLECTION" ); + } + break; + + case aiTextureType_BASE_COLOR: + { + GRSPrintfW( L"aiTextureType_BASE_COLOR (PBR Materials)" ); + } + break; + case aiTextureType_NORMAL_CAMERA: + { + GRSPrintfW( L"aiTextureType_NORMAL_CAMERA (PBR Materials)" ); + } + break; + case aiTextureType_EMISSION_COLOR: + { + GRSPrintfW( L"aiTextureType_EMISSION_COLOR (PBR Materials)" ); + } + break; + case aiTextureType_METALNESS: + { + GRSPrintfW( L"aiTextureType_METALNESS (PBR Materials)" ); + } + break; + case aiTextureType_DIFFUSE_ROUGHNESS: + { + GRSPrintfW( L"aiTextureType_DIFFUSE_ROUGHNESS (PBR Materials)" ); + } + break; + case aiTextureType_AMBIENT_OCCLUSION: + { + GRSPrintfW( L"aiTextureType_AMBIENT_OCCLUSION (PBR Materials)" ); + } + break; + case aiTextureType_UNKNOWN: + { + GRSPrintfW( L"aiTextureType_UNKNOWN (PBR Materials)" ); + } + break; + default: + break; + } } -void ShowMaterial(const UINT& nIndex, const aiMaterial*& paiMaterial) +void ShowMaterial( const UINT& nIndex, const aiMaterial*& paiMaterial ) { - const aiString strMaterialName = ((aiMaterial*)paiMaterial)->GetName(); // 注意这一行的强制类型转换符^~^ - - GRSPrintfA("\nMaterial[%u]:\"%s\", Property[%u]:\n" - , nIndex - , strMaterialName.length > 0 ? strMaterialName.C_Str() : GRS_NAME_ANONYMITY - , paiMaterial->mNumProperties - ); - - if (paiMaterial->mNumProperties > 0) - { - aiMaterialProperty* paiMaterialProperty = nullptr; - for (UINT i = 0; i < paiMaterial->mNumProperties; i++) - { - paiMaterialProperty = paiMaterial->mProperties[i]; - GRSPrintfA("Material Property[%4u]: :\t" - , i - , paiMaterialProperty->mKey.C_Str() - ); - aiTextureType emType = (aiTextureType)paiMaterialProperty->mSemantic; - ShowTextureType(emType); - - if (aiTextureType_NONE == paiMaterialProperty->mSemantic) - {// 非纹理类属性 - USES_CONVERSION; - GRSPrintfW(L" Property Type: "); - switch (paiMaterialProperty->mType) - { - case aiPTI_Float: - { - GRSPrintfW(L"aiPTI_Float: " GRS_SHOW_VECTOR_1D_FORMAT, *(float*)paiMaterialProperty->mData); - } - break; - case aiPTI_Double: - { - GRSPrintfW(L"aiPTI_Double: " GRS_SHOW_VECTOR_1D_FORMAT, *(float*)paiMaterialProperty->mData); - } - break; - case aiPTI_String: - { - GRSPrintfW(L"aiPTI_String[%u]: \"%s\"" - , paiMaterialProperty->mDataLength - , A2W(paiMaterialProperty->mData + sizeof(int)) - ); - } - break; - case aiPTI_Integer: - { - GRSPrintfW(L"aiPTI_Integer: %d", *(int*)paiMaterialProperty->mData); - } - break; - case aiPTI_Buffer: - { - GRSPrintfW(L"aiPTI_Buffer[%u]:[0x016X]" - , paiMaterialProperty->mDataLength - , paiMaterialProperty->mData); - } - break; - default: - break; - } - - } - else - {// 纹理类属性 - aiString aistrPath; - aiTextureMapping mapping = aiTextureMapping_UV; - unsigned int uvindex = 0; - ai_real blend = 0.0f; - aiTextureOp op = aiTextureOp_Multiply; - aiTextureMapMode mapmode = aiTextureMapMode_Wrap; - - if (AI_SUCCESS == paiMaterial->GetTexture(emType - , paiMaterialProperty->mIndex - , &aistrPath - , &mapping - , &uvindex - , &blend - , &op - , &mapmode - )) - { - GRSPrintfA(": \"%s\", Mapping mode:", aistrPath.C_Str()); - - switch (mapping) - { - case aiTextureMapping_UV: - { - GRSPrintfW(L"aiTextureMapping_UV"); - } - break; - case aiTextureMapping_SPHERE: - { - GRSPrintfW(L"aiTextureMapping_SPHERE"); - } - break; - case aiTextureMapping_CYLINDER: - { - GRSPrintfW(L"aiTextureMapping_CYLINDER"); - } - break; - case aiTextureMapping_BOX: - { - GRSPrintfW(L"aiTextureMapping_BOX"); - } - break; - case aiTextureMapping_PLANE: - { - GRSPrintfW(L"aiTextureMapping_PLANE"); - } - break; - case aiTextureMapping_OTHER: - { - GRSPrintfW(L"aiTextureMapping_OTHER"); - } - break; - - default: - break; - } - - - GRSPrintfW(L", UVIndex[%u], Blend" GRS_SHOW_VECTOR_1D_FORMAT, uvindex, blend); - - GRSPrintfW(L", Alpha OP: "); - - switch (op) - { - case aiTextureOp_Multiply: - { - GRSPrintfW(L"aiTextureOp_Multiply (T = T1 * T2)"); - } - break; - case aiTextureOp_Add: - { - GRSPrintfW(L"aiTextureOp_Add (T = T1 + T2)"); - } - break; - case aiTextureOp_Subtract: - { - GRSPrintfW(L"aiTextureOp_Subtract (T = T1 - T2)"); - } - break; - case aiTextureOp_Divide: - { - GRSPrintfW(L"aiTextureOp_Divide (T = T1 / T2)"); - } - break; - case aiTextureOp_SmoothAdd: - { - GRSPrintfW(L"aiTextureOp_SmoothAdd ( T = (T1 + T2) - (T1 * T2) )"); - } - break; - case aiTextureOp_SignedAdd: - { - GRSPrintfW(L"aiTextureOp_SignedAdd ( T = T1 + (T2-0.5) )"); - } - break; - default: - break; - } - - GRSPrintfW(L", Outside Process: "); - switch (mapmode) - { - case aiTextureMapMode_Wrap: - { - GRSPrintfW(L"aiTextureMapMode_Wrap"); - } - break; - case aiTextureMapMode_Clamp: - { - GRSPrintfW(L"aiTextureMapMode_Clamp"); - } - break; - case aiTextureMapMode_Decal: - { - GRSPrintfW(L"aiTextureMapMode_Decal"); - } - break; - case aiTextureMapMode_Mirror: - { - GRSPrintfW(L"aiTextureMapMode_Mirror"); - } - break; - default: - ATLASSERT(FALSE); - break; - } - } - - } - - GRSPrintfW(L";\n"); - } - } + const aiString strMaterialName = ( (aiMaterial*) paiMaterial )->GetName(); // 注意这一行的强制类型转换符^~^ + + GRSPrintfA( "\nMaterial[%u]:\"%s\", Property[%u]:\n" + , nIndex + , strMaterialName.length > 0 ? strMaterialName.C_Str() : GRS_NAME_ANONYMITY + , paiMaterial->mNumProperties + ); + + if ( paiMaterial->mNumProperties > 0 ) + { + aiMaterialProperty* paiMaterialProperty = nullptr; + for ( UINT i = 0; i < paiMaterial->mNumProperties; i++ ) + { + paiMaterialProperty = paiMaterial->mProperties[i]; + GRSPrintfA( "Material Property[%4u]: : " + , i + , paiMaterialProperty->mKey.C_Str() + ); + aiTextureType emType = (aiTextureType) paiMaterialProperty->mSemantic; + ShowTextureType( emType ); + + if ( aiTextureType_NONE == paiMaterialProperty->mSemantic ) + {// 非纹理类属性 + USES_CONVERSION; + GRSPrintfW( L" Property Type: " ); + switch ( paiMaterialProperty->mType ) + { + case aiPTI_Float: + { + GRSPrintfW( L"aiPTI_Float: " GRS_SHOW_VECTOR_1D_FORMAT, *(float*) paiMaterialProperty->mData ); + } + break; + case aiPTI_Double: + { + GRSPrintfW( L"aiPTI_Double: " GRS_SHOW_VECTOR_1D_FORMAT, *(float*) paiMaterialProperty->mData ); + } + break; + case aiPTI_String: + { + GRSPrintfW( L"aiPTI_String[%u]: \"%s\"" + , paiMaterialProperty->mDataLength + , A2W( paiMaterialProperty->mData + sizeof( int ) ) + ); + } + break; + case aiPTI_Integer: + { + GRSPrintfW( L"aiPTI_Integer: %d", *(int*) paiMaterialProperty->mData ); + } + break; + case aiPTI_Buffer: + { + GRSPrintfW( L"aiPTI_Buffer[%u]:[0x016X]" + , paiMaterialProperty->mDataLength + , paiMaterialProperty->mData ); + } + break; + default: + break; + } + + } + else + {// 纹理类属性 + aiString aistrPath; + aiTextureMapping mapping = aiTextureMapping_UV; + unsigned int uvindex = 0; + ai_real blend = 0.0f; + aiTextureOp op = aiTextureOp_Multiply; + aiTextureMapMode mapmode = aiTextureMapMode_Wrap; + + if ( AI_SUCCESS == paiMaterial->GetTexture( emType + , paiMaterialProperty->mIndex + , &aistrPath + , &mapping + , &uvindex + , &blend + , &op + , &mapmode + ) ) + { + GRSPrintfA( ": \"%s\", Mapping mode:", aistrPath.C_Str() ); + + switch ( mapping ) + { + case aiTextureMapping_UV: + { + GRSPrintfW( L"aiTextureMapping_UV" ); + } + break; + case aiTextureMapping_SPHERE: + { + GRSPrintfW( L"aiTextureMapping_SPHERE" ); + } + break; + case aiTextureMapping_CYLINDER: + { + GRSPrintfW( L"aiTextureMapping_CYLINDER" ); + } + break; + case aiTextureMapping_BOX: + { + GRSPrintfW( L"aiTextureMapping_BOX" ); + } + break; + case aiTextureMapping_PLANE: + { + GRSPrintfW( L"aiTextureMapping_PLANE" ); + } + break; + case aiTextureMapping_OTHER: + { + GRSPrintfW( L"aiTextureMapping_OTHER" ); + } + break; + + default: + break; + } + + + GRSPrintfW( L", UVIndex[%u], Blend" GRS_SHOW_VECTOR_1D_FORMAT, uvindex, blend ); + + GRSPrintfW( L", Alpha OP: " ); + + switch ( op ) + { + case aiTextureOp_Multiply: + { + GRSPrintfW( L"aiTextureOp_Multiply (T = T1 * T2)" ); + } + break; + case aiTextureOp_Add: + { + GRSPrintfW( L"aiTextureOp_Add (T = T1 + T2)" ); + } + break; + case aiTextureOp_Subtract: + { + GRSPrintfW( L"aiTextureOp_Subtract (T = T1 - T2)" ); + } + break; + case aiTextureOp_Divide: + { + GRSPrintfW( L"aiTextureOp_Divide (T = T1 / T2)" ); + } + break; + case aiTextureOp_SmoothAdd: + { + GRSPrintfW( L"aiTextureOp_SmoothAdd ( T = (T1 + T2) - (T1 * T2) )" ); + } + break; + case aiTextureOp_SignedAdd: + { + GRSPrintfW( L"aiTextureOp_SignedAdd ( T = T1 + (T2-0.5) )" ); + } + break; + default: + break; + } + + GRSPrintfW( L", Outside Process: " ); + switch ( mapmode ) + { + case aiTextureMapMode_Wrap: + { + GRSPrintfW( L"aiTextureMapMode_Wrap" ); + } + break; + case aiTextureMapMode_Clamp: + { + GRSPrintfW( L"aiTextureMapMode_Clamp" ); + } + break; + case aiTextureMapMode_Decal: + { + GRSPrintfW( L"aiTextureMapMode_Decal" ); + } + break; + case aiTextureMapMode_Mirror: + { + GRSPrintfW( L"aiTextureMapMode_Mirror" ); + } + break; + default: + ATLASSERT( FALSE ); + break; + } + } + + } + + GRSPrintfW( L";\n" ); + } + } } -void ShowAnimationsBehaviour(const aiAnimBehaviour& emBehaviour) +void ShowAnimationsBehaviour( const aiAnimBehaviour& emBehaviour ) {// 显示动画帧间差值的行为 - switch (emBehaviour) - { - case aiAnimBehaviour_DEFAULT: - {/** 取默认节点转换的值 */ - GRSPrintfA("aiAnimBehaviour_DEFAULT"); - } - break; - case aiAnimBehaviour_CONSTANT: - {/** 使用最接近的键值而不使用插值 */ - GRSPrintfA("aiAnimBehaviour_CONSTANT"); - } - break; - case aiAnimBehaviour_LINEAR: - {/** 最近的两个键的值被线性外推为当前时间值。*/ - GRSPrintfA("aiAnimBehaviour_LINEAR"); - } - break; - case aiAnimBehaviour_REPEAT: - {/** 动画重复。如果动画键从n到m,当前时间为t,则使用值为(t-n) % (|m-n|)。*/ - GRSPrintfA("aiAnimBehaviour_REPEAT"); - } - break; - default: - { - GRSPrintfA("0x%02X", emBehaviour); - } - break; - }; + switch ( emBehaviour ) + { + case aiAnimBehaviour_DEFAULT: + {/** 取默认节点转换的值 */ + GRSPrintfA( "aiAnimBehaviour_DEFAULT" ); + } + break; + case aiAnimBehaviour_CONSTANT: + {/** 使用最接近的键值而不使用插值 */ + GRSPrintfA( "aiAnimBehaviour_CONSTANT" ); + } + break; + case aiAnimBehaviour_LINEAR: + {/** 最近的两个键的值被线性外推为当前时间值。*/ + GRSPrintfA( "aiAnimBehaviour_LINEAR" ); + } + break; + case aiAnimBehaviour_REPEAT: + {/** 动画重复。如果动画键从n到m,当前时间为t,则使用值为(t-n) % (|m-n|)。*/ + GRSPrintfA( "aiAnimBehaviour_REPEAT" ); + } + break; + default: + { + GRSPrintfA( "0x%02X", emBehaviour ); + } + break; + }; } -void ShowAnimations(const aiScene* pModel) +void ShowAnimations( const aiScene* pModel ) { - GRSPrintfA("\nAnim Count[%4u]:\n", pModel->mNumAnimations); - - for (size_t i = 0; i < pModel->mNumAnimations; i++) - { - GRSPrintfA("\tAnim[%u]:\"%s\"\tDuration Time: " GRS_SHOW_VECTOR_1D_FORMAT " ticks, Channels[%u]\n" - , (UINT)i - , pModel->mAnimations[i]->mName.C_Str() - , pModel->mAnimations[i]->mDuration - , pModel->mAnimations[i]->mNumChannels); - GRSConsolePause(); - //GRSPrintfA("\n"); - for (UINT j = 0; j < pModel->mAnimations[i]->mNumChannels; j++) - { - aiNodeAnim* pChannels = pModel->mAnimations[i]->mChannels[j]; - - GRSPrintfA("\t\tChannel[%u]:\"%s\" Scaling Keys[%u], Rotation Keys[%u], Position Keys[%u], " - , j - , pChannels->mNodeName.C_Str() - , pChannels->mNumScalingKeys - , pChannels->mNumRotationKeys - , pChannels->mNumPositionKeys - ); - GRSPrintfA("Pre State: "); - ShowAnimationsBehaviour(pChannels->mPreState); - GRSPrintfA(" Post State: "); - ShowAnimationsBehaviour(pChannels->mPreState); - GRSPrintfA("\n"); - - ShowChannleInfo(pChannels); - } - } + GRSPrintfA( "Anim Count[%4u]:\n", pModel->mNumAnimations ); + + for ( size_t i = 0; i < pModel->mNumAnimations; i++ ) + { + GRSPrintfA( "Anim[%u]:\"%s\"\tDuration Time: " GRS_SHOW_VECTOR_1D_FORMAT " ticks, Channels[%u]\n" + , (UINT) i + , pModel->mAnimations[i]->mName.C_Str() + , pModel->mAnimations[i]->mDuration + , pModel->mAnimations[i]->mNumChannels ); + GRSConsolePause(); + //GRSPrintfA("\n"); + for ( UINT j = 0; j < pModel->mAnimations[i]->mNumChannels; j++ ) + { + aiNodeAnim* pChannels = pModel->mAnimations[i]->mChannels[j]; + + GRSPrintfA( "Channel[%u]:\"%s\" Scaling Keys[%u], Rotation Keys[%u], Position Keys[%u], " + , j + , pChannels->mNodeName.C_Str() + , pChannels->mNumScalingKeys + , pChannels->mNumRotationKeys + , pChannels->mNumPositionKeys + ); + GRSPrintfA( "Pre State: " ); + ShowAnimationsBehaviour( pChannels->mPreState ); + GRSPrintfA( " Post State: " ); + ShowAnimationsBehaviour( pChannels->mPreState ); + GRSPrintfA( "\n" ); + + ShowChannleInfo( pChannels ); + } + } } -void ShowChannleInfo(const aiNodeAnim* pChannle) +void ShowChannleInfo( const aiNodeAnim* pChannle ) { - UINT i = 0; - UINT nCol = 3; - - GRSPrintfW(L"\t\t\tScaling Keys[%u]:\n\t\t\t", pChannle->mNumScalingKeys); - for (i = 0; i < pChannle->mNumScalingKeys; i++) - { - GRSPrintfW(L"[%4u]:Time=" GRS_SHOW_VECTOR_1D_FORMAT " S" GRS_SHOW_VECTOR_3D_FORMAT "\t" - , i - , pChannle->mScalingKeys[i].mTime - , pChannle->mScalingKeys[i].mValue.x - , pChannle->mScalingKeys[i].mValue.y - , pChannle->mScalingKeys[i].mValue.z); - - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n\t\t\t"); - } - } - - GRSPrintfW(L"\n\t\t\tRotation Keys[%u]:\n\t\t\t", pChannle->mNumRotationKeys); - - for (i = 0; i < pChannle->mNumRotationKeys; i++) - {// 旋转分量是四元数,四个分量都有意义 - GRSPrintfW(L"[%4u]:Time=" GRS_SHOW_VECTOR_1D_FORMAT " Q" GRS_SHOW_VECTOR_4D_FORMAT "\t" - , i - , pChannle->mRotationKeys[i].mTime - , pChannle->mRotationKeys[i].mValue.x - , pChannle->mRotationKeys[i].mValue.y - , pChannle->mRotationKeys[i].mValue.z - , pChannle->mRotationKeys[i].mValue.w); - if (((i + 1) % nCol) == 0) - { - GRSPrintfW(L"\n\t\t\t"); - } - } - - GRSPrintfW(L"\n\t\t\tPosition Keys[%u]:\n\t\t\t", pChannle->mNumPositionKeys); - - for (i = 0; i < pChannle->mNumPositionKeys; i++) - { - GRSPrintfA("[%4u]:Time=" GRS_SHOW_VECTOR_1D_FORMAT " T" GRS_SHOW_VECTOR_3D_FORMAT "\t" - , i - , pChannle->mPositionKeys[i].mTime - , pChannle->mPositionKeys[i].mValue.x - , pChannle->mPositionKeys[i].mValue.y - , pChannle->mPositionKeys[i].mValue.z); - if (((i + 1) % nCol) == 0) - { - GRSPrintfA("\n\t\t\t"); - } - } - - GRSPrintfA("\n"); + UINT i = 0; + UINT nCol = 3; + + GRSPrintfW( L"Scaling Keys[%u]:\n", pChannle->mNumScalingKeys ); + for ( i = 0; i < pChannle->mNumScalingKeys; i++ ) + { + GRSPrintfW( L"[%4u]:Time=" GRS_SHOW_VECTOR_1D_FORMAT " S" GRS_SHOW_VECTOR_3D_FORMAT ", " + , i + , pChannle->mScalingKeys[i].mTime + , pChannle->mScalingKeys[i].mValue.x + , pChannle->mScalingKeys[i].mValue.y + , pChannle->mScalingKeys[i].mValue.z ); + + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + + GRSPrintfW( L"\nRotation Keys[%u]:\n", pChannle->mNumRotationKeys ); + + for ( i = 0; i < pChannle->mNumRotationKeys; i++ ) + {// 旋转分量是四元数,四个分量都有意义 + GRSPrintfW( L"[%4u]:Time=" GRS_SHOW_VECTOR_1D_FORMAT " Q" GRS_SHOW_VECTOR_4D_FORMAT ", " + , i + , pChannle->mRotationKeys[i].mTime + , pChannle->mRotationKeys[i].mValue.x + , pChannle->mRotationKeys[i].mValue.y + , pChannle->mRotationKeys[i].mValue.z + , pChannle->mRotationKeys[i].mValue.w ); + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfW( L"\n" ); + } + } + + GRSPrintfW( L"\nPosition Keys[%u]:\n", pChannle->mNumPositionKeys ); + + for ( i = 0; i < pChannle->mNumPositionKeys; i++ ) + { + GRSPrintfA( "[%4u]:Time=" GRS_SHOW_VECTOR_1D_FORMAT " T" GRS_SHOW_VECTOR_3D_FORMAT ", " + , i + , pChannle->mPositionKeys[i].mTime + , pChannle->mPositionKeys[i].mValue.x + , pChannle->mPositionKeys[i].mValue.y + , pChannle->mPositionKeys[i].mValue.z ); + if ( ( ( i + 1 ) % nCol ) == 0 ) + { + GRSPrintfA( "\n" ); + } + } + + GRSPrintfA( "\n" ); } -void TraverseNodeTree(const aiNode* pNode, int iBlank) +void TraverseNodeTree( const aiNode* pNode, int iBlank ) { - GRSPrintBlank(iBlank); - - int iY = GRSGetConsoleCurrentY(); - - //填充不连续的列 - if (pNode->mParent) - {//有父节点 - aiNode** pBrother = pNode->mParent->mChildren;//兄弟节点列表 - UINT nPos = 0; - for (nPos = 0; nPos < pNode->mParent->mNumChildren; nPos++) - {//查找节点在兄弟列表的位置,当前节点肯定在父节点的兄弟列表中 - if (pNode == pNode->mParent->mChildren[nPos]) - { - break; - } - } - - int iRow = 0; - SHORT sLine = 0; - - if (0 != nPos) - {//不是第一个兄弟 - UINT nPrev = --nPos; - if (GRSFindConsoleLine((void*)pNode->mParent->mChildren[nPrev], sLine)) - { - iRow = iY - sLine - 1; - } - } - else - {// 第一个兄弟 找父亲行 - if (GRSFindConsoleLine((void*)pNode->mParent, sLine)) - { - iRow = iY - sLine - 1; - } - } - - GRSPushConsoleCursor();//保存光标位置 - while (iRow--) - {//不停上移动光标,输出| - GRSMoveConsoleCursor(0, -1);//上移 - GRSPrintfA("|");//打印| - GRSMoveConsoleCursor(-1, 0);//左移回复光标位置 - } - GRSPopConsoleCursor();//恢复光标位置 - } - - - GRSSaveConsoleLine((void*)pNode, iY); - - GRSPrintfA("+――Name:\"%s\", Childs[%u]" - , (pNode->mName.length > 0) ? pNode->mName.C_Str() : GRS_NAME_ANONYMITY - , pNode->mNumChildren - , pNode->mNumMeshes); - - if (pNode->mNumMeshes > 0) - { - GRSPrintfW(L", Affect Meshs Count[%u]:{" - , pNode->mNumMeshes); - - for (UINT i = 0; i < pNode->mNumMeshes; i++) - { - GRSPrintfW(L"Mesh[%u] ", pNode->mMeshes[i]); - } - - GRSPrintfW(L"}"); - } - - GRSPrintfW(L", Node Transformation:\n\n"); - GRSPrintfMX(pNode->mTransformation, iBlank + 3); - GRSPrintfA("\n"); - - for (UINT i = 0; i < pNode->mNumChildren; ++i) - { - TraverseNodeTree(pNode->mChildren[i], iBlank + 1);//累加缩进次数和行数 - } + GRSPrintBlank( iBlank ); + + int iY = GRSGetConsoleCurrentY(); + + //填充不连续的列 + if ( pNode->mParent ) + {//有父节点 + aiNode** pBrother = pNode->mParent->mChildren;//兄弟节点列表 + UINT nPos = 0; + for ( nPos = 0; nPos < pNode->mParent->mNumChildren; nPos++ ) + {//查找节点在兄弟列表的位置,当前节点肯定在父节点的兄弟列表中 + if ( pNode == pNode->mParent->mChildren[nPos] ) + { + break; + } + } + + int iRow = 0; + SHORT sLine = 0; + + if ( 0 != nPos ) + {//不是第一个兄弟 + UINT nPrev = --nPos; + if ( GRSFindConsoleLine( (void*) pNode->mParent->mChildren[nPrev], sLine ) ) + { + iRow = iY - sLine - 1; + } + } + else + {// 第一个兄弟 找父亲行 + if ( GRSFindConsoleLine( (void*) pNode->mParent, sLine ) ) + { + iRow = iY - sLine - 1; + } + } + + GRSPushConsoleCursor();//保存光标位置 + while ( iRow-- ) + {//不停上移动光标,输出| + GRSMoveConsoleCursor( 0, -1 );//上移 + GRSPrintfA( "|" );//打印| + GRSMoveConsoleCursor( -1, 0 );//左移回复光标位置 + } + GRSPopConsoleCursor();//恢复光标位置 + } + + + GRSSaveConsoleLine( (void*) pNode, iY ); + + GRSPrintfA( "+――Name:\"%s\", Childs[%u]" + , ( pNode->mName.length > 0 ) ? pNode->mName.C_Str() : GRS_NAME_ANONYMITY + , pNode->mNumChildren + , pNode->mNumMeshes ); + + if ( pNode->mNumMeshes > 0 ) + { + GRSPrintfW( L", Affect Meshs Count[%u]:{" + , pNode->mNumMeshes ); + + for ( UINT i = 0; i < pNode->mNumMeshes; i++ ) + { + GRSPrintfW( L"Mesh[%u] ", pNode->mMeshes[i] ); + } + + GRSPrintfW( L"}" ); + } + + GRSPrintfW( L", Node Transformation:\n\n" ); + GRSPrintfMX( pNode->mTransformation, iBlank + 3 ); + GRSPrintfA( "\n" ); + + for ( UINT i = 0; i < pNode->mNumChildren; ++i ) + { + TraverseNodeTree( pNode->mChildren[i], iBlank + 1 );//累加缩进次数和行数 + } } -void ShowTextures(const UINT& nIndex, const aiTexture* paiTexture) +void ShowTextures( const UINT& nIndex, const aiTexture* paiTexture ) { - GRSPrintfA("Texture[%u]: \"%s\", Format Hint:\"%s\", Width=%u, Height=%u\n" - , nIndex - , paiTexture->mFilename.length > 0 ? paiTexture->mFilename.C_Str() : GRS_NAME_ANONYMITY - , paiTexture->achFormatHint - , paiTexture->mWidth - , paiTexture->mHeight - ); + GRSPrintfA( "Texture[%u]: \"%s\", Format Hint:\"%s\", Width=%u, Height=%u\n" + , nIndex + , paiTexture->mFilename.length > 0 ? paiTexture->mFilename.C_Str() : GRS_NAME_ANONYMITY + , paiTexture->achFormatHint + , paiTexture->mWidth + , paiTexture->mHeight + ); } -void ShowLights(const UINT& nIndex, const aiLight* paiLight) +void ShowLights( const UINT& nIndex, const aiLight* paiLight ) { - GRSPrintfA("\nLight[%u]: \"%s\" " - , nIndex - , paiLight->mName.length > 0 ? paiLight->mName.C_Str() : GRS_NAME_ANONYMITY - , paiLight->mType - ); - switch (paiLight->mType) - { - case aiLightSource_DIRECTIONAL: - { //! A directional light source has a well-defined direction - //! but is infinitely far away. That's quite a good - //! approximation for sun light. - GRSPrintfW(L"aiLightSource_DIRECTIONAL"); - } - break; - case aiLightSource_POINT: - { - //! A point light source has a well-defined position - //! in space but no direction - it emits light in all - //! directions. A normal bulb is a point light. - GRSPrintfW(L"aiLightSource_POINT"); - } - break; - case aiLightSource_SPOT: - { - //! A spot light source emits light in a specific - //! angle. It has a position and a direction it is pointing to. - //! A good example for a spot light is a light spot in - //! sport arenas. - GRSPrintfW(L"aiLightSource_SPOT"); - } - break; - case aiLightSource_AMBIENT: - { - //! The generic light level of the world, including the bounces - //! of all other light sources. - //! Typically, there's at most one ambient light in a scene. - //! This light type doesn't have a valid position, direction, or - //! other properties, just a color. - GRSPrintfW(L"aiLightSource_AMBIENT"); - } - break; - case aiLightSource_AREA: - { - //! An area light is a rectangle with predefined size that uniformly - //! emits light from one of its sides. The position is center of the - //! rectangle and direction is its normal vector. - GRSPrintfW(L"aiLightSource_AREA"); - } - break; - default: - break; - } - - GRSPrintfW(L" Position:" GRS_SHOW_VECTOR_3D_FORMAT " Direction:" GRS_SHOW_VECTOR_3D_FORMAT " Up:" GRS_SHOW_VECTOR_3D_FORMAT - , paiLight->mPosition.x - , paiLight->mPosition.y - , paiLight->mPosition.z - , paiLight->mDirection.x - , paiLight->mDirection.y - , paiLight->mDirection.z - , paiLight->mUp.x - , paiLight->mUp.y - , paiLight->mUp.z - ); - - GRSPrintfW(L"\n\tLight Attenuation Property: Constant" GRS_SHOW_VECTOR_1D_FORMAT\ - " Linear" GRS_SHOW_VECTOR_1D_FORMAT " Quadratic" GRS_SHOW_VECTOR_1D_FORMAT - , paiLight->mAttenuationConstant - , paiLight->mAttenuationLinear - , paiLight->mAttenuationQuadratic - ); - - GRSPrintfW(L"\n\tLight Color: Diffuse" GRS_SHOW_VECTOR_3D_FORMAT " Specular" GRS_SHOW_VECTOR_3D_FORMAT " Ambient" GRS_SHOW_VECTOR_3D_FORMAT - , paiLight->mColorDiffuse.r - , paiLight->mColorDiffuse.g - , paiLight->mColorDiffuse.b - , paiLight->mColorSpecular.r - , paiLight->mColorSpecular.g - , paiLight->mColorSpecular.b - , paiLight->mColorAmbient.r - , paiLight->mColorAmbient.g - , paiLight->mColorAmbient.b - ); - - GRSPrintfW(L"\n\tSize Light Property : Inner Cone" GRS_SHOW_VECTOR_1D_FORMAT " Outer Cone" GRS_SHOW_VECTOR_1D_FORMAT - , paiLight->mAngleInnerCone - , paiLight->mAngleOuterCone - ); - - GRSPrintfW(L"\n\tSpot Light Property : Size" GRS_SHOW_VECTOR_2D_FORMAT "\n" - , paiLight->mSize.x - , paiLight->mSize.y - ); + GRSPrintfA( "\nLight[%u]: \"%s\" " + , nIndex + , paiLight->mName.length > 0 ? paiLight->mName.C_Str() : GRS_NAME_ANONYMITY + , paiLight->mType + ); + switch ( paiLight->mType ) + { + case aiLightSource_DIRECTIONAL: + { //! A directional light source has a well-defined direction + //! but is infinitely far away. That's quite a good + //! approximation for sun light. + GRSPrintfW( L"aiLightSource_DIRECTIONAL" ); + } + break; + case aiLightSource_POINT: + { + //! A point light source has a well-defined position + //! in space but no direction - it emits light in all + //! directions. A normal bulb is a point light. + GRSPrintfW( L"aiLightSource_POINT" ); + } + break; + case aiLightSource_SPOT: + { + //! A spot light source emits light in a specific + //! angle. It has a position and a direction it is pointing to. + //! A good example for a spot light is a light spot in + //! sport arenas. + GRSPrintfW( L"aiLightSource_SPOT" ); + } + break; + case aiLightSource_AMBIENT: + { + //! The generic light level of the world, including the bounces + //! of all other light sources. + //! Typically, there's at most one ambient light in a scene. + //! This light type doesn't have a valid position, direction, or + //! other properties, just a color. + GRSPrintfW( L"aiLightSource_AMBIENT" ); + } + break; + case aiLightSource_AREA: + { + //! An area light is a rectangle with predefined size that uniformly + //! emits light from one of its sides. The position is center of the + //! rectangle and direction is its normal vector. + GRSPrintfW( L"aiLightSource_AREA" ); + } + break; + default: + break; + } + + GRSPrintfW( L" Position:" GRS_SHOW_VECTOR_3D_FORMAT " Direction:" GRS_SHOW_VECTOR_3D_FORMAT " Up:" GRS_SHOW_VECTOR_3D_FORMAT + , paiLight->mPosition.x + , paiLight->mPosition.y + , paiLight->mPosition.z + , paiLight->mDirection.x + , paiLight->mDirection.y + , paiLight->mDirection.z + , paiLight->mUp.x + , paiLight->mUp.y + , paiLight->mUp.z + ); + + GRSPrintfW( L"\n\tLight Attenuation Property: Constant" GRS_SHOW_VECTOR_1D_FORMAT\ + " Linear" GRS_SHOW_VECTOR_1D_FORMAT " Quadratic" GRS_SHOW_VECTOR_1D_FORMAT + , paiLight->mAttenuationConstant + , paiLight->mAttenuationLinear + , paiLight->mAttenuationQuadratic + ); + + GRSPrintfW( L"\n\tLight Color: Diffuse" GRS_SHOW_VECTOR_3D_FORMAT " Specular" GRS_SHOW_VECTOR_3D_FORMAT " Ambient" GRS_SHOW_VECTOR_3D_FORMAT + , paiLight->mColorDiffuse.r + , paiLight->mColorDiffuse.g + , paiLight->mColorDiffuse.b + , paiLight->mColorSpecular.r + , paiLight->mColorSpecular.g + , paiLight->mColorSpecular.b + , paiLight->mColorAmbient.r + , paiLight->mColorAmbient.g + , paiLight->mColorAmbient.b + ); + + GRSPrintfW( L"\n\tSize Light Property : Inner Cone" GRS_SHOW_VECTOR_1D_FORMAT " Outer Cone" GRS_SHOW_VECTOR_1D_FORMAT + , paiLight->mAngleInnerCone + , paiLight->mAngleOuterCone + ); + + GRSPrintfW( L"\n\tSpot Light Property : Size" GRS_SHOW_VECTOR_2D_FORMAT "\n" + , paiLight->mSize.x + , paiLight->mSize.y + ); } -void ShowCamera(const UINT& nIndex, const aiCamera* paiCamera) +void ShowCamera( const UINT& nIndex, const aiCamera* paiCamera ) { - GRSPrintfA("\nCamera[%u]: \"%s\", " - , nIndex - , paiCamera->mName.length > 0 ? paiCamera->mName.C_Str() : GRS_NAME_ANONYMITY - ); - - GRSPrintfW(L"Position:" GRS_SHOW_VECTOR_3D_FORMAT ", Up:" GRS_SHOW_VECTOR_3D_FORMAT ", LookAt:" GRS_SHOW_VECTOR_3D_FORMAT - , paiCamera->mPosition.x - , paiCamera->mPosition.y - , paiCamera->mPosition.z - , paiCamera->mUp.x - , paiCamera->mUp.y - , paiCamera->mUp.z - , paiCamera->mLookAt.x - , paiCamera->mLookAt.y - , paiCamera->mLookAt.z - ); - - GRSPrintfW(L", FOV:" GRS_SHOW_VECTOR_1D_FORMAT ", Near:" GRS_SHOW_VECTOR_1D_FORMAT ", Far:" GRS_SHOW_VECTOR_1D_FORMAT ", Aspect:" GRS_SHOW_VECTOR_1D_FORMAT "\n" - , paiCamera->mHorizontalFOV - , paiCamera->mClipPlaneNear - , paiCamera->mClipPlaneFar - , paiCamera->mAspect - ); + GRSPrintfA( "\nCamera[%u]: \"%s\", " + , nIndex + , paiCamera->mName.length > 0 ? paiCamera->mName.C_Str() : GRS_NAME_ANONYMITY + ); + + GRSPrintfW( L"Position:" GRS_SHOW_VECTOR_3D_FORMAT ", Up:" GRS_SHOW_VECTOR_3D_FORMAT ", LookAt:" GRS_SHOW_VECTOR_3D_FORMAT + , paiCamera->mPosition.x + , paiCamera->mPosition.y + , paiCamera->mPosition.z + , paiCamera->mUp.x + , paiCamera->mUp.y + , paiCamera->mUp.z + , paiCamera->mLookAt.x + , paiCamera->mLookAt.y + , paiCamera->mLookAt.z + ); + + GRSPrintfW( L", FOV:" GRS_SHOW_VECTOR_1D_FORMAT ", Near:" GRS_SHOW_VECTOR_1D_FORMAT ", Far:" GRS_SHOW_VECTOR_1D_FORMAT ", Aspect:" GRS_SHOW_VECTOR_1D_FORMAT "\n" + , paiCamera->mHorizontalFOV + , paiCamera->mClipPlaneNear + , paiCamera->mClipPlaneFar + , paiCamera->mAspect + ); +} + +void ShowMetadata( const aiMetadata* paiMetadata ) +{ + for ( UINT i = 0; i < paiMetadata->mNumProperties; i++ ) + { + GRSPrintfA( "MetaData[%u] - Key:\"%s\",Value=" + , i + , paiMetadata->mKeys[i].C_Str() + ); + + if ( nullptr != paiMetadata->mValues[i].mData ) + { + switch ( paiMetadata->mValues[i].mType ) + { + case AI_BOOL: + { + GRSPrintfA( "(BOOL)%s" + , ( *(BOOL*) paiMetadata->mValues[i].mData ) == FALSE ? "FALSE" : "TRUE" ); + } + break; + case AI_INT32: + { + GRSPrintfA( "(INT32)%d" + , ( *(INT32*) paiMetadata->mValues[i].mData ) ); + + } + break; + case AI_UINT64: + { + GRSPrintfA( "(UINT64)%u" + , ( *(UINT64*) paiMetadata->mValues[i].mData ) ); + + } + break; + case AI_FLOAT: + { + GRSPrintfA( "(FLOAT)%11.6f" + , ( *(FLOAT*) paiMetadata->mValues[i].mData ) ); + + } + break; + case AI_DOUBLE: + { + GRSPrintfA( "(DOUBLE)%11.6f" + , ( *(DOUBLE*) paiMetadata->mValues[i].mData ) ); + + } + break; + case AI_AISTRING: + { + GRSPrintfA( "(String)\"%s\"" + , ( (CHAR*) paiMetadata->mValues[i].mData ) ); + + } + break; + case AI_AIVECTOR3D: + { + aiVector3D* pV3Tmp = (aiVector3D*) paiMetadata->mValues[i].mData; + GRSPrintfA( "(Vector3D) " GRS_SHOW_VECTOR_3D_FORMAT + , pV3Tmp->x + , pV3Tmp->y + , pV3Tmp->z + ); + } + break; + + default: + { + GRSPrintfW( L"nullptr;" ); + } + break; + } + } + else + { + GRSPrintfW( L"nullptr;" ); + } + + GRSPrintfW( L"\n" ); + } } \ No newline at end of file diff --git a/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.cpp b/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.cpp index 543f017ff50374e2e0fb501d17e10d64a5016216..cd606176deb16992cde6e63dbd7cc82ce3f227c9 100644 --- a/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.cpp +++ b/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.cpp @@ -83,25 +83,25 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR HWND hWnd = nullptr; MSG msg = {}; - const UINT nFrameBackBufCount = 3u; - UINT nFrameIndex = 0; - DXGI_FORMAT emRenderTargetFormat = DXGI_FORMAT_R8G8B8A8_UNORM; - const float faClearColor[] = { 0.0f, 0.2f, 0.4f, 1.0f }; + const UINT nFrameBackBufCount = 3u; + UINT nFrameIndex = 0; + DXGI_FORMAT emRenderTargetFormat = DXGI_FORMAT_R8G8B8A8_UNORM; + const float faClearColor[] = { 0.17647f, 0.549f, 0.941176f, 1.0f }; UINT nRTVDescriptorSize = 0U; UINT nSamplerDescriptorSize = 0; UINT nCBVSRVDescriptorSize = 0; - D3D12_VIEWPORT stViewPort = { 0.0f, 0.0f, static_cast( iWidth ), static_cast( iHeight ), D3D12_MIN_DEPTH, D3D12_MAX_DEPTH }; - D3D12_RECT stScissorRect = { 0, 0, static_cast( iWidth ), static_cast( iHeight ) }; + D3D12_VIEWPORT stViewPort = { 0.0f, 0.0f, static_cast( iWidth ), static_cast( iHeight ), D3D12_MIN_DEPTH, D3D12_MAX_DEPTH }; + D3D12_RECT stScissorRect = { 0, 0, static_cast( iWidth ), static_cast( iHeight ) }; D3D_FEATURE_LEVEL emFeatureLevel = D3D_FEATURE_LEVEL_12_1; - ComPtr pIDXGIFactory5; - ComPtr pIDXGIFactory6; - ComPtr pIAdapter1; - ComPtr pID3D12Device4; + ComPtr pIDXGIFactory5; + ComPtr pIDXGIFactory6; + ComPtr pIAdapter1; + ComPtr pID3D12Device4; ComPtr pIMainCMDQueue; ComPtr pIMainCMDAlloc; @@ -111,11 +111,11 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR ComPtr pICopyCMDAlloc; ComPtr pICopyCMDList; - ComPtr pIFence; - UINT64 n64FenceValue = 0ui64; - HANDLE hEventFence = nullptr; - D3D12_RESOURCE_BARRIER stBeginResBarrier = {}; - D3D12_RESOURCE_BARRIER stEneResBarrier = {}; + ComPtr pIFence; + UINT64 n64FenceValue = 0ui64; + HANDLE hEventFence = nullptr; + D3D12_RESOURCE_BARRIER stBeginResBarrier = {}; + D3D12_RESOURCE_BARRIER stEneResBarrier = {}; ComPtr pISwapChain1; ComPtr pISwapChain3; @@ -124,22 +124,20 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR ComPtr pIDSVHeap; ComPtr pIDepthStencilBuffer; - ComPtr pIVSModel; - ComPtr pIPSModel; - ComPtr pIRootSignature; + ComPtr pIVSModel; + ComPtr pIPSModel; + ComPtr pIRootSignature; ComPtr pIPSOModel; ComPtr pIPSOWireFrame; ComPtr pICBVSRVHeap; ComPtr pISamplerHeap; + ComPtr pIUploadHeapModel; + ComPtr pIDefaultHeapModel; - - ComPtr pIUploadHeapModel; - ComPtr pIDefaultHeapModel; - - ComPtr pIUploadHeapIndices; - ComPtr pIDefaultHeapIndices; + ComPtr pIUploadHeapIndices; + ComPtr pIDefaultHeapIndices; ComPtr pIVBPositionsUp; ComPtr pIVBNormalsUp; @@ -163,13 +161,8 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR ComPtr pICBMVP; ComPtr pICBBones; - ST_GRS_CB_MVP* pstCBMVP = nullptr; - ST_GRS_CB_BONES* pstBones = nullptr; - - ComPtr pIWICFactory; - ComPtr pIWICDecoder; - ComPtr pIWICFrame; - ComPtr pIBMP; + ST_GRS_CB_MVP* pstCBMVP = nullptr; + ST_GRS_CB_BONES* pstBones = nullptr; CAtlArray> arTexture; CAtlArray> arTextureUp; @@ -1285,7 +1278,6 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR stEneResBarrier.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES; } - DWORD dwRet = 0; BOOL bExit = FALSE; D3D12_CPU_DESCRIPTOR_HANDLE stRTVHandle = pIRTVHeap->GetCPUDescriptorHandleForHeapStart(); @@ -1558,28 +1550,48 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam } XMVECTOR vDelta = { 0.0f,0.0f,1.0f,0.0f }; - if ( VK_UP == n16KeyCode ) + // Z-轴 + if ( VK_UP == n16KeyCode || 'w' == n16KeyCode || 'W' == n16KeyCode ) { g_v4EyePos = XMVectorAdd( g_v4EyePos, vDelta ); + g_v4LookAt = XMVectorAdd( g_v4LookAt, vDelta ); } - if ( VK_DOWN == n16KeyCode ) + if ( VK_DOWN == n16KeyCode || 's' == n16KeyCode || 'S' == n16KeyCode ) { g_v4EyePos = XMVectorSubtract( g_v4EyePos, vDelta ); + g_v4LookAt = XMVectorSubtract( g_v4LookAt, vDelta ); } + // X-轴 vDelta = { 1.0f,0.0f,0.0f,0.0f }; - if ( VK_LEFT == n16KeyCode ) + if ( VK_LEFT == n16KeyCode || 'a' == n16KeyCode || 'A' == n16KeyCode ) { g_v4EyePos = XMVectorAdd( g_v4EyePos, vDelta ); + g_v4LookAt = XMVectorAdd( g_v4LookAt, vDelta ); } - if ( VK_RIGHT == n16KeyCode ) + if ( VK_RIGHT == n16KeyCode || 'd' == n16KeyCode || 'D' == n16KeyCode ) { g_v4EyePos = XMVectorSubtract( g_v4EyePos, vDelta ); + g_v4LookAt = XMVectorSubtract( g_v4LookAt, vDelta ); } + // Y-轴 + vDelta = { 0.0f,1.0f,0.0f,0.0f }; + if ( VK_PRIOR == n16KeyCode || 'r' == n16KeyCode || 'R' == n16KeyCode ) + { + g_v4EyePos = XMVectorAdd( g_v4EyePos, vDelta ); + g_v4LookAt = XMVectorAdd( g_v4LookAt, vDelta ); + } + + if ( VK_NEXT == n16KeyCode || 'f' == n16KeyCode || 'F' == n16KeyCode ) + { + g_v4EyePos = XMVectorSubtract( g_v4EyePos, vDelta ); + g_v4LookAt = XMVectorSubtract( g_v4LookAt, vDelta ); + } + // 缩放 if ( VK_ADD == n16KeyCode || VK_OEM_PLUS == n16KeyCode ) { g_fScaling += 1.0f; diff --git a/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj b/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj index 6fafd408224d6f71aabca433963d60ef9301a5c4..9ff62b536fa6f224853324f8c989f4247ffa7e50 100644 --- a/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj +++ b/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj @@ -162,6 +162,11 @@ + + + Document + + diff --git a/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj.filters b/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj.filters index f3822d23c53ec3f50557034acebe4620870a9260..40c0773cd322e3e2d555bf83cdffe1c71a615050 100644 --- a/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj.filters +++ b/17-D3D12_Assimp_Animation/17-D3D12_Assimp_Animation.vcxproj.filters @@ -13,6 +13,9 @@ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {1a8435dd-5020-4b11-85fe-508e5932dc19} + @@ -42,4 +45,9 @@ 澶存枃浠 + + + Shader + + \ No newline at end of file diff --git a/6-MultiThread/6-MultiThreadWithMsgWait.cpp b/6-MultiThread/6-MultiThreadWithMsgWait.cpp index 15ce9a0036bff472557e286a91bb45b7fcce5891..ce8ef48137ea6df8dddf5948113937084f331461 100644 --- a/6-MultiThread/6-MultiThreadWithMsgWait.cpp +++ b/6-MultiThread/6-MultiThreadWithMsgWait.cpp @@ -1273,8 +1273,8 @@ UINT __stdcall RenderThread(void* pParam) stIBV.Format = DXGI_FORMAT_R32_UINT; stIBV.SizeInBytes = nIndexCnt * sizeof(UINT); - ::HeapFree(::GetProcessHeap(), 0, pstVertices); - ::HeapFree(::GetProcessHeap(), 0, pnIndices); + GRS_SAFE_FREE( pstVertices); + GRS_SAFE_FREE( pnIndices); } //4、创建常量缓冲 @@ -1643,12 +1643,8 @@ BOOL LoadMeshVertex(const CHAR*pszMeshFileName, UINT&nVertexCnt, ST_GRS_VERTEX*& fin.get(input); fin.get(input); - ppVertex = (ST_GRS_VERTEX*)HeapAlloc(::GetProcessHeap() - , HEAP_ZERO_MEMORY - , nVertexCnt * sizeof(ST_GRS_VERTEX)); - ppIndices = (UINT*)HeapAlloc(::GetProcessHeap() - , HEAP_ZERO_MEMORY - , nVertexCnt * sizeof(UINT)); + ppVertex = (ST_GRS_VERTEX*)GRS_CALLOC( nVertexCnt * sizeof(ST_GRS_VERTEX)); + ppIndices = (UINT*) GRS_CALLOC( nVertexCnt * sizeof(UINT)); for (UINT i = 0; i < nVertexCnt; i++) { diff --git a/Commons/GRS_Texture_Loader.h b/Commons/GRS_Texture_Loader.h index caa0b628f3eb33b509d521c5c39fe136075b1e23..9b747154696e63c62ff36e22cb6f919e2d8b3573 100644 --- a/Commons/GRS_Texture_Loader.h +++ b/Commons/GRS_Texture_Loader.h @@ -55,9 +55,9 @@ __inline BOOL LoadTextureFromMem( ID3D12GraphicsCommandList* pCMDList , IID_PPV_ARGS( &pITexture ) ) ); //获取需要的上传堆资源缓冲的大小,这个尺寸通常大于实际图片的尺寸 - D3D12_RESOURCE_DESC Desc = pITexture->GetDesc(); + D3D12_RESOURCE_DESC stDestDesc = pITexture->GetDesc(); UINT64 n64UploadBufferSize = 0; - pID3D12Device->GetCopyableFootprints( &Desc, 0, 1, 0, nullptr, nullptr, nullptr, &n64UploadBufferSize ); + pID3D12Device->GetCopyableFootprints( &stDestDesc, 0, 1, 0, nullptr, nullptr, nullptr, &n64UploadBufferSize ); stTextureHeapProp.Type = D3D12_HEAP_TYPE_UPLOAD; @@ -85,15 +85,12 @@ __inline BOOL LoadTextureFromMem( ID3D12GraphicsCommandList* pCMDList //获取向上传堆拷贝纹理数据的一些纹理转换尺寸信息 //对于复杂的DDS纹理这是非常必要的过程 - UINT nNumSubresources = 1u; //我们只有一副图片,即子资源个数为1 UINT nTextureRowNum = 0u; UINT64 n64TextureRowSizes = 0u; UINT64 n64RequiredSize = 0u; D3D12_PLACED_SUBRESOURCE_FOOTPRINT stTxtLayouts = {}; - D3D12_RESOURCE_DESC stDestDesc = pITexture->GetDesc(); - pID3D12Device->GetCopyableFootprints( &stDestDesc , 0 , nNumSubresources @@ -182,13 +179,15 @@ __inline BOOL LoadTextureFromFile( UINT nTextureH = 0; UINT nPicRowPitch = 0; - if ( WICLoadImageFromFile( pszTextureFile + bRet = WICLoadImageFromFile( pszTextureFile , emTextureFormat , nTextureW , nTextureH , nPicRowPitch , pbImageData - , szImageBufferSize ) ) + , szImageBufferSize ); + + if ( bRet ) { bRet = LoadTextureFromMem( pCMDList , pbImageData diff --git a/Revision.md b/Revision.md index 00efbe4e7d79cd8b17c672458ae401a802fef32e..b7590b6adae1396baa48545672ad02e614c57964 100644 --- a/Revision.md +++ b/Revision.md @@ -68,3 +68,17 @@ D3D12 ERROR: ID3D12CommandQueue::Present: Resource state (0x800: D3D12_RESOURCE_ 2021-6-10 1銆佹坊鍔犱簡Assimp瀵煎叆3D妯″瀷锛屽苟杩愯3D楠ㄩ鍔ㄧ敾鐨勭17鍙风ず渚嬶紱 + +2021-6-13 + +1銆佷慨姝d簡GRS_Texture_Loader.h涓敤WIC搴撳姞杞界汗鐞嗙殑BUG锛屼箣鍓嶅湪WIC鍔犺浇澶辫触鏃讹紝Load鍑芥暟浠荤劧浼氳繑鍥濼RUE锛屽苟涓斿湪鍒ゆ柇鏄惁闇瑕佸浘鐗囨牸寮忓吋瀹规ц浆鎹㈡椂閫昏緫涔熸槸閿欑殑锛岀幇鍦ㄦ敼涓洪鍏堝垽鏂兘鍚︾洿鎺ュ姞杞斤紝鐒跺悗鍐嶅垽鏂槸鍚﹀彲浠ュ仛鍏煎鎬ц浆鎹紝鐒跺悗鍐嶅幓杞崲鍔犺浇銆 + +2銆佹坊鍔犲苟淇浜嗙畝鍗曠殑鎽勫儚鏈烘帶鍒堕昏緫锛岃繖涓洰鍓嶈繕涓嶆槸浠嬬粛鐨勯噸鐐癸紝鎵浠ユ病鏈夊仛涓ユ牸鐨勬帶鍒躲 + +2021-6-14 + +1銆佸皢17鍙蜂緥瀛愪腑鐨勮儗鏅壊鏀规垚浜嗗ぉ绌鸿摑锛岀湅涓婂幓鑸掓湇涓浜涳紱 + +2021-6-16 + +1銆佽皟鏁翠簡16鍙蜂緥瀛愪腑鐨勮緭鍑烘牸寮忥紝骞朵笖杩藉姞浜嗘樉绀簃etadata鐨勪唬鐮侊紱