sunrize 1.7.6 → 1.7.8
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 +4 -4
- package/src/Application/Application.js +17 -0
- package/src/Application/Document.js +22 -0
- package/src/Application/Tabs.js +1 -0
- package/src/Bits/X3DUOM.js +10 -0
- package/src/Controls/Dialog.js +14 -9
- package/src/Editors/Library.js +12 -3
- package/src/Editors/MaterialsLibrary.js +14 -16
- package/src/assets/X3D/MaterialPreview.x3d +5 -9
- package/src/assets/X3D/TexturePreview.x3d +5 -9
- package/src/assets/html/application-template.html +5 -1
- package/src/assets/html/application.html +5 -1
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.8",
|
|
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.1
|
|
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",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"jquery-ui-dist": "^1.13.3",
|
|
100
100
|
"jstree": "^3.3.16",
|
|
101
101
|
"material-icons": "^1.13.12",
|
|
102
|
-
"material-symbols": "^0.
|
|
102
|
+
"material-symbols": "^0.21.2",
|
|
103
103
|
"md5": "^2.3.0",
|
|
104
104
|
"mime-types": "^2.1.35",
|
|
105
105
|
"monaco-editor": "^0.50.0",
|
|
@@ -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.1.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/Bits/X3DUOM.js
CHANGED
|
@@ -29,4 +29,14 @@ X3DUOM .find ("ConcreteNode[name=Shape]")
|
|
|
29
29
|
X3DUOM .find ("ConcreteNode[name=ParticleSystem]")
|
|
30
30
|
.append (X3DUOM .find ("field[name=pointerEvents]") .first () .clone ());
|
|
31
31
|
|
|
32
|
+
// damping
|
|
33
|
+
X3DUOM .find ("ConcreteNode[name=BoundedPhysicsModel]")
|
|
34
|
+
.append ($(X3DUOM [0] .createElement ("field"))
|
|
35
|
+
.attr ("name", "damping")
|
|
36
|
+
.attr ("type", "SFFloat")
|
|
37
|
+
.attr ("accessType", "inputOutput")
|
|
38
|
+
.attr ("default", "1")
|
|
39
|
+
.attr ("minInclusive", "0")
|
|
40
|
+
.attr ("description", "Damping that particles experience in the event of a collision."));
|
|
41
|
+
|
|
32
42
|
module .exports = X3DUOM;
|
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
|
};
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<component name='Scripting' level='1'/>
|
|
10
10
|
<meta name='created' content='Thu, 10 Jul 2014 17:28:33 GMT'/>
|
|
11
11
|
<meta name='creator' content='Holger Seelig'/>
|
|
12
|
-
<meta name='generator' content='Sunrize X3D Editor V1.6
|
|
13
|
-
<meta name='modified' content='Fri,
|
|
12
|
+
<meta name='generator' content='Sunrize X3D Editor V1.7.6, https://create3000.github.io/sunrize/'/>
|
|
13
|
+
<meta name='modified' content='Fri, 19 Jul 2024 18:04:50 GMT'/>
|
|
14
14
|
</head>
|
|
15
15
|
<Scene>
|
|
16
16
|
<LayerSet
|
|
@@ -19,16 +19,12 @@
|
|
|
19
19
|
<LayoutLayer DEF='CheckerBoard'>
|
|
20
20
|
<Layout
|
|
21
21
|
scaleMode='"PIXEL", "PIXEL"'/>
|
|
22
|
-
<Background DEF='Gray'
|
|
23
|
-
skyColor='0.4 0.4 0.4'/>
|
|
24
22
|
<Shape>
|
|
25
23
|
<Appearance>
|
|
26
|
-
<UnlitMaterial
|
|
27
|
-
emissiveColor='0.6 0.6 0.6'/>
|
|
28
24
|
<PixelTexture
|
|
29
|
-
image='2 2
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
image='2 2 1
|
|
26
|
+
0x99 0x66
|
|
27
|
+
0x66 0x99'/>
|
|
32
28
|
<TextureTransform
|
|
33
29
|
scale='5000 5000'/>
|
|
34
30
|
</Appearance>
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<component name='TextureProjection' level='2'/>
|
|
11
11
|
<meta name='created' content='Thu, 10 Jul 2014 17:28:33 GMT'/>
|
|
12
12
|
<meta name='creator' content='Holger Seelig'/>
|
|
13
|
-
<meta name='generator' content='Sunrize X3D Editor V1.7.
|
|
14
|
-
<meta name='modified' content='
|
|
13
|
+
<meta name='generator' content='Sunrize X3D Editor V1.7.6, https://create3000.github.io/sunrize/'/>
|
|
14
|
+
<meta name='modified' content='Fri, 19 Jul 2024 18:05:08 GMT'/>
|
|
15
15
|
</head>
|
|
16
16
|
<Scene>
|
|
17
17
|
<ExternProtoDeclare name='Volume' url='"Volume.x3d#Volume"'>
|
|
@@ -25,16 +25,12 @@
|
|
|
25
25
|
pickable='false'>
|
|
26
26
|
<Layout
|
|
27
27
|
scaleMode='"PIXEL", "PIXEL"'/>
|
|
28
|
-
<Background DEF='Gray'
|
|
29
|
-
skyColor='0.4 0.4 0.4'/>
|
|
30
28
|
<Shape>
|
|
31
29
|
<Appearance>
|
|
32
|
-
<UnlitMaterial
|
|
33
|
-
emissiveColor='0.6 0.6 0.6'/>
|
|
34
30
|
<PixelTexture
|
|
35
|
-
image='2 2
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
image='2 2 1
|
|
32
|
+
0x99 0x66
|
|
33
|
+
0x66 0x99'/>
|
|
38
34
|
<TextureTransform
|
|
39
35
|
scale='5000 5000'/>
|
|
40
36
|
</Appearance>
|
|
@@ -19,12 +19,16 @@
|
|
|
19
19
|
.etabs .tab {
|
|
20
20
|
background: var(--window-tabs-background-color);
|
|
21
21
|
border-color: var(--border-color) !important;
|
|
22
|
-
padding: 4px 3px;
|
|
22
|
+
padding: 4px 3px !important;
|
|
23
23
|
color: var(--window-tabs-text-color);
|
|
24
24
|
font-family: var(--sans-serif);
|
|
25
25
|
box-shadow: none;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
.etabs .tab:first-child {
|
|
29
|
+
border-left: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
.etabs .tab.active {
|
|
29
33
|
z-index: 1100;
|
|
30
34
|
background: var(--background-color);
|
|
@@ -19,12 +19,16 @@
|
|
|
19
19
|
.etabs .tab {
|
|
20
20
|
background: var(--window-tabs-background-color);
|
|
21
21
|
border-color: var(--border-color) !important;
|
|
22
|
-
padding: 4px 3px;
|
|
22
|
+
padding: 4px 3px !important;
|
|
23
23
|
color: var(--window-tabs-text-color);
|
|
24
24
|
font-family: var(--sans-serif);
|
|
25
25
|
box-shadow: none;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
.etabs .tab:first-child {
|
|
29
|
+
border-left: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
.etabs .tab.active {
|
|
29
33
|
z-index: 1100;
|
|
30
34
|
background: var(--background-color);
|