3DVisualizr - Standalone JS library for 3D Digital Twin
3DVisualizr is designed to view and visualize factory data in a 3D format by connecting data sources to virtual assets. Virtual assets can display their state, by changing their color based on some predefined rules, and KPIs in a label that can be attached to each individual asset.
In the documentation, we mostly refer 3DVisualizr by its acronym 3DV. However, sometimes we can refer the library by its legacy name E3D.
Current Version
Version | Documentation |
---|---|
4.1.6 | Documentation |
Install
The 3d viewer can be installed as a dependency to a project using either yarn or npm. To do this you need to connect to a private registry which can be done as follows
Connect to the private NPM registry for installing 3d viewer by creating .npmrc at the root of your project (next to package.json). The registry has npmjs.com as an upstream feed, meaning that you can still use regular packages from public sources. Add the following contents to .npmrc
registry=https://pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/registry/
always-auth=trueThe registry needs to be authenticated against
- For Windows use vsts-npm-auth
- For Others (unix) put the following in your user .npmrc (usually located located at
~/.npmrc
) and replace both[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
with a token with read access to the registry
; begin auth token
//pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/registry/:username=elisasmartfactory
//pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/registry/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/registry/:email=npm requires email to be set but doesn't use the value
//pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/:username=elisasmartfactory
//pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/elisasmartfactory/_packaging/3dv/npm/:email=npm requires email to be set but doesn't use the value
; end auth tokenFinally install the 3d viewer as dependency
yarn add e3d@latest
npm install e3d@latestor
@preview
for stable development versionor
@next
for latest development version
The package contains typings and can be easily imported into existing projects.
Getting started
Including the viewer to your project
Including e3d
In order to get started you need to include the 3d viewer to your project. Depending on the project and setup you can do one of the following
- Import the module to your project by using default
import { ... } from "e3d";
(Recommended if the project supports this).- Note: with this method you also need to include the e3d.app.css with the method of your choosing. For example by using the css-loader for Webpack
- Copy the distribution files to your project and include the necessary files in the page manually
<link rel="stylesheet" type="text/css" href="path/to/the/files/e3d.app.css">
<script src="path/to/the/files/e3d.bundle.js"></script>
<!-- e3d.bundle.es5.js is also shipped with the package if es6 is not supported -->
First steps
Everything in the viewer starts with the Widget
. The widget is used to initialise and start everything beneath it and will work as sort of a context for the specific runtime. Meaning that it will hold all the data and settings for the context during runtime. After initialisation the Viewer
, which can be accessed through widget.viewer
, will handle most of the orchestration of what's visible in the screen.
import { Widget } from "e3d";
const widget = new Widget();
Next the widget's render()
method will return HTML string that contains all the required elements to initialise and start the viewer. Thus this content needs to be rendered somewhere into the page. After the returned HTML is rendered on to the page, everything else can be initialised by calling afterRender()
container.innerHTML = widget.render();
widget.afterRender();
Now the viewer is ready to use and you can load in your first scene either by calling widget.viewer.loadScene("URL_TO_THE_SCENE_FILE");
or by setting the SCENE_MODEL_URL
setting.
Putting it together
import { Widget } from "e3d";
const container = document.querySelector(".e3d-container");
const widget = new Widget();
container.innerHTML = widget.render();
widget.afterRender();
widget.viewer.loadScene("scene_file.babylon");
This is all you need to get the viewer up and running with a scene.
Using settings
The viewer uses settings to control how certain features function and to store the current state of the viewer.
Some settings need to be set before the viewer is started, these settings are marked as not-updateable and setting them after viewer has started is disabled and has no effect. You can set these after creating the widget and before calling afterRender()
. Also loading in possibly saved settings (e.g. default camera position) is best done before the initialisation.
The settings can be set directly from the widget using its setSetting(...)
method or by calling the SetSetting(...)
method from e3d. The latter requires supplying the context as a parameter as it can be called from anywhere.
Getting the current value of a setting works the same way; either by calling getSetting(...)
from the widget or GetSetting(...)
globally from e3d.
// These two methods are equally valid
SetSetting(widget, Setting.DEBUG_MODE, true);
widget.setSetting(Setting.PERSONAL_ACCESS_TOKEN, "MY_PAT", true);
// NOTE: The last parameter of the widget's setSetting is "notify" which defaults to true. If set to false,
// no notification of the setting being updated is propagated to the viewer thus most likely not having
// the desired effect. The viewer itself uses false in the notify param some times to avoid triggering
// updates that it has already performed due to it triggering the setSetting itself.
// If unsure, just use the global SetSetting which will always trigger the notification
// These two methods are equally valid
GetSetting(widget, Setting.DEBUG_MODE);
widget.getSetting(Setting.PERSONAL_ACCESS_TOKEN);
The viewer itself doesn't touch most of the settings, but may at times modify the following settings
- When a group selection changes, the following two settings are updated
- SELECTED_GROUP_ID
- SELECTED_GROUP_NAME
- When the custom mode changes, the custom mode setting is updated
- CUSTOM_MODE
- When the user clicks on "Save Default Transform" button in the camera module, the following settings are updated
- CAMERA_DEFAULT_POSITION
- CAMERA_DEFAULT_TARGET_POSITION
When any one of the above is changed/updated by the viewer, an accompanying event is triggered that can be used to catch the new values. We'll have a look at the events later.
Listening to setting updates
When a setting is updated (and the notify is set to true), each updated triggers a notification that you can listen to. This is done using the SettingsUpdateService
in which you can register and unregister listeners for setting updates. The viewer itself uses this service to listen to setting updates and acts accordingly, so the use outside of the viewer itself might be limited as the integration/implementation will most likely be the one actually updating the settings. It does allow for some form of indirection as you can set the settings somewhere in your code and catch the update elsewhere without having to pass anything else around.
To register a listener you can call the static method registerSettingUpdateListener(...)
from the service, the method returns a handle to the listener which can be used to unregister the listener.
// The last param (null here) is the context of the callback if needed.
// Useful if you're passing in a method of an object that requires access to "this"
const handle = SettingsUpdateService.registerSettingUpdateListener(widget, (key, value) => {
console.log(`Setting ${key} was updated to value ${value}`);
}, null);
// Later (during destroy for example) unregister the listener
SettingsUpdateService.unregisterSettingUpdateListener(widgete, handle);
Persistent settings
The viewer also uses something referred to as "persistent settings", which are intended to be user/browser specific settings that are stored throughout sessions. Currently the GUI modules and wanted camera type are stored and loaded using the persistent settings but each implementation is responsible to do the actual storing and loading.
To implement the storing and loading, you need to call ImplSetPlatformPersistentSetting
and ImplGetPlatformPersistentSetting
which take in the context (widget) and a function that does the storing/loading. Easiest way to store these for the user is to use localStorage, but if localStorage is not supported, other ways can be implemented as well.
ImplGetPlatformPersistentSetting(widget, (key) =>
{
// We're using the widget's elementId as an additional identifier here
// Thus allowing separate configuration for multiple view(s/ers) in the same origin
return localStorage.getItem(`${widget.elementId}_${key}`);
});
ImplSetPlatformPersistentSetting(widget, (key, value) =>
{
localStorage.setItem(`${widget.elementId}_${key}`, value);
});
If the getter and/or setter for persistent settings are not implemented, the viewer will still work but they will not be utilised.
List of available settings
Below is a table of all available settings. The Updateable
column defines whether the setting is updateable after startup.
The keys are available under the Setting
enum.
Key | Description | Type | Default value | Updateable |
---|---|---|---|---|
TRANSITION_TO_DEFAULT_ON_SCENE_LOAD | If set to true, camera will transition to default position after scene has finished loading | Boolean | true | true |
CAMERA_FOLLOW_OBJECTS | If set to true, camera will follow moving objects (dynamic objects) | Boolean | false | false |
CAMERA_FOLLOW_ROTATION | If set to true, camera will act as if it was parented to the moving object. This value depends on CameraFollowObjects | Boolean | false | false |
CAMERA_DEFAULT_POSITION | Default camera position, gets updated when UpdateCameraDefaultTransform is called | Vector | 15, 15, 15 | true |
CAMERA_DEFAULT_TARGET_POSITION | Default camera target position, gets updated when UpdateCameraDefaultTransform is called | Vector | 0, 0, 0 | true |
CAMERA_PATH_SPEED | Camera path animation speed in units per second | Float | 2 | true |
CAMERA_PANNING_SENSITIVITY | Camera panning sensitivity, smaller value will make the camera pan faster | Float | 0.5 | true |
CAMERA_ANGULAR_SENSITIVITY | Camera angular sensitivity, smaller value will make the camera turn faster | Integer | 500 | true |
CAMERA_MIN_RADIUS | Minimum radius/distance from the focus point. Used for arc ball rotate camera (default camera). Set to <0 for no limit | Float | Integer | true |
CAMERA_MAX_RADIUS | Maximum radius/distance from the focus point. Used for arc ball rotate camera (default camera). Set to <0 for no limit | Float | -1 | true |
USE_MESH_DEFAULT_CAMERA_FOCUS | Whether to use default focus points for meshes if mesh specific focus data is not specified. | Boolean | false | true |
MESH_DEFAULT_FOCUS_OFFSET | Default camera focus offset if no focus data is specified | Vector | -2, 6, -7 | true |
MESH_DEFAULT_FOCUS_TARGET_OFFSET | Default camera focus target offset if no focus data is specified | Vector | 0, 0, 0 | true |
CUSTOM_MODE | Tracks the current custom mode of the viewer. | String | None | false |
DYNAMIC_OBJECT_UNIT_SCALE | Unit scale used in dynamic object positioning, all position values are multiplied by this value | Vector | 1, 1, 1 | true |
DYNAMIC_OBJECT_UNIT_OFFSET | Unit offset used in dynamic object positioning, this value is added to all position values after scaling | Vector | 0, 0, 0 | true |
DYNAMIC_OBJECT_IS_GEO_LOCATED | Whether position for a dynamic object is given as geo coordinates | Boolean | false | true |
CANVAS_RENDERING_WIDTH | Maximum rendering canvas width. Needs "LimitCanvasSize" to be set to true. NOTE: The canvas will still be stretched to fit the space, reducing this will only affect the internal render size which can improve performance for the cost of quality. | Integer | 1920 | false |
CANVAS_RENDERING_HEIGHT | Maximum rendering canvas height. Needs "LimitCanvasSize" to be set to true. NOTE: The canvas will still be stretched to fit the space, reducing this will only affect the internal render size which can improve performance for the cost of quality." | Integer | 1080 | false |
LIMIT_CANVAS_SIZE | When true, the rendering canvas width and height will be limited according to configuration. | Boolean | false | false |
MAX_FPS | Maximum rendered frames per second | Integer | 144 | false |
SHOW_PERFORMANCE_TIMINGS | Show rendering related timings | Boolean | false | false |
CONSTANTLY_UPDATE_VIEWER | Force update viewer even if nothing's happening | Boolean | false | false |
DEBUG_MODE | Enable debug features and extra logging | Boolean | false | false |
ENABLE_OFFLINE_SUPPORT | Enable offline support, e.g. 3d model caching using client browser cache (.manifest files) | Boolean | true | false |
ENABLE_BACKGROUND_GRADIENT | Enable background gradient | Boolean | true | true |
SHOW_ONLY_SELECTED_GROUP | Shows only the selected group | Boolean | true | false |
OBJECT_DEFAULT_PICKABLE | Are objects pickable by default. | Boolean | false | false |
ATTACHED_LABELS_DEFINE_PICKABLES | If set to true, only objects with attached labels will be pickable. | Boolean | false | false |
SCENE_NAME | Usually the name of the factory, used in various non-critical parts of the widget. | String | true | |
SCENE_MODEL_URL | URL to the model | String | true | |
SCENE_MODEL_FILE_SIZE | Download size of the model | Integer | Boolean | true |
RESET_SCENE_ON_MODEL_CHANGE | Reset the scene whenever the model changes | Boolean | true | false |
SCENE_BACKGROUND_COLOUR | The background of the widget. Opacity is supported | Colour | #b1b1b1ff | true |
REFERENCE_SCALE | Reference scale for the scene. Will be used to scale things like geo objects, asset library place holders, camera min and max z etc. | Float | Integer | true |
GEO_FENCE_BASE_FONT_SIZE | Base font size for the text in geo fences. | Integer | 16 | true |
GEO_SCENE_UNITS | How scene units correspond to real-world units | Integer | 3 | false |
SORT_COMPONENTS_IN_LABEL | Sort components in a label by their type | Boolean | false | false |
COMPONENT_FONT_COLOUR_FIELD | Which style field to use for colouring the component text/value | String | textColour | false |
LABEL_STYLE_ICONSIZE | Global label icon size (px) used in label styling | Integer | 25 | false |
LABEL_ATLAS_SIZE | Size (width and height) of a label atlas | Integer | 1024 | false |
DYNAMIC_LIGHTING | Use dynamic lighting instead of unlit scene | Boolean | false | false |
GLOBAL_LIGHT_INTENSITY | Used only if dynamic lighting is enabled | Float | 0.75 | true |
ENVIRONMENT_TEXTURE | Environment texture, useful for scenes using PBR materials | String | true | |
ENABLE_LOGGING_LIMIT | Whether to enable logging limiting or not | Boolean | true | true |
MIN_DURATION_BETWEEN_SAME_MESSAGE | Minimum duration between two equal messages in ms. Only applies if EnableLoggingLimit is true | Integer | 1000 | true |
OBJECT_COLOR_INTENSITY | Object overlay color intensity, "intensity" can be also set with color alpha value | Float | 0.5 | false |
SELECTED_GROUP_ID | The id of the currently selected group in the scene | String | true | |
SELECTED_GROUP_NAME | The name of the currently selected group in the scene | String | true | |
SELECTED_OBJECT_ID | The currently selected object in the scene | String | true | |
SELECTED_LABEL_ID | The currently selected label id, triggers changed event | String | true | |
SELECTED_MESH_COLOUR | Colour of the outline of a selected mesh | Colour | #7ed8ff | false |
HOVERED_MESH_COLOUR | Colour of the outline of a selected mesh | Colour | #f9ef6b | false |
SELECTED_GROUP_COLOUR | Colour of the outline of a selected mesh from group selection | Colour | #00a950 | false |
PERSONAL_ACCESS_TOKEN | Personal access token to add to scene requests | String | true | |
ENABLE_GA | Enable Google Analytics | Boolean | true | false |
Using data
For the more "complex" configuration of the viewer, data is used. The type of data that can be supplied to the viewer varies and some are more meant for building/editing of the scene where as others are used for presenting data in the 3d view.
Setting data
Similar to the settings, data can be set directly from the widget using its setData(...)
method or by calling the SetData(...)
method from e3d.
Setting the data is a destructive operation in that it will overwrite any existing data. Meaning that if you set label data for example, the full payload needs to be provided each time for the labels to persist.
Getting the current value for a data works the same way; either by calling getData(...)
from the widget or GetData(...)
globally from e3d.
Each data has a specific format it needs to be supplied in for the data to display as expected.
We'll have a look at how to construct each data payload in a later chapter.
Updating data
Partial data updates are currently WIP and initial support is available for label data.
To perform an update on the dataset you can call the widget's updateData(...)
method or by calling the UpdateData(...)
method from e3d.
The update method tries to find a corresponding entry in the current dataset and update its values accordingly.
List of available data
Below is a table of all available data fields for the viewer.
The keys are available under the Data
enum.
Key | Description | Expected input |
---|---|---|
ASSET_LIBRARY | Asset library data is used to initialise the asset library with all the available assets a user can place to the scene. NOTE: Requires Capabilities.EDITING to be set. |
|
CAMERA_FOCUS | Camera focus data defines focus points for specific meshes in the scene. Allowing the camera to automatically transition to a desired view when a mesh is selected. |
|
CAMERA_PATH | Camera path data defines a set of points and directions that the camera will fly through when flythrough is triggered. |
|
DYNAMIC_OBJECT | Dynamic object data is used to present "dynamic" objects in the scene. After initialisation, any concurrent updates will move and rotate the objects from their previous locations to new ones. |
|
GEO | An object that contains arrays for both the geo markers and geo fences. Geo markers are used as reference points in the scene to transform scene positions to real world coordinates. The fences are then defined using coordinates. If no markers are defined, the scene origin is considered to be lat: 0, lon: 0, el: 0. For the most accurate results use three markers in which case barycentric coordinates are used to interpolate the coordinates. |
|
GROUP | Group data defines grouping of nodes (either groups or meshes in the scene). While nested groups are supported, any given node can directly belong only to a single group. |
|
LABEL | Label data is used to define some more specific data about one or more meshes in the scene. Can be attached to a single mesh or a group of meshes. |
|
LAYER | Layer data allows grouping of meshes to layers which can be highlighted and/or shown/hidden or demand. |
|
SCENE | The scene data contains all the assets that have been brought in to the scene that are not part of the base file. This is most useful when building a scene and exporting the result to a single baked file should be preferred when presenting. |
|
Type definitions for each input type can be seen below
// Asset library
interface AssetLibraryData
{
name: string;
url: string;
thumbnail: string;
category: string;
tag: string;
}
// Camera focus
interface CameraFocusData
{
id: string;
relativePosition: Array<number>;
relativeTargetPosition: Array<number>;
}
// Camera path
interface CameraPathData
{
position: Array<number>;
direction: Array<number>;
}
// Coordinate, used by DynamicObjectData and GeoData
interface Coordinate
{
latitude: number;
longitude: number;
elevation: number;
}
// Dynamic object
interface DynamicObjectData
{
id: string;
url: string;
scale: Array<number>;
rotation: Array<number>;
position: Array<number> | Coordinate;
}
// Geo
interface GeoData
{
markers: GeoMarkerData[];
fences: GeoFenceData[];
}
interface GeoMarkerData
{
coordinates: Coordinate;
scenePosition: Array<number>;
}
interface GeoFenceData
{
name: string;
colour: string;
coordinates: Coordinate[];
}
// Group
interface GroupData
{
name: string;
id: string;
nodes: Array<string>;
}
// Label
interface ILabelData
{
id: string;
title?: string;
isGroupLabel?: boolean;
collapsedTitle?: string;
group?: string;
meshId?: string;
objectButtonText?: string;
layout?: LABEL_LAYOUT;
status?: Style;
components?: ComponentData[];
}
// Layer
interface LayerData
{
layerName: string;
meshIds: string[];
visibility: boolean;
dataDefinesOnlyVisibility?: boolean;
}
// Scene
type MeshNameMapping = { [origName: string]: string };
export interface SceneData
{
name: string;
meshNameMap: MeshNameMapping;
position: Array<number>;
scale: Array<number>;
rotation: Array<number>;
modelName: string;
url: string;
}
Using events
The viewer has events that are triggered when something in the viewer happens. Events can be listened to or propagated forward if wanted. The propagation and listening can be accessed using the EventDispatcher
.
To register a listener for an event use registerEventListener(...)
to register the listener, this method will return a handle that can later be used to unregister the listener using unregisterEventListener(...)
.
If you wish to propagate all events forward you can register an event dispatcher using the registerEventDispatcher(...)
method. This callback will be given the event name and related arguments for every single event triggered in the context.
// To add a listener to an event, you can use the following method (shown its signature)
// Where eventName is the event to listen to
// callback is a function that will be called when the event happens
// owner is the owner of the callback function (if need be), can be set to window or null if the function's just generic
EventDispatcher.registerEventListener(ctx: ElemIdOrObject, eventName: EventName, callback: Function, owner: any): number
// If you want to propagate the events further (e.g. call something when any even occurs)
// You can use the EventDispatcher.registerEventDispatcher method to register an event dispatcher
EventDispatcher.registerEventDispatcher(ctx: ElemIdOrObject, dispatcher: Function, owner: any): number
// Both of the above methods return a handle to the listener/dispatcher which can be used to unregister
// from the events if wanted/need be with the following methods
EventDispatcher.unregisterEventDispatcher(ctx: ElemIdOrObject, handle: number)
EventDispatcher.unregisterEventListener(ctx: ElemIdOrObject, eventName: EventName, handle: number)
Simple example
In the example below, we register an event listener for the export ready event and download the result as a zip using BABYLON's Download tool.
import { EventDispatcher, EventName } from "e3d";
EventDispatcher.registerEventListener(widget, EventName.EXPORT_READY, (content: Blob, name: string) =>
{
BABYLON.Tools.Download(content, `${name}.zip`);
}, null);
A list of available events
The constants can be accessed under EventName
. The event arguments can be caught within the callback
Constant | Description | Event arguments |
---|---|---|
Asset library events | ||
SCENE_DATA_UPDATED | Triggered when scene data has been updated | data: SceneData[] |
Camera events | ||
CAMERA_TRANSITION_STOPPED | Triggered when a camera transition is stopped | - |
CAMERA_TRANSITION_DONE | Triggered when a camera transition finishes | - |
CAMERA_TRANSITION_TO_MESH_DONE | Triggered when a camera transition to a mesh is finished. If the mesh is null, no transition happened | `mesh: BABYLON.Mesh |
CAMERA_TRANSITION_TO_HOME_DONE | Triggered when a camera transition to home is finished | - |
CAMERA_PATH_UPDATED | Triggered when the camera flythrough path has been updated | data: CameraPathData[] |
CAMERA_TRANSFORM_UPDATED | Triggered when a camera focus data has been updated | data: CameraFocusData[] |
CAMERA_DEFAULT_TRANSFORM_UPDATED | Triggered when the default transform positions have been updated | position: number[], target: number[] |
Geo events | ||
GEO_DATA_UPDATED | Triggered when geo data has been updated | data: GeoData |
Group events | ||
GROUP_HOVERED | Triggered when a group is hovered | group: GroupLabel |
GROUP_CLICKED | Triggered when a group is clicked (either from a label or from home menu) | group: GroupLabel or null |
SCENE_GROUP_DATA_INITIALISED | Triggered once the viewer has initialised group data from the .babylon file | - |
Label events | ||
LABEL_HOVERED | Triggered when a label is hovered | label: Label |
LABEL_CLICKED | Triggered when a label is clicked | label: Label |
Layer events | ||
LAYER_DATA_UPDATED | Triggered when layer data has been updated | data: LayerData[] |
SCENE_LAYER_DATA_INITIALISED | Triggered once the viewer has initialised layer data from the .babylon file | - |
Object events | ||
OBJECT_HOVERED | Triggered when an object has been hovered | mesh: BABYLON.Mesh |
OBJECT_CLICKED | Triggered when an object has been clicked | mesh: BABYLON.Mesh |
Scene/mesh | ||
MODEL_LOAD_DONE | Triggered when a model (scene) load succeeds and finishes | - |
MODEL_LOAD_ERROR | Triggered when a model (scene) load fails | - |
MESH_LOAD_DONE | Triggered when a mesh load succeeds and finishes | - |
MESH_LOAD_ERROR | Triggered when a mesh load fails | - |
Selections | ||
SELECTED_LABEL_CHANGED | Triggered when a new label has been selected | label: UiElement |
SELECTED_OBJECT_CHANGED | Triggered when a new object has been selected | objectId: string |
SELECTED_GROUP_CHANGED | Triggered when a new group has been selected | groupId: string, groupName: string |
Misc | ||
HOME_CLICKED | Triggered when the home button is clicked | - |
CUSTOM_MODE_CHANGED | Triggered when a custom mode changes | customMode: CUSTOM_MODE |
SCREENSHOT_CAPTURED | Triggered once the screenshot capture is finished after request | data: string |
HYPERLINK_COMPONENT_CLICKED | Triggered when a hyperlink component has been clicked | id: string, parentId: string |
BUTTON_COMPONENT_CLICKED | Triggered when a button component has been clicked | id: string, value: string, parentId: string |
EXPORT_READY | Triggered after an export has finished | zipData: Blob, sceneName: string |
EXPORT_FAILED | Triggered if an export fails | errorMsg: string |
Adding localisation support
All strings in the viewer are localisable (with some limitations on "dynamic" texts, texts that are a combination of multiple). Localisation is supported through the usage of tokens
The viewer supports simple localisation using tokens. To support localisation, implement a localisation function for the widget before viewer is initialised using ImplLocalisationFunction
. You preferably return the default value if no localisation exists for a given token.
// Simple example of what the localisation implementation could be like
ImplLocalisationFunction(function (token: string, defaultValue: string): string
{
return PlatformSpecificLocalisationFunction(token) || defaultValue;
});
Some variable fields like label and component titles are also passed through the localisation function.
A list of currently used tokens and their default values
Token | Default value |
---|---|
e3d.export.invalidExportType | Invalid export type requested |
e3d.export.noEmptyNameAllowed | Export needs to have a name defined |
e3d.generic.all | All |
e3d.generic.alpha | alpha |
e3d.generic.blue | blue |
e3d.generic.colour | Colour |
e3d.generic.disable | Disable |
e3d.generic.elevation | Elevation |
e3d.generic.enable | Enable |
e3d.generic.green | green |
e3d.generic.hide | Hide |
e3d.generic.latitude | Latitude |
e3d.generic.longitude | Longitude |
e3d.generic.name | Name |
e3d.generic.none | None |
e3d.generic.notAvailable | N/A |
e3d.generic.position | Position |
e3d.generic.red | red |
e3d.generic.search | Search |
e3d.generic.show | Show |
e3d.generic.unsorted | Unsorted |
e3d.groups.newGroup | New Group |
e3d.input.combobox.noMatchingSuggestions | No suggestions |
e3d.layers.newLayer | New Layer |
e3d.loading.changingScene | Changing scene |
e3d.loading.clearingScene | Clearing scene |
e3d.loading.complete | Loading complete |
e3d.loading.downloaded | Downloaded |
e3d.loading.initialisingProperties | Initializing viewer settings |
e3d.loading.loadingScene | Loading scene |
e3d.loading.scripts | Loading scripts |
e3d.loading.settingUp | Setting up scene |
e3d.loading.waitingForScene | Waiting for scene |
e3d.module.assetLibrary.activateEditModeInf | Activate Edit Mode to Add or Move Objects |
e3d.module.assetLibrary.noAssets | No assets |
e3d.module.assetLibrary.title | Asset Library |
e3d.module.atlasDebugger.atlases | Atlases |
e3d.module.atlasDebugger.title | Label atlas debugger |
e3d.module.camera.addWaypoint | Add Waypoint |
e3d.module.camera.flythrough | Play Flythrough |
e3d.module.camera.focusObject | Focus on the Object |
e3d.module.camera.focusPoints | Focus Points |
e3d.module.camera.mode | Mode |
e3d.module.camera.orbit | Orbit Camera |
e3d.module.camera.removeWaypoint | Remove Waypoint |
e3d.module.camera.rtsMaxHeight | Maximum Height |
e3d.module.camera.rtsMinHeight | Minimum Height |
e3d.module.camera.saveDefaultTransform | Save Default Transform |
e3d.module.camera.saveFocusPoint | Save Focus point |
e3d.module.camera.saveWaypoints | Save Waypoints |
e3d.module.camera.title | Camera |
e3d.module.camera.topDown | Top Down Camera |
e3d.module.camera.waypoints | Waypoints |
e3d.module.dev.attachTestLabel | Attach test label |
e3d.module.dev.decGlobalLightIntensity | Decrease global light intensity |
e3d.module.dev.downloadSnapshot | Download snapshot |
e3d.module.dev.exportScene | Export scene |
e3d.module.dev.fakeXREntryAndLeave | Fake XR entry and leave |
e3d.module.dev.geoMarkerTest | Geomarker test |
e3d.module.dev.incCinematicCamSpeed | Increase CinematicCamera speed |
e3d.module.dev.incGlobalLightIntensity | Increase global light intensity |
e3d.module.dev.labelTest | Label test |
e3d.module.dev.logObjCoords | Log selected obj coords |
e3d.module.dev.openInspector | Open inspector |
e3d.module.dev.reduceCinematicCamSpeed | Reduce CinematicCamera speed |
e3d.module.dev.title | Development tools |
e3d.module.dev.transitionToDefault | Transition camera to default |
e3d.module.dev.updateCameraDefaultTransform | Update camera default transform |
e3d.module.dev.updateCameraTransform | Update camera transform |
e3d.module.editLayer.addObjectsToLayer | Add Selected Objects to the Layer |
e3d.module.editLayer.createLayer | Create New Layer |
e3d.module.editLayer.deleteLayer | Delete Layer |
e3d.module.editLayer.selectedLayer | Selected layer |
e3d.module.editLayer.title | Edit Layers |
e3d.module.export.babylon | Export .babylon |
e3d.module.export.customModeWarn | Can't export while a custom mode is enabled |
e3d.module.export.exporting | Exporting |
e3d.module.export.exportName | Export name |
e3d.module.export.filterFailed | Filter for export name failed |
e3d.module.export.finished | Export finished |
e3d.module.export.missingFileName | Export missing filename |
e3d.module.export.obj | Export .obj |
e3d.module.export.objUpDir | OBJ Up Direction |
e3d.module.export.ready | Ready to export |
e3d.module.export.title | Export |
e3d.module.geo.addArea | Add Area |
e3d.module.geo.addMarker | Add Geomarker |
e3d.module.geo.editor | Geo Editor |
e3d.module.geo.removeArea | Remove Area |
e3d.module.geo.removeMarker | Remove Geomarker |
e3d.module.geo.selectedControlPoint | Selected Control Point |
e3d.module.geo.selectedFence | Selected Geo Fence |
e3d.module.geo.title | Geo |
e3d.module.heatmap.enableCustomThresholds | Enable Custom Thresholds |
e3d.module.heatmap.title | Heatmaps |
e3d.module.home.homeButton | Home |
e3d.module.home.nGroupsSelected | %d groups selected |
e3d.module.home.nObjectsSelected | %d objects selected |
e3d.module.home.noGroupSelected | No group selected |
e3d.module.home.noObjectSelected | No object selected |
e3d.module.home.title | Scene |
e3d.module.info.camera | Camera |
e3d.module.info.direction | Direction |
e3d.module.info.fps | FPS |
e3d.module.info.hoveredMesh | Hovered mesh |
e3d.module.info.memory | Memory |
e3d.module.info.noMeshSelected | No mesh selected |
e3d.module.info.position | Position |
e3d.module.info.resolution | Resolution |
e3d.module.info.selectedMeshid | Selected mesh id |
e3d.module.info.selectedMeshName | Selected mesh name |
e3d.module.info.selectedMeshPos | Selected mesh position |
e3d.module.info.title | Info |
e3d.module.info.totalLabels | Total labels |
e3d.module.info.version | Version |
e3d.module.info.visibleLabels | Visible labels |
e3d.module.label.noLabelSelected | No label selected |
e3d.module.label.noLabelSelected | No label selected |
e3d.module.label.title | Label |
e3d.module.log.title | Log |
e3d.module.modifier.addModifier | Add modifier |
e3d.module.modifier.title | Modifiers |
e3d.module.outliner.addObjectsToGroup | Add Selected Objects to Active Group |
e3d.module.outliner.addObjectsToGroup | Delete Group |
e3d.module.outliner.newGroup | Create New Group |
e3d.module.outliner.title | Outliner |
e3d.module.refImage.clear | Clear Floorplan |
e3d.module.refImage.dndHint | Drag and drop a reference image here |
e3d.module.refImage.imageOpacityHint | Image Opacity (%) |
e3d.module.refImage.imageWidthHint | Image Width (m) |
e3d.module.refImage.ready | Ready for drop |
e3d.module.refImage.refImage | Floorplan |
e3d.module.refImage.rotation | Rotation |
e3d.module.refImage.title | Reference Image |
e3d.module.sceneEdit.alignY | Align Y |
e3d.module.sceneEdit.alignZ | Align Z |
e3d.module.sceneEdit.aligX | Align X |
e3d.module.sceneEdit.delete | Delete |
e3d.module.sceneEdit.duplicate | Duplicate |
e3d.module.sceneEdit.editMode | Edit Mode |
e3d.module.sceneEdit.position | Position |
e3d.module.sceneEdit.rotate | Rotate |
e3d.module.sceneEdit.rotation | Rotation |
e3d.module.sceneEdit.save | Save Changes |
e3d.module.sceneEdit.scale | Scale |
e3d.module.sceneEdit.scaling | Scaling |
e3d.module.sceneEdit.snapRotation | Snap Rotation to 15 degrees |
e3d.module.sceneEdit.title | Scene Editing |
e3d.module.sceneEdit.translate | Translate |
e3d.module.theme.blue | Blue |
e3d.module.theme.default | Default |
e3d.module.theme.light | Light |
e3d.module.theme.title | Theme |
e3d.module.viewLayer.noLayers | No layers |
e3d.module.viewLayer.title | View Layers |
e3d.module.webxr.enterVR | Enter VR |
e3d.module.webxr.leaveVR | Leave VR |
e3d.module.webxr.notSupported | WebXR not supported |
e3d.module.webxr.sslOnly | WebXR can only be served over HTTPS |
e3d.module.webxr.title | WebXR |
e3d.module.zoneProfiler.title | Zone Profiler |
e3d.module.zoneProfiler.zoneProfiler | Zone Profiler |