sunrize 2.7.2 → 2.8.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.
- package/package.json +5 -5
- package/src/Application/Document.js +123 -1
- package/src/Application/Footer.js +1 -3
- package/src/Application/Registry.js +29 -22
- package/src/Controls/AddPrototypePopover.js +1 -1
- package/src/Controls/AnimationPropertiesPopover.js +3 -3
- package/src/Controls/EditNodePopover.js +3 -3
- package/src/Controls/EditUserDefinedFieldPopover.js +3 -3
- package/src/Controls/ExportNodePopover.js +2 -2
- package/src/Controls/ImportNodePopover.js +2 -2
- package/src/Controls/SetOrientationPopover.js +1 -1
- package/src/Controls/Splitter.js +3 -3
- package/src/Editors/AnimationEditor.js +16 -8
- package/src/Editors/AnimationMemberList.js +1 -0
- package/src/Editors/BrowserFrame.js +10 -10
- package/src/Editors/Console.js +1 -1
- package/src/Editors/Library.js +1 -1
- package/src/Editors/MaterialsLibrary.js +9 -4
- package/src/Editors/OutlineEditor.js +84 -64
- package/src/Editors/OutlineRouteGraph.js +2 -1
- package/src/Editors/OutlineView.js +2 -2
- package/src/Editors/SceneProperties.js +12 -12
- package/src/Editors/ScriptEditor.js +1 -1
- package/src/Editors/VideoRecorder.js +415 -51
- package/src/Tools/Core/X3DNodeTool.js +4 -5
- package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.x3d +5 -1
- package/src/Tools/Geometry2D/Arc2DTool.js +1 -0
- package/src/Tools/Geometry2D/ArcClose2DTool.js +1 -0
- package/src/Tools/Geometry2D/Circle2DTool.js +1 -0
- package/src/Tools/Geometry2D/Disk2DTool.js +2 -0
- package/src/Tools/Geometry2D/Rectangle2DTool.js +1 -0
- package/src/Tools/Geometry3D/BoxTool.js +1 -0
- package/src/Tools/Geometry3D/ConeTool.js +1 -0
- package/src/Tools/Geometry3D/CylinderTool.js +1 -0
- package/src/Tools/Geometry3D/SphereTool.js +1 -0
- package/src/Tools/Grouping/X3DTransformNodeTool.js +7 -5
- package/src/Tools/Grouping/X3DTransformNodeTool.x3d +11 -3
- package/src/Tools/Lighting/X3DLightNodeTool.x3d +18 -12
- package/src/Tools/Navigation/X3DViewpointNodeTool.x3d +2 -0
- package/src/Tools/Rendering/X3DGeometryNodeTool.x3d +1 -1
- package/src/Tools/Sound/ListenerPointSourceTool.x3d +8 -2
- package/src/Tools/Sound/SoundTool.x3d +10 -0
- package/src/Tools/Sound/SpatialSoundTool.x3d +8 -2
- package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +2 -0
- package/src/Undo/Editor.js +33 -21
- package/src/assets/html/window.html +1 -1
- package/src/assets/themes/default.css +91 -5
|
@@ -1718,51 +1718,61 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1718
1718
|
|
|
1719
1719
|
async saveDataUrlToFile (id, executionContextId, nodeId)
|
|
1720
1720
|
{
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1721
|
+
try
|
|
1722
|
+
{
|
|
1723
|
+
const
|
|
1724
|
+
executionContext = this .objects .get (executionContextId),
|
|
1725
|
+
urlObject = this .objects .get (nodeId),
|
|
1726
|
+
index = urlObject ._url .findIndex (fileURL => fileURL .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)),
|
|
1727
|
+
dataURL = Editor .decodeURI (urlObject ._url [index]),
|
|
1728
|
+
protocol = dataURL .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s),
|
|
1729
|
+
match = dataURL .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/s),
|
|
1730
|
+
isData = protocol [0] === "data:";
|
|
1731
|
+
|
|
1732
|
+
if (!((isData && match) || !isData))
|
|
1733
|
+
return;
|
|
1732
1734
|
|
|
1733
|
-
|
|
1735
|
+
// Open dialog.
|
|
1734
1736
|
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
?
|
|
1742
|
-
: [{ name: _("All Files"), extensions: ["*"] }];
|
|
1737
|
+
const
|
|
1738
|
+
name = urlObject .getName () ,
|
|
1739
|
+
mimeType = isData ? match [1] || "text/plain" : this .protocolToMimeType .get (protocol [0]),
|
|
1740
|
+
extension = mime .extension (mimeType),
|
|
1741
|
+
defaultDirectory = $.try (() => path .dirname (url .fileURLToPath (executionContext .getWorldURL ()))),
|
|
1742
|
+
desktop = await electron .ipcRenderer .invoke ("path", "desktop"),
|
|
1743
|
+
defaultPath = name ? path .join (defaultDirectory ?? desktop, `${name}.${extension}`) : (defaultDirectory ?? desktop);
|
|
1743
1744
|
|
|
1744
|
-
|
|
1745
|
+
const filters = extension
|
|
1746
|
+
? [{ name: _(`${extension .toUpperCase ()} Document`), extensions: [extension] }]
|
|
1747
|
+
: [{ name: _("All Files"), extensions: ["*"] }];
|
|
1745
1748
|
|
|
1746
|
-
|
|
1747
|
-
|
|
1749
|
+
const response = await electron .ipcRenderer .invoke ("file-path", { type: "save", defaultPath, filters });
|
|
1750
|
+
|
|
1751
|
+
if (response .canceled)
|
|
1752
|
+
return;
|
|
1748
1753
|
|
|
1749
|
-
|
|
1754
|
+
// Create file.
|
|
1750
1755
|
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1756
|
+
const
|
|
1757
|
+
data = dataURL .substring (dataURL .indexOf (isData ? "," : ":") + 1),
|
|
1758
|
+
buffer = Buffer .from (data, isData && match [3] === "base64" ? "base64" : "utf8");
|
|
1754
1759
|
|
|
1755
|
-
|
|
1760
|
+
fs .writeFileSync (response .filePath, buffer);
|
|
1756
1761
|
|
|
1757
|
-
|
|
1762
|
+
// Add undo step.
|
|
1758
1763
|
|
|
1759
|
-
|
|
1764
|
+
const value = urlObject ._url .toSpliced (index, 1, Editor .relativePath (executionContext, response .filePath));
|
|
1760
1765
|
|
|
1761
|
-
|
|
1766
|
+
UndoManager .shared .beginUndo (_("Save Data URL to File"));
|
|
1762
1767
|
|
|
1763
|
-
|
|
1768
|
+
Editor .setFieldValue (executionContext, urlObject, urlObject ._url, value);
|
|
1764
1769
|
|
|
1765
|
-
|
|
1770
|
+
UndoManager .shared .endUndo ();
|
|
1771
|
+
}
|
|
1772
|
+
catch (error)
|
|
1773
|
+
{
|
|
1774
|
+
console .error (error);
|
|
1775
|
+
}
|
|
1766
1776
|
}
|
|
1767
1777
|
|
|
1768
1778
|
textTypes = new Set ([
|
|
@@ -1868,50 +1878,59 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1868
1878
|
|
|
1869
1879
|
async convertNodeToInlineFile (id, executionContextId, nodeId, typeName)
|
|
1870
1880
|
{
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1881
|
+
try
|
|
1882
|
+
{
|
|
1883
|
+
const
|
|
1884
|
+
executionContext = this .objects .get (executionContextId),
|
|
1885
|
+
childNode = this .objects .get (nodeId),
|
|
1886
|
+
name = childNode .getDisplayName (),
|
|
1887
|
+
defaultDirectory = $.try (() => path .dirname (url .fileURLToPath (executionContext .getWorldURL ()))),
|
|
1888
|
+
desktop = await electron .ipcRenderer .invoke ("path", "desktop"),
|
|
1889
|
+
defaultPath = name ? path .join (defaultDirectory ?? desktop, `${name}.x3d`) : (defaultDirectory ?? desktop),
|
|
1890
|
+
response = await electron .ipcRenderer .invoke ("file-path", { type: "save", defaultPath });
|
|
1877
1891
|
|
|
1878
|
-
|
|
1879
|
-
|
|
1892
|
+
if (response .canceled)
|
|
1893
|
+
return;
|
|
1880
1894
|
|
|
1881
|
-
|
|
1882
|
-
{
|
|
1883
|
-
case "Inline":
|
|
1884
|
-
UndoManager .shared .beginUndo (_("Convert Node to Inline File"));
|
|
1885
|
-
break;
|
|
1886
|
-
case "InlineGeometry":
|
|
1887
|
-
UndoManager .shared .beginUndo (_("Convert Node to InlineGeometry"));
|
|
1888
|
-
break;
|
|
1889
|
-
}
|
|
1895
|
+
// Create inline file.
|
|
1890
1896
|
|
|
1891
|
-
|
|
1897
|
+
await Editor .convertNodesToInlineFile (executionContext, [childNode], response .filePath);
|
|
1892
1898
|
|
|
1893
|
-
|
|
1899
|
+
// Create Inline node.
|
|
1894
1900
|
|
|
1895
|
-
|
|
1901
|
+
switch (typeName)
|
|
1902
|
+
{
|
|
1903
|
+
case "Inline":
|
|
1904
|
+
UndoManager .shared .beginUndo (_("Convert Node to Inline File"));
|
|
1905
|
+
break;
|
|
1906
|
+
case "InlineGeometry":
|
|
1907
|
+
UndoManager .shared .beginUndo (_("Convert Node to InlineGeometry"));
|
|
1908
|
+
break;
|
|
1909
|
+
}
|
|
1896
1910
|
|
|
1897
|
-
|
|
1911
|
+
await Editor .addComponent (executionContext, "Networking");
|
|
1898
1912
|
|
|
1899
|
-
|
|
1913
|
+
const inlineNode = executionContext .createNode (typeName) .getValue ();
|
|
1900
1914
|
|
|
1901
|
-
|
|
1915
|
+
inlineNode ._url = [Editor .relativePath (executionContext, response .filePath)];
|
|
1902
1916
|
|
|
1903
|
-
|
|
1904
|
-
|
|
1917
|
+
if (childNode .getName ())
|
|
1918
|
+
Editor .updateNamedNode (executionContext, childNode .getName (), inlineNode);
|
|
1905
1919
|
|
|
1906
|
-
|
|
1920
|
+
// Insert Inline node.
|
|
1907
1921
|
|
|
1908
|
-
|
|
1922
|
+
Editor .replaceAllOccurrences (executionContext, childNode, inlineNode);
|
|
1909
1923
|
|
|
1910
|
-
|
|
1924
|
+
UndoManager .shared .endUndo ();
|
|
1911
1925
|
|
|
1912
|
-
|
|
1926
|
+
await this .browser .nextFrame ();
|
|
1913
1927
|
|
|
1914
|
-
|
|
1928
|
+
this .expandTo (inlineNode);
|
|
1929
|
+
}
|
|
1930
|
+
catch (error)
|
|
1931
|
+
{
|
|
1932
|
+
console .error (error);
|
|
1933
|
+
}
|
|
1915
1934
|
}
|
|
1916
1935
|
|
|
1917
1936
|
addNormalsToGeometry (id, executionContextId, nodeId)
|
|
@@ -2284,7 +2303,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
2284
2303
|
executionContext = this .objects .get (executionContextId),
|
|
2285
2304
|
proto = this .objects .get (protoNodeId),
|
|
2286
2305
|
defaultDirectory = $.try (() => path .dirname (url .fileURLToPath (executionContext .getWorldURL ()))),
|
|
2287
|
-
|
|
2306
|
+
desktop = await electron .ipcRenderer .invoke ("path", "desktop"),
|
|
2307
|
+
defaultPath = path .join (defaultDirectory ?? desktop, `${proto .getName ()}.x3d`),
|
|
2288
2308
|
response = await electron .ipcRenderer .invoke ("file-path", { type: "save", defaultPath });
|
|
2289
2309
|
|
|
2290
2310
|
if (response .canceled)
|
|
@@ -302,7 +302,8 @@ module .exports = class OutlineRouteGraph extends OutlineView
|
|
|
302
302
|
rect1 = canvas1 .get (0) .getBoundingClientRect (),
|
|
303
303
|
rect2 = canvas2 .get (0) .getBoundingClientRect ();
|
|
304
304
|
|
|
305
|
-
|
|
305
|
+
if (!canvas1 .is (".route-value"))
|
|
306
|
+
canvas1 .height (Math .ceil (rect2 .y - rect1 .y));
|
|
306
307
|
|
|
307
308
|
canvas1 .prop ("width", canvas1 .width ());
|
|
308
309
|
canvas1 .prop ("height", canvas1 .height ());
|
|
@@ -2486,7 +2486,7 @@ module .exports = class OutlineView extends Interface
|
|
|
2486
2486
|
|
|
2487
2487
|
$("<div></div>")
|
|
2488
2488
|
.addClass (type + "-value-container")
|
|
2489
|
-
.append ($("<input
|
|
2489
|
+
.append ($("<input>"))
|
|
2490
2490
|
.appendTo (li);
|
|
2491
2491
|
|
|
2492
2492
|
// Make jsTree.
|
|
@@ -2626,7 +2626,7 @@ module .exports = class OutlineView extends Interface
|
|
|
2626
2626
|
child .find (".jstree-node")
|
|
2627
2627
|
.wrapInner ("<div class=\"item no-select\"/>")
|
|
2628
2628
|
.find (".item")
|
|
2629
|
-
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves\"></canvas></div>");
|
|
2629
|
+
.append ("<div class=\"route-curves-wrapper\"><canvas class=\"route-curves route-value\"></canvas></div>");
|
|
2630
2630
|
|
|
2631
2631
|
this .connectFieldActions (child);
|
|
2632
2632
|
|
|
@@ -56,7 +56,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
56
56
|
this .profileAndComponents .table .body = $("<tbody></tbody>") .appendTo (this .profileAndComponents .table);
|
|
57
57
|
this .profileAndComponents .inputs = { };
|
|
58
58
|
|
|
59
|
-
this .profileAndComponents .inputs .checkbox = $("<input
|
|
59
|
+
this .profileAndComponents .inputs .checkbox = $("<input>")
|
|
60
60
|
.attr ("id", "infer-profile-and-components-checkbox")
|
|
61
61
|
.attr ("type", "checkbox")
|
|
62
62
|
.on ("click", () => this .toggleInferProfileAndComponents ());
|
|
@@ -81,7 +81,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
81
81
|
$("<tr></tr>")
|
|
82
82
|
.append ($("<td></td>")
|
|
83
83
|
.width ("15px")
|
|
84
|
-
.append ($("<input
|
|
84
|
+
.append ($("<input>")
|
|
85
85
|
.attr ("type", "checkbox")
|
|
86
86
|
.attr ("id", `scene-properties-${component .name}`)
|
|
87
87
|
.attr ("component", component .name)
|
|
@@ -92,7 +92,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
92
92
|
.text (component .title)))
|
|
93
93
|
.append ($("<td></td>")
|
|
94
94
|
.width ("15px")
|
|
95
|
-
.append ($("<input
|
|
95
|
+
.append ($("<input>")
|
|
96
96
|
.attr ("component", component .name)
|
|
97
97
|
.attr ("level", component .level)
|
|
98
98
|
.val (component .level)
|
|
@@ -128,8 +128,8 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
128
128
|
|
|
129
129
|
this .units .inputs = new Map (Units .map (unit => [unit .category,
|
|
130
130
|
{
|
|
131
|
-
name: $("<input
|
|
132
|
-
conversionFactor: $("<input
|
|
131
|
+
name: $("<input>") .attr ("list", unit .category),
|
|
132
|
+
conversionFactor: $("<input>") .attr ("category", unit .category),
|
|
133
133
|
}]));
|
|
134
134
|
|
|
135
135
|
$("<tr></tr>")
|
|
@@ -185,7 +185,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
185
185
|
this .metaDataOptions = $("<table></table>") .appendTo (this .metaData);
|
|
186
186
|
this .metaDataOptions .body = $("<tbody></tbody>") .appendTo (this .metaDataOptions);
|
|
187
187
|
|
|
188
|
-
this .commonMetaData = $("<input
|
|
188
|
+
this .commonMetaData = $("<input>")
|
|
189
189
|
.attr ("id", "common-metadata")
|
|
190
190
|
.attr ("type", "checkbox")
|
|
191
191
|
.on ("click", () => this .toggleCommonMetaData ());
|
|
@@ -247,12 +247,12 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
247
247
|
this .worldInfo .table .body = $("<tbody></tbody>") .appendTo (this .worldInfo .table);
|
|
248
248
|
this .worldInfo .inputs = { };
|
|
249
249
|
|
|
250
|
-
this .worldInfo .inputs .checkbox = $("<input
|
|
250
|
+
this .worldInfo .inputs .checkbox = $("<input>")
|
|
251
251
|
.attr ("id", "world-info-checkbox")
|
|
252
252
|
.attr ("type", "checkbox")
|
|
253
253
|
.on ("click", () => this .toggleWorldInfo ());
|
|
254
254
|
|
|
255
|
-
this .worldInfo .inputs .title = $("<input
|
|
255
|
+
this .worldInfo .inputs .title = $("<input>") .attr ("spellcheck", "true");
|
|
256
256
|
this .worldInfo .inputs .info = $("<textarea></textarea>") .attr ("spellcheck", "true") .height ("100%") .css ("resize", "none");
|
|
257
257
|
|
|
258
258
|
this .worldInfo .checkboxRow = $("<tr></tr>")
|
|
@@ -495,14 +495,14 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
495
495
|
.addClass (this .config .file .sortMetaData ? ["disabled"] : [ ])
|
|
496
496
|
.text ("drag_handle")))
|
|
497
497
|
.append ($("<td></td>")
|
|
498
|
-
.append ($("<input
|
|
498
|
+
.append ($("<input>")
|
|
499
499
|
.attr ("index", 0)
|
|
500
500
|
.attr ("placeholder", _("Insert meta key here."))
|
|
501
501
|
.attr ("spellcheck", "true")
|
|
502
502
|
.val (key) .on ("change", (event) => this .changeMetaData (event, key))))
|
|
503
503
|
.append ($("<td></td>")
|
|
504
504
|
.addClass ("meta-value")
|
|
505
|
-
.append ($("<input
|
|
505
|
+
.append ($("<input>")
|
|
506
506
|
.attr ("index", 1)
|
|
507
507
|
.attr ("placeholder", _("Insert meta value here."))
|
|
508
508
|
.attr ("spellcheck", "true")
|
|
@@ -566,12 +566,12 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
566
566
|
$("<tr></tr>")
|
|
567
567
|
.append ($("<td></td>"))
|
|
568
568
|
.append ($("<td></td>")
|
|
569
|
-
.append ($("<input
|
|
569
|
+
.append ($("<input>")
|
|
570
570
|
.attr ("placeholder", _("Add new meta key."))
|
|
571
571
|
.attr ("spellcheck", "true")
|
|
572
572
|
.on ("change", event => this .changeMetaData (event, ""))))
|
|
573
573
|
.append ($("<td></td>")
|
|
574
|
-
.append ($("<input
|
|
574
|
+
.append ($("<input>")
|
|
575
575
|
.prop ("readonly", true)
|
|
576
576
|
.attr ("spellcheck", "true")
|
|
577
577
|
.on ("change", event => this .changeMetaData (event, ""))))
|
|
@@ -130,7 +130,7 @@ module .exports = class ScriptEditor extends Interface
|
|
|
130
130
|
.addClass (["alternating", "node-list"])
|
|
131
131
|
.appendTo (this .horizontalSplitterTop);
|
|
132
132
|
|
|
133
|
-
this .nodeName = $("<input
|
|
133
|
+
this .nodeName = $("<input>")
|
|
134
134
|
.addClass ("node-name")
|
|
135
135
|
.attr ("title", _("Rename node."))
|
|
136
136
|
.attr ("placeholder", _("Enter node name."))
|