How to load a j3o scene file programatically?

I’ve created a scene containing a terrain and a directional light, stored in “Project Assets/Scenes/cameraTest.j3o”.

How do I now load this in my Main.java (SimpleApplication)?

I tried googling and looking in the documentation but couldn’t find anything :confused:

#Whop!
Looks like I’ve found it. I noticed in the SDK that there was a code template called "J3O Load"ooks like that’s what I need!

@see
https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_asset.html

Thanks.

Hm. I’m running version 3.0 of the SDK and my scene file has a .j3o extension but the code in this part of the docs says this:

Spatial scene = assetManager.loadModel("Scenes/town/main.scene");
rootNode.attachChild(scene);

Actually I just noticed there’s an example where it uses a .j3o as well. Oh well, I guess that’ll work then!

Lots of suffixes work (.scene, .ogre.xml, .blend, .j3o…). Basically whatever jme has importer for will work.