Skip to content

Support for .obj files with textures#1

Open
2s0ckz wants to merge 8 commits into
3DRev:mainfrom
2s0ckz:main
Open

Support for .obj files with textures#1
2s0ckz wants to merge 8 commits into
3DRev:mainfrom
2s0ckz:main

Conversation

@2s0ckz
Copy link
Copy Markdown

@2s0ckz 2s0ckz commented Apr 24, 2026

Added option to load .obj files with textures. Switched from frequency-weighted solid colour clustering to perceptual, diversity-preserving clustering so many shades of a single colour do not crowd out distinct colours. Added colour palette option for user-defined solid colours. Added an export preview visualization option. Added recoloring tools in preview mode.

2s0ckz added 3 commits April 24, 2026 18:36
…y-weighted solid colour clustering to perceptual, diversity-preserving clustering so many shades of a single color do not crowd out distinct colors. Added color palette option for user-defined solid colours. Added an export preview visualization option. Added recoloring tools in preview mode.
Fixes to full spectrum processing of .obj textures. Added undo/redo functionality in export preview mode.
@davidkrammer
Copy link
Copy Markdown

davidkrammer commented Apr 26, 2026

does not work for me, i tried your implementation with colored obj file from meshy.ai

Edit: i forgot to add the mtl and png files, but loading a colored model is so slow.. took like 5 minutes to open and has issues
Screenshot 2026-04-26 at 19 44 27

@2s0ckz
Copy link
Copy Markdown
Author

2s0ckz commented Apr 26, 2026

Interesting.... It works for me. This model (after converting to .obj format) runs in less than a minute on my machine: https://sketchfab.com/3d-models/dog-e395f26615ca445ab32f01ded17ff3bf

Did you check if the model you are using is large enough for the layer dithering to work properly?

model processed zoomed

Implemented @davidkrammer 's improved .obj file handling while maintaining other added features.
@davidkrammer
Copy link
Copy Markdown

the model i have used to test is from meshy and has 145,6mb with a lot of triangles :D i made my own implementation which imports that large file in around 9 seconds here #2

@2s0ckz
Copy link
Copy Markdown
Author

2s0ckz commented Apr 26, 2026

I saw your update and merged it into my fork (there were several other feature updates in my fork, such as export preview, solid color processing, and recoloring, so I thought it would be easier to merge your code into this fork than vice versa). Your .obj file import code is definitely better than mine was.

Could you try testing the updated code and let me know if it works?

Also, I meant large with respect to volume, rather than file size. From your screenshot, it looks like the model might be on the same order of magnitude in size as the filament layers, which might be the cause of the issues.

@davidkrammer
Copy link
Copy Markdown

yes my model is only 0.15mm when loaded in so i have to scale it. sadly it does not load textures in your new commit for me
Screenshot 2026-04-27 at 01 33 58
Screenshot 2026-04-27 at 01 35 17

@2s0ckz
Copy link
Copy Markdown
Author

2s0ckz commented Apr 27, 2026

Is there any way you could send me a link to this file? Thank you!

@2s0ckz
Copy link
Copy Markdown
Author

2s0ckz commented Apr 27, 2026

Unable to download without a subscription... any chance you could upload it to Google Drive or Dropbox? I'd like to figure this issue out because the textures are loading fine for several models that I've tried uploading, so it might be an edge case that shows up with this model.

@davidkrammer
Copy link
Copy Markdown

@2s0ckz
Copy link
Copy Markdown
Author

2s0ckz commented Apr 27, 2026

Thanks for that link. I think the problem is that the .obj file references a .mtl file called "Meshy_AI_A_colorful_parrot_0423221052_texture.mtl" and texture file called "Meshy_AI_A_colorful_parrot_0423221052_texture.png", but the .mtl and .png files are named parrot.mtl and parrot.png, respectively.

After renaming the files and copying some more of your code for the .obj loading pipeline, the model loads fine. However, this file is too large and causes the web app to run out of memory when processing in CMY mode.

Parrot

Cleaned up code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants