sunrize 2.1.17 → 2.1.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sunrize",
3
3
  "productName": "Sunrize X3D Editor",
4
- "version": "2.1.17",
4
+ "version": "2.1.19",
5
5
  "description": "Sunrize — A Multi-Platform X3D Editor",
6
6
  "main": "src/main.js",
7
7
  "bin": {
@@ -91,15 +91,15 @@
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.0",
95
- "globals": "^17.8.0",
94
+ "eslint": "^10.8.1",
95
+ "globals": "^17.9.0",
96
96
  "shell-tools": "^1.1.9"
97
97
  },
98
98
  "dependencies": {
99
99
  "@vscode/codicons": "^0.0.45",
100
100
  "capitalize": "^2.0.4",
101
101
  "console": "^0.7.2",
102
- "electron": "^43.2.0",
102
+ "electron": "^43.3.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.45.9",
111
+ "material-symbols": "^0.45.10",
112
112
  "md5": "^2.3.0",
113
113
  "mime-types": "^3.0.2",
114
114
  "monaco-editor": "^0.55.1",
@@ -118,15 +118,15 @@
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.0.4",
122
- "x_ite-off-parser": "^1.2.4",
123
- "x_ite-sog-parser": "^2.0.1",
124
- "x_ite-spz-parser": "^2.0.0",
125
- "x3d-traverse": "^2.0.1"
121
+ "x_ite": "^16.1.0",
122
+ "x_ite-off-parser": "^1.3.0",
123
+ "x_ite-sog-parser": "^2.1.0",
124
+ "x_ite-spz-parser": "^2.1.0",
125
+ "x3d-traverse": "^2.1.0"
126
126
  },
127
127
  "allowScripts": {
128
+ "electron-winstaller@5.4.4": true,
128
129
  "fs-xattr@0.3.1": true,
129
- "macos-alias@0.2.12": true,
130
- "electron-winstaller@5.4.4": true
130
+ "macos-alias@0.2.12": true
131
131
  }
132
132
  }
@@ -534,12 +534,9 @@ module .exports = class Application
534
534
  label: _("View"),
535
535
  submenu: [
536
536
  {
537
- role: "reload",
538
- visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
539
- },
540
- {
541
- role: "forceReload",
537
+ label: _("Reload"),
542
538
  visible: process .env .SUNRISE_ENVIRONMENT === "DEVELOPMENT",
539
+ click: () => this .mainWindow .reload (),
543
540
  },
544
541
  {
545
542
  role: "toggleDevTools",
@@ -234,9 +234,9 @@ module .exports = class Dashboard extends Interface
234
234
  viewpointNode = this .browser .getActiveViewpoint (),
235
235
  straighten = this .browser .getBrowserOption ("StraightenHorizon");
236
236
 
237
- const [values, bbox] = Editor .getModelMatricesAndBBoxes (executionContext, layerNode, nodes);
237
+ const [, bbox] = Editor .getModelMatricesAndBBoxes (executionContext, layerNode, nodes);
238
238
 
239
- viewpointNode .lookAtBBox (layerNode, bbox, 1, straighten);
239
+ viewpointNode .lookAtBBox ({ layerNode, bbox, straighten });
240
240
  }
241
241
  else
242
242
  {
@@ -2,7 +2,6 @@
2
2
 
3
3
  const
4
4
  $ = window .jQuery = require ("jquery"),
5
- $ui = require ("jquery-ui-dist/jquery-ui"),
6
5
  electron = require ("electron"),
7
6
  fs = require ("fs"),
8
7
  path = require ("path"),
@@ -20,6 +19,7 @@ const
20
19
  AudioParser = require ("../Parser/AudioParser"),
21
20
  _ = require ("./GetText");
22
21
 
22
+ require ("jquery-ui-dist/jquery-ui");
23
23
  require ("x_ite-sog-parser");
24
24
  require ("x_ite-spz-parser/x_ite-spz-parser-123.js");
25
25
  require ("x_ite-spz-parser/x_ite-spz-parser-4.js");
@@ -205,6 +205,7 @@ module .exports = class Document extends Interface
205
205
  configure ()
206
206
  {
207
207
  this .config .file .setDefaultValues ({
208
+ commonMetaData: true,
208
209
  inferProfileAndComponents: true,
209
210
  primitiveQuality: "MEDIUM",
210
211
  textureQuality: "MEDIUM",
@@ -459,22 +460,25 @@ Viewpoint {
459
460
  if (this .config .file .inferProfileAndComponents ?? true)
460
461
  Editor .inferProfileAndComponents (scene, new UndoManager ());
461
462
 
462
- // Add default meta data.
463
+ // Add common meta data.
463
464
 
464
- const
465
- pkg = require ("../../package.json"),
466
- generator = scene .getMetaData ("generator") ?.filter (value => !value .startsWith (pkg .productName)) ?? [ ];
465
+ if (this .config .file .commonMetaData ?? true)
466
+ {
467
+ const
468
+ pkg = require ("../../package.json"),
469
+ generator = scene .getMetaData ("generator") ?.filter (value => !value .startsWith (pkg .productName)) ?? [ ];
467
470
 
468
- generator .unshift (`${pkg .productName} V${pkg .version}, ${pkg .homepage}`);
471
+ generator .unshift (`${pkg .productName} V${pkg .version}, ${pkg .homepage}`);
469
472
 
470
- if (!scene .getMetaData ("creator") ?.some (value => value .includes (this .fullname)))
471
- scene .addMetaData ("creator", this .fullname);
473
+ if (!scene .getMetaData ("creator") ?.some (value => value .includes (this .fullname)))
474
+ scene .addMetaData ("creator", this .fullname);
472
475
 
473
- if (!scene .getMetaData ("created"))
474
- scene .setMetaData ("created", new Date () .toUTCString ());
476
+ if (!scene .getMetaData ("created"))
477
+ scene .setMetaData ("created", new Date () .toUTCString ());
475
478
 
476
- scene .setMetaData ("modified", new Date () .toUTCString ());
477
- scene .setMetaData ("generator", generator);
479
+ scene .setMetaData ("modified", new Date () .toUTCString ());
480
+ scene .setMetaData ("generator", generator);
481
+ }
478
482
 
479
483
  // Save source code.
480
484
 
@@ -1102,7 +1106,7 @@ Viewpoint {
1102
1106
  tool = geometryTool ?? shapeNode .getExecutionContext () .getOuterNode () ?.getTool (),
1103
1107
  node = tool ?? shapeNode .getExecutionContext () .getOuterNode () ?? shapeNode;
1104
1108
 
1105
- outlineEditor .expandTo (node, { expandObject: true, expandAll: true });
1109
+ outlineEditor .expandTo (node, { expandObject: true, expandInlineNodes: true, expandAll: true });
1106
1110
 
1107
1111
  let elements = outlineEditor .sceneGraph .find (`.node[node-id=${node .getId ()}]`);
1108
1112
 
@@ -1130,10 +1134,7 @@ Viewpoint {
1130
1134
  else
1131
1135
  {
1132
1136
  while (!outlineEditor .isEditable (elements))
1133
- {
1134
- elements .jstree ("close_node", elements);
1135
1137
  elements = elements .parent () .closest (".node, .scene", outlineEditor .sceneGraph);
1136
- }
1137
1138
 
1138
1139
  elements = Array .from (elements);
1139
1140
  }
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  const
4
- $ = require ("jquery"),
5
- X3D = require ("../X3D"),
6
- Dialog = require ("../Controls/Dialog"),
7
- Editor = require ("../Undo/Editor"),
8
- UndoManager = require ("../Undo/UndoManager"),
9
- _ = require ("../Application/GetText");
4
+ $ = require ("jquery"),
5
+ Dialog = require ("../Controls/Dialog"),
6
+ _ = require ("../Application/GetText");
10
7
 
11
8
  module .exports = new class BrowserFrame extends Dialog
12
9
  {
@@ -124,25 +121,24 @@ module .exports = new class BrowserFrame extends Dialog
124
121
  {
125
122
  super .configure ({ size: [388, 175] });
126
123
 
127
- this .connect (Editor .getWorldInfo (this .browser .currentScene));
124
+ this .config .file .setDefaultValues ({
125
+ fixedSize: false,
126
+ numerator: 1,
127
+ denominator: 1,
128
+ backgroundColor: "",
129
+ });
130
+
128
131
  this .updateInputs ();
129
132
  this .onresize ();
130
133
  }
131
134
 
132
- connect (worldInfoNode)
133
- {
134
- worldInfoNode ?.addMetaDataCallback (this, "Sunrize/BrowserFrame/fixedSize", () => this .updateInputs ());
135
- worldInfoNode ?.addMetaDataCallback (this, "Sunrize/BrowserFrame/aspectRatio", () => this .updateInputs ());
136
- worldInfoNode ?.addMetaDataCallback (this, "Sunrize/BrowserFrame/backgroundColor", () => this .updateInputs ());
137
- }
138
-
139
135
  updateInputs ()
140
136
  {
141
137
  const
142
- worldInfoNode = Editor .getWorldInfo (this .browser .currentScene),
143
- [fixedSize = false] = worldInfoNode ?.getMetaData ("Sunrize/BrowserFrame/fixedSize") ?? [ ],
144
- [numerator = 1, denominator = 1] = worldInfoNode ?.getMetaData ("Sunrize/BrowserFrame/aspectRatio") ?? [ ],
145
- [backgroundColor = ""] = worldInfoNode ?.getMetaData ("Sunrize/BrowserFrame/backgroundColor") ?? [ ];
138
+ fixedSize = this .config .file .fixedSize,
139
+ numerator = this .config .file .numerator,
140
+ denominator = this .config .file .denominator,
141
+ backgroundColor = this .config .file .backgroundColor;
146
142
 
147
143
  this .updateSize ();
148
144
 
@@ -160,22 +156,12 @@ module .exports = new class BrowserFrame extends Dialog
160
156
 
161
157
  onchange ()
162
158
  {
163
- const
164
- worldInfoNode = Editor .getWorldInfo (this .browser .currentScene, true),
165
- fixedSize = new X3D .SFBool (this .fixedSize .prop ("checked")),
166
- aspectRatio = new X3D .MFDouble (this .numerator .val (), this .denominator .val ()),
167
- backgroundColor = new X3D .SFString (this .backgroundColor .val ());
159
+ this .config .file .fixedSize = this .fixedSize .prop ("checked");
160
+ this .config .file .numerator = this .numerator .val ();
161
+ this .config .file .denominator = this .denominator .val ();
162
+ this .config .file .backgroundColor = this .backgroundColor .val ();
168
163
 
169
- this .connect (worldInfoNode);
170
-
171
- UndoManager .shared .beginUndo (_("Change Browser Frame"));
172
-
173
- Editor .setNodeMetaData (worldInfoNode, "Sunrize/BrowserFrame/fixedSize", fixedSize);
174
- Editor .setNodeMetaData (worldInfoNode, "Sunrize/BrowserFrame/aspectRatio", aspectRatio);
175
- Editor .setNodeMetaData (worldInfoNode, "Sunrize/BrowserFrame/backgroundColor", backgroundColor);
176
- Editor .deferFunction (() => this .onresize ());
177
-
178
- UndoManager .shared .endUndo ();
164
+ this .onresize ();
179
165
  }
180
166
 
181
167
  /**
@@ -184,13 +170,13 @@ module .exports = new class BrowserFrame extends Dialog
184
170
  onresize ()
185
171
  {
186
172
  const
187
- worldInfoNode = Editor .getWorldInfo (this .browser .currentScene),
188
- [fixedSize = false] = worldInfoNode ?.getMetaData ("Sunrize/BrowserFrame/fixedSize") ?? [ ],
189
- [numerator = 1, denominator = 1] = worldInfoNode ?.getMetaData ("Sunrize/BrowserFrame/aspectRatio") ?? [ ],
190
- [backgroundColor = ""] = worldInfoNode ?.getMetaData ("Sunrize/BrowserFrame/backgroundColor") ?? [ ],
191
- aspectRatio = numerator / denominator,
192
- frameAspectRatio = $("#browser-frame") .width () / $("#browser-frame") .height (),
193
- element = $(this .browser .element);
173
+ fixedSize = this .config .file .fixedSize,
174
+ numerator = this .config .file .numerator,
175
+ denominator = this .config .file .denominator,
176
+ backgroundColor = this .config .file .backgroundColor,
177
+ aspectRatio = numerator / denominator,
178
+ frameAspectRatio = $("#browser-frame") .width () / $("#browser-frame") .height (),
179
+ element = $(this .browser .element);
194
180
 
195
181
  if (fixedSize && aspectRatio)
196
182
  {
@@ -500,7 +500,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
500
500
  },
501
501
  {
502
502
  label: _("Import Node..."),
503
- visible: executionContext !== this .executionContext && !element .closest (".instance-scene") .length,
503
+ visible: executionContext !== this .executionContext && !element .closest (".instance-scene, .InlineGeometry.internal-scene", this .sceneGraph) .length && !element .closest (".internal-scene", this .sceneGraph) .parent () .closest (".internal-scene", this .sceneGraph) .length,
504
504
  args: ["addImportedNode", element .attr ("id")],
505
505
  },
506
506
  ];
@@ -1740,39 +1740,47 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
1740
1740
  {
1741
1741
  const
1742
1742
  executionContext = this .objects .get (executionContextId),
1743
- urlObject = this .objects .get (nodeId),
1744
- index = urlObject ._url .findIndex (fileURL => !fileURL .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)),
1745
- fileURL = new URL (urlObject ._url [index], executionContext .getWorldURL ());
1743
+ urlObject = this .objects .get (nodeId);
1746
1744
 
1747
- const
1748
- response = await fetch (fileURL),
1749
- mimeType = mime .lookup (fileURL .pathname)
1750
- || response .headers .get ("content-type") ?.replace (/;.*$/, "")
1751
- || "application/octet-stream";
1745
+ for (const url of urlObject ._url)
1746
+ {
1747
+ if (url .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s))
1748
+ continue;
1752
1749
 
1753
- // console .log (mimeType)
1750
+ const
1751
+ fileURL = new URL (url, executionContext .getWorldURL ()),
1752
+ response = await fetch (fileURL);
1754
1753
 
1755
- if (!response .ok)
1756
- return;
1754
+ // console .log (fileURL .href);
1755
+ // console .log (response .ok);
1757
1756
 
1758
- const buffer = Buffer .from (await response .arrayBuffer ());
1757
+ if (!response .ok)
1758
+ continue;
1759
1759
 
1760
- // Add undo step.
1760
+ const mimeType = mime .lookup (fileURL .pathname)
1761
+ || response .headers .get ("content-type") ?.replace (/;.*$/, "")
1762
+ || "application/octet-stream";
1761
1763
 
1762
- const value = urlObject ._url .copy ();
1764
+ const buffer = Buffer .from (await response .arrayBuffer ());
1763
1765
 
1764
- if (this .mimeTypeToProtocol .has (mimeType))
1765
- value [index] = `${this .mimeTypeToProtocol .get (mimeType)}${buffer .toString ('utf8')}`;
1766
- else if (this .textTypes .has (mimeType))
1767
- value [index] = encodeURI (`data:${mimeType},${buffer .toString ('utf8')}`);
1768
- else
1769
- value [index] = `data:${mimeType};base64,${buffer .toString ('base64')}`;
1766
+ // Add undo step.
1770
1767
 
1771
- UndoManager .shared .beginUndo (_("Embed External Resource as Data URL"));
1768
+ const value = urlObject ._url .copy ();
1772
1769
 
1773
- Editor .setFieldValue (executionContext, urlObject, urlObject ._url, value);
1770
+ if (this .mimeTypeToProtocol .has (mimeType))
1771
+ value .unshift (`${this .mimeTypeToProtocol .get (mimeType)}${buffer .toString ('utf8')}`);
1772
+ else if (this .textTypes .has (mimeType))
1773
+ value .unshift (encodeURI (`data:${mimeType},${buffer .toString ('utf8')}`));
1774
+ else
1775
+ value .unshift (`data:${mimeType};base64,${buffer .toString ('base64')}`);
1774
1776
 
1775
- UndoManager .shared .endUndo ();
1777
+ UndoManager .shared .beginUndo (_("Embed External Resource as Data URL"));
1778
+
1779
+ Editor .setFieldValue (executionContext, urlObject, urlObject ._url, value);
1780
+
1781
+ UndoManager .shared .endUndo ();
1782
+ break;
1783
+ }
1776
1784
  }
1777
1785
 
1778
1786
  moveViewpointToUserPosition (id, executionContextId, nodeId)
@@ -657,6 +657,11 @@ module .exports = class OutlineView extends Interface
657
657
  this .restoreScrollPositions ();
658
658
  }
659
659
 
660
+ #inlineNodes = new Set ([
661
+ X3D .X3DConstants .Inline,
662
+ X3D .X3DConstants .InlineGeometry,
663
+ ]);
664
+
660
665
  #updateNodeSymbol = Symbol ();
661
666
 
662
667
  expandNode (parent, node, full)
@@ -754,7 +759,7 @@ module .exports = class OutlineView extends Interface
754
759
  {
755
760
  // X3DUrlObject
756
761
 
757
- if (node .getType () .includes (X3D .X3DConstants .Inline))
762
+ if (node .getType () .some (type => this .#inlineNodes .has (type)))
758
763
  {
759
764
  node .getLoadState () .addFieldCallback (this .#updateNodeSymbol, this .updateNode .bind (this, parent, node, full));
760
765
  }
@@ -763,9 +768,9 @@ module .exports = class OutlineView extends Interface
763
768
  node .getLoadState () .addFieldCallback (this .#updateNodeSymbol, this .updateFieldLoadState .bind (this, node));
764
769
  }
765
770
 
766
- if (node .checkLoadState () === X3D .X3DConstants .COMPLETE_STATE && this .expandInlineNodes && node .getType () .includes (X3D .X3DConstants .Inline))
771
+ if (node .checkLoadState () === X3D .X3DConstants .COMPLETE_STATE && this .expandInlineNodes && node .getType () .some (type => this .#inlineNodes .has (type)))
767
772
  {
768
- ul .append (this .createSceneElement (node .getInternalScene (), "Scene", "internal-scene"));
773
+ ul .append (this .createSceneElement (node .getInternalScene (), "Scene", ["internal-scene", node .getTypeName ()]));
769
774
  }
770
775
  else
771
776
  {
@@ -1193,13 +1198,16 @@ module .exports = class OutlineView extends Interface
1193
1198
  .addClass (node ._isActive .getValue () ? "on" : "off")
1194
1199
  .text ("stop"));
1195
1200
 
1196
- buttons .push ($("<span></span>")
1197
- .attr ("order", "7")
1198
- .attr ("title", _("Toggle loop."))
1199
- .attr ("action", "loop-node")
1200
- .addClass (["button", "material-icons"])
1201
- .addClass (node ._loop .getValue () ? "on" : "off")
1202
- .text ("repeat"));
1201
+ if (node .getFieldDefinition ("loop"))
1202
+ {
1203
+ buttons .push ($("<span></span>")
1204
+ .attr ("order", "7")
1205
+ .attr ("title", _("Toggle loop."))
1206
+ .attr ("action", "loop-node")
1207
+ .addClass (["button", "material-icons"])
1208
+ .addClass (node ._loop .getValue () ? "on" : "off")
1209
+ .text ("repeat"));
1210
+ }
1203
1211
 
1204
1212
  if (!node ._enabled .getValue ())
1205
1213
  buttons .slice (-3) .forEach (button => button .hide ());
@@ -1210,7 +1218,7 @@ module .exports = class OutlineView extends Interface
1210
1218
  {
1211
1219
  if (node .getExecutionContext () .getOuterNode () instanceof X3D .X3DProtoDeclaration)
1212
1220
  {
1213
- if (!node .getType () .includes (X3D .X3DConstants .Inline))
1221
+ if (!node .getType () .some (type => this .#inlineNodes .has (type)))
1214
1222
  continue;
1215
1223
  }
1216
1224
 
@@ -3413,7 +3421,7 @@ module .exports = class OutlineView extends Interface
3413
3421
  {
3414
3422
  // Hide all X3DShapeNode nodes and show all other nodes.
3415
3423
 
3416
- for (const object of this .executionContext .traverse (Traverse .INLINE_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3424
+ for (const object of this .executionContext .traverse (Traverse .INLINE_SCENE | Traverse .INLINE_GEOMETRY_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3417
3425
  {
3418
3426
  if (!(object instanceof X3D .SFNode))
3419
3427
  continue;
@@ -3430,7 +3438,7 @@ module .exports = class OutlineView extends Interface
3430
3438
 
3431
3439
  const selection = require ("../Application/Selection");
3432
3440
 
3433
- for (const object of Traverse .traverse (selection .nodes, Traverse .INLINE_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3441
+ for (const object of Traverse .traverse (selection .nodes, Traverse .INLINE_SCENE | Traverse .INLINE_GEOMETRY_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3434
3442
  {
3435
3443
  if (!(object instanceof X3D .SFNode))
3436
3444
  continue;
@@ -3451,7 +3459,7 @@ module .exports = class OutlineView extends Interface
3451
3459
  {
3452
3460
  const selection = require ("../Application/Selection");
3453
3461
 
3454
- for (const object of Traverse .traverse (selection .nodes .length ? selection .nodes : this .executionContext, Traverse .INLINE_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3462
+ for (const object of Traverse .traverse (selection .nodes .length ? selection .nodes : this .executionContext, Traverse .INLINE_SCENE | Traverse .INLINE_GEOMETRY_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3455
3463
  {
3456
3464
  if (!(object instanceof X3D .SFNode))
3457
3465
  continue;
@@ -3467,7 +3475,7 @@ module .exports = class OutlineView extends Interface
3467
3475
 
3468
3476
  showAllObjects ()
3469
3477
  {
3470
- for (const object of this .executionContext .traverse (Traverse .INLINE_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3478
+ for (const object of this .executionContext .traverse (Traverse .INLINE_SCENE | Traverse .INLINE_GEOMETRY_SCENE | Traverse .PROTOTYPE_INSTANCES | Traverse .PROTO_DECLARATIONS | Traverse .PROTO_DECLARATION_BODY | Traverse .ROOT_NODES))
3471
3479
  {
3472
3480
  if (!(object instanceof X3D .SFNode))
3473
3481
  continue;
@@ -3923,7 +3931,7 @@ module .exports = class OutlineView extends Interface
3923
3931
  flags |= Traverse .PROTO_DECLARATION_BODY;
3924
3932
 
3925
3933
  if (this .expandInlineNodes && expandInlineNodes)
3926
- flags |= Traverse .INLINE_SCENE;
3934
+ flags |= Traverse .INLINE_SCENE | Traverse .INLINE_GEOMETRY_SCENE;
3927
3935
 
3928
3936
  flags |= Traverse .ROOT_NODES;
3929
3937
 
@@ -37,7 +37,7 @@ module .exports = new class SceneProperties extends Dialog
37
37
 
38
38
  this .tabs .addTextTab ("profile-and-components", _("Profile & Components"));
39
39
  this .tabs .addTextTab ("units", _("Units"));
40
- this .tabs .addTextTab ("meta-data", _("Metadata"));
40
+ this .tabs .addTextTab ("meta-data", _("Meta Data"));
41
41
  this .tabs .addTextTab ("world-info", _("World Info"));
42
42
 
43
43
  this .tabs .setup ();
@@ -178,6 +178,22 @@ module .exports = new class SceneProperties extends Dialog
178
178
 
179
179
  // Meta Data
180
180
 
181
+ this .metaDataOptions = $("<table></table>") .appendTo (this .metaData);
182
+ this .metaDataOptions .body = $("<tbody></tbody>") .appendTo (this .metaDataOptions);
183
+
184
+ this .commonMetaData = $("<input></input>")
185
+ .attr ("id", "common-metadata")
186
+ .attr ("type", "checkbox")
187
+ .on ("click", () => this .toggleCommonMetaData ());
188
+
189
+ $("<tr></tr>")
190
+ .append ($("<td></td>")
191
+ .append (this .commonMetaData)
192
+ .append ($("<label></label>")
193
+ .attr ("for", "common-metadata")
194
+ .text (_("Add Common Meta Data when Saving"))))
195
+ .appendTo (this .metaDataOptions .body);
196
+
181
197
  this .metaData .table = $("<table></table>") .addClass ("sticky-headers") .appendTo (this .metaData);
182
198
  this .metaData .table .head = $("<thead></thead>") .appendTo (this .metaData .table);
183
199
  this .metaData .table .body = $("<tbody></tbody>") .appendTo (this .metaData .table) .sortable ({
@@ -285,6 +301,7 @@ module .exports = new class SceneProperties extends Dialog
285
301
  const app = require ("../Application/Window");
286
302
 
287
303
  this .profileAndComponents .inputs .checkbox .prop ("checked", app .config .file .inferProfileAndComponents);
304
+ this .commonMetaData .prop ("checked", app .config .file .commonMetaData);
288
305
 
289
306
  this .toggleInferProfileAndComponents ();
290
307
  this .updateProfile ();
@@ -418,6 +435,13 @@ module .exports = new class SceneProperties extends Dialog
418
435
  Editor .updateUnit (this .executionContext, category, name .val (), conversionFactor .val ());
419
436
  }
420
437
 
438
+ toggleCommonMetaData ()
439
+ {
440
+ const app = require ("../Application/Window");
441
+
442
+ app .config .file .commonMetaData = this .commonMetaData .prop ("checked");
443
+ }
444
+
421
445
  sortMetaData (event)
422
446
  {
423
447
  event .preventDefault ();
@@ -2623,11 +2623,11 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2623
2623
  oldCenterOfRotation = viewpointNode .getCenterOfRotation () .copy (),
2624
2624
  oldFieldOfView = viewpointNode .getFieldOfView ();
2625
2625
 
2626
- viewpointNode .resetUserOffsets ();
2627
2626
  viewpointNode .setPosition (position);
2628
2627
  viewpointNode .setOrientation (orientation);
2629
2628
  viewpointNode .setCenterOfRotation (centerOfRotation);
2630
2629
  viewpointNode .setFieldOfView (fieldOfView);
2630
+ viewpointNode .resetUserOffsets ();
2631
2631
 
2632
2632
  undoManager .registerUndo (() =>
2633
2633
  {