Jump to content

Babylon.js rendering multi textures with FilesInput


theB
 Share

Recommended Posts

I am using Babylon's FilesInput for listening to an upload from the user. I have also implemented the import for an .obj file. So a user gives to babylon an .obj file with an .mtl file for the materials and .jpg for the texture. However let's say that my user have multiple textures in multiple .jpg files. I noticed that babylon.js just reads the first one and don't consider the others .jpg files. Is there a way to fix this? To clarify my question. With the structure:

- materialFile.mtl
- textureFile.jpg
- objectFile.obj

Everything is perfect. However when I have:

- materialFile.mtl
- textureFile1.jpg
- textureFile2.jpg
- textureFile3.jpg
- objectFile.obj

Babylon.js don't read textureFile2 and 3. Here is my code for the FilesInput:

Importer = new BABYLON.FilesInput(this.engine, this.scene, this.Loaded.bind(this), null,
  null, null, () => BABYLON.Tools.ClearLogCache(),
  null, this.Error.bind(this));
Importer.monitorElementForDragNDrop(canvas);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...