sunrize 1.7.7 → 1.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/Application/Application.js +17 -0
- package/src/Application/Document.js +22 -0
- package/src/Application/Tabs.js +1 -0
- package/src/Controls/Dialog.js +14 -9
- package/src/Editors/Library.js +12 -3
- package/src/Editors/MaterialsLibrary.js +14 -16
- package/src/Editors/Primitives.js +20 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.9",
|
|
5
5
|
"description": "A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"capitalize": "^2.0.4",
|
|
92
92
|
"console": "^0.7.2",
|
|
93
|
-
"electron": "^30.
|
|
93
|
+
"electron": "^30.3.1",
|
|
94
94
|
"electron-prompt": "^1.7.0",
|
|
95
95
|
"electron-squirrel-startup": "^1.0.1",
|
|
96
96
|
"electron-tabs": "^1.0.4",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"string-similarity": "^4.0.4",
|
|
110
110
|
"tweakpane": "^3.1.10",
|
|
111
111
|
"update-electron-app": "^3.0.0",
|
|
112
|
-
"x_ite": "^10.0
|
|
112
|
+
"x_ite": "^10.2.0"
|
|
113
113
|
},
|
|
114
114
|
"config": {
|
|
115
115
|
"forge": {
|
|
@@ -593,6 +593,23 @@ module .exports = class Application
|
|
|
593
593
|
},
|
|
594
594
|
],
|
|
595
595
|
},
|
|
596
|
+
{
|
|
597
|
+
label: _("Text Compression"),
|
|
598
|
+
submenu: [
|
|
599
|
+
{
|
|
600
|
+
label: _("Char Spacing"),
|
|
601
|
+
type: "radio",
|
|
602
|
+
checked: this .menuOptions .textCompression === "CHAR_SPACING",
|
|
603
|
+
click: () => this .mainWindow .webContents .send ("text-compression", "CHAR_SPACING"),
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
label: _("Scaling"),
|
|
607
|
+
type: "radio",
|
|
608
|
+
checked: this .menuOptions .textCompression === "SCALING",
|
|
609
|
+
click: () => this .mainWindow .webContents .send ("text-compression", "SCALING"),
|
|
610
|
+
},
|
|
611
|
+
],
|
|
612
|
+
},
|
|
596
613
|
{
|
|
597
614
|
label: _("Color Space"),
|
|
598
615
|
submenu: [
|
|
@@ -96,6 +96,7 @@ module .exports = class Document extends Interface
|
|
|
96
96
|
|
|
97
97
|
electron .ipcRenderer .on ("primitive-quality", (event, value) => this .setPrimitiveQuality (value));
|
|
98
98
|
electron .ipcRenderer .on ("texture-quality", (event, value) => this .setTextureQuality (value));
|
|
99
|
+
electron .ipcRenderer .on ("text-compression", (event, value) => this .setTextCompression (value));
|
|
99
100
|
electron .ipcRenderer .on ("color-space", (event, value) => this .setColorSpace (value));
|
|
100
101
|
electron .ipcRenderer .on ("tone-mapping", (event, value) => this .setToneMapping (value));
|
|
101
102
|
electron .ipcRenderer .on ("order-independent-transparency", (event, value) => this .setOrderIndependentTransparency (value));
|
|
@@ -130,6 +131,7 @@ module .exports = class Document extends Interface
|
|
|
130
131
|
const browserOptions = [
|
|
131
132
|
"PrimitiveQuality",
|
|
132
133
|
"TextureQuality",
|
|
134
|
+
"TextCompression",
|
|
133
135
|
"ColorSpace",
|
|
134
136
|
"ToneMapping",
|
|
135
137
|
"OrderIndependentTransparency",
|
|
@@ -175,6 +177,7 @@ module .exports = class Document extends Interface
|
|
|
175
177
|
inferProfileAndComponents: true,
|
|
176
178
|
primitiveQuality: "MEDIUM",
|
|
177
179
|
textureQuality: "MEDIUM",
|
|
180
|
+
textCompression: "CHAR_SPACING",
|
|
178
181
|
colorSpace: "LINEAR_WHEN_PHYSICAL_MATERIAL",
|
|
179
182
|
toneMapping: "NONE",
|
|
180
183
|
orderIndependentTransparency: false,
|
|
@@ -189,6 +192,7 @@ module .exports = class Document extends Interface
|
|
|
189
192
|
|
|
190
193
|
this .setPrimitiveQuality (this .config .file .primitiveQuality);
|
|
191
194
|
this .setTextureQuality (this .config .file .textureQuality);
|
|
195
|
+
this .setTextCompression (this .config .file .textCompression);
|
|
192
196
|
this .setColorSpace (this .config .file .colorSpace);
|
|
193
197
|
this .setToneMapping (this .config .file .toneMapping);
|
|
194
198
|
this .setOrderIndependentTransparency (this .config .file .orderIndependentTransparency);
|
|
@@ -634,6 +638,23 @@ Viewpoint {
|
|
|
634
638
|
this .updateMenu ();
|
|
635
639
|
}
|
|
636
640
|
|
|
641
|
+
/**
|
|
642
|
+
*
|
|
643
|
+
* @param {string} value
|
|
644
|
+
*/
|
|
645
|
+
setTextCompression (value)
|
|
646
|
+
{
|
|
647
|
+
this .browser .setBrowserOption ("TextCompression", value);
|
|
648
|
+
this .browser .setDescription (`Text Compression: ${value}`);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
set_TextCompression ()
|
|
652
|
+
{
|
|
653
|
+
this .config .file .textCompression = this .browser .getBrowserOption ("TextCompression");
|
|
654
|
+
|
|
655
|
+
this .updateMenu ();
|
|
656
|
+
}
|
|
657
|
+
|
|
637
658
|
/**
|
|
638
659
|
*
|
|
639
660
|
* @param {string} value
|
|
@@ -741,6 +762,7 @@ Viewpoint {
|
|
|
741
762
|
{
|
|
742
763
|
primitiveQuality: this .config .file .primitiveQuality,
|
|
743
764
|
textureQuality: this .config .file .textureQuality,
|
|
765
|
+
textCompression: this .config .file .textCompression,
|
|
744
766
|
colorSpace: this .config .file .colorSpace,
|
|
745
767
|
toneMapping: this .config .file .toneMapping,
|
|
746
768
|
orderIndependentTransparency: this .config .file .orderIndependentTransparency,
|
package/src/Application/Tabs.js
CHANGED
|
@@ -88,6 +88,7 @@ module .exports = new class Tabs
|
|
|
88
88
|
|
|
89
89
|
this .forwardToActiveTab ("primitive-quality");
|
|
90
90
|
this .forwardToActiveTab ("texture-quality");
|
|
91
|
+
this .forwardToActiveTab ("text-compression");
|
|
91
92
|
this .forwardToActiveTab ("color-space");
|
|
92
93
|
this .forwardToActiveTab ("tone-mapping");
|
|
93
94
|
this .forwardToActiveTab ("order-independent-transparency");
|
package/src/Controls/Dialog.js
CHANGED
|
@@ -23,15 +23,15 @@ module .exports = class Dialog extends Interface
|
|
|
23
23
|
{
|
|
24
24
|
this .element .dialog ("widget")
|
|
25
25
|
.nextAll (".ui-widget-overlay")
|
|
26
|
-
.on ("click", () => this .close ())
|
|
26
|
+
.on ("click", () => this .close ());
|
|
27
27
|
|
|
28
|
-
this .onopen ()
|
|
28
|
+
this .onopen ();
|
|
29
29
|
},
|
|
30
30
|
close: () =>
|
|
31
31
|
{
|
|
32
|
-
this .onclose ()
|
|
32
|
+
this .onclose ();
|
|
33
33
|
},
|
|
34
|
-
})
|
|
34
|
+
});
|
|
35
35
|
|
|
36
36
|
this .element .dialog ("widget")
|
|
37
37
|
.draggable ({
|
|
@@ -40,7 +40,7 @@ module .exports = class Dialog extends Interface
|
|
|
40
40
|
.resizable({
|
|
41
41
|
resize: (event, ui) => this .config .file .size = [ui .size .width, ui .size .height],
|
|
42
42
|
})
|
|
43
|
-
.find (".ui-dialog-titlebar") .remove ()
|
|
43
|
+
.find (".ui-dialog-titlebar") .remove ();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
configure (defaults = { })
|
|
@@ -51,7 +51,7 @@ module .exports = class Dialog extends Interface
|
|
|
51
51
|
position: undefined,
|
|
52
52
|
size: [400, 250],
|
|
53
53
|
},
|
|
54
|
-
defaults))
|
|
54
|
+
defaults));
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
open ()
|
|
@@ -63,14 +63,19 @@ module .exports = class Dialog extends Interface
|
|
|
63
63
|
width: this .config .file .size [0],
|
|
64
64
|
height: this .config .file .size [1],
|
|
65
65
|
})
|
|
66
|
-
.dialog ("open")
|
|
66
|
+
.dialog ("open");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
isOpen ()
|
|
70
|
+
{
|
|
71
|
+
return this .element .dialog ("isOpen");
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
close ()
|
|
70
75
|
{
|
|
71
|
-
this .element .dialog ("close")
|
|
76
|
+
this .element .dialog ("close");
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
onopen () { }
|
|
75
80
|
onclose () { }
|
|
76
|
-
}
|
|
81
|
+
};
|
package/src/Editors/Library.js
CHANGED
|
@@ -70,13 +70,15 @@ module .exports = new class Library extends Dialog
|
|
|
70
70
|
.appendTo (this .element)
|
|
71
71
|
.addClass ("library-output");
|
|
72
72
|
|
|
73
|
+
if (!this .isOpen ())
|
|
74
|
+
return;
|
|
75
|
+
|
|
73
76
|
// Configure list type.
|
|
74
77
|
|
|
75
78
|
const button = [... this .buttons .children ()]
|
|
76
79
|
.find (button => $(button) .data ("type") === this .config .file .type);
|
|
77
80
|
|
|
78
|
-
|
|
79
|
-
this .button ($(button));
|
|
81
|
+
this .button ($(button ?? this .buttons .children () [0]));
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
async open (executionContext, node, field)
|
|
@@ -87,7 +89,14 @@ module .exports = new class Library extends Dialog
|
|
|
87
89
|
|
|
88
90
|
super .open ();
|
|
89
91
|
this .panes .forEach (pane => pane .open ());
|
|
90
|
-
|
|
92
|
+
|
|
93
|
+
// Configure list type.
|
|
94
|
+
|
|
95
|
+
const button = [... this .buttons .children ()]
|
|
96
|
+
.find (button => $(button) .data ("type") === this .config .file .type);
|
|
97
|
+
|
|
98
|
+
this .button ($(button ?? this .buttons .children () [0]));
|
|
99
|
+
|
|
91
100
|
this .input .trigger ("focus");
|
|
92
101
|
}
|
|
93
102
|
|
|
@@ -10,9 +10,6 @@ module .exports = class Materials extends LibraryPane
|
|
|
10
10
|
id = "MATERIALS";
|
|
11
11
|
description = "Materials";
|
|
12
12
|
|
|
13
|
-
#canvas;
|
|
14
|
-
#browser;
|
|
15
|
-
#scene;
|
|
16
13
|
#list;
|
|
17
14
|
|
|
18
15
|
async update ()
|
|
@@ -31,13 +28,14 @@ module .exports = class Materials extends LibraryPane
|
|
|
31
28
|
.appendTo (this .output)
|
|
32
29
|
.addClass ("library-list");
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const
|
|
32
|
+
canvas = $("<x3d-canvas preserveDrawingBuffer='true'></x3d-canvas>"),
|
|
33
|
+
browser = canvas .prop ("browser"),
|
|
34
|
+
scene = await browser .createX3DFromURL (new X3D .MFString (`file://${__dirname}/Materials.x3d`));
|
|
37
35
|
|
|
38
36
|
const
|
|
39
|
-
materials =
|
|
40
|
-
viewpoint =
|
|
37
|
+
materials = scene .getExportedNode ("Materials"),
|
|
38
|
+
viewpoint = scene .getExportedNode ("Viewpoint"),
|
|
41
39
|
nodes = [ ];
|
|
42
40
|
|
|
43
41
|
for (const [g, group] of materials .children .entries ())
|
|
@@ -63,12 +61,12 @@ module .exports = class Materials extends LibraryPane
|
|
|
63
61
|
|
|
64
62
|
// Create icons.
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
canvas
|
|
67
65
|
.css ({ "position": "absolute", "visibility": "hidden" })
|
|
68
|
-
.prependTo (
|
|
66
|
+
.prependTo ($("body"));
|
|
69
67
|
|
|
70
|
-
await
|
|
71
|
-
await
|
|
68
|
+
await browser .resize (25, 25);
|
|
69
|
+
await browser .replaceWorld (scene);
|
|
72
70
|
|
|
73
71
|
for (const element of Array .from (this .output .find (".node"), e => $(e)))
|
|
74
72
|
{
|
|
@@ -85,12 +83,12 @@ module .exports = class Materials extends LibraryPane
|
|
|
85
83
|
viewpoint .position .y = node .translation .y;
|
|
86
84
|
viewpoint .position .z = 2.65;
|
|
87
85
|
|
|
88
|
-
await
|
|
86
|
+
await browser .nextFrame ();
|
|
89
87
|
|
|
90
|
-
element .css ("background-image", `url(${
|
|
88
|
+
element .css ("background-image", `url(${canvas [0] .toDataURL ()})`);
|
|
91
89
|
}
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
browser .dispose ();
|
|
92
|
+
canvas .remove ();
|
|
95
93
|
}
|
|
96
94
|
};
|
|
@@ -360,6 +360,26 @@ DEF Sphere Transform {
|
|
|
360
360
|
geometry Sphere { }
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
+
`
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
componentInfo: { name: "Lighting" },
|
|
367
|
+
typeName: "EnvironmentLight",
|
|
368
|
+
x3dSyntax: `
|
|
369
|
+
EnvironmentLight {
|
|
370
|
+
diffuseTexture ImageCubeMapTexture {
|
|
371
|
+
url "https://create3000.github.io/Library/Tests/Components/images/helipad-diffuse.jpg"
|
|
372
|
+
textureProperties DEF _1 TextureProperties {
|
|
373
|
+
generateMipMaps TRUE
|
|
374
|
+
minificationFilter "NICEST"
|
|
375
|
+
magnificationFilter "NICEST"
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
specularTexture ImageCubeMapTexture {
|
|
379
|
+
url "https://create3000.github.io/Library/Tests/Components/images/helipad-specular.jpg"
|
|
380
|
+
textureProperties USE _1
|
|
381
|
+
}
|
|
382
|
+
}
|
|
363
383
|
`
|
|
364
384
|
},
|
|
365
385
|
{
|