HttpSynchronization
Inherits ResourceSynchronization
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The unique identifier for this resource that is used to request a set of files from the synchronization servers |
|
An identifier string. May not contain ‘.’, spaces, newlines, or tabs |
No |
|
The version of this resource that should be requested |
|
Value of type ‘Integer’ |
No |
|
Determines whether .zip files that are downloaded should automatically be unzipped. If this value is not specified, no unzipping is performed |
|
Value of type ‘Boolean’ |
Yes |
|
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 |
|
Value of type ‘String’ |
Yes |
Asset Examples
1local sun = asset.require("scene/solarsystem/sun/sun")
2local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
3
4
5
6local model = asset.resource({
7 Name = "Animated Box",
8 Type = "HttpSynchronization",
9 Identifier = "animated_box",
10 Version = 1
11})
12
13
14local Model = {
15 Identifier = "ModelShader",
16 Parent = transforms.EarthCenter.Identifier,
17 Transform = {
18 Translation = {
19 Type = "StaticTranslation",
20 Position = { -11E7, 0.0, 0.0 }
21 }
22 },
23 Renderable = {
24 Type = "RenderableModel",
25 GeometryFile = model .. "BoxAnimated.glb",
26 ModelScale = 3E7,
27 -- (malej 2023-MAY-22) Note that PerformShading should be false in this example,
28 -- these example shaders dont't contain any light calculations
29 PerformShading = false,
30 VertexShader = asset.resource("model_vs.glsl"),
31 FragmentShader = asset.resource("model_fs.glsl"),
32 EnableAnimation = true,
33 AnimationStartTime = "2023 05 11 00:00:00",
34 AnimationTimeScale = "Second",
35 AnimationMode = "LoopInfinitely"
36 },
37 GUI = {
38 Name = "Model Shader",
39 Path = "/Example",
40 Description = "Simple box model with a custom shader"
41 }
42}
43
44
45asset.onInitialize(function()
46 openspace.addSceneGraphNode(Model)
47end)
48
49asset.onDeinitialize(function()
50 openspace.removeSceneGraphNode(Model)
51end)
52
53asset.export(Model)