sunrize 1.1.5 → 1.1.7
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 +8 -10
- package/src/Application/Selection.js +11 -11
- package/src/Application/Tabs.js +3 -1
- package/src/Editors/OutlineEditor.js +19 -36
- package/src/Editors/OutlineView.js +36 -36
- package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.js +2 -2
- package/src/Tools/Lighting/DirectionalLightTool.js +1 -1
- package/src/Tools/Lighting/PointLightTool.js +1 -1
- package/src/Tools/Lighting/SpotLightTool.js +2 -2
- package/src/Tools/Lighting/X3DLightNodeTool.js +2 -2
- package/src/Tools/Navigation/BillboardTool.js +1 -1
- package/src/Tools/Navigation/LODTool.js +1 -1
- package/src/Tools/Navigation/OrthoViewpointTool.js +1 -1
- package/src/Tools/Navigation/ViewpointTool.js +1 -1
- package/src/Tools/Navigation/X3DViewpointNodeTool.js +1 -1
- package/src/Tools/Sound/SoundTool.js +2 -2
- package/src/Tools/{TextureProjector → TextureProjection}/TextureProjectorParallelTool.js +1 -1
- package/src/Tools/{TextureProjector → TextureProjection}/X3DTextureProjectorNodeTool.js +3 -3
- package/src/Tools.js +10 -10
- package/src/assets/html/window-template.html +1 -0
- package/src/assets/html/window.html +1 -0
- package/src/assets/themes/default-template.css +15 -2
- package/src/assets/themes/default.css +15 -2
- /package/src/Tools/{TextureProjector → TextureProjection}/TextureProjectorTool.js +0 -0
- /package/src/Tools/{TextureProjector → TextureProjection}/X3DTextureProjectorNodeTool.x3d +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.7",
|
|
5
5
|
"description": "A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"@electron-forge/maker-deb": "^6.4.2",
|
|
61
61
|
"@electron-forge/maker-rpm": "^6.4.2",
|
|
62
62
|
"@electron-forge/maker-squirrel": "^6.4.2",
|
|
63
|
-
"@electron-forge/maker-zip": "^6.4.2"
|
|
63
|
+
"@electron-forge/maker-zip": "^6.4.2",
|
|
64
|
+
"electron": "^27.0.2"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"capitalize": "^2.0.4",
|
|
67
68
|
"console": "^0.7.2",
|
|
68
|
-
"electron": "^26.2.4",
|
|
69
69
|
"electron-prompt": "^1.7.0",
|
|
70
70
|
"electron-squirrel-startup": "^1.0.0",
|
|
71
71
|
"electron-tabs": "^1.0.2",
|
|
@@ -74,20 +74,20 @@
|
|
|
74
74
|
"jquery-ui-dist": "^1.13.2",
|
|
75
75
|
"jstree": "^3.3.16",
|
|
76
76
|
"material-icons": "^1.13.12",
|
|
77
|
-
"material-symbols": "^0.13.
|
|
77
|
+
"material-symbols": "^0.13.1",
|
|
78
78
|
"md5": "^2.3.0",
|
|
79
|
-
"monaco-editor": "^0.
|
|
79
|
+
"monaco-editor": "^0.44.0",
|
|
80
80
|
"node-clipboardy": "^1.0.3",
|
|
81
81
|
"node-localstorage": "^3.0.5",
|
|
82
82
|
"qtip2": "^3.0.3",
|
|
83
83
|
"spectrum-colorpicker2": "^2.0.10",
|
|
84
84
|
"string-similarity": "^4.0.4",
|
|
85
|
-
"x_ite": "^
|
|
85
|
+
"x_ite": "^9.0.1"
|
|
86
86
|
},
|
|
87
87
|
"config": {
|
|
88
88
|
"forge": {
|
|
89
89
|
"packagerConfig": {
|
|
90
|
-
"icon": "./src/images/icon.png"
|
|
90
|
+
"icon": "./src/assets/images/icon.png"
|
|
91
91
|
},
|
|
92
92
|
"makers": [
|
|
93
93
|
{
|
|
@@ -104,9 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"name": "@electron-forge/maker-deb",
|
|
107
|
-
"config": {
|
|
108
|
-
"icon": "./src/images/icon256.png"
|
|
109
|
-
}
|
|
107
|
+
"config": {}
|
|
110
108
|
},
|
|
111
109
|
{
|
|
112
110
|
"name": "@electron-forge/maker-rpm",
|
|
@@ -2,36 +2,36 @@ module .exports = new class Selection
|
|
|
2
2
|
{
|
|
3
3
|
constructor ()
|
|
4
4
|
{
|
|
5
|
-
this .nodes = new Map ()
|
|
5
|
+
this .nodes = new Map ();
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
clear ()
|
|
9
9
|
{
|
|
10
10
|
for (const node of this .nodes .values ())
|
|
11
11
|
{
|
|
12
|
-
node .getTool () ?.setSelected (false)
|
|
13
|
-
node .removeTool ()
|
|
12
|
+
node .getTool () ?.setSelected (false);
|
|
13
|
+
node .removeTool ();
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
this .nodes .clear ()
|
|
16
|
+
this .nodes .clear ();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
set (node)
|
|
20
20
|
{
|
|
21
|
-
this .clear ()
|
|
22
|
-
this .add (node)
|
|
21
|
+
this .clear ();
|
|
22
|
+
this .add (node);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
add (node)
|
|
26
26
|
{
|
|
27
|
-
this .nodes .set (node .valueOf (), node .addTool ("createOnSelection"))
|
|
28
|
-
node .getTool () ?.setSelected (true)
|
|
27
|
+
this .nodes .set (node .valueOf (), node .addTool ("createOnSelection"));
|
|
28
|
+
node .getTool () ?.setSelected (true);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
remove (node)
|
|
32
32
|
{
|
|
33
|
-
node .getTool () ?.setSelected (false)
|
|
34
|
-
node .removeTool ()
|
|
35
|
-
this .nodes .delete (node .valueOf ())
|
|
33
|
+
node .getTool () ?.setSelected (false);
|
|
34
|
+
node .removeTool ();
|
|
35
|
+
this .nodes .delete (node .valueOf ());
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/Application/Tabs.js
CHANGED
|
@@ -34,7 +34,7 @@ module .exports = new class Tabs
|
|
|
34
34
|
{
|
|
35
35
|
this .tabs .on ("tab-active", tab =>
|
|
36
36
|
{
|
|
37
|
-
electron .ipcRenderer .send ("title", tab .
|
|
37
|
+
electron .ipcRenderer .send ("title", tab .getTitle ())
|
|
38
38
|
|
|
39
39
|
if (tab .url .startsWith ("file:"))
|
|
40
40
|
electron .ipcRenderer .send ("current-file", url .fileURLToPath (tab .url))
|
|
@@ -241,6 +241,8 @@ module .exports = new class Tabs
|
|
|
241
241
|
|
|
242
242
|
$(tab .element) .find (".tab-title") .attr ("title", fileURL .startsWith ("id:") ? _ ("Currently still unsaved.") : decodeURI (fileURL))
|
|
243
243
|
|
|
244
|
+
electron .ipcRenderer .send ("title", tab .getTitle ())
|
|
245
|
+
|
|
244
246
|
this .saveTabs ()
|
|
245
247
|
}
|
|
246
248
|
|
|
@@ -497,7 +497,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
497
497
|
{
|
|
498
498
|
const
|
|
499
499
|
primary = $(".node.primary, .proto.primary, .externproto.primary"),
|
|
500
|
-
selected = this .sceneGraph .find (".node.selected"),
|
|
500
|
+
selected = this .sceneGraph .find (".node.manual.selected"),
|
|
501
501
|
selection = selected .filter (primary) .length ? selected : primary,
|
|
502
502
|
ids = selection .map (function () { return this .id }) .get (),
|
|
503
503
|
elements = ids .map (id => $(`#${id}`)),
|
|
@@ -552,7 +552,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
552
552
|
{
|
|
553
553
|
const
|
|
554
554
|
primary = $(".node.primary"),
|
|
555
|
-
selected = this .sceneGraph .find (".node.selected"),
|
|
555
|
+
selected = this .sceneGraph .find (".node.manual.selected"),
|
|
556
556
|
selection = selected .filter (primary) .length ? selected : primary,
|
|
557
557
|
ids = selection .map (function () { return this .id }) .get ()
|
|
558
558
|
|
|
@@ -607,26 +607,29 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
607
607
|
parentField = parentFieldElement .hasClass ("scene") ? parentNode .rootNodes : this .getField (parentFieldElement),
|
|
608
608
|
node = this .objects .get (nodeId),
|
|
609
609
|
copy = X3D .X3DBaseNode .prototype .copy .call (node, executionContext),
|
|
610
|
-
index = parseInt (element .attr ("index"))
|
|
610
|
+
index = parseInt (element .attr ("index"));
|
|
611
611
|
|
|
612
|
-
UndoManager .shared .beginUndo (_ ("Unlink Clone"))
|
|
612
|
+
UndoManager .shared .beginUndo (_ ("Unlink Clone"));
|
|
613
|
+
|
|
614
|
+
if (node .getName ())
|
|
615
|
+
Editor .updateNamedNode (executionContext, executionContext .getUniqueName (node .getName ()), copy);
|
|
613
616
|
|
|
614
617
|
switch (parentField .getType ())
|
|
615
618
|
{
|
|
616
619
|
case X3D .X3DConstants .SFNode:
|
|
617
620
|
{
|
|
618
|
-
Editor .setFieldValue (executionContext, parentNode, parentField, copy)
|
|
619
|
-
break
|
|
621
|
+
Editor .setFieldValue (executionContext, parentNode, parentField, copy);
|
|
622
|
+
break;
|
|
620
623
|
}
|
|
621
624
|
case X3D .X3DConstants .MFNode:
|
|
622
625
|
{
|
|
623
|
-
Editor .removeValueFromArray (executionContext, parentNode, parentField, index)
|
|
624
|
-
Editor .insertValueIntoArray (executionContext, parentNode, parentField, index, copy)
|
|
625
|
-
break
|
|
626
|
+
Editor .removeValueFromArray (executionContext, parentNode, parentField, index);
|
|
627
|
+
Editor .insertValueIntoArray (executionContext, parentNode, parentField, index, copy);
|
|
628
|
+
break;
|
|
626
629
|
}
|
|
627
630
|
}
|
|
628
631
|
|
|
629
|
-
UndoManager .shared .endUndo ()
|
|
632
|
+
UndoManager .shared .endUndo ();
|
|
630
633
|
}
|
|
631
634
|
|
|
632
635
|
addParentGroup (id, executionContextId, nodeId, component, typeName, fieldName)
|
|
@@ -1284,7 +1287,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1284
1287
|
{
|
|
1285
1288
|
const
|
|
1286
1289
|
element = $(event .target) .closest (".node", this .sceneGraph),
|
|
1287
|
-
selected = this .sceneGraph .find (".node.selected"),
|
|
1290
|
+
selected = this .sceneGraph .find (".node.manual.selected"),
|
|
1288
1291
|
selection = selected .filter (element) .length ? selected : element,
|
|
1289
1292
|
ids = selection .map (function () { return this .id }) .get ()
|
|
1290
1293
|
|
|
@@ -1717,12 +1720,12 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1717
1720
|
destinationParentField = destinationParentFieldElement .hasClass ("scene") ? destinationParentNode .rootNodes : this .getField (destinationParentFieldElement),
|
|
1718
1721
|
destinationIndex = parseInt (destinationElement .attr ("index"))
|
|
1719
1722
|
|
|
1720
|
-
if (destinationElement .hasClass ("node") && destinationElement .data ("drag-type") ==="drag-after")
|
|
1723
|
+
if (destinationElement .hasClass ("node") && destinationElement .data ("drag-type") === "drag-after")
|
|
1721
1724
|
++ destinationIndex
|
|
1722
1725
|
|
|
1723
1726
|
if (destinationElement .attr ("node-id") !== "NULL")
|
|
1724
1727
|
{
|
|
1725
|
-
if (destinationElement .hasClass ("node") && destinationElement .data ("drag-type") ==="drag-into")
|
|
1728
|
+
if (destinationElement .hasClass ("node") && destinationElement .data ("drag-type") === "drag-into")
|
|
1726
1729
|
{
|
|
1727
1730
|
destinationParentNode = this .getNode (destinationElement)
|
|
1728
1731
|
}
|
|
@@ -1789,7 +1792,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1789
1792
|
|
|
1790
1793
|
if (destinationElement .attr ("node-id") !== "NULL")
|
|
1791
1794
|
{
|
|
1792
|
-
if (destinationElement .hasClass ("node") && destinationElement .data ("drag-type") ==="drag-into")
|
|
1795
|
+
if (destinationElement .hasClass ("node") && destinationElement .data ("drag-type") === "drag-into")
|
|
1793
1796
|
{
|
|
1794
1797
|
try
|
|
1795
1798
|
{
|
|
@@ -1867,7 +1870,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1867
1870
|
|
|
1868
1871
|
// Adjust matrix.
|
|
1869
1872
|
|
|
1870
|
-
if (destinationElement .data ("dropEffect")
|
|
1873
|
+
if (destinationElement .data ("dropEffect") ?.match (/copy|move/))
|
|
1871
1874
|
{
|
|
1872
1875
|
if (sourceNode .getType () .includes (X3D .X3DConstants .X3DTransformNode))
|
|
1873
1876
|
{
|
|
@@ -1896,13 +1899,6 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1896
1899
|
}
|
|
1897
1900
|
}
|
|
1898
1901
|
|
|
1899
|
-
// Update node name and clone count.
|
|
1900
|
-
|
|
1901
|
-
if (destinationElement .data ("dropEffect") === "link")
|
|
1902
|
-
{
|
|
1903
|
-
this .registerUpdateSceneGraph ()
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
1902
|
// End.
|
|
1907
1903
|
|
|
1908
1904
|
++ destinationIndex
|
|
@@ -2002,23 +1998,10 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
2002
1998
|
return modelMatrix
|
|
2003
1999
|
}
|
|
2004
2000
|
|
|
2005
|
-
// Call update.
|
|
2006
|
-
|
|
2007
|
-
registerUpdateSceneGraph (undoManager = UndoManager .shared)
|
|
2008
|
-
{
|
|
2009
|
-
this .updateSceneGraph ()
|
|
2010
|
-
|
|
2011
|
-
undoManager .registerUndo (() =>
|
|
2012
|
-
{
|
|
2013
|
-
this .registerUpdateSceneGraph (undoManager)
|
|
2014
|
-
},
|
|
2015
|
-
true)
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
2001
|
removeEmptyGroups ()
|
|
2019
2002
|
{
|
|
2020
2003
|
const
|
|
2021
|
-
selection = this .sceneGraph .find (".node.primary, .node.selected"),
|
|
2004
|
+
selection = this .sceneGraph .find (".node.primary, .node.manual.selected"),
|
|
2022
2005
|
ids = selection .map (function () { return this .id }) .get (),
|
|
2023
2006
|
nodes = ids .length ? ids .map (id => this .getNode ($(`#${id}`))) : this .executionContext .rootNodes
|
|
2024
2007
|
|
|
@@ -15,7 +15,6 @@ const
|
|
|
15
15
|
const
|
|
16
16
|
_expanded = Symbol (),
|
|
17
17
|
_fullExpanded = Symbol (),
|
|
18
|
-
_primary = Symbol (),
|
|
19
18
|
_selected = Symbol (),
|
|
20
19
|
_changing = Symbol .for ("Sunrize.changing")
|
|
21
20
|
|
|
@@ -147,9 +146,11 @@ module .exports = class OutlineView extends Interface
|
|
|
147
146
|
updateComponents ()
|
|
148
147
|
{
|
|
149
148
|
this .onDemandToolNodes = new Set ([
|
|
149
|
+
X3D .X3DConstants .DirectionalLight,
|
|
150
|
+
X3D .X3DConstants .PointLight,
|
|
151
|
+
X3D .X3DConstants .SpotLight,
|
|
150
152
|
X3D .X3DConstants .Sound,
|
|
151
153
|
X3D .X3DConstants .X3DEnvironmentalSensorNode,
|
|
152
|
-
X3D .X3DConstants .X3DLightNode,
|
|
153
154
|
X3D .X3DConstants .X3DTextureProjectorNode,
|
|
154
155
|
X3D .X3DConstants .X3DViewpointNode,
|
|
155
156
|
])
|
|
@@ -898,9 +899,6 @@ module .exports = class OutlineView extends Interface
|
|
|
898
899
|
|
|
899
900
|
if (node)
|
|
900
901
|
{
|
|
901
|
-
if (node .getUserData (_primary))
|
|
902
|
-
classes .push ("primary")
|
|
903
|
-
|
|
904
902
|
if (node .getUserData (_selected))
|
|
905
903
|
classes .push ("selected")
|
|
906
904
|
|
|
@@ -1209,9 +1207,6 @@ module .exports = class OutlineView extends Interface
|
|
|
1209
1207
|
|
|
1210
1208
|
const classes = [type]
|
|
1211
1209
|
|
|
1212
|
-
if (field .getUserData (_primary))
|
|
1213
|
-
classes .push ("primary")
|
|
1214
|
-
|
|
1215
1210
|
if (field .hasReferences ())
|
|
1216
1211
|
classes .push ("references")
|
|
1217
1212
|
|
|
@@ -2622,10 +2617,7 @@ module .exports = class OutlineView extends Interface
|
|
|
2622
2617
|
selection = require ("../Application/Selection"),
|
|
2623
2618
|
nodes = this .sceneGraph .find (".primary, .selected")
|
|
2624
2619
|
|
|
2625
|
-
nodes .removeClass (["primary", "selected"])
|
|
2626
|
-
|
|
2627
|
-
for (const element of nodes)
|
|
2628
|
-
this .getNode ($(element)) .setUserData (_primary, false)
|
|
2620
|
+
nodes .removeClass (["primary", "manual", "selected"])
|
|
2629
2621
|
|
|
2630
2622
|
for (const element of nodes)
|
|
2631
2623
|
this .getNode ($(element)) .setUserData (_selected, false)
|
|
@@ -2772,55 +2764,63 @@ module .exports = class OutlineView extends Interface
|
|
|
2772
2764
|
selectNodeElement (element, add = false)
|
|
2773
2765
|
{
|
|
2774
2766
|
if (!element .hasClass ("node"))
|
|
2775
|
-
return
|
|
2767
|
+
return;
|
|
2776
2768
|
|
|
2777
2769
|
if (!this .isEditable (element))
|
|
2778
|
-
return
|
|
2770
|
+
return;
|
|
2779
2771
|
|
|
2780
2772
|
const
|
|
2781
2773
|
selection = require ("../Application/Selection"),
|
|
2782
|
-
selected = element .hasClass ("
|
|
2774
|
+
selected = element .hasClass ("manual"),
|
|
2783
2775
|
selectedElements = this .sceneGraph .find (".primary, .selected"),
|
|
2784
2776
|
node = this .getNode (element),
|
|
2785
|
-
elements = $(`.node[node-id=${node .getId ()}]`)
|
|
2786
|
-
|
|
2787
|
-
for (const element of selectedElements)
|
|
2788
|
-
this .getNode ($(element)) .setUserData (_primary, false)
|
|
2777
|
+
elements = $(`.node[node-id=${node .getId ()}]`);
|
|
2789
2778
|
|
|
2790
|
-
selectedElements .removeClass ("primary")
|
|
2779
|
+
selectedElements .removeClass ("primary");
|
|
2791
2780
|
|
|
2792
2781
|
if (add)
|
|
2793
2782
|
{
|
|
2794
|
-
node .setUserData (_primary, true)
|
|
2795
|
-
node .setUserData (_selected, !selected)
|
|
2796
|
-
|
|
2797
2783
|
if (selected)
|
|
2798
2784
|
{
|
|
2799
|
-
|
|
2785
|
+
if (elements .length === 1)
|
|
2786
|
+
{
|
|
2787
|
+
element .removeClass (["manual", "selected"]);
|
|
2788
|
+
}
|
|
2789
|
+
else
|
|
2790
|
+
{
|
|
2791
|
+
if (elements .filter (".manual") .length === 1)
|
|
2792
|
+
elements .removeClass (["manual", "selected"]);
|
|
2793
|
+
else
|
|
2794
|
+
element .removeClass ("manual");
|
|
2795
|
+
}
|
|
2800
2796
|
}
|
|
2801
2797
|
else
|
|
2802
2798
|
{
|
|
2803
|
-
element .addClass ("primary")
|
|
2804
|
-
elements .addClass ("selected")
|
|
2799
|
+
element .addClass (["primary", "manual", "selected"]);
|
|
2805
2800
|
}
|
|
2806
2801
|
|
|
2807
|
-
if (
|
|
2808
|
-
|
|
2802
|
+
if (elements .filter (".manual") .length)
|
|
2803
|
+
{
|
|
2804
|
+
node .setUserData (_selected, true);
|
|
2805
|
+
selection .add (node);
|
|
2806
|
+
}
|
|
2809
2807
|
else
|
|
2810
|
-
|
|
2808
|
+
{
|
|
2809
|
+
node .setUserData (_selected, false);
|
|
2810
|
+
selection .remove (node);
|
|
2811
|
+
}
|
|
2811
2812
|
}
|
|
2812
2813
|
else
|
|
2813
2814
|
{
|
|
2814
2815
|
for (const element of selectedElements)
|
|
2815
|
-
this .getNode ($(element)) .setUserData (_selected, false)
|
|
2816
|
+
this .getNode ($(element)) .setUserData (_selected, false);
|
|
2816
2817
|
|
|
2817
|
-
node .setUserData (
|
|
2818
|
-
node .setUserData (_selected, true)
|
|
2818
|
+
node .setUserData (_selected, true);
|
|
2819
2819
|
|
|
2820
|
-
selectedElements .removeClass ("selected")
|
|
2821
|
-
element .addClass ("primary")
|
|
2822
|
-
elements .addClass ("selected")
|
|
2823
|
-
selection .set (node)
|
|
2820
|
+
selectedElements .removeClass (["manual", "selected"]);
|
|
2821
|
+
element .addClass (["primary", "manual"]);
|
|
2822
|
+
elements .addClass ("selected");
|
|
2823
|
+
selection .set (node);
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
2826
|
|
|
@@ -12,8 +12,8 @@ class X3DEnvironmentalSensorNodeTool extends X3DChildNodeTool
|
|
|
12
12
|
{
|
|
13
13
|
await super .initialize (__dirname, "X3DEnvironmentalSensorNodeTool.x3d")
|
|
14
14
|
|
|
15
|
-
this .toolNode ._size .addFieldInterest (this .tool .size)
|
|
16
|
-
this .toolNode ._center .addFieldInterest (this .tool .center)
|
|
15
|
+
this .toolNode ._size .addFieldInterest (this .tool .getField ("size"))
|
|
16
|
+
this .toolNode ._center .addFieldInterest (this .tool .getField ("center"))
|
|
17
17
|
|
|
18
18
|
this .tool .boxColor = this .toolBoxColor
|
|
19
19
|
this .tool .size = this .toolNode ._size
|
|
@@ -8,7 +8,7 @@ class DirectionalLightTool extends X3DLightNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
await super .initialize ()
|
|
10
10
|
|
|
11
|
-
this .toolNode ._direction .addFieldInterest (this .tool .direction)
|
|
11
|
+
this .toolNode ._direction .addFieldInterest (this .tool .getField ("direction"))
|
|
12
12
|
|
|
13
13
|
this .tool .direction = this .toolNode ._direction
|
|
14
14
|
this .tool .whichChoice = 0
|
|
@@ -8,7 +8,7 @@ class PointLightTool extends X3DLightNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
await super .initialize ()
|
|
10
10
|
|
|
11
|
-
this .toolNode ._location .addFieldInterest (this .tool .location)
|
|
11
|
+
this .toolNode ._location .addFieldInterest (this .tool .getField ("location"))
|
|
12
12
|
|
|
13
13
|
this .tool .location = this .toolNode ._location
|
|
14
14
|
this .tool .whichChoice = 1
|
|
@@ -8,8 +8,8 @@ class SpotLightTool extends X3DLightNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
await super .initialize ()
|
|
10
10
|
|
|
11
|
-
this .toolNode ._location .addFieldInterest (this .tool .location)
|
|
12
|
-
this .toolNode ._direction .addFieldInterest (this .tool .direction)
|
|
11
|
+
this .toolNode ._location .addFieldInterest (this .tool .getField ("location"))
|
|
12
|
+
this .toolNode ._direction .addFieldInterest (this .tool .getField ("direction"))
|
|
13
13
|
this .toolNode ._beamWidth .addFieldInterest (this .tool .getField ("beamWidth"))
|
|
14
14
|
this .toolNode ._cutOffAngle .addFieldInterest (this .tool .getField ("cutOffAngle"))
|
|
15
15
|
|
|
@@ -13,8 +13,8 @@ class X3DLightNodeTool extends X3DChildNodeTool
|
|
|
13
13
|
await super .initialize (__dirname, "X3DLightNodeTool.x3d")
|
|
14
14
|
|
|
15
15
|
this .toolNode ._on .addFieldInterest (this .tool .getField ("on"))
|
|
16
|
-
this .toolNode ._color .addFieldInterest (this .tool .color)
|
|
17
|
-
this .toolNode ._intensity .addFieldInterest (this .tool .intensity)
|
|
16
|
+
this .toolNode ._color .addFieldInterest (this .tool .getField ("color"))
|
|
17
|
+
this .toolNode ._intensity .addFieldInterest (this .tool .getField ("intensity"))
|
|
18
18
|
|
|
19
19
|
this .tool .on = this .toolNode ._on
|
|
20
20
|
this .tool .color = this .toolNode ._color
|
|
@@ -12,7 +12,7 @@ class BillboardTool extends X3DBoundedObjectTool
|
|
|
12
12
|
{
|
|
13
13
|
await super .initialize ()
|
|
14
14
|
|
|
15
|
-
this .toolNode ._axisOfRotation .addFieldInterest (this .tool .axisOfRotation)
|
|
15
|
+
this .toolNode ._axisOfRotation .addFieldInterest (this .tool .getField ("axisOfRotation"))
|
|
16
16
|
|
|
17
17
|
this .tool .centerDisplay = true
|
|
18
18
|
this .tool .axisOfRotation = this .toolNode ._axisOfRotation
|
|
@@ -12,7 +12,7 @@ class LODTool extends X3DBoundedObjectTool
|
|
|
12
12
|
{
|
|
13
13
|
await super .initialize ()
|
|
14
14
|
|
|
15
|
-
this .toolNode ._center .addFieldInterest (this .tool .center)
|
|
15
|
+
this .toolNode ._center .addFieldInterest (this .tool .getField ("center"))
|
|
16
16
|
|
|
17
17
|
this .tool .centerDisplay = true
|
|
18
18
|
this .tool .center = this .toolNode ._center
|
|
@@ -10,7 +10,7 @@ class OrthoViewpointTool extends X3DViewpointNodeTool
|
|
|
10
10
|
{
|
|
11
11
|
await super .initialize ()
|
|
12
12
|
|
|
13
|
-
this .toolNode ._position .addFieldInterest (this .tool .position)
|
|
13
|
+
this .toolNode ._position .addFieldInterest (this .tool .getField ("position"))
|
|
14
14
|
|
|
15
15
|
this .tool .position = this .toolNode ._position
|
|
16
16
|
}
|
|
@@ -8,7 +8,7 @@ class ViewpointTool extends X3DViewpointNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
await super .initialize ()
|
|
10
10
|
|
|
11
|
-
this .toolNode ._position .addFieldInterest (this .tool .position)
|
|
11
|
+
this .toolNode ._position .addFieldInterest (this .tool .getField ("position"))
|
|
12
12
|
|
|
13
13
|
this .tool .position = this .toolNode ._position
|
|
14
14
|
}
|
|
@@ -14,7 +14,7 @@ class X3DViewpointNodeTool extends X3DChildNodeTool
|
|
|
14
14
|
{
|
|
15
15
|
await super .initialize (__dirname, "X3DViewpointNodeTool.x3d")
|
|
16
16
|
|
|
17
|
-
this .toolNode ._orientation .addFieldInterest (this .tool .orientation)
|
|
17
|
+
this .toolNode ._orientation .addFieldInterest (this .tool .getField ("orientation"))
|
|
18
18
|
this .toolNode ._isBound .addFieldInterest (this .tool .getField ("bound"))
|
|
19
19
|
|
|
20
20
|
this .tool .whichChoice = this .toolWhichChoice
|
|
@@ -14,8 +14,8 @@ class SoundTool extends X3DChildNodeTool
|
|
|
14
14
|
{
|
|
15
15
|
await super .initialize (__dirname, "SoundTool.x3d")
|
|
16
16
|
|
|
17
|
-
this .toolNode ._location .addFieldInterest (this .tool .location)
|
|
18
|
-
this .toolNode ._direction .addFieldInterest (this .tool .direction)
|
|
17
|
+
this .toolNode ._location .addFieldInterest (this .tool .getField ("location"))
|
|
18
|
+
this .toolNode ._direction .addFieldInterest (this .tool .getField ("direction"))
|
|
19
19
|
this .toolNode ._minBack .addFieldInterest (this .tool .getField ("minBack"))
|
|
20
20
|
this .toolNode ._minFront .addFieldInterest (this .tool .getField ("minFront"))
|
|
21
21
|
this .toolNode ._maxBack .addFieldInterest (this .tool .getField ("maxBack"))
|
|
@@ -8,7 +8,7 @@ class TextureProjectorParallelTool extends X3DTextureProjectorNodeTool
|
|
|
8
8
|
{
|
|
9
9
|
await super .initialize ()
|
|
10
10
|
|
|
11
|
-
this .toolNode ._fieldOfView .addFieldInterest (this .tool .parallelFieldOfView)
|
|
11
|
+
this .toolNode ._fieldOfView .addFieldInterest (this .tool .getField ("parallelFieldOfView"))
|
|
12
12
|
this .toolNode ._nearDistance .addFieldInterest (this .tool .getField ("parallelNearDistance"))
|
|
13
13
|
this .toolNode ._farDistance .addFieldInterest (this .tool .getField ("parallelFarDistance"))
|
|
14
14
|
this .toolNode ._aspectRatio .addFieldInterest (this .tool .getField ("parallelAspectRatio"))
|
|
@@ -15,9 +15,9 @@ class X3DTextureProjectorNodeTool extends X3DChildNodeTool
|
|
|
15
15
|
await super .initialize (__dirname, "X3DTextureProjectorNodeTool.x3d")
|
|
16
16
|
|
|
17
17
|
this .toolNode ._on .addFieldInterest (this .tool .getField ("on"))
|
|
18
|
-
this .toolNode ._location .addFieldInterest (this .tool .location)
|
|
19
|
-
this .toolNode ._direction .addFieldInterest (this .tool .direction)
|
|
20
|
-
this .toolNode ._upVector .addFieldInterest (this .tool .upVector)
|
|
18
|
+
this .toolNode ._location .addFieldInterest (this .tool .getField ("location"))
|
|
19
|
+
this .toolNode ._direction .addFieldInterest (this .tool .getField ("direction"))
|
|
20
|
+
this .toolNode ._upVector .addFieldInterest (this .tool .getField ("upVector"))
|
|
21
21
|
this .toolNode ._texture .addFieldInterest (this .tool .getField ("texture"))
|
|
22
22
|
|
|
23
23
|
this .tool .on = this .toolNode ._on
|
package/src/Tools.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
const
|
|
4
4
|
fs = require ("fs"),
|
|
5
5
|
path = require ("path"),
|
|
6
|
-
X3D = require ("./X3D")
|
|
6
|
+
X3D = require ("./X3D");
|
|
7
7
|
|
|
8
|
-
const _tool = Symbol .for ("Sunrize.tool")
|
|
8
|
+
const _tool = Symbol .for ("Sunrize.tool");
|
|
9
9
|
|
|
10
10
|
Object .assign (X3D .X3DNode .prototype,
|
|
11
11
|
{
|
|
12
12
|
getTool ()
|
|
13
13
|
{
|
|
14
|
-
return this .getUserData (_tool)
|
|
14
|
+
return this .getUserData (_tool);
|
|
15
15
|
},
|
|
16
16
|
addTool (action = "createOnDemand")
|
|
17
17
|
{
|
|
18
|
-
const module = path .resolve (__dirname, "Tools", this .constructor .componentName, this .constructor .typeName + "Tool.js")
|
|
18
|
+
const module = path .resolve (__dirname, "Tools", this .constructor .componentName, this .constructor .typeName + "Tool.js");
|
|
19
19
|
|
|
20
20
|
if (!fs .existsSync (module))
|
|
21
|
-
return this
|
|
21
|
+
return this;
|
|
22
22
|
|
|
23
|
-
const Tool = require (module)
|
|
23
|
+
const Tool = require (module);
|
|
24
24
|
|
|
25
25
|
if (!Tool [action])
|
|
26
|
-
return this
|
|
26
|
+
return this;
|
|
27
27
|
|
|
28
|
-
return this .getUserData (_tool) ?? new Tool (this)
|
|
28
|
+
return this .getUserData (_tool) ?? new Tool (this);
|
|
29
29
|
},
|
|
30
30
|
removeTool ()
|
|
31
31
|
{
|
|
32
|
-
return this
|
|
32
|
+
return this .getTool () ?.removeTool () ?? this;
|
|
33
33
|
},
|
|
34
34
|
})
|
|
@@ -964,8 +964,21 @@ body.dark .ui-widget .library-list .component {
|
|
|
964
964
|
background-color: var(--tint-color1);
|
|
965
965
|
}
|
|
966
966
|
|
|
967
|
-
.tree-view .jstree-node.
|
|
968
|
-
outline: 1px
|
|
967
|
+
.tree-view .jstree-node.manual.node {
|
|
968
|
+
outline: 1px dashed var(--system-blue);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.tree-view .jstree-node.primary.externproto,
|
|
972
|
+
.tree-view .jstree-node.primary.proto {
|
|
973
|
+
outline: 1px solid var(--system-indigo);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.tree-view .jstree-node.primary.node {
|
|
977
|
+
outline: 1px solid var(--system-blue);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.tree-view .jstree-node.primary.field {
|
|
981
|
+
outline: 1px solid var(--system-orange);
|
|
969
982
|
}
|
|
970
983
|
|
|
971
984
|
.tree-view .no-select {
|
|
@@ -964,8 +964,21 @@ body.dark .ui-widget .library-list .component {
|
|
|
964
964
|
background-color: var(--tint-color1);
|
|
965
965
|
}
|
|
966
966
|
|
|
967
|
-
.tree-view .jstree-node.
|
|
968
|
-
outline: 1px
|
|
967
|
+
.tree-view .jstree-node.manual.node {
|
|
968
|
+
outline: 1px dashed var(--system-blue);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.tree-view .jstree-node.primary.externproto,
|
|
972
|
+
.tree-view .jstree-node.primary.proto {
|
|
973
|
+
outline: 1px solid var(--system-indigo);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.tree-view .jstree-node.primary.node {
|
|
977
|
+
outline: 1px solid var(--system-blue);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.tree-view .jstree-node.primary.field {
|
|
981
|
+
outline: 1px solid var(--system-orange);
|
|
969
982
|
}
|
|
970
983
|
|
|
971
984
|
.tree-view .no-select {
|
|
File without changes
|
|
File without changes
|