Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Open more model formats directly - #3694

Open
ewanhowell5195 wants to merge 30 commits into
JannisX11:nextfrom
ewanhowell5195:next
Open

Open more model formats directly#3694
ewanhowell5195 wants to merge 30 commits into
JannisX11:nextfrom
ewanhowell5195:next

Conversation

@ewanhowell5195

@ewanhowell5195 ewanhowell5195 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Adds direct opening for obj, gltf, glb, fbx, dae, stl, ply, 3mf, amf, 3ds, kmz, md2 and wrl, through normal file opening (Ctrl+O, drag and drop, recent files, file associations). They load into a generic model project.

OBJ reuses the importer from the OBJ dialog so it keeps its quads. The rest go through three.js loaders and a shared converter in js/io/three_import.ts, and import as triangles.

Codecs can now declare how their file should be read, since the binary formats were previously read as text.

GLTF and FBX are also in File > Import, with a scale option, adding to the current project inside an undo step instead of opening a new one.

The new formats are import only. Opening one deliberately does not set an export path, so saving cannot overwrite the source file.

Also fixes mesh vertex points being left visible on creation, which only showed on meshes built outside the usual draw flow.

The import OBJ dialog now fills in the MTL field from the mtllib line or a matching file name.

If a model uses files that cannot be found, eg an OBJ's MTL or its textures, a dialog now asks you to provide them. On desktop this only asks for files that are actually missing. The web version cannot read files that were not chosen, so it always asks. Picking an MTL in the dialog checks what textures it needs, and adds any missing ones to the same dialog.

Also fixes drag and drop in the web app, which has been broken for all file types since d68d6f1. Dropping a file crashed before any handler ran. This is because the drop handler calls string methods on the dropped files, and the web version has File objects rather than paths. There were two older bugs underneath that as well, meaning that on the live site every drop still throws an error in the console after the file loads.

opens as a generic model, reusing the importer from the obj dialog.
they were left visible on creation, so meshes built outside the usual draw flow rendered black points over every vertex.
binary formats were previously always read as text, in all four places that open a model.
adds the shared three.js to blockbench converter that the other formats reuse.
three misdetects and then chokes on ascii fbx, so it is sanitised before parsing.
their inherited compile returns an empty string, so saving would have blanked the file that was opened.
some loaders attach images through their own manager once parse has returned. decoding runs concurrently so a texture that never arrives costs one wait, not one per material.
the chevrotain parser it needs adds about 180kb to the bundle.
@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for blockbench-dev ready!

Name Link
🔨 Latest commit 7381670
🔍 Latest deploy log https://app.netlify.com/projects/blockbench-dev/deploys/6a9c1ddb80d8410007e9b5d8
😎 Deploy Preview https://deploy-preview-3694--blockbench-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

importing adds to the current project inside an undo step, rather than opening a new one.
matches the obj import dialog. gltf has no unit field, so files not authored in metres need this.
# Conflicts:
#	js/io/codec.ts
#	types/custom/codec.d.ts
@EJD799

EJD799 commented Aug 20, 2026

Copy link
Copy Markdown

There's an issue. The textures never load, presumably since the web version can't access local files that aren't chosen. In the web version, it should ask for the MTL and all the textures as well.

@ewanhowell5195

ewanhowell5195 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Hey @EJD799, this is fixed now! If a model uses files that cannot be found, a dialog asks you to provide them. In the web version it asks for the MTL, and picking one adds any textures it needs to the same dialog. On desktop it only asks for files that are actually missing next to the model.

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