You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
loadModel works well for most obj, but for obj file with crlf line terminator, model loader will use wrong file name to find mtl file, and finally cannot find mtl file.
for example,
INFO: FILEIO: [CamoStellarJet.obj] Text file loaded successfully
': No such file or directory (2)oStellarJet.mtl
': -3BJ: Failed to parse material file 'CamoStellarJet.mtl
after changing clrf to normal line terminator,
INFO: FILEIO: [CamoStellarJet.obj] Text file loaded successfully
INFO: MODEL: [CamoStellarJet.obj] OBJ data loaded successfully: 1 meshes/1 materials
INFO: MODEL: model has 1 material meshes
INFO: FILEIO: [CamoStellarJet.png] File loaded successfully
every thing works well.
My crlf obj file is generated by magical voxel in windows, but it can be loaded successfully in blender.
The text was updated successfully, but these errors were encountered:
raysan5
changed the title
[rrmodule] Fails to load mtl file in obj file with crlf line terminator
[rmodels] Fails to load mtl file in obj file with crlf line terminator
Jun 21, 2023
@futu2 I'm afraid the issue resides in tinyobj_loader_c.h external library, it uses fp = fopen(filename, "r"); to load the material file and consequently the EOL are not properly translated to the OS.
@futu2@Peter0x44 Just pushed a possible fix for the issue but please note that it belongs to an external library (tinyobj_loader_c.h) and this fix could be overwritten when library gets updated. Feel free to comment if issue persists.
Issue description
loadModel works well for most obj, but for obj file with crlf line terminator, model loader will use wrong file name to find mtl file, and finally cannot find mtl file.
for example,
after changing clrf to normal line terminator,
every thing works well.
My crlf obj file is generated by magical voxel in windows, but it can be loaded successfully in blender.
The text was updated successfully, but these errors were encountered: