HttpSynchronization

Inherits ResourceSynchronization

Members

Name

Documentation

Type

Description

Optional

Identifier

The unique identifier for this resource that is used to request a set of files from the synchronization servers

Identifier

An identifier string. May not contain ‘.’, spaces, newlines, or tabs

No

Version

The version of this resource that should be requested

Integer

Value of type ‘Integer’

No

UnzipFiles

Determines whether .zip files that are downloaded should automatically be unzipped. If this value is not specified, no unzipping is performed

Boolean

Value of type ‘Boolean’

Yes

UnzipFilesDestination

The destination for the unzipping. If this value is specified, all zip files contained in the synchronization will be unzipped into the same specified folder. If this value is specified, but ‘unzipFiles’ is false, no extaction will be performed

String

Value of type ‘String’

Yes

Asset Examples

 1-- Basic
 2-- This example loads a model.
 3
 4-- Load the example model from OpenSpace servers
 5-- If you want to use your own model, this block of code can be safely deleted
 6local model = asset.resource({
 7  Name = "Animated Box",
 8  Type = "HttpSynchronization",
 9  Identifier = "animated_box",
10  Version = 1
11})
12
13local Node = {
14  Identifier = "RenderableModel_Example",
15  Renderable = {
16    Type = "RenderableModel",
17    GeometryFile = model .. "BoxAnimated.glb",
18    -- Use the line below insted of the one above if you want to use your own model
19    --GeometryFile = "C:/path/to/model.fbx",
20  },
21  GUI = {
22    Name = "RenderableModel - Basic",
23    Path = "/Examples"
24  }
25}
26
27asset.onInitialize(function()
28  openspace.addSceneGraphNode(Node)
29end)
30
31asset.onDeinitialize(function()
32  openspace.removeSceneGraphNode(Node)
33end)
34
35
36-- Model credit
37--[[
38  Author = Cesium, https://cesium.com/
39  URL = https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/BoxAnimated
40  License =
41    Creative Commons Attribution 4.0 International License,
42    https://creativecommons.org/licenses/by/4.0/
43]]