Skip to content

Commit 83bdf53

Browse files
committed
glb fix for latest blockbench export.
1 parent 8a3f647 commit 83bdf53

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/graphics/mesh/glb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ void GLBLoader::handleNode(int node_id, GLBFile::Node& node)
135135
if (node_json.find("mesh") != node_json.end()) {
136136
auto& mesh = json["meshes"][static_cast<int>(node_json["mesh"])];
137137
for(auto& primitive : mesh["primitives"]) {
138+
if (static_cast<int>(primitive["mode"]) != 4) continue; // Only import triangle primitives
138139
auto& p_a = json["accessors"][static_cast<int>(primitive["attributes"]["POSITION"])];
139140
auto& p_b = json["bufferViews"][static_cast<int>(p_a["bufferView"])];
140141
auto& n_a = json["accessors"][static_cast<int>(primitive["attributes"]["NORMAL"])];

0 commit comments

Comments
 (0)