Skip to content

Commit 7c3206f

Browse files
committed
Ignore Tr parameter when d exists in MTL(#43)
1 parent 4886eeb commit 7c3206f

File tree

5 files changed

+948
-40
lines changed

5 files changed

+948
-40
lines changed

loader_example.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,14 @@ static bool TestStreamLoadObj() {
364364
std::map<std::string, int>* matMap,
365365
std::string* err) {
366366
(void)matId;
367-
(void)err;
368-
LoadMtl(matMap, materials, &m_matSStream);
367+
std::string warning;
368+
LoadMtl(matMap, materials, &m_matSStream, &warning);
369+
370+
if (!warning.empty()) {
371+
if (err) {
372+
(*err) += warning;
373+
}
374+
}
369375
return true;
370376
}
371377

models/tr-and-d-issue-43.mtl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
newmtl Material.001
2+
Ka 0 0 0
3+
Kd 0 0 0
4+
Ks 0 0 0
5+
d 0.75
6+
Tr 0.5
7+
8+
newmtl Material.002
9+
Ka 0 0 0
10+
Kd 0 0 0
11+
Ks 0 0 0
12+
Tr 0.5
13+
d 0.75

0 commit comments

Comments
 (0)