I am trying to achieve a Babylon.JS model viewer which allows for configuring various aspects of the model. Whilst I have JavaScript experience I am new to Blender and 3D modelling in general. This is in the context of interiors so for example for a kitchen one might want to switch the meshes which are visible (for example displaying different cabinet handle shapes) or the material (for example choosing a marble or wood floor).

I am exporting my models as a glTF file (using glTF-Blender-IO) and importing it into Babylon.JS which is working successfully. I can see how I can go about changing the meshes which are visible by having multiple meshes in Blender and selectively showing/hiding them in Babylon so that only the desired mesh is visible at any one time. The issue I am having is thinking about how I can export alternate materials from Blender.

I am able to switch the materials used between meshes easily in Babylon.JS easily by simply changing the material for the mesh to one of the other materials in the scene. The problem is that I am only able to export the materials which are assigned to a mesh and can only export one material per mesh. Ideally I would like to be able to export a large number of materials from Blender so that they are available for use in Babylon.JS but at the minute the only way I can think to do this is to create a dummy mesh for each material which is not visible when rendered. I wonder if anyone knows of a better way of achieving this?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.