To add and remove assets from a scene an AssetContainer can be used.
It can be created manually
var container = new BABYLON.AssetContainer(scene);
Or by loading from a file. See loading from files
The container can then be used to add or remove contents of the container from the scene.
// Add all objects in the asset container to the scene container.addAllToScene() // Remove all objects in the container from the scene container.removeAllFromScene()
var keepAssets = new BABYLON.KeepAssets(); keepAssets.cameras.push(camera); container.moveAllFromScene(keepAssets);