sunrize 2.1.21 → 2.3.0

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.
Files changed (58) hide show
  1. package/package.json +7 -7
  2. package/src/Application/Application.js +42 -27
  3. package/src/Application/Dashboard.js +33 -0
  4. package/src/Application/Document.js +122 -67
  5. package/src/Application/Footer.js +8 -3
  6. package/src/Application/GetText.js +20 -2
  7. package/src/Application/Interface.js +1 -1
  8. package/src/Application/Tabs.js +384 -49
  9. package/src/Application/TopBar.js +32 -0
  10. package/src/Controls/AddPrototypePopover.js +2 -1
  11. package/src/Controls/AnimationPropertiesPopover.js +3 -4
  12. package/src/Controls/AudioPreviewPopover.js +2 -8
  13. package/src/Controls/EditNodePopover.js +4 -1
  14. package/src/Controls/EditUserDefinedFieldPopover.js +4 -1
  15. package/src/Controls/ExportNodePopover.js +3 -1
  16. package/src/Controls/ImportNodePopover.js +3 -1
  17. package/src/Controls/Tabs.js +28 -2
  18. package/src/Controls/TexturePreviewPopover.js +5 -5
  19. package/src/Controls/VideoPreviewPopover.js +5 -8
  20. package/src/Controls/VolumeSliderPopover.js +41 -0
  21. package/src/Editors/AnimationEditor.js +19 -5
  22. package/src/Editors/BrowserFrame.js +40 -26
  23. package/src/Editors/Console.js +4 -1
  24. package/src/Editors/NodeList.js +2 -2
  25. package/src/Editors/SceneProperties.js +7 -3
  26. package/src/Editors/ScriptEditor.js +2 -1
  27. package/src/Parser/AudioParser.js +2 -2
  28. package/src/Parser/VideoParser.js +2 -3
  29. package/src/Tools/Core/X3DNodeTool.js +3 -3
  30. package/src/Tools/Core/X3DPrototypeInstanceTool.js +2 -0
  31. package/src/Tools/Grids/AxonometricGridTool.js +1 -1
  32. package/src/Tools/Grids/X3DGridNodeTool.js +7 -13
  33. package/src/Tools/Grouping/X3DBoundedObjectTool.x3d +4 -2
  34. package/src/Tools/Grouping/X3DTransformNodeTool.x3d +4 -2
  35. package/src/Tools/Rendering/X3DGeometryNodeTool.x3d +4 -3
  36. package/src/Tools/Shaders/ToolShader.x3d +6 -6
  37. package/src/Undo/Editor.js +81 -79
  38. package/src/assets/html/application-template.html +95 -27
  39. package/src/assets/html/application.html +95 -27
  40. package/src/assets/html/window-template.html +2 -1
  41. package/src/assets/html/window.html +2 -1
  42. package/src/assets/images/seti/audio.svg +44 -0
  43. package/src/assets/images/seti/default.svg +36 -0
  44. package/src/assets/images/seti/html.svg +37 -0
  45. package/src/assets/images/seti/image.svg +37 -0
  46. package/src/assets/images/seti/json.svg +37 -0
  47. package/src/assets/images/seti/obj.svg +50 -0
  48. package/src/assets/images/seti/others.svg +50 -0
  49. package/src/assets/images/seti/ply.svg +50 -0
  50. package/src/assets/images/seti/sog.svg +57 -0
  51. package/src/assets/images/seti/spz.svg +57 -0
  52. package/src/assets/images/seti/stl.svg +50 -0
  53. package/src/assets/images/seti/svg.svg +41 -0
  54. package/src/assets/images/seti/video.svg +36 -0
  55. package/src/assets/images/seti/vrml.svg +34 -0
  56. package/src/assets/locale/dictionary.json +43 -0
  57. package/src/assets/themes/default.css +312 -216
  58. package/src/assets/themes/system-colors.css +11 -11
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "2.1.21",
4
+ "version": "2.3.0",
5
5
  "description": "Sunrize — A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -22,8 +22,8 @@
22
22
  "make": "electron-forge make",
23
23
  "postmake": "npm i -P electron",
24
24
  "publish:github": "node build/publish-to-github.js",
25
- "predocs": "rm -f -r docs/_site/",
26
- "docs": "cd docs && bundle exec jekyll serve --ssl-key ssl/server.key --ssl-cert ssl/server.crt --incremental --host=`ipconfig getifaddr en0`",
25
+ "predocs:server": "rm -f -r docs/_site/",
26
+ "docs:server": "cd docs && bundle exec jekyll serve --ssl-key ssl/server.key --ssl-cert ssl/server.crt --incremental --host=`ipconfig getifaddr en0`",
27
27
  "predocs:install": "cd docs && ln -s -f ../../ssl ./",
28
28
  "docs:install": "cd docs && gem install bundler && bundle install",
29
29
  "docs:update": "cd docs && bundle update",
@@ -91,7 +91,7 @@
91
91
  "@electron-forge/maker-zip": "^7.11.2",
92
92
  "@electron-forge/publisher-github": "^7.11.2",
93
93
  "@eslint/js": "^10.0.1",
94
- "eslint": "^10.8.1",
94
+ "eslint": "^10.9.1",
95
95
  "globals": "^17.11.0",
96
96
  "shell-tools": "^1.1.9"
97
97
  },
@@ -99,7 +99,7 @@
99
99
  "@vscode/codicons": "^0.0.45",
100
100
  "capitalize": "^2.0.4",
101
101
  "console": "^0.7.2",
102
- "electron": "^43.4.0",
102
+ "electron": "^44.0.0",
103
103
  "electron-prompt": "^1.7.0",
104
104
  "electron-squirrel-startup": "^1.0.1",
105
105
  "electron-tabs": "^1.0.4",
@@ -108,7 +108,7 @@
108
108
  "jquery-ui-dist": "^1.13.3",
109
109
  "jstree": "^3.3.17",
110
110
  "material-icons": "^1.13.14",
111
- "material-symbols": "^0.46.0",
111
+ "material-symbols": "^0.47.0",
112
112
  "md5": "^2.3.0",
113
113
  "mime-types": "^3.0.2",
114
114
  "monaco-editor": "^0.55.1",
@@ -118,7 +118,7 @@
118
118
  "string-similarity": "^4.0.4",
119
119
  "tweakpane": "^4.0.5",
120
120
  "update-electron-app": "^3.3.0",
121
- "x_ite": "^16.1.2",
121
+ "x_ite": "^16.2.0",
122
122
  "x_ite-off-parser": "^1.3.0",
123
123
  "x_ite-sog-parser": "^2.1.0",
124
124
  "x_ite-spz-parser": "^2.1.0",
@@ -87,11 +87,12 @@ module .exports = class Application
87
87
 
88
88
  async setup ()
89
89
  {
90
- electron .app .on ("activate", (event) => this .onactivate ());
91
- electron .app .on ("new-window-for-tab", (event) => this .createWindow ());
90
+ electron .app .on ("activate", () => this .onactivate ());
91
+ electron .app .on ("new-window-for-tab", () => this .createWindow ());
92
92
  electron .app .on ("open-file", (event, filePath) => this .openFiles ([url .pathToFileURL (filePath) .href]));
93
- electron .app .on ("window-all-closed", (event) => this .quit ());
93
+ electron .app .on ("window-all-closed", () => this .quit ());
94
94
 
95
+ electron .ipcMain .on ("locale", (event, locale) => _.setLocale (locale));
95
96
  electron .ipcMain .on ("title", (event, title) => this .title = title);
96
97
  electron .ipcMain .on ("current-file", (event, currentFile) => this .currentFile = currentFile);
97
98
  electron .ipcMain .on ("add-recent-location", (event, fileURL) => this .addRecentLocation (fileURL));
@@ -112,7 +113,7 @@ module .exports = class Application
112
113
 
113
114
  this .openFiles (this .receivedFiles);
114
115
 
115
- electron .app .on ("second-instance", (event, argv, cwd) =>
116
+ electron .app .on ("second-instance", (event, argv) =>
116
117
  {
117
118
  this .openFiles (argv .slice (1)
118
119
  .filter (filePath => fs .existsSync (filePath) && fs .lstatSync (filePath) .isFile ())
@@ -139,24 +140,35 @@ module .exports = class Application
139
140
 
140
141
  set currentFile (currentFile)
141
142
  {
143
+ currentFile = String (currentFile);
144
+
142
145
  const protocol = currentFile .match (/^(.+?:)/);
143
146
 
144
147
  switch (protocol ?.[1])
145
148
  {
146
- default:
147
- this .#currentFile = new URL (currentFile) .pathname .split ("/") .at (-1);
149
+ case undefined:
150
+ case "id:":
151
+ case "data:":
152
+ {
153
+ this .#currentFile = `${_("New Scene")}.x3d`;
148
154
  break;
155
+ }
149
156
  case "file:":
157
+ {
150
158
  this .#currentFile = url .fileURLToPath (currentFile);
151
159
  break;
152
- case "data:":
153
- case "id:":
154
- case undefined:
155
- this .#currentFile = "";
160
+ }
161
+ default:
162
+ {
163
+ this .#currentFile = new URL (currentFile) .pathname .split ("/") .at (-1);
156
164
  break;
165
+ }
157
166
  }
158
167
 
159
- this .mainWindow .setRepresentedFilename (this .#currentFile);
168
+ if (fs .existsSync (this .#currentFile))
169
+ this .mainWindow .setRepresentedFilename (this .#currentFile);
170
+ else
171
+ this .mainWindow .setRepresentedFilename ("");
160
172
  }
161
173
 
162
174
  pushMenu (menu)
@@ -220,7 +232,7 @@ module .exports = class Application
220
232
  accelerator: "Shift+CmdOrCtrl+O",
221
233
  click: async () =>
222
234
  {
223
- const clipboard = electron .clipboard .readText ();
235
+ const clipboard = await electron .clipboard .readText ();
224
236
 
225
237
  this .pushMenu (this .createDialogMenu ());
226
238
 
@@ -314,6 +326,8 @@ module .exports = class Application
314
326
  if (response .canceled)
315
327
  return;
316
328
 
329
+ this .currentFile = url .pathToFileURL (response .filePath);
330
+
317
331
  this .addRecentDocument (response .filePath);
318
332
 
319
333
  this .mainWindow .webContents .send ("save-file-as", response .filePath);
@@ -377,6 +391,8 @@ module .exports = class Application
377
391
 
378
392
  this .mainWindow .webContents .send ("export-as", response .filePath);
379
393
 
394
+ this .currentFile = url .pathToFileURL (response .filePath);
395
+
380
396
  this .updateMenu ();
381
397
  },
382
398
  },
@@ -539,13 +555,9 @@ module .exports = class Application
539
555
  click: () => this .mainWindow .reload (),
540
556
  },
541
557
  {
542
- role: "toggleDevTools",
543
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
544
- },
545
- {
546
- label: _("Reload Tab"),
558
+ label: _("Toggle Developer Tools"),
547
559
  visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
548
- click: () => this .mainWindow .webContents .send ("reload"),
560
+ click: () => this .mainWindow .webContents .openDevTools (),
549
561
  },
550
562
  {
551
563
  label: _("Toggle Tab Developer Tools"),
@@ -723,12 +735,6 @@ module .exports = class Application
723
735
  click: () => this .mainWindow .webContents .send ("logarithmic-depth-buffer", !this .menuOptions .logarithmicDepthBuffer),
724
736
  },
725
737
  { type: "separator" },
726
- {
727
- label: _("Mute Audio"),
728
- type: "checkbox",
729
- checked: this .menuOptions .mute,
730
- click: () => this .mainWindow .webContents .send ("mute", !this .menuOptions .mute),
731
- },
732
738
  {
733
739
  label: _("Display Rubberband"),
734
740
  type: "checkbox",
@@ -750,7 +756,9 @@ module .exports = class Application
750
756
  },
751
757
  { type: "separator" },
752
758
  {
753
- role: "togglefullscreen",
759
+ label: this .config .fullscreen ? _("Leave Full Screen") : _("Full Screen"),
760
+ accelerator: process .platform === "darwin" ? "Command+Control+F" : "F11",
761
+ click: () => this .mainWindow .setFullScreen (!this .config .fullscreen),
754
762
  },
755
763
  ],
756
764
  },
@@ -939,8 +947,11 @@ module .exports = class Application
939
947
 
940
948
  contextMenu (id, menu)
941
949
  {
942
- electron .Menu .buildFromTemplate (this .addMenuItemHandlers (id, this .filterSeparators (menu)))
943
- .popup ({ window: this .mainWindow });
950
+ const contextMenu = electron .Menu .buildFromTemplate (this .addMenuItemHandlers (id, this .filterSeparators (menu)));
951
+
952
+ contextMenu .on ("menu-will-close", () => this .mainWindow .webContents .send (`${id}-will-close`));
953
+
954
+ contextMenu .popup ({ window: this .mainWindow });
944
955
  }
945
956
 
946
957
  addMenuItemHandlers (id, menu)
@@ -1150,12 +1161,16 @@ module .exports = class Application
1150
1161
  onenterfullscreen ()
1151
1162
  {
1152
1163
  this .config .fullscreen = true;
1164
+
1165
+ this .updateMenu ();
1153
1166
  }
1154
1167
 
1155
1168
  onleavefullscreen ()
1156
1169
  {
1157
1170
  this .config .fullscreen = false;
1158
1171
  this .config .maximized = false;
1172
+
1173
+ this .updateMenu ();
1159
1174
  }
1160
1175
 
1161
1176
  onclose (event)
@@ -43,6 +43,17 @@ module .exports = class Dashboard extends Interface
43
43
  .appendTo (this .toolbar)
44
44
  .on ("click", () => this .play (!this .config .file .play));
45
45
 
46
+ this .volumeButton = $("<span></span>")
47
+ .addClass (["material-icons"])
48
+ .attr ("title", _("Adjust global sound intensity."))
49
+ .css ({ position: "relative", left: "1px", transform: "scale(0.9)" })
50
+ .text ("volume_down")
51
+ .appendTo (this .toolbar)
52
+ .on ("click", () => this .showVolumeSlider ());
53
+
54
+ this .browser .getBrowserOptions () ._SoundIntensity
55
+ .addFieldCallback (this, value => this .updateSoundIntensity (value));
56
+
46
57
  $("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
47
58
 
48
59
  const hierarchy = require ("./Hierarchy");
@@ -105,9 +116,12 @@ module .exports = class Dashboard extends Interface
105
116
  this .config .file .setDefaultValues ({
106
117
  pointer: "arrow",
107
118
  play: this .config .global .play,
119
+ soundIntensity: 1,
108
120
  panel: false,
109
121
  });
110
122
 
123
+ this .browser .setBrowserOption ("SoundIntensity", this .config .file .soundIntensity);
124
+
111
125
  this [this .config .file .pointer] ();
112
126
  this .play ((this .config .file .play) && !this .isInitialScene);
113
127
  this .straighten (this .browser .getBrowserOption ("StraightenHorizon"));
@@ -160,6 +174,25 @@ module .exports = class Dashboard extends Interface
160
174
  this .playButton .removeClass ("active");
161
175
  }
162
176
 
177
+ showVolumeSlider ()
178
+ {
179
+ require ("../Controls/VolumeSliderPopover");
180
+
181
+ this .volumeButton .volumeSliderPopover (this .browser);
182
+ }
183
+
184
+ updateSoundIntensity (value)
185
+ {
186
+ this .config .file .soundIntensity = value;
187
+
188
+ if (value === 0)
189
+ this .volumeButton .text ("volume_off");
190
+ else if (value < 0.75)
191
+ this .volumeButton .text ("volume_down");
192
+ else
193
+ this .volumeButton .text ("volume_up");
194
+ }
195
+
163
196
  selectParent ()
164
197
  {
165
198
  this .selectHierarchy ("up");
@@ -8,6 +8,7 @@ const
8
8
  X3D = require ("../X3D"),
9
9
  Interface = require ("./Interface"),
10
10
  Splitter = require ("../Controls/Splitter"),
11
+ TopBar = require ("./TopBar"),
11
12
  Dashboard = require ("./Dashboard"),
12
13
  Footer = require ("./Footer"),
13
14
  Sidebar = require ("./Sidebar"),
@@ -43,6 +44,7 @@ module .exports = class Document extends Interface
43
44
 
44
45
  this .verticalSplitter = new Splitter ($("#vertical-splitter"), "vertical");
45
46
  this .horizontalSplitter = new Splitter ($("#horizontal-splitter"), "horizontal");
47
+ this .topBar = new TopBar ($("#browser-top-bar"), this);
46
48
  this .secondaryToolbar = new Dashboard ($("#secondary-toolbar"), this);
47
49
  this .footer = new Footer ($("#footer"));
48
50
  this .sidebar = new Sidebar ($("#sidebar"));
@@ -66,7 +68,8 @@ module .exports = class Document extends Interface
66
68
 
67
69
  // Actions
68
70
 
69
- electron .ipcRenderer .on ("activate", () => this .activate ());
71
+ electron .ipcRenderer .on ("activate", (event, value) => this .activate (value));
72
+ electron .ipcRenderer .on ("mute", (event, value) => this .setMute (value, true));
70
73
 
71
74
  $(window)
72
75
  .on ("focusin", () => this .onfocus ())
@@ -77,13 +80,13 @@ module .exports = class Document extends Interface
77
80
  // File Menu
78
81
 
79
82
  electron .ipcRenderer .on ("open-files", (event, urls) => this .loadURL (urls [0])); // DEBUG
80
- electron .ipcRenderer .on ("save-file", (event) => this .saveFile ());
83
+ electron .ipcRenderer .on ("save-file", () => this .saveFile ());
81
84
  electron .ipcRenderer .on ("save-file-as", (event, filePath) => this .saveFileAs (filePath));
82
85
  electron .ipcRenderer .on ("save-copy-as", (event, filePath) => this .saveCopyAs (filePath));
83
86
  electron .ipcRenderer .on ("auto-save", (event, value) => this .autoSave = value);
84
87
  electron .ipcRenderer .on ("export-as", (event, filePath) => this .exportAs (filePath));
85
- electron .ipcRenderer .on ("scene-properties", (event) => require ("../Editors/SceneProperties") .open ());
86
- electron .ipcRenderer .on ("close", (event) => this .close ());
88
+ electron .ipcRenderer .on ("scene-properties", () => require ("../Editors/SceneProperties") .open ());
89
+ electron .ipcRenderer .on ("close", () => this .close ());
87
90
 
88
91
  $(window) .on ("beforeunload", () => this .close ());
89
92
 
@@ -101,17 +104,16 @@ module .exports = class Document extends Interface
101
104
 
102
105
  // View Menu
103
106
 
104
- electron .ipcRenderer .on ("primitive-quality", (event, value) => this .setPrimitiveQuality (value));
105
- electron .ipcRenderer .on ("texture-quality", (event, value) => this .setTextureQuality (value));
106
- electron .ipcRenderer .on ("text-compression", (event, value) => this .setTextCompression (value));
107
- electron .ipcRenderer .on ("color-space", (event, value) => this .setColorSpace (value));
108
- electron .ipcRenderer .on ("tone-mapping", (event, value) => this .setToneMapping (value));
109
- electron .ipcRenderer .on ("order-independent-transparency", (event, value) => this .setOrderIndependentTransparency (value));
110
- electron .ipcRenderer .on ("logarithmic-depth-buffer", (event, value) => this .setLogarithmicDepthBuffer (value));
111
- electron .ipcRenderer .on ("mute", (event, value) => this .setMute (value));
112
- electron .ipcRenderer .on ("display-rubberband", (event, value) => this .setDisplayRubberband (value));
107
+ electron .ipcRenderer .on ("primitive-quality", (event, value) => this .setPrimitiveQuality (value, true));
108
+ electron .ipcRenderer .on ("texture-quality", (event, value) => this .setTextureQuality (value, true));
109
+ electron .ipcRenderer .on ("text-compression", (event, value) => this .setTextCompression (value, true));
110
+ electron .ipcRenderer .on ("color-space", (event, value) => this .setColorSpace (value, true));
111
+ electron .ipcRenderer .on ("tone-mapping", (event, value) => this .setToneMapping (value, true));
112
+ electron .ipcRenderer .on ("order-independent-transparency", (event, value) => this .setOrderIndependentTransparency (value, true));
113
+ electron .ipcRenderer .on ("logarithmic-depth-buffer", (event, value) => this .setLogarithmicDepthBuffer (value, true));
114
+ electron .ipcRenderer .on ("display-rubberband", (event, value) => this .setDisplayRubberband (value, true));
113
115
  electron .ipcRenderer .on ("display-timings", (event, value) => this .setDisplayTimings (value));
114
- electron .ipcRenderer .on ("show-library", (event) => this .showLibrary ());
116
+ electron .ipcRenderer .on ("show-library", () => this .showLibrary ());
115
117
 
116
118
  // Layout Menu
117
119
 
@@ -164,14 +166,17 @@ module .exports = class Document extends Interface
164
166
 
165
167
  // Connect browser events.
166
168
 
169
+ this .browser .getRenderingProperties () ._SoundDestinations .addInterest ("toggleMuteButton", this);
167
170
  this .browser ._activeLayer .addInterest ("toggleGrids", this);
168
171
 
169
172
  // Connect for Snap Target and Snap Source.
170
173
 
171
174
  $(this .browser .element)
172
- .on ("mousedown", event => this .onmousedown (event))
173
- .on ("mouseup", event => this .onsnaptool (event))
174
- .on ("mouseup", event => this .onselect (event))
175
+ .on ("mousedown", event => this .onmousedown (event))
176
+ .on ("mouseup", event => this .onsnaptool (event))
177
+ .on ("mouseup", event => this .onselect (event));
178
+
179
+ $("#browser-frame")
175
180
  .on ("contextmenu", event => this .showBrowserContextMenu (event));
176
181
 
177
182
  electron .ipcRenderer .on ("document", (event, key, ... args) => this [key] (... args));
@@ -214,9 +219,9 @@ module .exports = class Document extends Interface
214
219
  toneMapping: "NONE",
215
220
  orderIndependentTransparency: false,
216
221
  logarithmicDepthBuffer: false,
217
- mute: false,
218
222
  rubberband: true,
219
223
  timings: false,
224
+ mute: false,
220
225
  });
221
226
 
222
227
  this .fileSaveFileTypeWarning = false;
@@ -230,9 +235,9 @@ module .exports = class Document extends Interface
230
235
  this .setToneMapping (this .config .file .toneMapping);
231
236
  this .setOrderIndependentTransparency (this .config .file .orderIndependentTransparency);
232
237
  this .setLogarithmicDepthBuffer (this .config .file .logarithmicDepthBuffer);
233
- this .setMute (this .config .file .mute);
234
238
  this .setDisplayRubberband (this .config .file .rubberband);
235
239
  this .setDisplayTimings (this .config .file .timings);
240
+ this .setMute (this .config .file .mute);
236
241
 
237
242
  // Configure grids.
238
243
 
@@ -251,17 +256,40 @@ module .exports = class Document extends Interface
251
256
 
252
257
  // Run activate.
253
258
 
254
- this .activate ();
259
+ this .activate (true);
255
260
  }
256
261
 
262
+ #wasLive;
263
+
257
264
  /**
258
265
  * Run actions when tab is activated/selected.
259
266
  */
260
- activate ()
267
+ activate (active)
261
268
  {
262
- this .updateMenu ();
269
+ if (active)
270
+ {
271
+ this .updateMenu ();
272
+
273
+ electron .ipcRenderer .sendToHost ("focus");
274
+
275
+ // Live Handling
276
+
277
+ if (this .#wasLive)
278
+ this .browser .beginUpdate ();
279
+
280
+ this .browser .setBrowserOption ("AutoUpdate", true);
281
+
282
+ this .#wasLive = undefined;
283
+ }
284
+ else
285
+ {
286
+ // Live Handling
287
+
288
+ this .#wasLive ??= this .browser .isLive ();
263
289
 
264
- electron .ipcRenderer .sendToHost ("focus");
290
+ this .browser .setBrowserOption ("AutoUpdate", false);
291
+ this .browser .endUpdate ();
292
+ }
265
293
  }
266
294
 
267
295
  updateMenu ()
@@ -401,13 +429,15 @@ module .exports = class Document extends Interface
401
429
  }
402
430
  else
403
431
  {
404
- await this .loadURL (encodeURI (`data:model/x3d+vrml,
405
- Viewpoint {
406
- description "Initial View"
407
- position 2.869677 3.854335 8.769781
408
- orientation -0.7765887 0.6177187 0.1238285 0.5052317
409
- }
410
- `));
432
+ await this .loadURL (encodeURI (/* xml */ `data:model/x3d+xml,
433
+ <X3D profile='Interchange'>
434
+ <Scene>
435
+ <Viewpoint
436
+ description='Initial View'
437
+ position='2.869677 3.854335 8.769781'
438
+ orientation='-0.7765887 0.6177187 0.1238285 0.5052317'/>
439
+ </Scene>
440
+ </X3D>`));
411
441
 
412
442
  this .activateGridTool ("GridTool", true, false);
413
443
  }
@@ -438,8 +468,10 @@ Viewpoint {
438
468
  await this .#replaceWorld .call (this .browser, scene);
439
469
 
440
470
  this .browser .currentScene .setSpecificationVersion (X3D .LATEST_VERSION);
471
+
472
+ electron .ipcRenderer .sendToHost ("scene-encoding", scene .encoding);
441
473
  }
442
- catch (error)
474
+ catch
443
475
  {
444
476
  // console .error (error);
445
477
  }
@@ -679,10 +711,12 @@ Viewpoint {
679
711
  *
680
712
  * @param {string} value
681
713
  */
682
- setPrimitiveQuality (value)
714
+ setPrimitiveQuality (value, notification)
683
715
  {
684
716
  this .browser .setBrowserOption ("PrimitiveQuality", value);
685
- this .browser .setDescription (`Primitive Quality: ${value .toLowerCase ()}`);
717
+
718
+ if (notification)
719
+ this .browser .setDescription (`Primitive Quality: ${value .toLowerCase ()}`);
686
720
  }
687
721
 
688
722
  set_PrimitiveQuality ()
@@ -696,10 +730,12 @@ Viewpoint {
696
730
  *
697
731
  * @param {string} value
698
732
  */
699
- setTextureQuality (value)
733
+ setTextureQuality (value, notification)
700
734
  {
701
735
  this .browser .setBrowserOption ("TextureQuality", value);
702
- this .browser .setDescription (`Texture Quality: ${value .toLowerCase ()}`);
736
+
737
+ if (notification)
738
+ this .browser .setDescription (`Texture Quality: ${value .toLowerCase ()}`);
703
739
  }
704
740
 
705
741
  set_TextureQuality ()
@@ -713,10 +749,12 @@ Viewpoint {
713
749
  *
714
750
  * @param {string} value
715
751
  */
716
- setTextCompression (value)
752
+ setTextCompression (value, notification)
717
753
  {
718
754
  this .browser .setBrowserOption ("TextCompression", value);
719
- this .browser .setDescription (`Text Compression: ${value}`);
755
+
756
+ if (notification)
757
+ this .browser .setDescription (`Text Compression: ${value}`);
720
758
  }
721
759
 
722
760
  set_TextCompression ()
@@ -730,10 +768,12 @@ Viewpoint {
730
768
  *
731
769
  * @param {string} value
732
770
  */
733
- setColorSpace (value)
771
+ setColorSpace (value, notification)
734
772
  {
735
773
  this .browser .setBrowserOption ("ColorSpace", value);
736
- this .browser .setDescription (`Color Space: ${value}`);
774
+
775
+ if (notification)
776
+ this .browser .setDescription (`Color Space: ${value}`);
737
777
  }
738
778
 
739
779
  set_ColorSpace ()
@@ -747,10 +787,12 @@ Viewpoint {
747
787
  *
748
788
  * @param {string} value
749
789
  */
750
- setToneMapping (value)
790
+ setToneMapping (value, notification)
751
791
  {
752
792
  this .browser .setBrowserOption ("ToneMapping", value);
753
- this .browser .setDescription (`Tone Mapping: ${value}`);
793
+
794
+ if (notification)
795
+ this .browser .setDescription (`Tone Mapping: ${value}`);
754
796
  }
755
797
 
756
798
  set_ToneMapping ()
@@ -764,10 +806,12 @@ Viewpoint {
764
806
  *
765
807
  * @param {boolean} value
766
808
  */
767
- setOrderIndependentTransparency (value)
809
+ setOrderIndependentTransparency (value, notification)
768
810
  {
769
811
  this .browser .setBrowserOption ("OrderIndependentTransparency", value);
770
- this .browser .setDescription (`OrderIndependentTransparency: ${value ? "on" : "off"}`);
812
+
813
+ if (notification)
814
+ this .browser .setDescription (`OrderIndependentTransparency: ${value ? "on" : "off"}`);
771
815
  }
772
816
 
773
817
  set_OrderIndependentTransparency ()
@@ -781,10 +825,12 @@ Viewpoint {
781
825
  *
782
826
  * @param {boolean} value
783
827
  */
784
- setLogarithmicDepthBuffer (value)
828
+ setLogarithmicDepthBuffer (value, notification)
785
829
  {
786
830
  this .browser .setBrowserOption ("LogarithmicDepthBuffer", value);
787
- this .browser .setDescription (`LogarithmicDepthBuffer: ${value ? "on" : "off"}`);
831
+
832
+ if (notification)
833
+ this .browser .setDescription (`LogarithmicDepthBuffer: ${value ? "on" : "off"}`);
788
834
  }
789
835
 
790
836
  set_LogarithmicDepthBuffer ()
@@ -798,27 +844,12 @@ Viewpoint {
798
844
  *
799
845
  * @param {boolean} value
800
846
  */
801
- setMute (value)
802
- {
803
- this .browser .setBrowserOption ("Mute", value);
804
- this .browser .setDescription (`Mute: ${value ? "on" : "off"}`);
805
- }
806
-
807
- set_Mute ()
808
- {
809
- this .config .file .mute = this .browser .getBrowserOption ("Mute");
810
-
811
- this .updateMenu ();
812
- }
813
-
814
- /**
815
- *
816
- * @param {boolean} value
817
- */
818
- setDisplayRubberband (value)
847
+ setDisplayRubberband (value, notification)
819
848
  {
820
849
  this .browser .setBrowserOption ("Rubberband", value);
821
- this .browser .setDescription (`Rubberband: ${value ? "on" : "off"}`);
850
+
851
+ if (notification)
852
+ this .browser .setDescription (`Rubberband: ${value ? "on" : "off"}`);
822
853
  }
823
854
 
824
855
  set_Rubberband ()
@@ -881,7 +912,7 @@ Viewpoint {
881
912
 
882
913
  toggleGrids ()
883
914
  {
884
- const configNode = Editor .getConfigNode (this .browser);
915
+ const configNode = Editor .getLayerConfigNode (this .browser);
885
916
 
886
917
  for (const typeName of Document .#Grids)
887
918
  {
@@ -908,7 +939,7 @@ Viewpoint {
908
939
 
909
940
  if (visible)
910
941
  {
911
- for (const [typeName, grid] of this .#grids)
942
+ for (const [, grid] of this .#grids)
912
943
  {
913
944
  if (undo)
914
945
  Editor .setFieldValue (this .browser .currentScene, grid .tool .getValue (), grid ._visible, false);
@@ -1185,7 +1216,7 @@ Viewpoint {
1185
1216
  executionContext = this .browser .currentScene,
1186
1217
  layerNode = this .browser .getActiveLayer (),
1187
1218
  nodes = selection .nodes,
1188
- [values, bbox] = Editor .getModelMatricesAndBBoxes (executionContext, layerNode, nodes);
1219
+ [, bbox] = Editor .getModelMatricesAndBBoxes (executionContext, layerNode, nodes);
1189
1220
 
1190
1221
  if (!bbox .size .norm ())
1191
1222
  return;
@@ -1297,4 +1328,28 @@ Viewpoint {
1297
1328
 
1298
1329
  viewpointNode ._set_bind = true;
1299
1330
  }
1331
+
1332
+ toggleMuteButton ()
1333
+ {
1334
+ electron .ipcRenderer .sendToHost ("mute-button", this .browser .getRenderingProperty ("SoundDestinations"));
1335
+ }
1336
+
1337
+ /**
1338
+ *
1339
+ * @param {boolean} value
1340
+ */
1341
+ setMute (value, notification)
1342
+ {
1343
+ this .browser .setBrowserOption ("Mute", value);
1344
+
1345
+ if (notification)
1346
+ this .browser .setDescription (`Mute: ${value ? "on" : "off"}`);
1347
+ }
1348
+
1349
+ set_Mute ()
1350
+ {
1351
+ this .config .file .mute = this .browser .getBrowserOption ("Mute");
1352
+
1353
+ electron .ipcRenderer .sendToHost ("mute", this .browser .getBrowserOption ("Mute"));
1354
+ }
1300
1355
  };
@@ -16,9 +16,14 @@ module .exports = class Footer extends Tabs
16
16
 
17
17
  addTabs ()
18
18
  {
19
- this .addTextTab ("console", _("Console"));
20
- this .addTextTab ("script-editor", _("Script Editor"));
21
- this .addTextTab ("animation-editor", _("Animation Editor"));
19
+ this .addIconTextTab ("console", "menu", _("Console"))
20
+ .find (".material-icons") .css ("color", "var(--system-green)");
21
+
22
+ this .addIconTextTab ("script-editor", "data_array", _("Script Editor"))
23
+ .find (".material-icons") .css ("color", "var(--system-blue)");
24
+
25
+ this .addIconTextTab ("animation-editor","animation", _("Animation Editor"))
26
+ .find (".material-icons") .css ("color", "var(--system-indigo)");
22
27
 
23
28
  this .console = new Console (this .getPanel ("console"));
24
29
  }