Normand Briere
2019-08-04 0c85af6e46f48b7425d59fc776b193c06a4a1f52
GroupEditor.java
....@@ -23,6 +23,302 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versionlist == null)
360
+ {
361
+ copy.versionlist = new Object3D[100];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -80,10 +382,22 @@
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versionlist == null)
387
+ {
388
+ copy.versionlist = new Object3D[100];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +408,7 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
....@@ -189,8 +504,8 @@
189504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190505 // pasteExpandItem.addActionListener(this);
191506 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
194509
195510 if (Globals.ADVANCED)
196511 {
....@@ -380,13 +695,14 @@
380695 shadowYItem.addActionListener(this);
381696 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
383701 if (Globals.ADVANCED)
384702 {
385703 menu.add("-");
386704 linkerItem = menu.add(new MenuItem("Linker"));
387705 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390706 templateItem = menu.add(new MenuItem("Template"));
391707 templateItem.addActionListener(this);
392708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -415,7 +731,7 @@
415731 genNormalsMESHItem.addActionListener(this);
416732 if (Globals.ADVANCED)
417733 {
418
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
419735 genNormalsMINEItem.addActionListener(this);
420736 }
421737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -508,10 +824,15 @@
508824 attachBumpItem.addActionListener(this);
509825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
510826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
511828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
512829 detachPigmentItem.addActionListener(this);
513830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
514831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
515836 menu.add("-");
516837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
517838 sortbysizeItem.addActionListener(this);
....@@ -538,6 +859,7 @@
538859 buildToolsMenu(menu);
539860 }
540861
862
+
541863 void SetupUI2(ObjEditor oe)
542864 {
543865 // June 2019
....@@ -582,7 +904,7 @@
582904 */
583905 cGridBag copyOptionsPanel = new cGridBag();
584906
585
- copyOptionsPanel.preferredHeight = 1;
907
+ copyOptionsPanel.preferredHeight = 2;
586908
587909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588910
....@@ -590,50 +912,66 @@
590912 //minButton.setToolTipText("Minimize window");
591913 //minButton.addActionListener(this);
592914
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
596921
597922 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598923 fullButton.setToolTipText("Full-screen window");
599924 fullButton.addActionListener(this);
600925
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
601930 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602931 restoreCameraButton.setToolTipText("Restore viewpoint");
603932 restoreCameraButton.addActionListener(this);
604933
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("Duplicate current version");
936
+ saveButton.addActionListener(this);
937
+
605938 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
939
+ undoButton.setToolTipText("Previous version");
607940 undoButton.addActionListener(this);
608941 undoButton.setEnabled(false);
609942
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Undo (restore current version)");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Save (replace current version)");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
610956 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
- redoButton.setToolTipText("Redo changes");
957
+ redoButton.setToolTipText("Next version");
612958 redoButton.addActionListener(this);
613959 redoButton.setEnabled(false);
614960
615
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
- saveButton.setToolTipText("Save changes");
617
- saveButton.addActionListener(this);
618
-
619
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620962 liveCB.setToolTipText("Enable animation");
621963 liveCB.addItemListener(this);
622964
623
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624966 oneStepButton.setToolTipText("Animate one step forward");
625967 oneStepButton.addActionListener(this);
626968
627
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628970 fastCB.setToolTipText("Fast mode");
629971 fastCB.addItemListener(this);
630972
631973 //oe.toolboxPanel.Return();
632974
633
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- screenfitButton.setToolTipText("Screen fit");
635
- screenfitButton.addActionListener(this);
636
-
637975 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638976 // trackCB.setToolTipText("Enable tracking");
639977 // trackCB.addItemListener(this);
....@@ -646,31 +984,32 @@
646984 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647985 snapobjectButton.addActionListener(this);
648986 snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ fourButton.addActionListener(this);
990
+ fourButton.setToolTipText("Show control panel only");
649991 }
650992
651993 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
652994
653
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
- twoButton.setToolTipText("Show center view only");
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
655997 twoButton.addActionListener(this);
656998 this.fullscreenLayout = twoButton;
657999
658
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
659
- fourButton.addActionListener(this);
660
- fourButton.setToolTipText("Show left panel only");
661
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
- sixButton.setToolTipText("2-column layout left");
663
- sixButton.addActionListener(this);
664
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
- threeButton.setToolTipText("2-column layout right");
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
6661002 threeButton.addActionListener(this);
667
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
- sevenButton.setToolTipText("3-column layout");
669
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
6701009 //
6711010
672
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
- rootButton.setToolTipText("Edit selection in new tab");
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
6741013 rootButton.addActionListener(this);
6751014
6761015 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -679,28 +1018,30 @@
6791018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6801019 //clearButton.addActionListener(this);
6811020
1021
+ cGridBag row1 = new cGridBag();
1022
+
6821023 // INSERT
683
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6841025 gridButton.setToolTipText("Create grid");
6851026 gridButton.addActionListener(this);
6861027
687
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6881029 boxButton.setToolTipText("Create box");
6891030 boxButton.addActionListener(this);
6901031
691
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6921033 sphereButton.setToolTipText("Create sphere");
6931034 sphereButton.addActionListener(this);
6941035
695
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6961037 coneButton.setToolTipText("Create cone");
6971038 coneButton.addActionListener(this);
6981039
699
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7001041 torusButton.setToolTipText("Create torus");
7011042 torusButton.addActionListener(this);
7021043
703
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7041045 superButton.setToolTipText("Create superellipsoid");
7051046 superButton.addActionListener(this);
7061047
....@@ -711,51 +1052,57 @@
7111052 kleinButton.addActionListener(this);
7121053 }
7131054
714
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7151056 particlesButton.setToolTipText("Create particle system");
7161057 particlesButton.addActionListener(this);
7171058
718
- oe.toolboxPanel.Return();
1059
+ oe.toolboxPanel.add(row1);
7191060
720
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7211064 groupButton.setToolTipText("Create group");
7221065 groupButton.addActionListener(this);
7231066
724
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7251068 compositeButton.setToolTipText("Create composite");
7261069 compositeButton.addActionListener(this);
7271070
728
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7291072 switchButton.setToolTipText("Create item switcher");
7301073 switchButton.addActionListener(this);
7311074
732
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7331076 loopButton.setToolTipText("Create loop");
7341077 loopButton.addActionListener(this);
7351078
736
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7371080 textureButton.setToolTipText("Create texture");
7381081 textureButton.addActionListener(this);
7391082
740
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7411084 overlayButton.setToolTipText("Create overlay");
7421085 overlayButton.addActionListener(this);
7431086
744
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7451088 lightButton.setToolTipText("Create light");
7461089 lightButton.addActionListener(this);
7471090
748
- for (int i=6; --i>=0;)
749
- {
750
- oe.toolboxPanel.Return();
751
- oe.toolboxPanel.add(new cGridBag());
752
- oe.toolboxPanel.add(new cGridBag());
753
- oe.toolboxPanel.add(new cGridBag());
754
- oe.toolboxPanel.add(new cGridBag());
755
- oe.toolboxPanel.add(new cGridBag());
756
- oe.toolboxPanel.add(new cGridBag());
757
- oe.toolboxPanel.add(new cGridBag());
758
- }
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
7591106
7601107 // EDIT panel
7611108 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -763,14 +1110,14 @@
7631110 editButton.addActionListener(this);
7641111
7651112 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Remove selection controls");
1113
+ uneditButton.setToolTipText("Unpin and remove selection controls");
7671114 uneditButton.addActionListener(this);
7681115
7691116 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
7701117 allParamsButton.setToolTipText("Show all controle");
7711118 allParamsButton.addActionListener(this);
7721119
773
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7741121 clearPanelButton.setToolTipText("Clear edit panel");
7751122 clearPanelButton.addActionListener(this);
7761123
....@@ -811,9 +1158,12 @@
8111158
8121159 oe.treePanel.add(copyOptionsPanel);
8131160 oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
8141164
815
-// mainPanel.setDividerLocation(0.5); //1.0);
816
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
8171167
8181168 //jList.addListSelectionListener(this);
8191169 oe.jTree.addTreeSelectionListener(this);
....@@ -821,7 +1171,7 @@
8211171 //jTree.setEditable(true);
8221172 oe.jTree.setDragEnabled(true);
8231173 //jTree.setPreferredSize(new Dimension(10,10));
824
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
8251175
8261176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8271177
....@@ -833,7 +1183,7 @@
8331183 dgr.addDragGestureListener(this);
8341184 }catch(Exception e) {}
8351185 */
836
- radio.layout = sevenButton;
1186
+ radio.layout = threeButton; // sixButton;
8371187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8381188 }
8391189
....@@ -884,9 +1234,12 @@
8841234 smoothCB.setToolTipText("Snapping delay");
8851235 smoothCB.addItemListener(this);
8861236
887
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
888
- slowCB.setToolTipText("Smooth interpolation");
889
- slowCB.addItemListener(this);
1237
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
+// slowCB.setToolTipText("Smooth interpolation");
1239
+// slowCB.addItemListener(this);
1240
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1241
+ minshaderCB.setToolTipText("Minimal fast shader");
1242
+ minshaderCB.addItemListener(this);
8901243
8911244 // constraints.gridy += 1;
8921245 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -936,9 +1289,9 @@
9361289 toggleSwitchCB.setToolTipText("Choose a single item");
9371290 toggleSwitchCB.addItemListener(this);
9381291
939
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
940
- autosaveCB.setToolTipText("On structure change");
941
- autosaveCB.addItemListener(this);
1292
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1293
+ autokeepCB.setToolTipText("On structure change");
1294
+ autokeepCB.addItemListener(this);
9421295
9431296 panel.Return();
9441297 if (Globals.ADVANCED)
....@@ -967,7 +1320,7 @@
9671320 {
9681321 cRadio radioButton = new cRadio(obj.name);
9691322
970
- // Patch to avoid bug with transparency.
1323
+ // June 2019. Patch to avoid bug with transparency.
9711324 radioButton.hadMaterial = obj.material != null;
9721325 if (!radioButton.hadMaterial)
9731326 {
....@@ -975,7 +1328,7 @@
9751328 }
9761329
9771330 radioButton.SetObject(obj);
978
- radioButton.layout = sevenButton;
1331
+ radioButton.layout = threeButton; // sixButton;
9791332 radioButton.SetCamera(cameraView.renderCamera, false);
9801333 radioButton.addActionListener(this);
9811334 radioPanel.add(radioButton);
....@@ -1000,6 +1353,8 @@
10001353 cCheckBox localCB;
10011354 cCheckBox crowdCB;
10021355 cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
10031358 cToggleButton fastCB;
10041359 cCheckBox slowCB;
10051360 cCheckBox boxCB;
....@@ -1015,7 +1370,7 @@
10151370
10161371 cCheckBox oeilCB;
10171372 cCheckBox shadowCB;
1018
- cCheckBox autosaveCB;
1373
+ cCheckBox autokeepCB;
10191374 cCheckBox lookAtCB;
10201375
10211376 // static int COLOR = 1;
....@@ -1070,6 +1425,12 @@
10701425 {
10711426 cameraView.ToggleInertia();
10721427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
10731434 }
10741435 else if(e.getSource() == localCB)
10751436 {
....@@ -1127,9 +1488,9 @@
11271488 {
11281489 Globals.FREEZEONMOVE ^= true;
11291490 }
1130
- else if(e.getSource() == autosaveCB)
1491
+ else if(e.getSource() == autokeepCB)
11311492 {
1132
- Globals.SAVEONMAKE ^= true;
1493
+ Globals.REPLACEONMAKE ^= true;
11331494 }
11341495 else if(e.getSource() == lookAtCB)
11351496 {
....@@ -1211,8 +1572,6 @@
12111572 }
12121573 }
12131574
1214
- String string = (String) object;
1215
-
12161575 System.out.println("Transfer = " + object + "; drop : " + target);
12171576 // if( object instanceof java.io.File[])
12181577 // {
....@@ -1220,6 +1579,8 @@
12201579 // objEditor.DropFile((java.io.File[]) object, true);
12211580 // return;
12221581 // }
1582
+
1583
+ String string = object.toString();
12231584
12241585 // File path for Mac and Windows
12251586 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1469,6 +1830,9 @@
14691830 animationItem.addItemListener(this);
14701831 animationItem.setState(Globals.ANIMATION);
14711832
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
1835
+
14721836 menu.add("-");
14731837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14741838 parseverticesItem.addActionListener(this);
....@@ -1481,6 +1845,8 @@
14811845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14821846 reduce34MorphItem.addActionListener(this);
14831847 menu.add("-");
1848
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1849
+ memoryItem.addActionListener(this);
14841850 menu.add(computeAOItem = new MenuItem("Compute AO"));
14851851 computeAOItem.addActionListener(this);
14861852
....@@ -1489,8 +1855,6 @@
14891855 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14901856 mirrorItem.addActionListener(this);
14911857 menu.add("-");
1492
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1493
- memoryItem.addActionListener(this);
14941858 menu.add(analyzeItem = new MenuItem("Analyze"));
14951859 analyzeItem.addActionListener(this);
14961860 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1651,6 +2015,16 @@
16512015 listUI.remove(i);
16522016 }
16532017 }
2018
+ }
2019
+
2020
+ private void EditElement(Object3D elem, boolean newWindow)
2021
+ {
2022
+ // if (!(elem instanceof Composite))
2023
+ // newWindow = false;
2024
+ listUI.add(elem);
2025
+ elem.openEditWindow(this, newWindow); //, false);
2026
+ System.out.println("edit : " + elem);
2027
+ elem.editWindow.refreshContents(true); // ? new
16542028 }
16552029
16562030 /**
....@@ -2080,6 +2454,23 @@
20802454 {
20812455 makeSomething(new Light());
20822456 } else
2457
+// if (source == skybox1Button ||
2458
+// source == skybox2Button ||
2459
+// source == skybox3Button ||
2460
+// source == skybox4Button ||
2461
+// source == skybox5Button ||
2462
+// source == skybox6Button ||
2463
+// source == skybox7Button ||
2464
+// source == skybox11Button ||
2465
+// source == skybox12Button ||
2466
+// source == skybox13Button ||
2467
+// source == skybox14Button ||
2468
+// source == skybox15Button ||
2469
+// source == skybox16Button ||
2470
+// source == skybox17Button)
2471
+// {
2472
+// ChangeSkybox(source);
2473
+// } else
20832474 if (source == csgItem)
20842475 {
20852476 group(new CSG());
....@@ -2165,7 +2556,7 @@
21652556 if (source == computeAOItem)
21662557 {
21672558 Globals.drawMode = CameraPane.OCCLUSION;
2168
- Globals.theRenderer.repaint();
2559
+ cameraView.repaint();
21692560 } else
21702561 if (source == recompileItem)
21712562 {
....@@ -2213,15 +2604,33 @@
22132604 } else
22142605 if (source == undoButton)
22152606 {
2607
+ // Go to previous version
2608
+ //if (!Undo())
2609
+ //java.awt.Toolkit.getDefaultToolkit().beep();
22162610 Undo();
2611
+ } else
2612
+ if (source == restoreButton)
2613
+ {
2614
+ // Restore current version
2615
+ Restore();
2616
+ restoreButton.setEnabled(false);
2617
+ } else
2618
+ if (source == replaceButton)
2619
+ {
2620
+ // Overwrite current version
2621
+ Replace();
2622
+ replaceButton.setEnabled(false);
22172623 } else
22182624 if (source == redoButton)
22192625 {
2626
+ // Go to next version
22202627 Redo();
22212628 } else
22222629 if (source == saveButton)
22232630 {
2224
- Save();
2631
+ // Save a new version
2632
+ if (!Save(true))
2633
+ java.awt.Toolkit.getDefaultToolkit().beep();
22252634 } else
22262635 if (source == oneStepButton)
22272636 {
....@@ -2230,17 +2639,14 @@
22302639 } else
22312640 if (source == screenfitButton)
22322641 {
2233
- //Reload(lastConverter, lastFilename, true);
22342642 ScreenFit();
22352643 } else
22362644 if (source == screenfitpointButton)
22372645 {
2238
- //Reload(lastConverter, lastFilename, true);
22392646 ScreenFitPoint();
22402647 } else
22412648 if (source == snapobjectButton)
22422649 {
2243
- //Reload(lastConverter, lastFilename, true);
22442650 SnapObject();
22452651 } else
22462652 // if (event.getSource() == recompileButton)
....@@ -2604,7 +3010,7 @@
26043010 {
26053011 StepAll();
26063012 } else
2607
- if (source == clearItem) // || event.getSource() == clearButton)
3013
+ if (source == deleteItem) // || event.getSource() == clearButton)
26083014 {
26093015 //int indices[] = jList.getSelectedIndices();
26103016 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3086,7 +3492,7 @@
30863492 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30873493 {
30883494 obj = (Object3D)e.nextElement();
3089
- obj.SetBumpTexture(null);
3495
+ obj.ResetBumpTexture();
30903496 }
30913497
30923498 refreshContents();
....@@ -3100,6 +3506,31 @@
31003506 obj.SetBumpTexture(obj.GetPigmentTexture());
31013507 }
31023508
3509
+ refreshContents();
3510
+ } else
3511
+ if (source == embedTexturesItem)
3512
+ {
3513
+ Object3D obj;
3514
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3515
+ {
3516
+ obj = (Object3D)e.nextElement();
3517
+ obj.EmbedTextures(true);
3518
+ }
3519
+
3520
+ refreshContents();
3521
+ } else
3522
+ if (source == deEmbedTexturesItem)
3523
+ {
3524
+ Object3D obj;
3525
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3526
+ {
3527
+ obj = (Object3D)e.nextElement();
3528
+ obj.EmbedTextures(false);
3529
+ }
3530
+
3531
+ CameraPane.texturepigment.clear();
3532
+ CameraPane.texturebump.clear();
3533
+
31033534 refreshContents();
31043535 } else
31053536 if (source == flashSelectionButton)
....@@ -3203,8 +3634,8 @@
32033634 // centralPanel.setVisible(true);
32043635 // XYZPanel.setVisible(true);
32053636 bigThree.ClearUI();
3637
+ bigThree.add(scenePanel);
32063638 bigThree.add(centralPanel);
3207
- bigThree.add(XYZPanel);
32083639 bigThree.FlushUI();
32093640
32103641 cameraView.requestFocusInWindow();
....@@ -3284,8 +3715,8 @@
32843715 // centralPanel.setVisible(true);
32853716 // XYZPanel.setVisible(false);
32863717 bigThree.ClearUI();
3287
- bigThree.add(scenePanel);
32883718 bigThree.add(centralPanel);
3719
+ bigThree.add(scenePanel);
32893720 bigThree.FlushUI();
32903721
32913722 cameraView.requestFocusInWindow();
....@@ -3391,10 +3822,10 @@
33913822 {
33923823 Object3D child = (Object3D)e.nextElement();
33933824 if(child.editWindow != null)
3394
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33953825 child.pinned = false;
33963826 child.CloseUI();
33973827 listUI.remove(child);
3828
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33983829
33993830 //child.editWindow = null; // ???????????
34003831 }
....@@ -3413,6 +3844,7 @@
34133844 obj.CloseUI();
34143845 }
34153846 listUI.clear();
3847
+ SetPinStates(group.selection.size() > 0);
34163848 refreshContents(true);
34173849 } else
34183850 if (source == allParamsButton)
....@@ -3468,6 +3900,9 @@
34683900 }
34693901
34703902 copy = group;
3903
+
3904
+ SetUndoStates();
3905
+
34713906 //Globals.theRenderer.object = group;
34723907 if(!useclient)
34733908 {
....@@ -3496,8 +3931,11 @@
34963931 radio.layout.doClick();
34973932
34983933 ClearUnpinned();
3499
- SetPinStates(group.selection.size() > 0);
3500
- if (group.selection.size() == 1)
3934
+
3935
+ //Grafreed.Assert(group != null);
3936
+ //Grafreed.Assert(group.selection != null);
3937
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3938
+ if (group.selection == null || group.selection.size() == 1)
35013939 EditSelection(false);
35023940 keepparent = group.parent;
35033941 // PARENT = NULL or not???
....@@ -3510,11 +3948,13 @@
35103948 } else if (event.getSource() == editCameraItem)
35113949 {
35123950 cameraView.ProtectCamera();
3951
+ cameraView.requestFocusInWindow();
35133952 cameraView.repaint();
35143953 return;
35153954 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
35163955 {
35173956 cameraView.RevertCamera();
3957
+ cameraView.requestFocusInWindow();
35183958 cameraView.repaint();
35193959 return;
35203960 // } else if (event.getSource() == textureButton)
....@@ -4091,7 +4531,7 @@
40914531
40924532 try
40934533 {
4094
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4534
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
40954535 }
40964536 catch (Exception e)
40974537 {
....@@ -4568,6 +5008,12 @@
45685008
45695009 void EditSelection(boolean newWindow)
45705010 {
5011
+ if (group.selection == null)
5012
+ {
5013
+ EditElement(group, newWindow); // ? new
5014
+ return;
5015
+ }
5016
+
45715017 // aConstraints.gridy = 0;
45725018 for (int i=0; i<group.selection.size(); i++)
45735019 {
....@@ -4578,12 +5024,7 @@
45785024 Object3D elem = (Object3D)group.selection.elementAt(i);
45795025 if(elem != group || !newWindow)
45805026 {
4581
- // if (!(elem instanceof Composite))
4582
- // newWindow = false;
4583
- listUI.add(elem);
4584
- elem.openEditWindow(this, newWindow); //, false);
4585
- System.out.println("edit : " + elem);
4586
- elem.editWindow.refreshContents(true); // ? new
5027
+ EditElement(elem, newWindow); // ? new
45875028 }
45885029 }
45895030 }
....@@ -4646,9 +5087,7 @@
46465087
46475088 freezemodel = false;
46485089 }
4649
-
4650
- boolean flashIt = true;
4651
-
5090
+
46525091 public void valueChanged(TreeSelectionEvent e)
46535092 //public boolean handleEvent(Event event)
46545093 {
....@@ -4723,12 +5162,14 @@
47235162 uneditButton.setEnabled(enabled);
47245163 unselectButton.setEnabled(enabled);
47255164 flashSelectionButton.setEnabled(enabled);
5165
+
5166
+ clearPanelButton.setEnabled(!listUI.isEmpty());
47265167 }
47275168
47285169 void refreshContents(boolean cp)
47295170 {
4730
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4731
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
5171
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5172
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47325173 {
47335174 objEditor.ClearInfo(); // .GetMaterial());
47345175
....@@ -4827,8 +5268,8 @@
48275268
48285269 if (cut)
48295270 {
4830
- if (Globals.SAVEONMAKE)
4831
- Save();
5271
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5272
+// Save();
48325273 //int indices[] = jList.getSelectedIndices();
48335274 //for (int i = indices.length - 1; i >= 0; i--)
48345275 //jList.remove(indices[i]);
....@@ -4931,6 +5372,10 @@
49315372
49325373 void paste(boolean expand)
49335374 {
5375
+ if (Globals.REPLACEONMAKE)
5376
+ Save();
5377
+ boolean keep = Globals.REPLACEONMAKE;
5378
+ Globals.REPLACEONMAKE = false;
49345379 // if (GrafreeD.clipboard == null)
49355380 // return;
49365381 boolean first = true;
....@@ -4990,6 +5435,7 @@
49905435 Grafreed.clipboard.get(0).parent = keepparent;
49915436 }
49925437
5438
+ Globals.REPLACEONMAKE = keep;
49935439 ResetModel();
49945440 refreshContents();
49955441 }
....@@ -5125,6 +5571,10 @@
51255571
51265572 void group(Object3D csg, boolean grab)
51275573 {
5574
+ if (Globals.REPLACEONMAKE)
5575
+ Save();
5576
+ boolean keep = Globals.REPLACEONMAKE;
5577
+ Globals.REPLACEONMAKE = false;
51285578 if (//false) // why??
51295579 !group.selection.isEmpty())
51305580 {
....@@ -5238,10 +5688,15 @@
52385688 //node.add(csg);
52395689 //makeSomething(node);
52405690 makeSomething(csg);
5691
+ Globals.REPLACEONMAKE = keep;
52415692 }
52425693
52435694 void Ungroup(Object3D g)
52445695 {
5696
+ if (Globals.REPLACEONMAKE)
5697
+ Save();
5698
+ boolean keep = Globals.REPLACEONMAKE;
5699
+ Globals.REPLACEONMAKE = false;
52455700 if (g instanceof HiddenObject)
52465701 {
52475702 HiddenObject h = (HiddenObject) g;
....@@ -5258,6 +5713,7 @@
52585713 objEditor.makeSomething(g.get(i), false);
52595714 }
52605715 }
5716
+ Globals.REPLACEONMAKE = keep;
52615717 }
52625718
52635719 void ungroup()
....@@ -5558,6 +6014,22 @@
55586014 cButton loopButton;
55596015 cButton textureButton;
55606016
6017
+ cButton skybox1Button;
6018
+ cButton skybox2Button;
6019
+ cButton skybox3Button;
6020
+ cButton skybox4Button;
6021
+ cButton skybox5Button;
6022
+ cButton skybox6Button;
6023
+ cButton skybox7Button;
6024
+
6025
+ cButton skybox11Button;
6026
+ cButton skybox12Button;
6027
+ cButton skybox13Button;
6028
+ cButton skybox14Button;
6029
+ cButton skybox15Button;
6030
+ cButton skybox16Button;
6031
+ cButton skybox17Button;
6032
+
55616033 cButton gridButton;
55626034 cButton boxButton;
55636035 cButton sphereButton;
....@@ -5621,7 +6093,7 @@
56216093 private MenuItem pasteLinkItem;
56226094 private MenuItem pasteCloneItem;
56236095 private MenuItem pasteExpandItem;
5624
- private MenuItem clearItem;
6096
+ private MenuItem deleteItem;
56256097 private MenuItem clearAllItem;
56266098 private MenuItem genUVItem;
56276099 private MenuItem genNormalsMESHItem;
....@@ -5705,6 +6177,8 @@
57056177 private MenuItem attachBumpItem;
57066178 private MenuItem detachBumpItem;
57076179 private MenuItem pigmentBumpItem;
6180
+ private MenuItem embedTexturesItem;
6181
+ private MenuItem deEmbedTexturesItem;
57086182
57096183 private MenuItem particleItem;
57106184 private MenuItem ragdollItem;