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

Fix loading of .obj mesh files #3772

Merged
merged 3 commits into from
Oct 10, 2023
Merged

Fix loading of .obj mesh files #3772

merged 3 commits into from
Oct 10, 2023

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Oct 10, 2023

mime_guess maps .obj to tgif files... but let's be real: nobody expects a tgif file.

This also made me realize that mime_guess is unmaintained and missing some important stuff (e.g. JPEG XL) and we should switch to mime_guess2... but for that we must first switch egui_commonmark to mime_guess2 😭

Also, we don't load associated mtl files when loading objs, which makes their use pretty limited...

$ rerun  /tmp/bm/bmw.obj

image

What

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested demo.rerun.io (if applicable)
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@teh-cmc teh-cmc added 🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself include in changelog labels Oct 10, 2023
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the python-side guessing better?

crates/re_types/src/components/media_type_ext.rs Outdated Show resolved Hide resolved
@teh-cmc
Copy link
Member Author

teh-cmc commented Oct 10, 2023

Is the python-side guessing better?

Yeah, the C++ and Python SDKs don't use a third-party lib, they just do a dumb switch.

They could use a .to_ascii_lowercase() too though.

@teh-cmc teh-cmc merged commit 0a2a594 into main Oct 10, 2023
31 of 32 checks passed
@teh-cmc teh-cmc deleted the cmc/obj_dragndrop branch October 10, 2023 11:51
@emilk emilk changed the title MediaType::guess_from_path: enforce .obj extension to be Wavefront Obj Fix loading of .obj mesh files Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working include in changelog 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drag & Drop of obj models doesn't work
2 participants