Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLB to OBJ / MTL issue #313

Open
fabiencomte opened this issue Jan 4, 2025 · 5 comments
Open

GLB to OBJ / MTL issue #313

fabiencomte opened this issue Jan 4, 2025 · 5 comments
Assignees
Labels

Comments

@fabiencomte
Copy link

Hello,
I try to convert GLB files with textures in OBJ / MTL and the application goes in infinite loop. No file is created.
2019_bugatti_divo.zip

2014__volkswagen_gti_roadster_vision_gt_gr.3.glb.zip

@fabiencomte
Copy link
Author

Not better with GLTF source.
2021_bugatti_chiron_pur_sport.zip

@HuguesDelorme HuguesDelorme self-assigned this Jan 6, 2025
@stellarpower
Copy link

I am reproducing the same behaviour, it locks up. I have had success with some files before. IDK enough about the file types to know what the differences would be, but GLB exported form Blender 3.4 worked fine, GLB export from Blender 4.3 causes the loop. I have also tried converting the GLB to GLTF and the problem the same. I'll see if I can look into it

@stellarpower
Copy link

stellarpower commented Jan 29, 2025

Okay, so this is the cause of the error, and it's hanging because it's not catching the exception. The worker thread exits presumably with the unhandled exception, but the QApplication thread is hanging waiting for a progress update or something like it:

Image

The following update gets us a clean exit:

bool OccObjWriter::writeFile(const FilePath& filepath, TaskProgress* progress) try{

    ... 

    if (m_seqRootLabel.IsEmpty())
        return writer.Perform(m_document, fileInfo, occProgress->Start());
    else
        return writer.Perform(m_document, m_seqRootLabel, nullptr, fileInfo, occProgress->Start());

} catch (const Standard_Failure &e){
    cerr << e.GetMessageString() << "\n\n" << e.GetStackString() << endl;
    return false;
} catch (...) {
    cerr << "Unhandled exception in conversion" << endl;
    return false;
}

I'm just following the backtrace here, @HuguesDelorme you'd know far better than I what it really amounts to re the input file. Here's a mesh to reproduce, in binary format but with an extension to fool GH's CDN.

Blender 4.3 NS S3R1.glb.txt

I'm reproducing on both OpenCascade 7.8.1 and 7.6.3.

Cheers

@fabiencomte
Copy link
Author

Hello, thank you so much to investigate the issue. Best regards.

@HuguesDelorme HuguesDelorme added this to the version/0.10.0 milestone Jan 30, 2025
@HuguesDelorme
Copy link
Member

I'm just following the backtrace here, @HuguesDelorme you'd know far better than I what it really amounts to re the input file. Here's a mesh to reproduce, in binary format but with an extension to fool GH's CDN.
Cheers

@stellarpower
Many thanks for your investigation and the hard work
Will propose a fix soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants