sunrize 1.8.26 → 1.8.28
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 +2 -2
- package/src/Controls/AddPrototypePopover.js +4 -0
- package/src/Controls/EditNodePopover.js +77 -0
- package/src/Controls/EditUserDefinedFieldPopover.js +58 -14
- package/src/Controls/ExportNodePopover.js +9 -2
- package/src/Controls/ImportNodePopover.js +9 -2
- package/src/Controls/Popover.js +6 -1
- package/src/Controls/RenameNodeInput.js +26 -11
- package/src/Editors/OutlineEditor.js +19 -18
- package/src/Editors/OutlineView.js +10 -9
- package/src/Editors/Panel.js +8 -5
- package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.x3d +8 -2
- package/src/Tools/Grids/X3DGridNodeTool.js +2 -2
- package/src/Tools/Grouping/X3DTransformNodeTool.x3d +8 -2
- package/src/Tools/Lighting/X3DLightNodeTool.x3d +8 -2
- package/src/Tools/Navigation/X3DViewpointNodeTool.x3d +10 -4
- package/src/Tools/Sound/ListenerPointSourceTool.x3d +8 -2
- package/src/Tools/Sound/SoundTool.x3d +27 -14
- package/src/Tools/Sound/SpatialSoundTool.x3d +8 -2
- package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +8 -2
- package/src/Undo/Editor.js +43 -1
- package/src/assets/X3DUOM.xml +41 -25
- package/src/assets/themes/default-template.css +15 -7
- package/src/assets/themes/default.css +15 -7
- package/src/Controls/RenameNodePopover.js +0 -40
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.28",
|
|
5
5
|
"description": "A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"string-similarity": "^4.0.4",
|
|
111
111
|
"tweakpane": "^3.1.10",
|
|
112
112
|
"update-electron-app": "^3.1.1",
|
|
113
|
-
"x_ite": "^12.0.
|
|
113
|
+
"x_ite": "^12.0.5",
|
|
114
114
|
"x3d-traverse": "^1.0.13"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -35,6 +35,10 @@ $.fn.addPrototypePopover = function (executionContext, type)
|
|
|
35
35
|
.on ("change", () => config .selectedIndex = protoMenu .prop ("selectedIndex"))
|
|
36
36
|
.appendTo (content);
|
|
37
37
|
|
|
38
|
+
$("<span></span>")
|
|
39
|
+
.text (_("Name"))
|
|
40
|
+
.appendTo (content);
|
|
41
|
+
|
|
38
42
|
const nameInput = $("<input></input>")
|
|
39
43
|
.attr ("placeholder", _("Enter name"))
|
|
40
44
|
.appendTo (content);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const
|
|
4
|
+
X3D = require ("../X3D"),
|
|
5
|
+
$ = require ("jquery"),
|
|
6
|
+
_ = require ("../Application/GetText");
|
|
7
|
+
|
|
8
|
+
require ("./Popover");
|
|
9
|
+
require ("./RenameNodeInput");
|
|
10
|
+
|
|
11
|
+
$.fn.editNodePopover = function (node)
|
|
12
|
+
{
|
|
13
|
+
// Create content.
|
|
14
|
+
|
|
15
|
+
const content = $("<div></div>");
|
|
16
|
+
|
|
17
|
+
$("<span></span>")
|
|
18
|
+
.text (_("Name"))
|
|
19
|
+
.appendTo (content);
|
|
20
|
+
|
|
21
|
+
const nameInput = $("<input></input>")
|
|
22
|
+
.attr ("placeholder", _("Enter name"))
|
|
23
|
+
.appendTo (content);
|
|
24
|
+
|
|
25
|
+
if (node instanceof X3D .X3DProtoDeclaration)
|
|
26
|
+
{
|
|
27
|
+
$("<span></span>")
|
|
28
|
+
.text (_("Application Information"))
|
|
29
|
+
.appendTo (content);
|
|
30
|
+
|
|
31
|
+
$("<input></input>")
|
|
32
|
+
.addClass ("appinfo")
|
|
33
|
+
.attr ("placeholder", _("Enter application information"))
|
|
34
|
+
.val (node .getAppInfo ())
|
|
35
|
+
.appendTo (content);
|
|
36
|
+
|
|
37
|
+
$("<span></span>")
|
|
38
|
+
.text (_("Documentation"))
|
|
39
|
+
.appendTo (content);
|
|
40
|
+
|
|
41
|
+
$("<input></input>")
|
|
42
|
+
.addClass ("documentation")
|
|
43
|
+
.attr ("placeholder", _("Enter documentation"))
|
|
44
|
+
.val (node .getDocumentation ())
|
|
45
|
+
.appendTo (content);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Setup input after appInfo and documentation.
|
|
49
|
+
nameInput .renameNodeInput (node);
|
|
50
|
+
|
|
51
|
+
// Create tooltip.
|
|
52
|
+
|
|
53
|
+
const tooltip = this .popover ({
|
|
54
|
+
content: content,
|
|
55
|
+
extension:
|
|
56
|
+
{
|
|
57
|
+
wide: node instanceof X3D .X3DProtoDeclaration,
|
|
58
|
+
},
|
|
59
|
+
events: {
|
|
60
|
+
show: (event, api) =>
|
|
61
|
+
{
|
|
62
|
+
content .children () .off (".editNodePopover") .on ("keydown.editNodePopover", (event) =>
|
|
63
|
+
{
|
|
64
|
+
if (event .key !== "Enter")
|
|
65
|
+
return;
|
|
66
|
+
|
|
67
|
+
api .toggle (false);
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
setTimeout (() => nameInput .trigger ("select"), 1);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
return this;
|
|
76
|
+
};
|
|
77
|
+
|
|
@@ -35,7 +35,7 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
35
35
|
const typeNameMenu = $("<select></select>")
|
|
36
36
|
.appendTo (content);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
$("<optgroup></optgroup>")
|
|
39
39
|
.attr ("label", "Single Fields")
|
|
40
40
|
.append ($("<option></option>") .text ("SFBool"))
|
|
41
41
|
.append ($("<option></option>") .text ("SFColor"))
|
|
@@ -60,7 +60,7 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
60
60
|
.append ($("<option></option>") .text ("SFVec4f"))
|
|
61
61
|
.appendTo (typeNameMenu);
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
$("<optgroup></optgroup>")
|
|
64
64
|
.attr ("label", "Multi Fields")
|
|
65
65
|
.append ($("<option></option>") .text ("MFBool"))
|
|
66
66
|
.append ($("<option></option>") .text ("MFColor"))
|
|
@@ -92,13 +92,12 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
92
92
|
.append ($("<option></option>") .text ("inputOutput"))
|
|
93
93
|
.appendTo (content);
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
.
|
|
95
|
+
$("<span></span>")
|
|
96
|
+
.text (_("Name"))
|
|
97
97
|
.appendTo (content);
|
|
98
98
|
|
|
99
|
-
const
|
|
100
|
-
.
|
|
101
|
-
.on ("click", confirm)
|
|
99
|
+
const nameInput = $("<input></input>")
|
|
100
|
+
.attr ("placeholder", _("Enter name"))
|
|
102
101
|
.appendTo (content);
|
|
103
102
|
|
|
104
103
|
if (field instanceof X3D .X3DField)
|
|
@@ -114,6 +113,26 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
114
113
|
.prop ("selected", true);
|
|
115
114
|
|
|
116
115
|
nameInput .val (field .getName ());
|
|
116
|
+
|
|
117
|
+
$("<span></span>")
|
|
118
|
+
.text (_("Application Information"))
|
|
119
|
+
.appendTo (content);
|
|
120
|
+
|
|
121
|
+
$("<input></input>")
|
|
122
|
+
.addClass ("appinfo")
|
|
123
|
+
.attr ("placeholder", _("Enter application information"))
|
|
124
|
+
.val (field .getAppInfo ())
|
|
125
|
+
.appendTo (content);
|
|
126
|
+
|
|
127
|
+
$("<span></span>")
|
|
128
|
+
.text (_("Documentation"))
|
|
129
|
+
.appendTo (content);
|
|
130
|
+
|
|
131
|
+
$("<input></input>")
|
|
132
|
+
.addClass ("documentation")
|
|
133
|
+
.attr ("placeholder", _("Enter documentation"))
|
|
134
|
+
.val (field .getDocumentation ())
|
|
135
|
+
.appendTo (content);
|
|
117
136
|
}
|
|
118
137
|
else
|
|
119
138
|
{
|
|
@@ -128,10 +147,19 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
128
147
|
.prop ("selected", true);
|
|
129
148
|
}
|
|
130
149
|
|
|
150
|
+
$("<button></button>")
|
|
151
|
+
.text (_("Apply"))
|
|
152
|
+
.on ("click", confirm)
|
|
153
|
+
.appendTo (content);
|
|
154
|
+
|
|
131
155
|
// Create tooltip.
|
|
132
156
|
|
|
133
157
|
const tooltip = this .popover ({
|
|
134
158
|
content: content,
|
|
159
|
+
extension:
|
|
160
|
+
{
|
|
161
|
+
wide: field instanceof X3D .X3DField,
|
|
162
|
+
},
|
|
135
163
|
events: {
|
|
136
164
|
show (event, api)
|
|
137
165
|
{
|
|
@@ -140,7 +168,7 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
140
168
|
electron .shell .beep ();
|
|
141
169
|
nameInput .highlight ();
|
|
142
170
|
})
|
|
143
|
-
.on ("keydown", event =>
|
|
171
|
+
.siblings (".appinfo, .documentation") .addBack () .on ("keydown", event =>
|
|
144
172
|
{
|
|
145
173
|
if (event .key !== "Enter")
|
|
146
174
|
return;
|
|
@@ -181,17 +209,26 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
181
209
|
if (!name .length)
|
|
182
210
|
return;
|
|
183
211
|
|
|
184
|
-
|
|
185
|
-
return;
|
|
186
|
-
|
|
187
|
-
// Change field.
|
|
212
|
+
// Edit field.
|
|
188
213
|
|
|
189
|
-
const
|
|
214
|
+
const
|
|
215
|
+
fields = Array .from (node .getUserDefinedFields ()),
|
|
216
|
+
appInfo = content .children (".appinfo") .val (),
|
|
217
|
+
documentation = content .children (".documentation") .val ();
|
|
190
218
|
|
|
191
219
|
if (type === field .getType ())
|
|
192
220
|
{
|
|
193
221
|
UndoManager .shared .beginUndo (_("Edit Field »%s«"), field .getName ());
|
|
194
|
-
|
|
222
|
+
|
|
223
|
+
if (accessType !== field .getAccessType () || name !== field .getName ())
|
|
224
|
+
Editor .updateUserDefinedField (executionContext, node, field, accessType, name);
|
|
225
|
+
|
|
226
|
+
if (appInfo !== field .getAppInfo ())
|
|
227
|
+
Editor .updateAppInfo (field, appInfo);
|
|
228
|
+
|
|
229
|
+
if (documentation !== field .getDocumentation ())
|
|
230
|
+
Editor .updateDocumentation (field, documentation);
|
|
231
|
+
|
|
195
232
|
UndoManager .shared .endUndo ();
|
|
196
233
|
}
|
|
197
234
|
else
|
|
@@ -207,6 +244,13 @@ $.fn.editUserDefinedFieldPopover = function (executionContext, node, field = -1)
|
|
|
207
244
|
fields .splice (index, 1, newField);
|
|
208
245
|
|
|
209
246
|
Editor .setUserDefinedFields (executionContext, node, fields);
|
|
247
|
+
|
|
248
|
+
if (appInfo !== field .getAppInfo ())
|
|
249
|
+
Editor .updateAppInfo (newField, appInfo);
|
|
250
|
+
|
|
251
|
+
if (documentation !== field .getDocumentation ())
|
|
252
|
+
Editor .updateDocumentation (newField, documentation);
|
|
253
|
+
|
|
210
254
|
UndoManager .shared .endUndo ();
|
|
211
255
|
}
|
|
212
256
|
}
|
|
@@ -15,14 +15,21 @@ $.fn.exportNodePopover = function (node, oldExportedName)
|
|
|
15
15
|
|
|
16
16
|
const scene = node .getExecutionContext ();
|
|
17
17
|
|
|
18
|
+
const content = $("<div></div>");
|
|
19
|
+
|
|
20
|
+
$("<span></span>")
|
|
21
|
+
.text (_("Name"))
|
|
22
|
+
.appendTo (content);
|
|
23
|
+
|
|
18
24
|
const nameInput = $("<input></input>")
|
|
19
25
|
.attr ("placeholder", _("Enter exported name"))
|
|
20
|
-
.val (oldExportedName ?? scene .getUniqueExportName (node .getName ()))
|
|
26
|
+
.val (oldExportedName ?? scene .getUniqueExportName (node .getName ()))
|
|
27
|
+
.appendTo (content);
|
|
21
28
|
|
|
22
29
|
// Create tooltip.
|
|
23
30
|
|
|
24
31
|
const tooltip = this .popover ({
|
|
25
|
-
content:
|
|
32
|
+
content: content,
|
|
26
33
|
events: {
|
|
27
34
|
show: (event, api) =>
|
|
28
35
|
{
|
|
@@ -15,14 +15,21 @@ $.fn.importNodePopover = function (inlineNode, exportedName, oldImportedName)
|
|
|
15
15
|
|
|
16
16
|
const executionContext = inlineNode .getExecutionContext ();
|
|
17
17
|
|
|
18
|
+
const content = $("<div></div>");
|
|
19
|
+
|
|
20
|
+
$("<span></span>")
|
|
21
|
+
.text (_("Name"))
|
|
22
|
+
.appendTo (content);
|
|
23
|
+
|
|
18
24
|
const nameInput = $("<input></input>")
|
|
19
25
|
.attr ("placeholder", _("Enter imported name"))
|
|
20
|
-
.val (oldImportedName ?? executionContext .getUniqueImportName (exportedName))
|
|
26
|
+
.val (oldImportedName ?? executionContext .getUniqueImportName (exportedName))
|
|
27
|
+
.appendTo (content);
|
|
21
28
|
|
|
22
29
|
// Create tooltip.
|
|
23
30
|
|
|
24
31
|
const tooltip = this .popover ({
|
|
25
|
-
content:
|
|
32
|
+
content: content,
|
|
26
33
|
events: {
|
|
27
34
|
show: (event, api) =>
|
|
28
35
|
{
|
package/src/Controls/Popover.js
CHANGED
|
@@ -13,6 +13,11 @@ $.fn.popover = function (options)
|
|
|
13
13
|
if (!options .preview)
|
|
14
14
|
$(".show-preview.on") .removeClass ("on") .addClass ("off");
|
|
15
15
|
|
|
16
|
+
let classes = "qtip-tipsy";
|
|
17
|
+
|
|
18
|
+
if (options .extension ?.wide)
|
|
19
|
+
classes += " qtip-wide";
|
|
20
|
+
|
|
16
21
|
return this .qtip ($.extend (true,
|
|
17
22
|
{
|
|
18
23
|
position: {
|
|
@@ -22,7 +27,7 @@ $.fn.popover = function (options)
|
|
|
22
27
|
effect: false,
|
|
23
28
|
},
|
|
24
29
|
style: {
|
|
25
|
-
classes:
|
|
30
|
+
classes: classes,
|
|
26
31
|
},
|
|
27
32
|
show: {
|
|
28
33
|
ready: true,
|
|
@@ -13,15 +13,15 @@ require ("../Bits/Validate");
|
|
|
13
13
|
$.fn.renameNodeInput = function (node)
|
|
14
14
|
{
|
|
15
15
|
this
|
|
16
|
-
.
|
|
17
|
-
.
|
|
16
|
+
.val (node ? node .getName () : "")
|
|
17
|
+
.siblings () .addBack () .off ("keydown.renameNodeInput")
|
|
18
18
|
|
|
19
19
|
this .validate (Editor .Id, () =>
|
|
20
20
|
{
|
|
21
21
|
electron .shell .beep ();
|
|
22
22
|
this .highlight ();
|
|
23
23
|
})
|
|
24
|
-
.on ("keydown.renameNodeInput", (event) =>
|
|
24
|
+
.siblings () .addBack () .on ("keydown.renameNodeInput", (event) =>
|
|
25
25
|
{
|
|
26
26
|
if (!node)
|
|
27
27
|
return;
|
|
@@ -33,9 +33,6 @@ $.fn.renameNodeInput = function (node)
|
|
|
33
33
|
|
|
34
34
|
let name = this .val ();
|
|
35
35
|
|
|
36
|
-
if (name === node .getName ())
|
|
37
|
-
return;
|
|
38
|
-
|
|
39
36
|
const executionContext = node .getExecutionContext ();
|
|
40
37
|
|
|
41
38
|
if (node instanceof X3D .X3DProtoDeclarationNode)
|
|
@@ -45,12 +42,15 @@ $.fn.renameNodeInput = function (node)
|
|
|
45
42
|
|
|
46
43
|
if (node .isExternProto)
|
|
47
44
|
{
|
|
48
|
-
name
|
|
45
|
+
if (name === node .getName ())
|
|
46
|
+
return;
|
|
49
47
|
|
|
50
48
|
const externproto = node;
|
|
51
49
|
|
|
52
50
|
UndoManager .shared .beginUndo (_("Update Extern Proto Declaration »%s«"), name);
|
|
53
51
|
|
|
52
|
+
name = executionContext .getUniqueExternProtoName (name);
|
|
53
|
+
|
|
54
54
|
Editor .updateExternProtoDeclaration (executionContext, name, externproto);
|
|
55
55
|
|
|
56
56
|
if (!executionContext .protos .get (name))
|
|
@@ -65,13 +65,25 @@ $.fn.renameNodeInput = function (node)
|
|
|
65
65
|
}
|
|
66
66
|
else
|
|
67
67
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const
|
|
69
|
+
proto = node,
|
|
70
|
+
appInfo = this .siblings (".appinfo") .val (),
|
|
71
|
+
documentation = this .siblings (".documentation") .val ();
|
|
71
72
|
|
|
72
73
|
UndoManager .shared .beginUndo (_("Update Proto Declaration »%s«"), name);
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
if (name !== node .getName ())
|
|
76
|
+
{
|
|
77
|
+
name = executionContext .getUniqueProtoName (name);
|
|
78
|
+
|
|
79
|
+
Editor .updateProtoDeclaration (executionContext, name, proto);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (appInfo !== node .getAppInfo ())
|
|
83
|
+
Editor .updateAppInfo (proto, appInfo);
|
|
84
|
+
|
|
85
|
+
if (documentation !== node .getDocumentation ())
|
|
86
|
+
Editor .updateDocumentation (proto, documentation);
|
|
75
87
|
|
|
76
88
|
const available = Editor .getNextAvailableProtoNode (executionContext, proto);
|
|
77
89
|
|
|
@@ -83,6 +95,9 @@ $.fn.renameNodeInput = function (node)
|
|
|
83
95
|
}
|
|
84
96
|
else
|
|
85
97
|
{
|
|
98
|
+
if (name === node .getName ())
|
|
99
|
+
return;
|
|
100
|
+
|
|
86
101
|
if (name)
|
|
87
102
|
Editor .updateNamedNode (executionContext, executionContext .getUniqueName (name), node);
|
|
88
103
|
else
|
|
@@ -201,14 +201,15 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
201
201
|
{
|
|
202
202
|
const
|
|
203
203
|
parentFieldElement = element .closest (".field, .scene", this .sceneGraph),
|
|
204
|
-
parentNodeElement = parentFieldElement .closest (".node, .proto, .scene", this .sceneGraph)
|
|
204
|
+
parentNodeElement = parentFieldElement .closest (".node, .proto, .scene", this .sceneGraph),
|
|
205
|
+
innerNode = $.try (() => node .getInnerNode ()) ?? node;
|
|
205
206
|
|
|
206
207
|
if (node)
|
|
207
208
|
{
|
|
208
209
|
var menu = [
|
|
209
210
|
{
|
|
210
|
-
label: _("
|
|
211
|
-
args: ["
|
|
211
|
+
label: _("Edit Node..."),
|
|
212
|
+
args: ["editNode", element .attr ("id"), executionContext .getId (), node .getId ()],
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
215
|
label: _("Export Node..."),
|
|
@@ -250,7 +251,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
250
251
|
{ type: "separator" },
|
|
251
252
|
];
|
|
252
253
|
|
|
253
|
-
if (
|
|
254
|
+
if (innerNode .getType () .includes (X3D .X3DConstants .X3DChildNode))
|
|
254
255
|
{
|
|
255
256
|
menu .push ({
|
|
256
257
|
label: _("Add Parent Group"),
|
|
@@ -556,9 +557,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
556
557
|
|
|
557
558
|
var menu = [
|
|
558
559
|
{
|
|
559
|
-
label: _("
|
|
560
|
+
label: _("Edit Exported Node..."),
|
|
560
561
|
visible: exportedNode .getExecutionContext () === this .executionContext,
|
|
561
|
-
args: ["
|
|
562
|
+
args: ["editExportedNode", element .attr ("id")],
|
|
562
563
|
},
|
|
563
564
|
{
|
|
564
565
|
label: _("Remove Exported Node"),
|
|
@@ -579,9 +580,9 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
579
580
|
|
|
580
581
|
var menu = [
|
|
581
582
|
{
|
|
582
|
-
label: _("
|
|
583
|
+
label: _("Edit Imported Node..."),
|
|
583
584
|
visible: importedNode .getExecutionContext () .getLocalScene () === this .executionContext,
|
|
584
|
-
args: ["
|
|
585
|
+
args: ["editImportedNode", element .attr ("id")],
|
|
585
586
|
},
|
|
586
587
|
{
|
|
587
588
|
label: _("Remove Imported Node"),
|
|
@@ -604,8 +605,8 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
604
605
|
args: ["addPrototype", element .attr ("id"), executionContext .getId ()],
|
|
605
606
|
},
|
|
606
607
|
{
|
|
607
|
-
label: _("
|
|
608
|
-
args: ["
|
|
608
|
+
label: _("Edit Prototype..."),
|
|
609
|
+
args: ["editPrototype", element .attr ("id"), executionContext .getId (), protoNode .getId ()],
|
|
609
610
|
},
|
|
610
611
|
{
|
|
611
612
|
label: _("Delete Prototype"),
|
|
@@ -761,15 +762,15 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
761
762
|
field .addEvent ();
|
|
762
763
|
}
|
|
763
764
|
|
|
764
|
-
|
|
765
|
+
editNode (id, executionContextId, nodeId)
|
|
765
766
|
{
|
|
766
|
-
require ("../Controls/
|
|
767
|
+
require ("../Controls/EditNodePopover");
|
|
767
768
|
|
|
768
769
|
const
|
|
769
770
|
element = $(`#${id}`),
|
|
770
771
|
node = this .objects .get (nodeId);
|
|
771
772
|
|
|
772
|
-
element .find ("> .item") .
|
|
773
|
+
element .find ("> .item") .editNodePopover (node);
|
|
773
774
|
}
|
|
774
775
|
|
|
775
776
|
openLibrary (id, executionContextId, nodeId, fieldId)
|
|
@@ -793,7 +794,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
793
794
|
element .find ("> .item") .exportNodePopover (node);
|
|
794
795
|
}
|
|
795
796
|
|
|
796
|
-
|
|
797
|
+
editExportedNode (id)
|
|
797
798
|
{
|
|
798
799
|
require ("../Controls/ExportNodePopover");
|
|
799
800
|
|
|
@@ -825,7 +826,7 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
825
826
|
element .find ("> .item") .importNodePopover (inlineNode, exportedNode .getExportedName ());
|
|
826
827
|
}
|
|
827
828
|
|
|
828
|
-
|
|
829
|
+
editImportedNode (id)
|
|
829
830
|
{
|
|
830
831
|
require ("../Controls/ImportNodePopover");
|
|
831
832
|
|
|
@@ -1992,15 +1993,15 @@ module .exports = class OutlineEditor extends OutlineRouteGraph
|
|
|
1992
1993
|
element .addPrototypePopover (executionContext);
|
|
1993
1994
|
}
|
|
1994
1995
|
|
|
1995
|
-
|
|
1996
|
+
editPrototype (id, executionContextId, protoNodeId)
|
|
1996
1997
|
{
|
|
1997
|
-
require ("../Controls/
|
|
1998
|
+
require ("../Controls/EditNodePopover");
|
|
1998
1999
|
|
|
1999
2000
|
const
|
|
2000
2001
|
element = $(`#${id}`),
|
|
2001
2002
|
protoNode = this .objects .get (protoNodeId);
|
|
2002
2003
|
|
|
2003
|
-
element .find ("> .item") .
|
|
2004
|
+
element .find ("> .item") .editNodePopover (protoNode);
|
|
2004
2005
|
}
|
|
2005
2006
|
|
|
2006
2007
|
deletePrototype (id, executionContextId, protoNodeId, used, availableId)
|
|
@@ -284,9 +284,7 @@ module .exports = class OutlineView extends Interface
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
child .find (".externproto .name, .externproto .icon, .proto .name, .proto .icon, .node .name, .node .icon")
|
|
287
|
-
.on ("click", this .selectNode .bind (this))
|
|
288
|
-
|
|
289
|
-
child .find (".node .name")
|
|
287
|
+
.on ("click", this .selectNode .bind (this))
|
|
290
288
|
.on ("mouseenter", this .updateNodeTitle .bind (this));
|
|
291
289
|
|
|
292
290
|
child .find ("[action]")
|
|
@@ -1860,16 +1858,16 @@ module .exports = class OutlineView extends Interface
|
|
|
1860
1858
|
{
|
|
1861
1859
|
const
|
|
1862
1860
|
name = $(event .currentTarget),
|
|
1863
|
-
element = $(event .currentTarget) .closest (".node, .special", this .sceneGraph),
|
|
1861
|
+
element = $(event .currentTarget) .closest (".externproto, .proto, .node, .special", this .sceneGraph),
|
|
1864
1862
|
node = this .objects .get (parseInt (element .attr ("node-id")));
|
|
1865
1863
|
|
|
1866
1864
|
// Handle NULL node element.
|
|
1867
1865
|
if (!node)
|
|
1868
1866
|
return;
|
|
1869
1867
|
|
|
1870
|
-
const
|
|
1868
|
+
const nodeElement = X3DUOM .find (`ConcreteNode[name="${node .getTypeName ()}"] InterfaceDefinition`);
|
|
1871
1869
|
|
|
1872
|
-
name .attr ("title", this .getNodeTitle (
|
|
1870
|
+
name .attr ("title", this .getNodeTitle (node, nodeElement));
|
|
1873
1871
|
}
|
|
1874
1872
|
|
|
1875
1873
|
updateFieldTitle (event)
|
|
@@ -1884,9 +1882,9 @@ module .exports = class OutlineView extends Interface
|
|
|
1884
1882
|
name .attr ("title", this .getFieldTitle (node, field, fieldElement));
|
|
1885
1883
|
}
|
|
1886
1884
|
|
|
1887
|
-
getNodeTitle (
|
|
1885
|
+
getNodeTitle (node, nodeElement)
|
|
1888
1886
|
{
|
|
1889
|
-
const description =
|
|
1887
|
+
const description = nodeElement .attr ("appinfo") ?? node .getAppInfo ?.();
|
|
1890
1888
|
|
|
1891
1889
|
let title = "";
|
|
1892
1890
|
|
|
@@ -1903,7 +1901,10 @@ module .exports = class OutlineView extends Interface
|
|
|
1903
1901
|
return string .length > n ? string .slice (0, n) + "..." : string;
|
|
1904
1902
|
};
|
|
1905
1903
|
|
|
1906
|
-
|
|
1904
|
+
if (node .getType () .includes (X3D .X3DConstants .X3DPrototypeInstance))
|
|
1905
|
+
field = node .getFieldDefinitions () .get (field .getName ()) .getValue ();
|
|
1906
|
+
|
|
1907
|
+
const description = fieldElement .attr ("description") ?? field .getAppInfo ();
|
|
1907
1908
|
|
|
1908
1909
|
let title = "";
|
|
1909
1910
|
|
package/src/Editors/Panel.js
CHANGED
|
@@ -137,9 +137,9 @@ module .exports = new class Panel extends Interface
|
|
|
137
137
|
|
|
138
138
|
// Set title.
|
|
139
139
|
|
|
140
|
-
const
|
|
140
|
+
const nodeElement = concreteNode .find (`InterfaceDefinition`);
|
|
141
141
|
|
|
142
|
-
this .container .attr ("title", this .getNodeTitle (
|
|
142
|
+
this .container .attr ("title", this .getNodeTitle (node, nodeElement));
|
|
143
143
|
|
|
144
144
|
// Make first folder title draggable.
|
|
145
145
|
|
|
@@ -736,9 +736,9 @@ module .exports = new class Panel extends Interface
|
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
-
getNodeTitle (
|
|
739
|
+
getNodeTitle (node, nodeElement)
|
|
740
740
|
{
|
|
741
|
-
const description =
|
|
741
|
+
const description = nodeElement .attr ("appinfo") ?? node .getAppInfo ?.();
|
|
742
742
|
|
|
743
743
|
let title = "";
|
|
744
744
|
|
|
@@ -755,7 +755,10 @@ module .exports = new class Panel extends Interface
|
|
|
755
755
|
return string .length > n ? string .slice (0, n) + "..." : string;
|
|
756
756
|
};
|
|
757
757
|
|
|
758
|
-
|
|
758
|
+
if (node .getType () .includes (X3D .X3DConstants .X3DPrototypeInstance))
|
|
759
|
+
field = node .getFieldDefinitions () .get (field .getName ()) .getValue ();
|
|
760
|
+
|
|
761
|
+
const description = fieldElement .attr ("description") ?? field .getAppInfo ();
|
|
759
762
|
|
|
760
763
|
let title = "";
|
|
761
764
|
|
|
@@ -56,8 +56,14 @@
|
|
|
56
56
|
<connect nodeField='scale' protoField='size'/>
|
|
57
57
|
<connect nodeField='visible' protoField='selected'/>
|
|
58
58
|
</IS>
|
|
59
|
-
<
|
|
60
|
-
|
|
59
|
+
<Shape>
|
|
60
|
+
<Appearance>
|
|
61
|
+
<UnlitMaterial
|
|
62
|
+
transparency='1'/>
|
|
63
|
+
</Appearance>
|
|
64
|
+
<Box
|
|
65
|
+
size='1 1 1'/>
|
|
66
|
+
</Shape>
|
|
61
67
|
</Transform>
|
|
62
68
|
</Collision>
|
|
63
69
|
<Script DEF='Tool'
|
|
@@ -76,7 +76,7 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
field .assign (this .tool .getFieldDefinition (field .getName ()) .
|
|
79
|
+
field .assign (this .tool .getFieldDefinition (field .getName ()) .getValue ());
|
|
80
80
|
|
|
81
81
|
configNode ?.getMetaData (`Sunrize/${this .tool .getNodeTypeName ()}/${field .getName ()}`, field);
|
|
82
82
|
}
|
|
@@ -89,7 +89,7 @@ class X3DGridNodeTool extends X3DActiveLayerNodeTool
|
|
|
89
89
|
|
|
90
90
|
const path = `Sunrize/${this .tool .getNodeTypeName ()}/${field .getName ()}`;
|
|
91
91
|
|
|
92
|
-
if (field .equals (this .tool .getFieldDefinition (field .getName ()) .
|
|
92
|
+
if (field .equals (this .tool .getFieldDefinition (field .getName ()) .getValue ()))
|
|
93
93
|
{
|
|
94
94
|
const configNode = Editor .getConfigNode (this .getBrowser ());
|
|
95
95
|
|
|
@@ -718,8 +718,14 @@
|
|
|
718
718
|
<connect nodeField='translation' protoField='center'/>
|
|
719
719
|
</IS>
|
|
720
720
|
<ScreenGroup>
|
|
721
|
-
<
|
|
722
|
-
|
|
721
|
+
<Shape>
|
|
722
|
+
<Appearance>
|
|
723
|
+
<UnlitMaterial
|
|
724
|
+
transparency='1'/>
|
|
725
|
+
</Appearance>
|
|
726
|
+
<Box
|
|
727
|
+
size='40 40 40'/>
|
|
728
|
+
</Shape>
|
|
723
729
|
</ScreenGroup>
|
|
724
730
|
</Transform>
|
|
725
731
|
</Transform>
|