Unity Exporter Toolkit scene code

Hi, I am new to babylonjs and the toolkit… Is there a way to manipulate the already exported unity assets further using code without going back to unity (just as in playground)? I don’t want to use the script components (toolkit) but have direct access to the scene properties just from code. A very simple example, if I want to add a sphere on my already exported scene by using:
var sphere = BABYLON.MeshBuilder.CreateSphere(“sphere”, {}, scene); where (which file) should I put this code on so that the exported scene is updated with this new sphere.
My goal is to be able to manipulate objects during run-time and add some game logic after the export has happened. But I was not able to find any clue on where/how I can manipulate the scene using code only without going back to unity and without using any of the toolkit script components.
Thanks !

1 Like

Its funny you should mention that…

Hahah I was just talking about accommodating this idea, but it sounds like it has to be refined. But spot on bud this is one of my major concerns about developing scenes in an editor at this point.

Pinging @MackeyK24

Apart from the scripting limitations, it’s a great tool for exporting geometry from unity. But needs some serious fixing especially the light mapping is not exported correctly. I think the coordinates gets messed up during the conversion. But it’s a great tool for starting …

Yeah… that version was my first attempt at making babylon js tools :hammer_and_wrench:

You can always just NOT use any script components and just just use the raw geometry as best you can.

There is a new version coming out for the 4.1 release that is completely re-written from the ground up to support GLTF. So things like coordinations and materials are now properly exported to the GLTF 2.0 specification. So you get a much better scene export across the board.

Unity lighting is now exported properly including mixed light mapper modes and cascading shadow maps

Script components have be streamlined and now allow complete control via your own scripts.

There are also Pro Tools :toolbox: that support out the box things like pro Unity style shaders and pro Unity style physics, kinematic character controllers, advanced ray cast vehicles with AAA driving mechanics and multiple splat terrain and texture atlas exporting

Trying to get out with 4.1 release. But it’s a lot of work and there is only one of me

Keep on the look out for my Babylon Toolkit 4.1 technology preview video :blush:


I am looking forward to the new release. Thanks for the great job done till now :+1:

I see when using static batching (Babylon static layer), baked lightmaps are not exported. Is this normal ?

No… but it works correctly in new version. And now if you combine meshes … you would combine at design time. You mark meshes as static like you would in unity, and the scene manager extension will apply static mesh optimizations in BabylonJS

@MackeyK24 So are we transitioning to focus on gltf format over .Babylon?

Off your topic sorry, should I be focusing on that instead with the c4d exporter? Now im conflicted… And want to make sure im not wasting my time on something no one will be using in a year.

Also is there anywhere I can look at what you have done already for inspiration.

1 Like

Yep… GLTF is the way to go over native Babylon files

Can you point me to what you have been working on? Sorry I know this is off topic.

My driving demos at https://babylontoolkit.com/projects/speedway has a bit of everything from baked lightmaps with real-time cascade shadows to multi layered terrain splatmaps using texture atlas… via custom partial shaders to pro class vehicle physics with AAA driving mechanics… burns outs… skidding/drifting with AI drivers

And 100 percent GLTF 2.0 with a hit of extra unity metadata that the scene manager parses to give it that pizzazz :blush:


Super cool, thank you.

When will your new version be available ?

Correct me if I am mistaken but I does GLTF support lightmaps ? Tried already with platter gltf exporter. Lightmaps are not supported.

Lightmaps are not officially supported in the GLTF 2.0 spec. But the Babylon toolkit does export lightmap metadata that the scene manager parses and applies lightmap textures during material creation