How do I get the current scene name?

How do I get the current scene name?

If you’re talking about where you can access the current scene’s name so you can change it, you click on the settings icon image and then you click next to SCENE NAME and give the scene it’s new name.

image

I want to get it through Script

Well, usually in order to switch scenes, you just get the scene’s code.

image

And if you don’t want to switch scenes, then I’m not really sure what you’re trying to accomplish.

You can access the scene name from the pc.SceneRegistryItem:

var sceneItem = this.app.scenes.find("Main Scene");
console.log(sceneItem.name) // Main Scene

There’s no way to get the ‘current’ scene as scenes can be load additively, multiple teams etc.

The best bet is to keep track yourself in the project.

1 Like

@yaustar just wanted to check, but is this still the same case; that scenes can be loaded additively?

@Mark_Lundinnit sorry, not sure what you are asking ?

Yes, you can definitely load a scene hierarchy, add it to the existing hierarchy without removing the old one.

1 Like