Batch convert VRML Models to BabylonJS into single mesh

I currently have a few hundred models that are in VRML format that I’d like to convert to BabylonJS format. I’ve successfully done this with Blender by hand and programmatically using the python interface. However once I import the Babylon file into a Babylon scene (using the asset manager’s addMeshTask) and attempt to change the position of the mesh I noticed that the meshes aren’t linked together at all.

I also have to do some manual cleanup in the file, to remove the camera and light, but also to clean up the materials, I wrote a script to detect materials that are identical. I’m kind of surprised that happened in the first place, potentially related to them not being linked together?

Well as an old VRMLer myself, let me welcome you to the community :slight_smile:

I’ve successfully done this with Blender by hand

I can’t answer your question as I did the same myself a long while back, but do you want to really create a single mesh? For example: there are times when you can create “instances” - duplicate meshes that share the same materials but are just different position, rotation and scale.

But maybe someone can help - as I don’t consider myself a coder compared with lots of the folks around here.

You ever go in any Blaxxun worlds?

cheers, gryff :slight_smile:

1 Like

@gryff I’m an old VRMLer also. Worked for Bitmanagement (successor to Blaxxun) for a few years :slight_smile:

VRML/X3D is/was highly underrated. Still nostalgic for that …

@davidworkman9 in your addMeshTask you could parent loaded meshes to a new TransformNode and that could be what you use to position, rotate and scale your loaded meshes? Just an idea, but I’m not sure I fully understand your use case.

Thanks for the suggestion for TransformNode. That worked perfectly.

Never dealt with VRML before. That just happens to be the format that the library I’m working with is in. This is actually my first real project in the 3D world since college. Really enjoying Babylon though.

A little context: I’m working on a project to render electrical components (resistors, capacitors, ICs, etc.) on a plane. I have a library of hundreds of components in VRML that I want to convert to Babylon.

Another issue I’m sure I’ll run into is I would like to render them on the screen, potentially up to 100 of them at a time. I’m sure I’m going to run into some performance issues there. Any pointers would be appreciated! :slight_smile: