Layer System

From Virtual World Web Wiki
Revision as of 19:38, 5 September 2017 by Spark5 (Talk | contribs)

Jump to: navigation, search

The layer system is the basis for building 3D scenes. A layer is essentially an Object Type that can be connected to one or more scenes. It also describes the spacial bounds within which objects can be placed and who has permission to edit and configure the layer.

An Object Type is a storage container for a snippet (or sub-tree) of a 3D document (see: Document Object Model (DOM)). When an Instance of a Scene is created on an Instance Host a DOM document is initialized with a root node representing the instance itself, and as children of this root node, a scene node that represents the scene's configuration and a participants node that acts as a container for connected users' avatar documents. Layers attached on the scene then bring snippets of document into the scene as child nodes of the scene document.

Layer system DOM example.png

Layers are created in, and owned by, a single scene. Once created, they can be linked to other scenes or Worldspace. This is a very powerful feature as it allows you to share layout between scenes or to place shared objects or global scripts into a layer and then attach it at the world level so all scenes include the layer.

Layers inherit permissions from the scene they are created in (their owner). There are two layer-related permissions. When a user has the Layer Config permission on a scene they can create and delete layers on a scene as well as configure the spacial bounds of existing a layers, and set permissions on the layer, potentially granting edit rights to other users. When a user has the Layer Edit permission on a layer they can take the layer into edit mode and make changes to it. This works similar to "Scene Editing" in the past.

Layers also have versions. Only one version of a layer can be active at a time. You can edit any version of a layer and if you edit a version which is not currently active, other users won't see your changes until you make that version the active one.

Usage Examples

Hotel Rooms

Imagine you wanted to prop out 50 hotel rooms and you wanted them to be almost the same, with a few unique bits in each one. You could create a layer on the first hotel room, prop in all your shared objects like sinks, toilets, beds, showers, doors, etc. Then, link that layer to all of the other hotel rooms. Each scene also comes with a default layer when it's created, you could edit this layer in each scene to add your "special touches" to each hotel room.

Apartments With Base Objects

Imaging you wanted to have a user apartment that comes with some objects "built in" to the scene that they cannot edit. For example, you want to have scripted light switches that turn on built-in lighting, a working TV that streams content you provide, or working bathroom and kitchen fixtures that aren't meant to be removed or customized. This is easy with layers. Simply create your showroom property and put it up for sale in the property mall as you always would. Then create a layer on the showroom scene and prop in the shared objects. Finally, in the admin, set the "Action On Sale" for the layer to "Link". This way, when a new scene is created for a user on purchase, the layer will be linked to their new property, but they won't have edit rights on it, since it's owned by the showroom. A nice side-effect of this is that you can fix problems with this layer any time after the user purchases the property and they'll see the improvements immediately.

Convention Hall

Imagine you have a giant convention hall and you want to make it possible users to edit their own booths. Giving edit permission to the entire hall to all of the exhibitors would not be practical or safe. This is where bounded layers come in. Simply create your big empty convention hall scene, and prop out shared objects on the default layer (carpets, plants, lighting, ads, signs, etc.). Then, for each booth, create a new bounded layer. This can be done in Curiosity using visual tools to help you position and size the bounding box within which each booth owner can edit. Finally assign permissions to each layer so that the appropriate user can edit it. Later, the user can come to the convention hall, and they will only have Layer Edit permission on the one layer you assigned to them. They won't have Layer Config permission at all (since it's not their scene). When they edit their layer, they will only be able to place object inside the bounds you set for their booth.

Creating a layer

In the admin

Look up the scene in which you want to create the new layer by either:

  • Worldspace Menu -> Worlds Menu -> Select a world -> click the Scenes tab of your world -> select your scene from the list
  • paste the VWW URL of your scene into the Global Search box at the top of the admin left nav / menu bar.

On the Layers tab of your scene you can see all the layers owned by this scene as well as any layers linked to this scene from somewhere else.

Simply press the Create Layer button and give the new layer a name. That's it! You have a new layer on your scene and if you're in Curiosity in the scene at the time, you should see the new runtime layer document appear in the room immediately. You can now click on the new layer and start an edit session on the layer

In Curiosity

Editing a layer