Skip to content

Commit

Permalink
docs: update documentation for creating/renaming scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-moreau committed Aug 15, 2022
1 parent 35cfca6 commit f6e72d8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 67 deletions.
4 changes: 2 additions & 2 deletions doc/00 - welcome/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Welcome to the documentation of the Babylon.JS Editor. A series of tutorials are
## Tutorials
* Workspace
* [Creating a new workspace](../01%20-%20create-workspace/0-create-new-workspace.md)
* [Creating a new project](../01%20-%20create-workspace/1-creating-new-project.md)
* [Renaming a project](../01%20-%20create-workspace/2-renaming-project.md)
* [Creating a new scene](../01%20-%20create-workspace/1-creating-new-scene.md)
* [Renaming a scene](../01%20-%20create-workspace/2-renaming-scene.md)
* Running the scene
* [Running application/game](../02%20-%20running-project/0-running-project.md)
* [Playing scene](../02%20-%20running-project/1-playing-scene.md)
Expand Down
15 changes: 0 additions & 15 deletions doc/01 - create-workspace/1-creating-new-project.md

This file was deleted.

21 changes: 21 additions & 0 deletions doc/01 - create-workspace/1-creating-new-scene.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Adding Scene To Workspace

*Note: since Editor v4.4.0 the way to create new scenes changed. It is highly recommanded to update to to at least this version.*

By default, a newly created workspace contains one scene. Per workspace, it is possible to manage multiple
scenes in order to, for example, split levels of a game.

A newly created scene is always empty and ready to receive new assets etc.

## Creating A New Scene
To create a new scene in the workspace, just go to the `Assets Browser` panel and select `Add -> Scene...`.

![CreateNewProjectToolbar](./create-new-scene/create-new-project.png)

Once clicked, a popin appears to ask for the name of the scene. Once the button `Finish` is clicked,
the new scene is being created on the file system. Then, the Editor will ask to continue working
on the current scene or load the new one.

Once a scene has been created, a new folder located at *"`workspacePath`/projects/`sceneName`"* is created containing
all the resources of the scene. Once the new scene is loaded and generated, a new folder located at
*"`workspacePath`/scenes/`sceneName`"* is created.
50 changes: 0 additions & 50 deletions doc/01 - create-workspace/2-renaming-project.md

This file was deleted.

31 changes: 31 additions & 0 deletions doc/01 - create-workspace/2-renaming-scene.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Renaming A Scene

To rename a scene, just go to the `Assets Browser` panel and rename the scene file by double-clicking its name.

Once accepted, the following folders will be renamed:
- *`workspacePath`/projects/`oldname`* -> *`workspacePath`/projects/`newname`*
- *`workspacePath`/scenes/`oldname`* -> *`workspacePath`/scenes/`newname`*

Scene names must be unique. In case the folders already exists (in other words, if the scene already exists)
then the operation is aborted.

## Renaming paths in loaders in sources
Paths to scenes being loaded in the code must have their paths updated.

For example:
```typescript
const rootUrl = "./scenes/oldName/";

SceneLoader.Append(rootUrl, "scene.babylon", this.scene, () => {
...
});
```

should be renamed to:
```typescript
const rootUrl = "./scenes/newName/";

SceneLoader.Append(rootUrl, "scene.babylon", this.scene, () => {
...
});
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit f6e72d8

Please sign in to comment.