Skip to content

Commit

Permalink
Improved reporting of vertex welding stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ziriax committed May 23, 2018
1 parent a332cd0 commit 99f4b1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions maya/scripts/maya2glTF_UI.mel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
proc string _quoted(string $text)
proc string _quoted(string $text)
{
string $quote = "\"";
return $quote+$text+$quote;
Expand Down Expand Up @@ -251,7 +251,7 @@ global proc maya2glTF_UI()
global string $gMainProgressBar;

// This is auto-updated by msbuild
string $maya2glTF_version = "v0.9.4-beta b176ae5";
string $maya2glTF_version = "v0.9.4-beta a332cd0";

if (`window -exists maya2glTF_exporter_window`)
deleteUI maya2glTF_exporter_window;
Expand Down
5 changes: 4 additions & 1 deletion src/MeshRenderables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MeshRenderables::MeshRenderables(

const auto primitiveCount = mainIndices.primitiveCount();
const auto maxVertexCount = mainIndices.maxVertexCount();
const auto minVertexCount = mainShape->semantics().descriptions(Semantic::POSITION).at(0).elementCount;
const auto perPrimitiveVertexCount = mainIndices.perPrimitiveVertexCount();

auto primitiveVertexIndex = 0;
Expand All @@ -38,6 +39,7 @@ MeshRenderables::MeshRenderables(
const auto semanticsMask = args.meshPrimitiveAttributes;

auto totalWeldCount = 0;
auto totalVertexCount = 0;

for (auto primitiveIndex = 0; primitiveIndex < primitiveCount; ++primitiveIndex)
{
Expand Down Expand Up @@ -132,7 +134,8 @@ MeshRenderables::MeshRenderables(
}
}

cout << prefix << mainShape->dagPath().partialPathName().asChar() << ": welded " << totalWeldCount << " out of " << maxVertexCount << " vertices" << endl;
cout << prefix << mainShape->dagPath().partialPathName().asChar() << " will have " << maxVertexCount-totalWeldCount
<< " vertices. Welded#" << totalWeldCount << ", min#" << minVertexCount << ", max#" << maxVertexCount << endl;

// Now compute the blend-shape vector-deltas by subtracting the blend-shape-base mesh from the blend-shape-targets
if (meshShapes.size() > 1)
Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "externals.h"

const char* version = "v0.9.4-beta b176ae5";
const char* version = "v0.9.4-beta a332cd0";

0 comments on commit 99f4b1e

Please sign in to comment.