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,9 +356,9 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
63
- if (copy.versions == null)
359
+ if (copy.versionlist == null)
64360 {
65
- copy.versions = new byte[100][];
361
+ copy.versionlist = new Object3D[100];
66362 copy.versionindex = -1;
67363 }
68364
....@@ -80,18 +376,20 @@
80376 this.copy = this.group = copy;
81377 //selectees = this.group.selectees;
82378
83
- if (copy.versions == null)
84
- {
85
- copy.versions = new byte[100][];
86
- copy.versionindex = -1;
87
- }
88
-
89379 SetupMenu2(this); //objEditor);
90380 SetupUI2(objEditor);
91381 objEditor.SetupUI(true);
92382 SetupViews(objEditor);
93383
94384 ((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
+ }
95393 }
96394
97395 void CloneSelection(boolean supports)
....@@ -206,8 +504,8 @@
206504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
207505 // pasteExpandItem.addActionListener(this);
208506 menu.add("-");
209
- clearItem = menu.add(new MenuItem("Clear"));
210
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
211509
212510 if (Globals.ADVANCED)
213511 {
....@@ -433,7 +731,7 @@
433731 genNormalsMESHItem.addActionListener(this);
434732 if (Globals.ADVANCED)
435733 {
436
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437735 genNormalsMINEItem.addActionListener(this);
438736 }
439737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -526,10 +824,15 @@
526824 attachBumpItem.addActionListener(this);
527825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
528826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
529828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
530829 detachPigmentItem.addActionListener(this);
531830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
532831 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);
533836 menu.add("-");
534837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
535838 sortbysizeItem.addActionListener(this);
....@@ -601,7 +904,7 @@
601904 */
602905 cGridBag copyOptionsPanel = new cGridBag();
603906
604
- copyOptionsPanel.preferredHeight = 1;
907
+ copyOptionsPanel.preferredHeight = 2;
605908
606909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
607910
....@@ -629,7 +932,7 @@
629932 restoreCameraButton.addActionListener(this);
630933
631934 copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
- saveButton.setToolTipText("New version");
935
+ saveButton.setToolTipText("Duplicate current version");
633936 saveButton.addActionListener(this);
634937
635938 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -639,12 +942,12 @@
639942
640943 cGridBag updown = new cGridBag().setVertical(true);
641944 updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
- restoreButton.setToolTipText("Restore current");
945
+ restoreButton.setToolTipText("Undo (restore current version)");
643946 restoreButton.addActionListener(this);
644947 restoreButton.setEnabled(false);
645948
646949 updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
- replaceButton.setToolTipText("Replace current");
950
+ replaceButton.setToolTipText("Save (replace current version)");
648951 replaceButton.addActionListener(this);
649952 replaceButton.setEnabled(false);
650953
....@@ -681,31 +984,32 @@
681984 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682985 snapobjectButton.addActionListener(this);
683986 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");
684991 }
685992
686993 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
687994
688
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
- 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");
690997 twoButton.addActionListener(this);
691998 this.fullscreenLayout = twoButton;
692999
693
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
- fourButton.addActionListener(this);
695
- fourButton.setToolTipText("Show left panel only");
696
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
- sixButton.setToolTipText("2-column layout left");
698
- sixButton.addActionListener(this);
699
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- 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");
7011002 threeButton.addActionListener(this);
702
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
- sevenButton.setToolTipText("3-column layout");
704
- 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);
7051009 //
7061010
707
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
- 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");
7091013 rootButton.addActionListener(this);
7101014
7111015 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -714,28 +1018,30 @@
7141018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
7151019 //clearButton.addActionListener(this);
7161020
1021
+ cGridBag row1 = new cGridBag();
1022
+
7171023 // INSERT
718
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7191025 gridButton.setToolTipText("Create grid");
7201026 gridButton.addActionListener(this);
7211027
722
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7231029 boxButton.setToolTipText("Create box");
7241030 boxButton.addActionListener(this);
7251031
726
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7271033 sphereButton.setToolTipText("Create sphere");
7281034 sphereButton.addActionListener(this);
7291035
730
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7311037 coneButton.setToolTipText("Create cone");
7321038 coneButton.addActionListener(this);
7331039
734
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7351041 torusButton.setToolTipText("Create torus");
7361042 torusButton.addActionListener(this);
7371043
738
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7391045 superButton.setToolTipText("Create superellipsoid");
7401046 superButton.addActionListener(this);
7411047
....@@ -746,51 +1052,57 @@
7461052 kleinButton.addActionListener(this);
7471053 }
7481054
749
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7501056 particlesButton.setToolTipText("Create particle system");
7511057 particlesButton.addActionListener(this);
7521058
753
- oe.toolboxPanel.Return();
1059
+ oe.toolboxPanel.add(row1);
7541060
755
- 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);
7561064 groupButton.setToolTipText("Create group");
7571065 groupButton.addActionListener(this);
7581066
759
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7601068 compositeButton.setToolTipText("Create composite");
7611069 compositeButton.addActionListener(this);
7621070
763
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7641072 switchButton.setToolTipText("Create item switcher");
7651073 switchButton.addActionListener(this);
7661074
767
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7681076 loopButton.setToolTipText("Create loop");
7691077 loopButton.addActionListener(this);
7701078
771
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7721080 textureButton.setToolTipText("Create texture");
7731081 textureButton.addActionListener(this);
7741082
775
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7761084 overlayButton.setToolTipText("Create overlay");
7771085 overlayButton.addActionListener(this);
7781086
779
- 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);
7801088 lightButton.setToolTipText("Create light");
7811089 lightButton.addActionListener(this);
7821090
783
- for (int i=6; --i>=0;)
784
- {
785
- oe.toolboxPanel.Return();
786
- oe.toolboxPanel.add(new cGridBag());
787
- oe.toolboxPanel.add(new cGridBag());
788
- oe.toolboxPanel.add(new cGridBag());
789
- oe.toolboxPanel.add(new cGridBag());
790
- oe.toolboxPanel.add(new cGridBag());
791
- oe.toolboxPanel.add(new cGridBag());
792
- oe.toolboxPanel.add(new cGridBag());
793
- }
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);
7941106
7951107 // EDIT panel
7961108 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -798,14 +1110,14 @@
7981110 editButton.addActionListener(this);
7991111
8001112 editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
- uneditButton.setToolTipText("Remove selection controls");
1113
+ uneditButton.setToolTipText("Unpin and remove selection controls");
8021114 uneditButton.addActionListener(this);
8031115
8041116 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
8051117 allParamsButton.setToolTipText("Show all controle");
8061118 allParamsButton.addActionListener(this);
8071119
808
- editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
8091121 clearPanelButton.setToolTipText("Clear edit panel");
8101122 clearPanelButton.addActionListener(this);
8111123
....@@ -850,8 +1162,8 @@
8501162 versionSlider = (cNumberSlider)sliderPane.getComponent(1);
8511163 sliderPane.preferredHeight = 1;
8521164
853
-// mainPanel.setDividerLocation(0.5); //1.0);
854
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
8551167
8561168 //jList.addListSelectionListener(this);
8571169 oe.jTree.addTreeSelectionListener(this);
....@@ -859,7 +1171,7 @@
8591171 //jTree.setEditable(true);
8601172 oe.jTree.setDragEnabled(true);
8611173 //jTree.setPreferredSize(new Dimension(10,10));
862
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
8631175
8641176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8651177
....@@ -871,7 +1183,7 @@
8711183 dgr.addDragGestureListener(this);
8721184 }catch(Exception e) {}
8731185 */
874
- radio.layout = sevenButton;
1186
+ radio.layout = threeButton; // sixButton;
8751187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8761188 }
8771189
....@@ -922,9 +1234,12 @@
9221234 smoothCB.setToolTipText("Snapping delay");
9231235 smoothCB.addItemListener(this);
9241236
925
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
926
- slowCB.setToolTipText("Smooth interpolation");
927
- 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);
9281243
9291244 // constraints.gridy += 1;
9301245 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
....@@ -1013,7 +1328,7 @@
10131328 }
10141329
10151330 radioButton.SetObject(obj);
1016
- radioButton.layout = sevenButton;
1331
+ radioButton.layout = threeButton; // sixButton;
10171332 radioButton.SetCamera(cameraView.renderCamera, false);
10181333 radioButton.addActionListener(this);
10191334 radioPanel.add(radioButton);
....@@ -1038,6 +1353,8 @@
10381353 cCheckBox localCB;
10391354 cCheckBox crowdCB;
10401355 cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
10411358 cToggleButton fastCB;
10421359 cCheckBox slowCB;
10431360 cCheckBox boxCB;
....@@ -1108,6 +1425,12 @@
11081425 {
11091426 cameraView.ToggleInertia();
11101427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
11111434 }
11121435 else if(e.getSource() == localCB)
11131436 {
....@@ -1693,6 +2016,16 @@
16932016 }
16942017 }
16952018 }
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
2028
+ }
16962029
16972030 /**
16982031 * applyExample
....@@ -2121,6 +2454,23 @@
21212454 {
21222455 makeSomething(new Light());
21232456 } 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
21242474 if (source == csgItem)
21252475 {
21262476 group(new CSG());
....@@ -2206,7 +2556,7 @@
22062556 if (source == computeAOItem)
22072557 {
22082558 Globals.drawMode = CameraPane.OCCLUSION;
2209
- Globals.theRenderer.repaint();
2559
+ cameraView.repaint();
22102560 } else
22112561 if (source == recompileItem)
22122562 {
....@@ -2263,11 +2613,13 @@
22632613 {
22642614 // Restore current version
22652615 Restore();
2616
+ restoreButton.setEnabled(false);
22662617 } else
22672618 if (source == replaceButton)
22682619 {
22692620 // Overwrite current version
22702621 Replace();
2622
+ replaceButton.setEnabled(false);
22712623 } else
22722624 if (source == redoButton)
22732625 {
....@@ -2658,7 +3010,7 @@
26583010 {
26593011 StepAll();
26603012 } else
2661
- if (source == clearItem) // || event.getSource() == clearButton)
3013
+ if (source == deleteItem) // || event.getSource() == clearButton)
26623014 {
26633015 //int indices[] = jList.getSelectedIndices();
26643016 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3140,7 +3492,7 @@
31403492 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
31413493 {
31423494 obj = (Object3D)e.nextElement();
3143
- obj.SetBumpTexture(null);
3495
+ obj.ResetBumpTexture();
31443496 }
31453497
31463498 refreshContents();
....@@ -3154,6 +3506,31 @@
31543506 obj.SetBumpTexture(obj.GetPigmentTexture());
31553507 }
31563508
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
+
31573534 refreshContents();
31583535 } else
31593536 if (source == flashSelectionButton)
....@@ -3257,8 +3634,8 @@
32573634 // centralPanel.setVisible(true);
32583635 // XYZPanel.setVisible(true);
32593636 bigThree.ClearUI();
3637
+ bigThree.add(scenePanel);
32603638 bigThree.add(centralPanel);
3261
- bigThree.add(XYZPanel);
32623639 bigThree.FlushUI();
32633640
32643641 cameraView.requestFocusInWindow();
....@@ -3338,8 +3715,8 @@
33383715 // centralPanel.setVisible(true);
33393716 // XYZPanel.setVisible(false);
33403717 bigThree.ClearUI();
3341
- bigThree.add(scenePanel);
33423718 bigThree.add(centralPanel);
3719
+ bigThree.add(scenePanel);
33433720 bigThree.FlushUI();
33443721
33453722 cameraView.requestFocusInWindow();
....@@ -3445,10 +3822,10 @@
34453822 {
34463823 Object3D child = (Object3D)e.nextElement();
34473824 if(child.editWindow != null)
3448
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34493825 child.pinned = false;
34503826 child.CloseUI();
34513827 listUI.remove(child);
3828
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
34523829
34533830 //child.editWindow = null; // ???????????
34543831 }
....@@ -3467,6 +3844,7 @@
34673844 obj.CloseUI();
34683845 }
34693846 listUI.clear();
3847
+ SetPinStates(group.selection.size() > 0);
34703848 refreshContents(true);
34713849 } else
34723850 if (source == allParamsButton)
....@@ -3553,10 +3931,11 @@
35533931 radio.layout.doClick();
35543932
35553933 ClearUnpinned();
3556
- Grafreed.Assert(group != null);
3557
- Grafreed.Assert(group.selection != null);
3558
- SetPinStates(group.selection.size() > 0);
3559
- 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)
35603939 EditSelection(false);
35613940 keepparent = group.parent;
35623941 // PARENT = NULL or not???
....@@ -3569,11 +3948,13 @@
35693948 } else if (event.getSource() == editCameraItem)
35703949 {
35713950 cameraView.ProtectCamera();
3951
+ cameraView.requestFocusInWindow();
35723952 cameraView.repaint();
35733953 return;
35743954 } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
35753955 {
35763956 cameraView.RevertCamera();
3957
+ cameraView.requestFocusInWindow();
35773958 cameraView.repaint();
35783959 return;
35793960 // } else if (event.getSource() == textureButton)
....@@ -4150,7 +4531,7 @@
41504531
41514532 try
41524533 {
4153
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4534
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41544535 }
41554536 catch (Exception e)
41564537 {
....@@ -4627,6 +5008,12 @@
46275008
46285009 void EditSelection(boolean newWindow)
46295010 {
5011
+ if (group.selection == null)
5012
+ {
5013
+ EditElement(group, newWindow); // ? new
5014
+ return;
5015
+ }
5016
+
46305017 // aConstraints.gridy = 0;
46315018 for (int i=0; i<group.selection.size(); i++)
46325019 {
....@@ -4637,12 +5024,7 @@
46375024 Object3D elem = (Object3D)group.selection.elementAt(i);
46385025 if(elem != group || !newWindow)
46395026 {
4640
- // if (!(elem instanceof Composite))
4641
- // newWindow = false;
4642
- listUI.add(elem);
4643
- elem.openEditWindow(this, newWindow); //, false);
4644
- System.out.println("edit : " + elem);
4645
- elem.editWindow.refreshContents(true); // ? new
5027
+ EditElement(elem, newWindow); // ? new
46465028 }
46475029 }
46485030 }
....@@ -4705,9 +5087,7 @@
47055087
47065088 freezemodel = false;
47075089 }
4708
-
4709
- boolean flashIt = true;
4710
-
5090
+
47115091 public void valueChanged(TreeSelectionEvent e)
47125092 //public boolean handleEvent(Event event)
47135093 {
....@@ -4782,11 +5162,13 @@
47825162 uneditButton.setEnabled(enabled);
47835163 unselectButton.setEnabled(enabled);
47845164 flashSelectionButton.setEnabled(enabled);
5165
+
5166
+ clearPanelButton.setEnabled(!listUI.isEmpty());
47855167 }
47865168
47875169 void refreshContents(boolean cp)
47885170 {
4789
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
5171
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
47905172 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47915173 {
47925174 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5632,6 +6014,22 @@
56326014 cButton loopButton;
56336015 cButton textureButton;
56346016
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
+
56356033 cButton gridButton;
56366034 cButton boxButton;
56376035 cButton sphereButton;
....@@ -5695,7 +6093,7 @@
56956093 private MenuItem pasteLinkItem;
56966094 private MenuItem pasteCloneItem;
56976095 private MenuItem pasteExpandItem;
5698
- private MenuItem clearItem;
6096
+ private MenuItem deleteItem;
56996097 private MenuItem clearAllItem;
57006098 private MenuItem genUVItem;
57016099 private MenuItem genNormalsMESHItem;
....@@ -5779,6 +6177,8 @@
57796177 private MenuItem attachBumpItem;
57806178 private MenuItem detachBumpItem;
57816179 private MenuItem pigmentBumpItem;
6180
+ private MenuItem embedTexturesItem;
6181
+ private MenuItem deEmbedTexturesItem;
57826182
57836183 private MenuItem particleItem;
57846184 private MenuItem ragdollItem;