Control Blender object via BJS

Hello guys,

I followed the steps of this link to export a blender object to babylon.js Blender - Babylon.js Documentation
Now I have my object (a metro station modeling in blender) and I can visualize the object using HTML script mention in the link I showed you.

The problem is that the shape of the object is like a fixed image :thinking:, can I control the camera through BJS ? (rotate with the mouse, zoom in, zoom out), so that I can walk around my station.
and when I import the object, does the BJS exporter exports all the meshes of the object element by element and ensures their quality or exports the whole thing in one object ? (because I need meshes to use them in code for animations like mechanical stairs for example)

you will find attached an image of my station

with kind regards

Weird that you can’t move the camera, a raw copy-paste from the doc’ example works well

Did you check your browser console to stop some errors?

this is my browser console :

It can’t load the textures of my object

I solved the errors, now there is no error in my browser console, but camera still doesn’t work :worried::worried:

If you modeled the station with seperate meshes, they get exported as seperate meshes. If you modelled them as one mesh then you get one mesh. The quality depends on the quality you used in Blender. Low poly in Blender, low poly in Babylon.

As for the camera and lights, did you set them up in Blender, and export them? Have you attached the camera to the scene in your code?

cheers, gryff

thank you so much for your reply, I solve the problem by deleting camera in blender, no it works :slight_smile:
about meshes, I f I want to call them in code, I use directly their names using in blender ?

Use a call like this:

var myMesh = myScene.getMeshByName(“mesh name here”);

As for the camera it should not be an issue getting your camera from Blender :

var myCamera2 = myScene.getCameraByName(“Camera”);
myCamera2.speed = .1;
myScene.activeCamera = myCamera2;

cheers, gryff :slight_smile: