Closed plainliu closed 1 week ago
@plainliu those MTL lines almost look like coming from the custom OBJ Exporter that I have in my repository.
This document shows what I actually use for custom MTL entries.
If you are interested then take a look at customized Assimp I have made in my updates branch, especially the ObjFileMtlImporter.cpp file but don't limit your research to that file only.
My ASSIMP Viewer should be able to load your MTL + OBJ + Textures files. I think that my OBJ Viewer should be able to load those files as well.
Ah, these are special extensions for physical based realtime rendering.
@GitHubDragonFly I tried to import my obj use updates branch, it still load failed. the branch parsed P-c-c not only P-c, so "cns" error become "ns" error. OBJ Viewer can load my obj, I dont know why.
and I have some other questions
@kimkulling where can I get those special extensions? if not use them, importer return nullptr still is a question, I have fixed it on my local repo but not perfect way, and report the question here expecting fix it in this repo~~
@plainliu my OBJ Viewer is only looking for known entries and is ignoring the rest - that is probably why you can load your OBJ model.
I am not really keeping the updates
branch up-to-date but have just updated it now to include a check for space in the MTL file, which might make it work with your model. This assimp fork on my end is archived for historical purposes and if anyone can find anything useful in that updates
branch.
Maybe try loading your OBJ model again in my ASSIMP Viewer to see if it works now.
If you cannot compile the updates
branch then just try updating the file(s) manually.
@GitHubDragonFly Thanks, changes in function ObjFileMtlImporter::load()
is what I what. also need skip \t
.
I tried compile updates
branch, function getNumComponentsInDataDefinition
has errors
SkipSpaces
& SkipToken
params errorSkipSpaces
use mEnd
, and tmp
skip space failed, IsNumeric
only checked first space char, so isNum is false@plainliu maybe try compiling again.
I just updated ParsingUtils.h
file and, even though it is a mix of old and new code, the updates
branch did compile for me by using emscripten and mingw.
Would you also be able to actually test loading your OBJ+MTL+Texture files in my current ASSIMP Viewer just so I know whether it is working properly with your model.
@GitHubDragonFly The updates
branch compile & load my obj successfully now. ASSIMP Viewer loaded successfully too.
@plainliu thank you for testing.
Here is some more info about the updates
branch just so you are aware:
Here is another topic in this forum that has some other info.
Describe the bug ReadFile() throw exption and return nullptr when load obj.
To Reproduce There are lines in .mtl like:
when
ObjFileMtlImporter::load()
parsePccns 1-1
, first match char 'P', then match char 'c', then get next word "cns" in getFloatValue to parsedeadly error
Expected behavior The mtl file is created by a modified js OBJExporter, skip the line when parse failed