adobe / USD-Fileformat-plugins

A collection of USD fileformat plugins
312 stars 21 forks source link

Handle trailing whitespaces in obj/mtl file gracefully #23

Closed thearperson closed 5 months ago

thearperson commented 6 months ago

When processing obj materials, certain input files may be a bit ill-formatted with trailing whitespaces

Expected Behaviour

handle trailing whitespaces gracefully

Actual Behaviour

parsing logic fails with: https://github.com/adobe/USD-Fileformat-plugins/blob/main/utils/usdData.cpp#L276

Here is a sample mtl file illustrating the issue: test.mtl.txt

Here is a temporary workaround we are using internally for now: https://github.com/cloud-zeta/AdobeUSD/commit/87efbedadb900463fea1463827a38bce234375ad

Hope it helps. Thanks.

kwblackstone commented 5 months ago

thanks for the report, added a fix to v1.0.4