sunrize 2.7.1 → 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/MaterialPreviewPopover.js +5 -6
- package/src/Controls/SetOrientationPopover.js +1 -1
- package/src/Controls/Splitter.js +3 -3
- package/src/Controls/TexturePreviewPopover.js +1 -0
- 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 +101 -64
- package/src/Editors/OutlineRouteGraph.js +7 -5
- package/src/Editors/OutlineView.js +3 -3
- 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 +5 -21
- 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 +107 -21
|
@@ -56,15 +56,17 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
56
56
|
if ((keys & ActionKeys .Shift) && !this .tool .keys .includes ("SHIFT"))
|
|
57
57
|
return;
|
|
58
58
|
|
|
59
|
+
let scaleMode;
|
|
60
|
+
|
|
59
61
|
if (this .tool .tools .includes ("TRANSLATE"))
|
|
60
62
|
{
|
|
61
|
-
|
|
63
|
+
scaleMode = keys === ActionKeys .Option || keys === (ActionKeys .Shift | ActionKeys .Option)
|
|
62
64
|
? "SCALE_FROM_OPPOSITE_HANDLE"
|
|
63
65
|
: "SCALE_FROM_CENTER";
|
|
64
66
|
}
|
|
65
67
|
else
|
|
66
68
|
{
|
|
67
|
-
|
|
69
|
+
scaleMode = "SCALE_FROM_CENTER";
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
this .tool .translateMode = keys === ActionKeys .Option ? "TRANSLATE_ALONG_PLANE" : "TRANSLATE_ALONG_AXIS";
|
|
@@ -81,15 +83,6 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
81
83
|
|
|
82
84
|
beginUndo ()
|
|
83
85
|
{
|
|
84
|
-
if (this .isHidden ())
|
|
85
|
-
return false;
|
|
86
|
-
|
|
87
|
-
if (!this ._visible .getValue ())
|
|
88
|
-
return false;
|
|
89
|
-
|
|
90
|
-
if (!this .tool .undo)
|
|
91
|
-
return false;
|
|
92
|
-
|
|
93
86
|
this .#initialMatrix .assign (this .getCurrentMatrix ());
|
|
94
87
|
|
|
95
88
|
this .#initialTranslation = this ._translation .copy ();
|
|
@@ -135,12 +128,6 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
135
128
|
|
|
136
129
|
transformGroups ()
|
|
137
130
|
{
|
|
138
|
-
if (this .isHidden ())
|
|
139
|
-
return;
|
|
140
|
-
|
|
141
|
-
if (!this ._visible .getValue ())
|
|
142
|
-
return;
|
|
143
|
-
|
|
144
131
|
if (this .tool .group === "NONE")
|
|
145
132
|
return;
|
|
146
133
|
|
|
@@ -161,10 +148,7 @@ class X3DTransformNodeTool extends X3DChildNodeTool
|
|
|
161
148
|
if (other === this)
|
|
162
149
|
continue;
|
|
163
150
|
|
|
164
|
-
if (other .
|
|
165
|
-
continue;
|
|
166
|
-
|
|
167
|
-
if (!other ._visible .getValue ())
|
|
151
|
+
if (!other .tool .selected)
|
|
168
152
|
continue;
|
|
169
153
|
|
|
170
154
|
if (other .tool .group !== this .tool .group)
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<unit category='angle' name='degree' conversionFactor='0.017453292519943295'/>
|
|
13
13
|
<meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
|
|
14
14
|
<meta name='creator' content='Holger Seelig'/>
|
|
15
|
-
<meta name='generator' content='Sunrize X3D Editor V2.
|
|
16
|
-
<meta name='modified' content='
|
|
15
|
+
<meta name='generator' content='Sunrize X3D Editor V2.7.2, https://create3000.github.io/sunrize/'/>
|
|
16
|
+
<meta name='modified' content='Fri, 27 Nov 2026 22:51:55 GMT'/>
|
|
17
17
|
</head>
|
|
18
18
|
<Scene>
|
|
19
19
|
<ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
|
|
@@ -671,7 +671,7 @@
|
|
|
671
671
|
</IS>
|
|
672
672
|
<ProtoInstance name='BooleanSwitch' DEF='CenterLine'>
|
|
673
673
|
<fieldValue name='children'>
|
|
674
|
-
<Shape
|
|
674
|
+
<Shape DEF='_1'
|
|
675
675
|
castShadow='false'>
|
|
676
676
|
<Appearance DEF='CenterLineStyle'>
|
|
677
677
|
<LineProperties
|
|
@@ -1829,6 +1829,13 @@ async function set_toggleCenterTool ()
|
|
|
1829
1829
|
{
|
|
1830
1830
|
keepCenter = !keepCenter;
|
|
1831
1831
|
|
|
1832
|
+
if (centerTool .getValue () .getTool ())
|
|
1833
|
+
{
|
|
1834
|
+
const tool = await centerTool .getValue () .getTool () .getToolInstance ();
|
|
1835
|
+
|
|
1836
|
+
tool .selected = keepCenter;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1832
1839
|
if (!keepCenter)
|
|
1833
1840
|
return;
|
|
1834
1841
|
|
|
@@ -1840,6 +1847,7 @@ async function set_toggleCenterTool ()
|
|
|
1840
1847
|
Browser .addRoute (tool, "grouping", this, "grouping");
|
|
1841
1848
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
1842
1849
|
|
|
1850
|
+
tool .selected = true;
|
|
1843
1851
|
tool .group = "CENTER_TOOL";
|
|
1844
1852
|
tool .undo = false;
|
|
1845
1853
|
tool .tools = new MFString ("TRANSLATE");
|
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.1//EN" "https://www.web3d.org/specifications/x3d-4.1.dtd">
|
|
3
3
|
<X3D profile='Interchange' version='4.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.1.xsd'>
|
|
4
4
|
<head>
|
|
5
|
+
<component name='Core' level='2'/>
|
|
5
6
|
<component name='Layout' level='2'/>
|
|
7
|
+
<component name='Navigation' level='2'/>
|
|
6
8
|
<component name='Scripting' level='1'/>
|
|
7
9
|
<component name='Shaders' level='1'/>
|
|
8
10
|
<meta name='comment' content='Rise and Shine'/>
|
|
9
11
|
<meta name='created' content='Fri, 01 Aug 2014 17:41:58 GMT'/>
|
|
10
12
|
<meta name='creator' content='Holger Seelig'/>
|
|
11
|
-
<meta name='generator' content='Sunrize X3D Editor V2.
|
|
13
|
+
<meta name='generator' content='Sunrize X3D Editor V2.7.2, https://create3000.github.io/sunrize/'/>
|
|
12
14
|
<meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Lighting/X3DLightNodeTool.x3d'/>
|
|
13
|
-
<meta name='modified' content='
|
|
15
|
+
<meta name='modified' content='Fri, 27 Nov 2026 23:06:09 GMT'/>
|
|
14
16
|
</head>
|
|
15
17
|
<Scene>
|
|
16
18
|
<ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
|
|
@@ -41,16 +43,15 @@
|
|
|
41
43
|
<Transform DEF='_1'>
|
|
42
44
|
<ScreenGroup>
|
|
43
45
|
<Transform DEF='Lights'
|
|
44
|
-
|
|
45
|
-
scale='12 12 12'
|
|
46
|
-
scaleOrientation='0 0 -1 0.785398163397448'>
|
|
46
|
+
scale='12 12 12'>
|
|
47
47
|
<Switch>
|
|
48
48
|
<IS>
|
|
49
49
|
<connect nodeField='whichChoice' protoField='type'/>
|
|
50
50
|
</IS>
|
|
51
51
|
<Transform DEF='DirectionalLight'
|
|
52
52
|
translation='0 0 -0.16262'
|
|
53
|
-
scale='2 2 2'
|
|
53
|
+
scale='2 2 2'
|
|
54
|
+
bboxSize='5 5 5'>
|
|
54
55
|
<Transform DEF='Rays'>
|
|
55
56
|
<Shape
|
|
56
57
|
castShadow='false'>
|
|
@@ -173,10 +174,11 @@
|
|
|
173
174
|
<Sphere DEF='_2'/>
|
|
174
175
|
</Shape>
|
|
175
176
|
</Transform>
|
|
176
|
-
<Transform DEF='SpotLight'
|
|
177
|
+
<Transform DEF='SpotLight'
|
|
178
|
+
bboxSize='5 5 5'>
|
|
177
179
|
<Transform DEF='Cone'>
|
|
178
180
|
<Transform
|
|
179
|
-
translation='0 0 -
|
|
181
|
+
translation='0 0 -1'
|
|
180
182
|
rotation='1 0 0 4.71239'
|
|
181
183
|
scale='1.70236 1.70236 1.70236'>
|
|
182
184
|
<Shape
|
|
@@ -191,7 +193,7 @@
|
|
|
191
193
|
</Transform>
|
|
192
194
|
</Transform>
|
|
193
195
|
<Transform DEF='Bulb'
|
|
194
|
-
translation='0 0 1
|
|
196
|
+
translation='0 0 1'>
|
|
195
197
|
<Shape DEF='Sphere_1'
|
|
196
198
|
castShadow='false'>
|
|
197
199
|
<Appearance USE='_10'/>
|
|
@@ -312,9 +314,11 @@ async function initialize ()
|
|
|
312
314
|
{
|
|
313
315
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
314
316
|
|
|
317
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
315
318
|
Browser .addRoute (tool, "activeTool", this, "activeTool");
|
|
316
319
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
317
320
|
|
|
321
|
+
tool .selected = selected;
|
|
318
322
|
tool .undo = false;
|
|
319
323
|
tool .tools = new MFString ("TRANSLATE");
|
|
320
324
|
tool .centerDisplay = false;
|
|
@@ -435,8 +439,10 @@ function set_angle ()
|
|
|
435
439
|
<ROUTE fromNode='TransformTool' fromField='rotation_changed' toNode='Tool' toField='set_rotation'/>
|
|
436
440
|
</ProtoBody>
|
|
437
441
|
</ProtoDeclare>
|
|
438
|
-
<
|
|
439
|
-
<
|
|
440
|
-
|
|
442
|
+
<Transform>
|
|
443
|
+
<ProtoInstance name='X3DLightNodeTool'>
|
|
444
|
+
<fieldValue name='selected' value='true'/>
|
|
445
|
+
</ProtoInstance>
|
|
446
|
+
</Transform>
|
|
441
447
|
</Scene>
|
|
442
448
|
</X3D>
|
|
@@ -187,9 +187,11 @@ async function initialize ()
|
|
|
187
187
|
{
|
|
188
188
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
189
189
|
|
|
190
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
190
191
|
Browser .addRoute (tool, "activeTool", this, "activeTool");
|
|
191
192
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
192
193
|
|
|
194
|
+
tool .selected = selected;
|
|
193
195
|
tool .undo = false;
|
|
194
196
|
tool .tools = new MFString ("TRANSLATE", "ROTATE");
|
|
195
197
|
tool .centerDisplay = false;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<ProtoInterface>
|
|
20
20
|
<field accessType='inputOutput' type='SFBool' name='selected'/>
|
|
21
21
|
<field accessType='inputOutput' type='SFString' name='group' value='NONE'/>
|
|
22
|
-
<field accessType='inputOutput' type='SFBool' name='undo'/>
|
|
22
|
+
<field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
|
|
23
23
|
<field accessType='inputOutput' type='SFVec3f' name='size' value='1 1 1'/>
|
|
24
24
|
<field accessType='inputOutput' type='SFBool' name='linesDisplay' value='true'/>
|
|
25
25
|
<field accessType='inputOutput' type='SFFloat' name='linewidthScaleFactor' value='2'/>
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
<X3D profile='Interchange' version='4.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.1.xsd'>
|
|
4
4
|
<head>
|
|
5
5
|
<component name='Layout' level='2'/>
|
|
6
|
+
<component name='Navigation' level='2'/>
|
|
7
|
+
<component name='Networking' level='2'/>
|
|
6
8
|
<component name='Scripting' level='1'/>
|
|
7
9
|
<meta name='created' content='Tue, 26 Mar 2024 07:12:19 GMT'/>
|
|
8
10
|
<meta name='creator' content='Holger Seelig'/>
|
|
9
|
-
<meta name='generator' content='Sunrize X3D Editor V2.
|
|
10
|
-
<meta name='modified' content='
|
|
11
|
+
<meta name='generator' content='Sunrize X3D Editor V2.7.2, https://create3000.github.io/sunrize/'/>
|
|
12
|
+
<meta name='modified' content='Fri, 27 Nov 2026 22:34:06 GMT'/>
|
|
11
13
|
</head>
|
|
12
14
|
<Scene>
|
|
13
15
|
<ProtoDeclare name='ListenerPointSourceTool'>
|
|
@@ -58,12 +60,14 @@
|
|
|
58
60
|
</Transform>
|
|
59
61
|
</Collision>
|
|
60
62
|
<Script DEF='ListenerPointSourceScript'>
|
|
63
|
+
<field accessType='inputOutput' type='SFBool' name='selected'/>
|
|
61
64
|
<field accessType='inputOutput' type='SFBool' name='active'/>
|
|
62
65
|
<field accessType='inputOutput' type='SFString' name='activeTool'/>
|
|
63
66
|
<field accessType='inputOutput' type='SFNode' name='transform'>
|
|
64
67
|
<Transform USE='TransformTool'/>
|
|
65
68
|
</field>
|
|
66
69
|
<IS>
|
|
70
|
+
<connect nodeField='selected' protoField='selected'/>
|
|
67
71
|
<connect nodeField='active' protoField='isActive'/>
|
|
68
72
|
<connect nodeField='activeTool' protoField='activeTool'/>
|
|
69
73
|
<connect nodeField='transform' protoField='transformTool'/>
|
|
@@ -74,9 +78,11 @@ async function initialize ()
|
|
|
74
78
|
{
|
|
75
79
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
76
80
|
|
|
81
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
77
82
|
Browser .addRoute (tool, "activeTool", this, "activeTool");
|
|
78
83
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
79
84
|
|
|
85
|
+
tool .selected = selected;
|
|
80
86
|
tool .undo = false;
|
|
81
87
|
tool .tools = new MFString ("TRANSLATE", "ROTATE");
|
|
82
88
|
tool .centerDisplay = false;
|
|
@@ -353,9 +353,11 @@ async function initialize ()
|
|
|
353
353
|
{
|
|
354
354
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
355
355
|
|
|
356
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
356
357
|
Browser .addRoute (tool, "activeTool", this, "activeTool");
|
|
357
358
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
358
359
|
|
|
360
|
+
tool .selected = selected;
|
|
359
361
|
tool .undo = false;
|
|
360
362
|
tool .tools = new MFString ("TRANSLATE", "ROTATE");
|
|
361
363
|
tool .centerDisplay = false;
|
|
@@ -420,8 +422,10 @@ async function set_minBackTime ()
|
|
|
420
422
|
|
|
421
423
|
const tool = await minBackTransform .getValue () .addTool () .getToolInstance ();
|
|
422
424
|
|
|
425
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
423
426
|
Browser .addRoute (tool, "isActive", this, "set_minBackActive");
|
|
424
427
|
|
|
428
|
+
tool .selected = selected;
|
|
425
429
|
tool .group = "NONE";
|
|
426
430
|
tool .undo = false;
|
|
427
431
|
tool .tools = new MFString ("TRANSLATE");
|
|
@@ -491,8 +495,10 @@ async function set_minFrontTime ()
|
|
|
491
495
|
|
|
492
496
|
const tool = await minFrontTransform .getValue () .addTool () .getToolInstance ();
|
|
493
497
|
|
|
498
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
494
499
|
Browser .addRoute (tool, "isActive", this, "set_minFrontActive");
|
|
495
500
|
|
|
501
|
+
tool .selected = selected;
|
|
496
502
|
tool .group = "NONE";
|
|
497
503
|
tool .undo = false;
|
|
498
504
|
tool .tools = new MFString ("TRANSLATE");
|
|
@@ -562,8 +568,10 @@ async function set_maxBackTime ()
|
|
|
562
568
|
|
|
563
569
|
const tool = await maxBackTransform .getValue () .addTool () .getToolInstance ();
|
|
564
570
|
|
|
571
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
565
572
|
Browser .addRoute (tool, "isActive", this, "set_maxBackActive");
|
|
566
573
|
|
|
574
|
+
tool .selected = selected;
|
|
567
575
|
tool .group = "NONE";
|
|
568
576
|
tool .undo = false;
|
|
569
577
|
tool .tools = new MFString ("TRANSLATE");
|
|
@@ -633,8 +641,10 @@ async function set_maxFrontTime ()
|
|
|
633
641
|
|
|
634
642
|
const tool = await maxFrontTransform .getValue () .addTool () .getToolInstance ();
|
|
635
643
|
|
|
644
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
636
645
|
Browser .addRoute (tool, "isActive", this, "set_maxFrontActive");
|
|
637
646
|
|
|
647
|
+
tool .selected = selected;
|
|
638
648
|
tool .group = "NONE";
|
|
639
649
|
tool .undo = false;
|
|
640
650
|
tool .tools = new MFString ("TRANSLATE");
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.1//EN" "https://www.web3d.org/specifications/x3d-4.1.dtd">
|
|
3
3
|
<X3D profile='Interchange' version='4.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.1.xsd'>
|
|
4
4
|
<head>
|
|
5
|
+
<component name='Core' level='2'/>
|
|
5
6
|
<component name='Layout' level='2'/>
|
|
7
|
+
<component name='Navigation' level='2'/>
|
|
6
8
|
<component name='Scripting' level='1'/>
|
|
7
9
|
<unit category='angle' name='degree' conversionFactor='0.017453292519943295'/>
|
|
8
10
|
<meta name='comment' content='Rise and Shine'/>
|
|
9
11
|
<meta name='created' content='Thu, 18 Feb 2016 08:47:54 GMT'/>
|
|
10
12
|
<meta name='creator' content='Holger Seelig'/>
|
|
11
|
-
<meta name='generator' content='Sunrize X3D Editor V2.
|
|
12
|
-
<meta name='modified' content='
|
|
13
|
+
<meta name='generator' content='Sunrize X3D Editor V2.7.2, https://create3000.github.io/sunrize/'/>
|
|
14
|
+
<meta name='modified' content='Fri, 27 Nov 2026 22:32:47 GMT'/>
|
|
13
15
|
</head>
|
|
14
16
|
<Scene>
|
|
15
17
|
<ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
|
|
@@ -275,6 +277,7 @@ function eventsProcessed ()
|
|
|
275
277
|
</Collision>
|
|
276
278
|
<Script DEF='SpatialSoundScript'
|
|
277
279
|
directOutput='true'>
|
|
280
|
+
<field accessType='inputOutput' type='SFBool' name='selected'/>
|
|
278
281
|
<field accessType='inputOutput' type='SFBool' name='active'/>
|
|
279
282
|
<field accessType='inputOutput' type='SFVec3f' name='direction'/>
|
|
280
283
|
<field accessType='initializeOnly' type='SFVec3f' name='upVector' value='0 1 0'/>
|
|
@@ -284,6 +287,7 @@ function eventsProcessed ()
|
|
|
284
287
|
<Transform USE='TransformTool'/>
|
|
285
288
|
</field>
|
|
286
289
|
<IS>
|
|
290
|
+
<connect nodeField='selected' protoField='selected'/>
|
|
287
291
|
<connect nodeField='active' protoField='isActive'/>
|
|
288
292
|
<connect nodeField='direction' protoField='direction'/>
|
|
289
293
|
<connect nodeField='activeTool' protoField='activeTool'/>
|
|
@@ -295,9 +299,11 @@ async function initialize ()
|
|
|
295
299
|
{
|
|
296
300
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
297
301
|
|
|
302
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
298
303
|
Browser .addRoute (tool, "activeTool", this, "activeTool");
|
|
299
304
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
300
305
|
|
|
306
|
+
tool .selected = selected;
|
|
301
307
|
tool .undo = false;
|
|
302
308
|
tool .tools = new MFString ("TRANSLATE", "ROTATE");
|
|
303
309
|
tool .centerDisplay = false;
|
|
@@ -232,9 +232,11 @@ async function initialize ()
|
|
|
232
232
|
|
|
233
233
|
const tool = await transform .getValue () .addTool () .getToolInstance ();
|
|
234
234
|
|
|
235
|
+
Browser .addRoute (this, "selected", tool, "selected");
|
|
235
236
|
Browser .addRoute (tool, "activeTool", this, "activeTool");
|
|
236
237
|
Browser .addRoute (tool, "isActive", this, "active");
|
|
237
238
|
|
|
239
|
+
tool .selected = selected;
|
|
238
240
|
tool .undo = false;
|
|
239
241
|
tool .tools = new MFString ("TRANSLATE", "ROTATE");
|
|
240
242
|
tool .centerDisplay = false;
|
package/src/Undo/Editor.js
CHANGED
|
@@ -396,6 +396,7 @@ module .exports = class Editor
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
/**
|
|
399
|
+
* Throws an error if filePath is not valid.
|
|
399
400
|
*
|
|
400
401
|
* @param {X3DExecutionContext} executionContext
|
|
401
402
|
* @param {Array<X3DNode>} nodes
|
|
@@ -1319,37 +1320,48 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
|
|
|
1319
1320
|
*/
|
|
1320
1321
|
static async turnIntoExternProto (executionContext, proto, filePath, undoManager = UndoManager .shared)
|
|
1321
1322
|
{
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1323
|
+
try
|
|
1324
|
+
{
|
|
1325
|
+
const
|
|
1326
|
+
browser = executionContext .getBrowser (),
|
|
1327
|
+
scene = await browser .createScene (browser .getProfile ("Core")),
|
|
1328
|
+
x3dSyntax = await this .exportX3D (executionContext, [proto]);
|
|
1326
1329
|
|
|
1327
|
-
|
|
1330
|
+
// Save proto scene.
|
|
1328
1331
|
|
|
1329
|
-
|
|
1332
|
+
scene .setWorldURL (url .pathToFileURL (filePath));
|
|
1330
1333
|
|
|
1331
|
-
|
|
1334
|
+
await this .importX3D (scene, x3dSyntax, new UndoManager ());
|
|
1332
1335
|
|
|
1333
|
-
|
|
1336
|
+
this .rewriteURLs (scene, scene, executionContext .worldURL, scene .worldURL, new UndoManager ());
|
|
1337
|
+
this .inferProfileAndComponents (scene, new UndoManager ());
|
|
1334
1338
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1339
|
+
fs .writeFileSync (filePath, this .getContents (scene, path .extname (filePath)));
|
|
1340
|
+
scene .dispose ();
|
|
1337
1341
|
|
|
1338
|
-
|
|
1339
|
-
scene .dispose ();
|
|
1342
|
+
// Replace proto.
|
|
1340
1343
|
|
|
1341
|
-
|
|
1342
|
-
name = executionContext .getUniqueExternProtoName (proto .getName ()),
|
|
1343
|
-
externproto = this .addExternProtoDeclaration (executionContext, name, undoManager),
|
|
1344
|
-
relativePath = this .relativePath (executionContext, filePath),
|
|
1345
|
-
absolutePath = url .pathToFileURL (filePath) .href,
|
|
1346
|
-
hash = "#" + encodeURIComponent (proto .getName ());
|
|
1344
|
+
undoManager .beginUndo (_("Turn Prototype »%s« into Extern Prototype"), proto .getName ());
|
|
1347
1345
|
|
|
1348
|
-
|
|
1346
|
+
this .removeProtoDeclaration (executionContext, proto .getName (), undoManager);
|
|
1349
1347
|
|
|
1350
|
-
|
|
1348
|
+
const
|
|
1349
|
+
name = executionContext .getUniqueExternProtoName (proto .getName ()),
|
|
1350
|
+
externproto = this .addExternProtoDeclaration (executionContext, name, undoManager),
|
|
1351
|
+
relativePath = this .relativePath (executionContext, filePath),
|
|
1352
|
+
absolutePath = url .pathToFileURL (filePath) .href,
|
|
1353
|
+
hash = "#" + encodeURIComponent (proto .getName ());
|
|
1351
1354
|
|
|
1352
|
-
|
|
1355
|
+
externproto ._url = new X3D .MFString (relativePath + hash, absolutePath + hash);
|
|
1356
|
+
|
|
1357
|
+
this .replaceProtoNodes (executionContext, proto, externproto, undoManager);
|
|
1358
|
+
|
|
1359
|
+
undoManager .endUndo ();
|
|
1360
|
+
}
|
|
1361
|
+
catch (error)
|
|
1362
|
+
{
|
|
1363
|
+
console .error (error);
|
|
1364
|
+
}
|
|
1353
1365
|
}
|
|
1354
1366
|
|
|
1355
1367
|
/**
|
|
@@ -364,9 +364,11 @@ tr.disabled ~ tr > td > div {
|
|
|
364
364
|
background-color: var(--accent-color);
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
/* Node Name */
|
|
367
|
+
/* Node Name, Settings */
|
|
368
368
|
|
|
369
|
-
input.node-name
|
|
369
|
+
input.node-name,
|
|
370
|
+
input.settings,
|
|
371
|
+
select.settings {
|
|
370
372
|
width: 100%;
|
|
371
373
|
height: var(--input-height);
|
|
372
374
|
border: none;
|
|
@@ -750,13 +752,13 @@ body.light .qtip-tipsy {
|
|
|
750
752
|
background-color: var(--system-gray7);
|
|
751
753
|
}
|
|
752
754
|
|
|
753
|
-
|
|
755
|
+
.mini-tip {
|
|
754
756
|
visibility: hidden;
|
|
755
757
|
opacity: 0;
|
|
756
758
|
user-select: none;
|
|
757
759
|
pointer-events: none;
|
|
758
760
|
position: absolute;
|
|
759
|
-
top:
|
|
761
|
+
top: 10px;
|
|
760
762
|
left: 10px;
|
|
761
763
|
padding: 2px 5px;
|
|
762
764
|
background: rgba(255, 255, 255, 0.5);
|
|
@@ -771,11 +773,15 @@ body.light .qtip-tipsy {
|
|
|
771
773
|
transition: visibility 300ms allow-discrete, opacity 300ms linear;
|
|
772
774
|
}
|
|
773
775
|
|
|
774
|
-
|
|
776
|
+
.mini-tip.visible {
|
|
775
777
|
visibility: visible;
|
|
776
778
|
opacity: 1;
|
|
777
779
|
}
|
|
778
780
|
|
|
781
|
+
#browser-size {
|
|
782
|
+
top: calc(var(--topbar-height) + 10px);
|
|
783
|
+
}
|
|
784
|
+
|
|
779
785
|
/* Dialog */
|
|
780
786
|
|
|
781
787
|
.dialog ::placeholder {
|
|
@@ -1868,6 +1874,81 @@ body.light .console-output .selected {
|
|
|
1868
1874
|
border-right: 1px solid var(--border-color);
|
|
1869
1875
|
}
|
|
1870
1876
|
|
|
1877
|
+
.video-recorder-settings-panel {
|
|
1878
|
+
overflow: hidden;
|
|
1879
|
+
position: absolute;
|
|
1880
|
+
inset: 0px;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
.video-recorder-settings {
|
|
1884
|
+
display: flex;
|
|
1885
|
+
flex-direction: column;
|
|
1886
|
+
height: 100%;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
.video-recorder-settings :is(input, select, .file-chooser) {
|
|
1890
|
+
border-top: 1px solid var(--border-color);
|
|
1891
|
+
border-bottom: 1px solid var(--border-color);
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.video-recorder-settings span {
|
|
1895
|
+
padding: 4px 0px;
|
|
1896
|
+
font-size: smaller;
|
|
1897
|
+
background: var(--system-gray8);
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
.video-recorder-settings span.header {
|
|
1901
|
+
border-bottom: 1px solid var(--border-color);
|
|
1902
|
+
background: transparent;
|
|
1903
|
+
font-weight: bold;
|
|
1904
|
+
color: var(--accent-color);
|
|
1905
|
+
text-align: center;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
.video-recorder-settings .filename-box {
|
|
1909
|
+
display: flex;
|
|
1910
|
+
}
|
|
1911
|
+
.video-recorder-settings .file-chooser {
|
|
1912
|
+
align-content: center;
|
|
1913
|
+
padding: 0px 5px 0px 0px;
|
|
1914
|
+
background: transparent;
|
|
1915
|
+
font-size: var(--font-size);
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
.video-recorder-record-panel {
|
|
1919
|
+
border-left: 1px solid var(--border-color);
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
.video-recorder-record-frame {
|
|
1923
|
+
position: absolute;
|
|
1924
|
+
margin: 10px;
|
|
1925
|
+
inset: 0px;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
.video-recorder-aspect-frame {
|
|
1929
|
+
overflow: hidden;
|
|
1930
|
+
box-sizing: content-box;
|
|
1931
|
+
position: absolute;
|
|
1932
|
+
border: 1px solid var(--border-color);
|
|
1933
|
+
left: 50%;
|
|
1934
|
+
top: 50%;
|
|
1935
|
+
transform: translate(-50%, -50%);
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
.video-recorder x3d-canvas {
|
|
1939
|
+
width: 100%;
|
|
1940
|
+
height: 100%;
|
|
1941
|
+
transform-origin: top left;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
.video-recorder video {
|
|
1945
|
+
position: absolute;
|
|
1946
|
+
width: 100%;
|
|
1947
|
+
height: auto;
|
|
1948
|
+
left: 50%;
|
|
1949
|
+
top: 50%;
|
|
1950
|
+
transform: translate(-50%, -50%);
|
|
1951
|
+
}
|
|
1871
1952
|
/* Sidebar */
|
|
1872
1953
|
|
|
1873
1954
|
#sidebar {
|
|
@@ -2011,22 +2092,6 @@ body.light .console-output .selected {
|
|
|
2011
2092
|
font-size: smaller;
|
|
2012
2093
|
}
|
|
2013
2094
|
|
|
2014
|
-
.scene-graph .not-started-state {
|
|
2015
|
-
color: var(--text-color);
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
.scene-graph .in-progress-state {
|
|
2019
|
-
color: var(--system-yellow);
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
.scene-graph .complete-state {
|
|
2023
|
-
color: var(--system-green);
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
.scene-graph .failed-state {
|
|
2027
|
-
color: var(--system-red);
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
2095
|
/* make drag & drop work */
|
|
2031
2096
|
.scene-graph .last {
|
|
2032
2097
|
overflow: hidden;
|
|
@@ -2218,6 +2283,10 @@ body.light .console-output .selected {
|
|
|
2218
2283
|
height: 25px;
|
|
2219
2284
|
}
|
|
2220
2285
|
|
|
2286
|
+
.scene-graph .route-curves.route-value {
|
|
2287
|
+
height: 100%;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2221
2290
|
.scene-graph :is(.field-value-container, .special-value-container) {
|
|
2222
2291
|
flex: 1 1 auto;
|
|
2223
2292
|
}
|
|
@@ -2244,6 +2313,7 @@ body.light .console-output .selected {
|
|
|
2244
2313
|
overflow: scroll;
|
|
2245
2314
|
margin-bottom: 8px;
|
|
2246
2315
|
height: 140px;
|
|
2316
|
+
min-height: 140px;
|
|
2247
2317
|
white-space: pre;
|
|
2248
2318
|
resize: vertical;
|
|
2249
2319
|
}
|
|
@@ -2313,6 +2383,22 @@ body.light .console-output .selected {
|
|
|
2313
2383
|
top: 4px;
|
|
2314
2384
|
}
|
|
2315
2385
|
|
|
2386
|
+
.scene-graph .not-started-state {
|
|
2387
|
+
color: var(--text-color);
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
.scene-graph .in-progress-state {
|
|
2391
|
+
color: var(--system-yellow);
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
.scene-graph .complete-state {
|
|
2395
|
+
color: var(--system-green);
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
.scene-graph .failed-state {
|
|
2399
|
+
color: var(--system-red);
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2316
2402
|
/* Spectrum Color Picker */
|
|
2317
2403
|
|
|
2318
2404
|
.sp-container {
|