Normand Briere
2019-08-01 90c87ae87a6d1b88ed8398da7bb95629f0df5b09
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.versions == null)
360
+ {
361
+ copy.versions = new byte[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.versions == null)
387
+ {
388
+ copy.versions = new byte[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)
....@@ -150,11 +465,19 @@
150465
151466 void SetupMenu2(GroupEditor oe)
152467 {
468
+ oe.jTree = new cTree();
469
+
153470 Menu menu;
154471 oe.menuBar.add(menu = new Menu("Edit"));
155472 //editItem = menu.add(new MenuItem("Edit"));
156473 //editItem.addActionListener(this);
157
- duplicateItem = menu.add(new MenuItem("Duplicate"));
474
+
475
+// undoItem = menu.add(new MenuItem("Undo"));
476
+// undoItem.addActionListener(this);
477
+// redoItem = menu.add(new MenuItem("Redo"));
478
+// redoItem.addActionListener(this);
479
+// menu.add("-");
480
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
158481 duplicateItem.addActionListener(this);
159482 cloneItem = menu.add(new MenuItem("Clone"));
160483 cloneItem.addActionListener(this);
....@@ -170,7 +493,6 @@
170493 copyItem.addActionListener(this);
171494 pasteItem = menu.add(new MenuItem("Paste"));
172495 pasteItem.addActionListener(this);
173
- menu.add("-");
174496
175497 menu.add("-");
176498 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -182,8 +504,8 @@
182504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183505 // pasteExpandItem.addActionListener(this);
184506 menu.add("-");
185
- clearItem = menu.add(new MenuItem("Clear"));
186
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
187509
188510 if (Globals.ADVANCED)
189511 {
....@@ -197,23 +519,23 @@
197519 //zBufferItem.addActionListener(this);
198520 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199521 //normalLensItem.addActionListener(this);
200
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
- revertCameraItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
202524
203
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
- toggleFullScreenItem.addItemListener(this);
205
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
- cameraMenu.add("-");
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
207537
208
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
- toggleTextureItem.addItemListener(this);
210
- toggleTextureItem.setState(CameraPane.textureon);
211
-
212
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
- toggleSwitchItem.addItemListener(this);
214
- toggleSwitchItem.setState(CameraPane.SWITCH);
215
-
216
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
217539 toggleHandleItem.addItemListener(this);
218540 toggleHandleItem.setState(CameraPane.HANDLES);
219541
....@@ -240,7 +562,7 @@
240562
241563 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242564 toggleDebugItem.addItemListener(this);
243
- toggleDebugItem.setState(CameraPane.DEBUG);
565
+ toggleDebugItem.setState(Globals.DEBUG);
244566
245567 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246568 toggleFrustumItem.addItemListener(this);
....@@ -261,14 +583,14 @@
261583 // animationItem.addItemListener(this);
262584 // animationItem.setState(CameraPane.ANIMATION);
263585 cameraMenu.add("-");
264
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
586
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
265587 editCameraItem.addActionListener(this);
266588
267589 if (Globals.ADVANCED)
268590 {
269591 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
270592 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
271
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
272594 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
273595 oe.cameraMenu.add("-");
274596 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -276,7 +598,7 @@
276598 editLeafItem.addActionListener(this);
277599 lookAtItem.addActionListener(this);
278600 //lookFromItem.addActinoListener(this);
279
- //switchItem.addActionListener(this);
601
+ //switchViewItem.addActionListener(this);
280602 }
281603
282604 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -321,21 +643,29 @@
321643 }
322644
323645 oe.menuBar.add(menu = new Menu("Group"));
324
- grabItem = menu.add(new MenuItem("Grab"));
325
- grabItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
326648 backItem = menu.add(new MenuItem("Back"));
327649 backItem.addActionListener(this);
328650 frontItem = menu.add(new MenuItem("Front"));
329651 frontItem.addActionListener(this);
330
- compositeItem = menu.add(new MenuItem("Composite"));
331
- compositeItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
332657 hideItem = menu.add(new MenuItem("Hidden Group"));
333658 hideItem.addActionListener(this);
659
+ }
334660 ungroupItem = menu.add(new MenuItem("Ungroup"));
335661 ungroupItem.addActionListener(this);
336
- menu.add("-");
337
- randomItem = menu.add(new MenuItem("Switch node"));
338
- randomItem.addActionListener(this);
662
+
663
+// menu.add("-");
664
+//
665
+// switchItem = menu.add(new MenuItem("Switch node"));
666
+// switchItem.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
339669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
340670 switchGeoItem.addActionListener(this);
341671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -343,8 +673,6 @@
343673 morphItem = menu.add(new MenuItem("Morph Group"));
344674 morphItem.addActionListener(this);
345675
346
- if (Globals.ADVANCED)
347
- {
348676 menu.add("-");
349677 physicsItem = menu.add(new MenuItem("Physics"));
350678 physicsItem.addActionListener(this);
....@@ -352,30 +680,29 @@
352680 frameselectorItem.addActionListener(this);
353681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
354682 scriptNodeItem.addActionListener(this);
355
- cameraItem = menu.add(new MenuItem("Camera"));
356
- cameraItem.addActionListener(this);
357683 }
358684
359685 oe.menuBar.add(menu = new Menu("Object"));
360
- textureItem = menu.add(new MenuItem("Texture"));
361
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
362688 billboardItem = menu.add(new MenuItem("Billboard"));
363689 billboardItem.addActionListener(this);
364690 csgItem = menu.add(new MenuItem("CSG"));
365691 csgItem.addActionListener(this);
366
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
367693 shadowXItem.addActionListener(this);
368
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
369695 shadowYItem.addActionListener(this);
370
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
371697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
372701 if (Globals.ADVANCED)
373702 {
374703 menu.add("-");
375704 linkerItem = menu.add(new MenuItem("Linker"));
376705 linkerItem.addActionListener(this);
377
- attributeItem = menu.add(new MenuItem("Attribute"));
378
- attributeItem.addActionListener(this);
379706 templateItem = menu.add(new MenuItem("Template"));
380707 templateItem.addActionListener(this);
381708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -404,7 +731,7 @@
404731 genNormalsMESHItem.addActionListener(this);
405732 if (Globals.ADVANCED)
406733 {
407
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
408735 genNormalsMINEItem.addActionListener(this);
409736 }
410737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -464,6 +791,14 @@
464791 markleavesItem.addActionListener(this);
465792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
466793 unmarkleavesItem.addActionListener(this);
794
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
795
+ rewindleavesItem.addActionListener(this);
796
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
797
+ unrewindleavesItem.addActionListener(this);
798
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
799
+ randomleavesItem.addActionListener(this);
800
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
801
+ unrandomleavesItem.addActionListener(this);
467802 menu.add("-");
468803 flipVItem = menu.add(new MenuItem("Flip V"));
469804 flipVItem.addActionListener(this);
....@@ -489,10 +824,15 @@
489824 attachBumpItem.addActionListener(this);
490825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
491826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
492828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
493829 detachPigmentItem.addActionListener(this);
494830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
495831 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);
496836 menu.add("-");
497837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
498838 sortbysizeItem.addActionListener(this);
....@@ -519,8 +859,21 @@
519859 buildToolsMenu(menu);
520860 }
521861
862
+
522863 void SetupUI2(ObjEditor oe)
523864 {
865
+ // June 2019
866
+ if (oe == null)
867
+ {
868
+ //super.SetupUI2(this);
869
+ //return;
870
+ }
871
+
872
+ if (copy != group)
873
+ {
874
+ //super.SetupUI2(this);
875
+ }
876
+
524877 //new Exception().printStackTrace();
525878
526879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -549,27 +902,79 @@
549902 oe.radioPanel.add(dummyButton);
550903 oe.buttonGroup.add(dummyButton);
551904 */
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
908
+
552909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
553910
554
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
911
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
912
+ //minButton.setToolTipText("Minimize window");
913
+ //minButton.addActionListener(this);
914
+
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
+ }
921
+
922
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ fullButton.setToolTipText("Full-screen window");
924
+ fullButton.addActionListener(this);
925
+
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
933
+
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("New version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
555962 liveCB.setToolTipText("Enable animation");
556963 liveCB.addItemListener(this);
557964
558
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559966 oneStepButton.setToolTipText("Animate one step forward");
560967 oneStepButton.addActionListener(this);
561968
562
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
563970 fastCB.setToolTipText("Fast mode");
564971 fastCB.addItemListener(this);
565972
566
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
- trackCB.setToolTipText("Enable tracking");
568
- trackCB.addItemListener(this);
569
-
570
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
- screenfitButton.setToolTipText("Screen fit");
572
- screenfitButton.addActionListener(this);
973
+ //oe.toolboxPanel.Return();
974
+
975
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
976
+// trackCB.setToolTipText("Enable tracking");
977
+// trackCB.addItemListener(this);
573978
574979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
575980 // screenfitpointButton.addActionListener(this);
....@@ -579,67 +984,156 @@
579984 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580985 snapobjectButton.addActionListener(this);
581986 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");
582991 }
583992
584
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
- flashSelectionButton.setToolTipText("Show selection");
586
- flashSelectionButton.addActionListener(this);
993
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
587994
588
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589
-
590
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
- 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");
592997 twoButton.addActionListener(this);
593
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- fourButton.addActionListener(this);
595
- fourButton.setToolTipText("Show left panel only");
596
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
- sixButton.setToolTipText("2-column layout left");
598
- sixButton.addActionListener(this);
599
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- threeButton.setToolTipText("2-column layout right");
998
+ this.fullscreenLayout = twoButton;
999
+
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
6011002 threeButton.addActionListener(this);
602
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
- sevenButton.setToolTipText("3-column layout");
604
- 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);
6051009 //
6061010
607
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- 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");
6091013 rootButton.addActionListener(this);
6101014
611
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1015
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6121016 closeButton.setToolTipText("Close tab");
6131017 closeButton.addActionListener(this);
6141018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6151019 //clearButton.addActionListener(this);
616
-
617
- cGridBag commandsPanel = new cGridBag();
1020
+
1021
+ cGridBag row1 = new cGridBag();
6181022
619
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
- editButton.setToolTipText("Edit selection");
1023
+ // INSERT
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ gridButton.setToolTipText("Create grid");
1026
+ gridButton.addActionListener(this);
1027
+
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ boxButton.setToolTipText("Create box");
1030
+ boxButton.addActionListener(this);
1031
+
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ sphereButton.setToolTipText("Create sphere");
1034
+ sphereButton.addActionListener(this);
1035
+
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ coneButton.setToolTipText("Create cone");
1038
+ coneButton.addActionListener(this);
1039
+
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ torusButton.setToolTipText("Create torus");
1042
+ torusButton.addActionListener(this);
1043
+
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ superButton.setToolTipText("Create superellipsoid");
1046
+ superButton.addActionListener(this);
1047
+
1048
+ if (Globals.ADVANCED)
1049
+ {
1050
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ kleinButton.setToolTipText("Create Klein bottle");
1052
+ kleinButton.addActionListener(this);
1053
+ }
1054
+
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ particlesButton.setToolTipText("Create particle system");
1057
+ particlesButton.addActionListener(this);
1058
+
1059
+ oe.toolboxPanel.add(row1);
1060
+
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ groupButton.setToolTipText("Create group");
1065
+ groupButton.addActionListener(this);
1066
+
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ compositeButton.setToolTipText("Create composite");
1069
+ compositeButton.addActionListener(this);
1070
+
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
1073
+ switchButton.addActionListener(this);
1074
+
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ loopButton.setToolTipText("Create loop");
1077
+ loopButton.addActionListener(this);
1078
+
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ textureButton.setToolTipText("Create texture");
1081
+ textureButton.addActionListener(this);
1082
+
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ overlayButton.setToolTipText("Create overlay");
1085
+ overlayButton.addActionListener(this);
1086
+
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ lightButton.setToolTipText("Create light");
1089
+ lightButton.addActionListener(this);
1090
+
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);
1106
+
1107
+ // EDIT panel
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
6211110 editButton.addActionListener(this);
6221111
623
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
- uneditButton.setToolTipText("Unedit selection");
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
6251114 uneditButton.addActionListener(this);
6261115
627
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
- allParamsButton.setToolTipText("Edit all params");
1116
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
+ allParamsButton.setToolTipText("Show all controle");
6291118 allParamsButton.addActionListener(this);
6301119
631
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6321121 clearPanelButton.setToolTipText("Clear edit panel");
6331122 clearPanelButton.addActionListener(this);
6341123
635
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6361125 unselectButton.setToolTipText("Unselect");
6371126 unselectButton.addActionListener(this);
6381127
639
- commandsPanel.preferredHeight = 1;
1128
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ flashSelectionButton.setToolTipText("Highlight selection");
1130
+ flashSelectionButton.addActionListener(this);
6401131
641
- oe.treePanel.add(commandsPanel);
642
- oe.treePanel.Return();
1132
+ editCommandsPanel.preferredHeight = 1;
1133
+
1134
+ SetPinStates(false);
1135
+// oe.treePanel.add(commandsPanel);
1136
+// oe.treePanel.Return();
6431137
6441138 // oe.aConstraints.gridx += 1;
6451139 // oe.aConstraints.weighty = 0;
....@@ -656,32 +1150,20 @@
6561150
6571151 JScrollPane jSP;
6581152 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
659
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6601154 ResetModel();
6611155
6621156 oe.treePanel.add(jSPPanel);
6631157 oe.treePanel.Return();
6641158
665
- cGridBag copyOptionsPanel = new cGridBag();
666
-
667
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
- colorCB.setToolTipText("Copy color when dropped");
669
- colorCB.addItemListener(this);
670
-
671
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
- materialCB.setToolTipText("Copy material when dropped");
673
- materialCB.addItemListener(this);
674
-
675
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
- textureCB.setToolTipText("Copy texture when dropped");
677
- textureCB.addItemListener(this);
678
-
679
- copyOptionsPanel.preferredHeight = 1;
6801159 oe.treePanel.add(copyOptionsPanel);
6811160 oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
6821164
683
-// mainPanel.setDividerLocation(0.5); //1.0);
684
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
6851167
6861168 //jList.addListSelectionListener(this);
6871169 oe.jTree.addTreeSelectionListener(this);
....@@ -689,7 +1171,7 @@
6891171 //jTree.setEditable(true);
6901172 oe.jTree.setDragEnabled(true);
6911173 //jTree.setPreferredSize(new Dimension(10,10));
692
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6931175
6941176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6951177
....@@ -701,29 +1183,49 @@
7011183 dgr.addDragGestureListener(this);
7021184 }catch(Exception e) {}
7031185 */
704
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
7051187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
7061188 }
7071189
7081190 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
7091191 {
1192
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1193
+ colorCB.setToolTipText("Copy color when dropped");
1194
+ colorCB.addItemListener(this);
1195
+
1196
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1197
+ materialCB.setToolTipText("Copy material when dropped");
1198
+ materialCB.addItemListener(this);
1199
+
1200
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1201
+ textureCB.setToolTipText("Copy texture when dropped");
1202
+ textureCB.addItemListener(this);
1203
+
1204
+ panel.Return();
1205
+
7101206 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
7111207 boxCB.setToolTipText("Display bounding boxes");
7121208 boxCB.addItemListener(this);
7131209
7141210 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
7161212 zoomBoxCB.addItemListener(this);
7171213
7181214 if (true) // Globals.ADVANCED)
7191215 {
720
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
- supportCB.setToolTipText("Enable rigging");
722
- supportCB.addItemListener(this);
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
7231223
7241224 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
7251225 // localCB.addItemListener(this);
7261226
1227
+ panel.Return();
1228
+
7271229 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
7281230 crowdCB.setToolTipText("Used for crowds");
7291231 crowdCB.addItemListener(this);
....@@ -740,6 +1242,8 @@
7401242 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
7411243 // speakerMocapCB.addItemListener(this);
7421244
1245
+ panel.Return();
1246
+
7431247 if (false)
7441248 {
7451249 // handled in scripts
....@@ -754,34 +1258,74 @@
7541258 //constraints.gridy += 1;
7551259 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
7561260 smoothfocusCB.addItemListener(this);
1261
+ panel.Return();
7571262 }
7581263
7591264 //constraints.gridx += 1;
7601265 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
7611266 // debugCB.addItemListener(this);
7621267
1268
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1269
+ trackCB.setToolTipText("Enable tracking target");
1270
+ trackCB.addItemListener(this);
1271
+
7631272 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1273
+ oeilCB.setToolTipText("Move camera when tracking");
7641274 oeilCB.addItemListener(this);
7651275
1276
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1277
+ shadowCB.setToolTipText("When live compute shadows");
1278
+ shadowCB.addItemListener(this);
1279
+
1280
+ panel.Return();
1281
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1282
+ toggleTextureCB.setToolTipText("Load textures");
1283
+ toggleTextureCB.addItemListener(this);
1284
+
1285
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1286
+ toggleSwitchCB.setToolTipText("Choose a single item");
1287
+ toggleSwitchCB.addItemListener(this);
1288
+
1289
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1290
+ autokeepCB.setToolTipText("On structure change");
1291
+ autokeepCB.addItemListener(this);
1292
+
1293
+ panel.Return();
1294
+ if (Globals.ADVANCED)
1295
+ {
7661296 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7671297 lookAtCB.setToolTipText("Look-at target");
7681298 lookAtCB.addItemListener(this);
1299
+ }
7691300
7701301 }
7711302
7721303 cGridBag fill = new cGridBag();
773
-
7741304 fill.preferredHeight = 200;
1305
+ cGridBag fill2 = new cGridBag();
1306
+ fill2.preferredHeight = 200;
1307
+ cGridBag fill3 = new cGridBag();
1308
+ fill3.preferredHeight = 200;
7751309
7761310 panel.add(fill);
1311
+ panel.add(fill2);
1312
+ panel.add(fill3);
7771313
7781314 }
7791315
7801316 void EditObject(Object3D obj)
7811317 {
7821318 cRadio radioButton = new cRadio(obj.name);
1319
+
1320
+ // June 2019. Patch to avoid bug with transparency.
1321
+ radioButton.hadMaterial = obj.material != null;
1322
+ if (!radioButton.hadMaterial)
1323
+ {
1324
+ obj.material = new cMaterial();
1325
+ }
1326
+
7831327 radioButton.SetObject(obj);
784
- radioButton.layout = sevenButton;
1328
+ radioButton.layout = sixButton; // sevenButton;
7851329 radioButton.SetCamera(cameraView.renderCamera, false);
7861330 radioButton.addActionListener(this);
7871331 radioPanel.add(radioButton);
....@@ -791,6 +1335,8 @@
7911335
7921336 void SetupViews(ObjEditor oe)
7931337 {
1338
+ theFrame = this;
1339
+
7941340 oe.SetupViews();
7951341
7961342 System.out.println("SetupViews");
....@@ -799,23 +1345,28 @@
7991345 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8001346 }
8011347
802
- JCheckBox liveCB;
803
- JCheckBox supportCB;
804
- JCheckBox localCB;
805
- JCheckBox crowdCB;
806
- JCheckBox smoothCB;
807
- JCheckBox fastCB;
808
- JCheckBox slowCB;
809
- JCheckBox boxCB;
810
- JCheckBox zoomBoxCB;
811
- JCheckBox trackCB;
812
- JCheckBox smoothfocusCB;
1348
+ cToggleButton liveCB;
1349
+ cCheckBox supportCB;
1350
+ cCheckBox localCB;
1351
+ cCheckBox crowdCB;
1352
+ cCheckBox smoothCB;
1353
+ cToggleButton fastCB;
1354
+ cCheckBox slowCB;
1355
+ cCheckBox boxCB;
1356
+ cCheckBox zoomBoxCB;
1357
+ cCheckBox freezeCB;
1358
+ //cToggleButton trackCB;
1359
+ cCheckBox trackCB;
1360
+ cCheckBox smoothfocusCB;
8131361 // JCheckBox speakerMocapCB;
814
- JCheckBox speakerCameraCB;
815
- JCheckBox speakerFocusCB;
816
- JCheckBox debugCB;
817
- JCheckBox oeilCB;
818
- JCheckBox lookAtCB;
1362
+ cCheckBox speakerCameraCB;
1363
+ cCheckBox speakerFocusCB;
1364
+ cCheckBox debugCB;
1365
+
1366
+ cCheckBox oeilCB;
1367
+ cCheckBox shadowCB;
1368
+ cCheckBox autokeepCB;
1369
+ cCheckBox lookAtCB;
8191370
8201371 // static int COLOR = 1;
8211372 // static int MATERIAL = 2;
....@@ -823,9 +1374,9 @@
8231374
8241375 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8251376
826
- JCheckBox colorCB;
827
- JCheckBox materialCB;
828
- JCheckBox textureCB;
1377
+ cCheckBox colorCB;
1378
+ cCheckBox materialCB;
1379
+ cCheckBox textureCB;
8291380
8301381 public void itemStateChanged(ItemEvent e)
8311382 {
....@@ -853,6 +1404,7 @@
8531404 } else if(e.getSource() == liveCB)
8541405 {
8551406 cameraView.ToggleLive();
1407
+ refreshContents(false);
8561408 }
8571409 else if(e.getSource() == supportCB)
8581410 {
....@@ -917,6 +1469,18 @@
9171469 {
9181470 cameraView.ToggleOeil();
9191471 }
1472
+ else if(e.getSource() == shadowCB)
1473
+ {
1474
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1475
+ }
1476
+ else if(e.getSource() == freezeCB)
1477
+ {
1478
+ Globals.FREEZEONMOVE ^= true;
1479
+ }
1480
+ else if(e.getSource() == autokeepCB)
1481
+ {
1482
+ Globals.REPLACEONMAKE ^= true;
1483
+ }
9201484 else if(e.getSource() == lookAtCB)
9211485 {
9221486 cameraView.ToggleLookAt();
....@@ -933,7 +1497,8 @@
9331497
9341498 /**/
9351499 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
936
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1500
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1501
+ TreePath path = objEditor.jTree.getSelectionPath();
9371502 if ((path == null) || (path.getPathCount() <= 1)) {
9381503 // We can't move the root node or an empty selection
9391504 return;
....@@ -996,8 +1561,6 @@
9961561 }
9971562 }
9981563
999
- String string = (String) object;
1000
-
10011564 System.out.println("Transfer = " + object + "; drop : " + target);
10021565 // if( object instanceof java.io.File[])
10031566 // {
....@@ -1005,6 +1568,8 @@
10051568 // objEditor.DropFile((java.io.File[]) object, true);
10061569 // return;
10071570 // }
1571
+
1572
+ String string = object.toString();
10081573
10091574 // File path for Mac and Windows
10101575 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1050,23 +1615,33 @@
10501615
10511616 assert target == objEditor.jTree;
10521617 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1618
+ Object3D destinationLeaf;
10531619 try {
1054
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1620
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10551621 } catch (Exception e) {
10561622 System.out.println("destinationPath : " + destinationPath);
10571623 return;
10581624 }
10591625
1060
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1626
+ for (int i=group.selection.size(); --i>=0;)
10611627 {
1628
+ Object3D child = (Object3D)group.selection.elementAt(i);
1629
+
1630
+ // Cannot move into itself
1631
+ if (child == destinationLeaf)
1632
+ return;
1633
+ }
1634
+
1635
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1636
+// {
10621637 loadClipboard(true);
10631638 objEditor.jTree.setSelectionPath(destinationPath);
10641639 pasteInto(false, false);
1065
- } else {
1066
- loadClipboard(false);
1067
- objEditor.jTree.setSelectionPath(destinationPath);
1068
- pasteInto(false, false); // true); // ???
1069
- }
1640
+// } else {
1641
+// loadClipboard(false);
1642
+// objEditor.jTree.setSelectionPath(destinationPath);
1643
+// pasteInto(false, false); // true); // ???
1644
+// }
10701645 }
10711646 public void dropActionChanged(DropTargetDragEvent dtde)
10721647 // Called if the user has modified the current drop gesture
....@@ -1171,22 +1746,30 @@
11711746 {
11721747 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11731748 //heightFieldItem.addActionListener(this);
1174
- gridItem = menu.add(new MenuItem("Grid"));
1175
- gridItem.addActionListener(this);
1176
- rectoidItem = menu.add(new MenuItem("Box"));
1177
- rectoidItem.addActionListener(this);
1178
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1179
- ellipsoidItem.addActionListener(this);
1180
- coneItem = menu.add(new MenuItem("Cone"));
1181
- coneItem.addActionListener(this);
1182
- torusItem = menu.add(new MenuItem("Torus"));
1183
- torusItem.addActionListener(this);
1184
- superItem = menu.add(new MenuItem("Superellipsoid"));
1185
- superItem.addActionListener(this);
1749
+// gridItem = menu.add(new MenuItem("Grid"));
1750
+// gridItem.addActionListener(this);
1751
+// rectoidItem = menu.add(new MenuItem("Box"));
1752
+// rectoidItem.addActionListener(this);
1753
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1754
+// ellipsoidItem.addActionListener(this);
1755
+// coneItem = menu.add(new MenuItem("Cone"));
1756
+// coneItem.addActionListener(this);
1757
+// torusItem = menu.add(new MenuItem("Torus"));
1758
+// torusItem.addActionListener(this);
1759
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1760
+// superItem.addActionListener(this);
1761
+
1762
+ cameraItem = menu.add(new MenuItem("Camera"));
1763
+ cameraItem.addActionListener(this);
1764
+
1765
+ if (!Globals.ADVANCED)
1766
+ {
11861767 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11871768 kleinItem.addActionListener(this);
1188
- particleItem = menu.add(new MenuItem("Particle system"));
1189
- particleItem.addActionListener(this);
1769
+ }
1770
+
1771
+// particleItem = menu.add(new MenuItem("Particle system"));
1772
+// particleItem.addActionListener(this);
11901773 if (Globals.ADVANCED)
11911774 {
11921775 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1212,15 +1795,15 @@
12121795 }
12131796 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12141797 bezierItem.addActionListener(this);
1215
- overlayItem = menu.add(new MenuItem("Overlay"));
1216
- overlayItem.addActionListener(this);
1217
- lightItem = menu.add(new MenuItem("Light"));
1218
- lightItem.addActionListener(this);
1798
+// overlayItem = menu.add(new MenuItem("Overlay"));
1799
+// overlayItem.addActionListener(this);
1800
+// lightItem = menu.add(new MenuItem("Light"));
1801
+// lightItem.addActionListener(this);
12191802 menu.add("-");
12201803 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12211804 //superLoopItem.addActionListener(this);
1222
- loopItem = menu.add(new MenuItem("Loop"));
1223
- loopItem.addActionListener(this);
1805
+// loopItem = menu.add(new MenuItem("Loop"));
1806
+// loopItem.addActionListener(this);
12241807 doubleItem = menu.add(new MenuItem("Fork"));
12251808 doubleItem.addActionListener(this);
12261809 if (Globals.ADVANCED)
....@@ -1236,6 +1819,9 @@
12361819 animationItem.addItemListener(this);
12371820 animationItem.setState(Globals.ANIMATION);
12381821
1822
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1823
+ archiveItem.addActionListener(this);
1824
+
12391825 menu.add("-");
12401826 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12411827 parseverticesItem.addActionListener(this);
....@@ -1248,6 +1834,8 @@
12481834 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12491835 reduce34MorphItem.addActionListener(this);
12501836 menu.add("-");
1837
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1838
+ memoryItem.addActionListener(this);
12511839 menu.add(computeAOItem = new MenuItem("Compute AO"));
12521840 computeAOItem.addActionListener(this);
12531841
....@@ -1256,11 +1844,9 @@
12561844 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12571845 mirrorItem.addActionListener(this);
12581846 menu.add("-");
1259
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1260
- memoryItem.addActionListener(this);
12611847 menu.add(analyzeItem = new MenuItem("Analyze"));
12621848 analyzeItem.addActionListener(this);
1263
- menu.add(dumpItem = new MenuItem("Dump"));
1849
+ menu.add(dumpItem = new MenuItem("Print"));
12641850 dumpItem.addActionListener(this);
12651851 // menu.add(pathItem = new MenuItem("From-to path"));
12661852 // pathItem.addActionListener(this);
....@@ -1401,9 +1987,34 @@
14011987 shadow.material = new cMaterial(obj.material);
14021988 shadow.material.diffuse = 0.0001f;
14031989 shadow.material.specular = 0.0001f;
1990
+ //shadow.projectedVertices[1].x = 300;
14041991
14051992 makeSomething(shadow);
14061993 }
1994
+
1995
+ private void ClearUnpinned()
1996
+ {
1997
+ //for (Object3D obj : listUI)
1998
+ for (int i=listUI.size(); --i>=0;)
1999
+ {
2000
+ Object3D obj = listUI.elementAt(i);
2001
+ if (!obj.pinned)
2002
+ {
2003
+ obj.CloseUI();
2004
+ listUI.remove(i);
2005
+ }
2006
+ }
2007
+ }
2008
+
2009
+ private void EditElement(Object3D elem, boolean newWindow)
2010
+ {
2011
+ // if (!(elem instanceof Composite))
2012
+ // newWindow = false;
2013
+ listUI.add(elem);
2014
+ elem.openEditWindow(this, newWindow); //, false);
2015
+ System.out.println("edit : " + elem);
2016
+ elem.editWindow.refreshContents(true); // ? new
2017
+ }
14072018
14082019 /**
14092020 * applyExample
....@@ -1648,7 +2259,7 @@
16482259 {
16492260 ScreenFit();
16502261 } else
1651
- if (source == switchItem)
2262
+ if (source == switchViewItem)
16522263 {
16532264 cVector v1 = new cVector();
16542265 cVector v2 = new cVector();
....@@ -1657,11 +2268,11 @@
16572268 objEditor.cameraView.renderCamera.setAim(v2, v1);
16582269 objEditor.cameraView.repaint();
16592270 } else
1660
- if (source == rectoidItem)
2271
+ if (source == rectoidItem || source == boxButton)
16612272 {
16622273 makeSomething(new Box());
16632274 } else
1664
- if (source == particleItem)
2275
+ if (source == particleItem || source == particlesButton)
16652276 {
16662277 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16672278 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1740,27 +2351,27 @@
17402351
17412352 makeSomething(obj);
17422353 } else
1743
- if (source == gridItem)
2354
+ if (source == gridItem || source == gridButton)
17442355 {
17452356 makeSomething(new Grid());
17462357 } else
1747
- if (source == ellipsoidItem)
2358
+ if (source == ellipsoidItem || source == sphereButton)
17482359 {
17492360 makeSomething(new Sphere());
17502361 } else
1751
- if (source == coneItem)
2362
+ if (source == coneItem || source == coneButton)
17522363 {
17532364 makeSomething(new Cone());
17542365 } else
1755
- if (source == torusItem)
2366
+ if (source == torusItem || source == torusButton)
17562367 {
17572368 makeSomething(new Torus());
17582369 } else
1759
- if (source == superItem)
2370
+ if (source == superItem || source == superButton)
17602371 {
17612372 makeSomething(new Superellipsoid());
17622373 } else
1763
- if (source == kleinItem)
2374
+ if (source == kleinItem || source == kleinButton)
17642375 {
17652376 makeSomething(new Klein());
17662377 } else
....@@ -1780,7 +2391,7 @@
17802391 {
17812392 makeSomething(new BezierSurface());
17822393 } else
1783
- if (source == overlayItem)
2394
+ if (source == overlayItem || source == overlayButton)
17842395 {
17852396 /*
17862397 Object3D obj = new BezierSurface(5,8);
....@@ -1828,10 +2439,27 @@
18282439 s.setup();
18292440 makeSomething(s);
18302441 } else
1831
- if (source == lightItem)
2442
+ if (source == lightItem || source == lightButton)
18322443 {
18332444 makeSomething(new Light());
18342445 } else
2446
+// if (source == skybox1Button ||
2447
+// source == skybox2Button ||
2448
+// source == skybox3Button ||
2449
+// source == skybox4Button ||
2450
+// source == skybox5Button ||
2451
+// source == skybox6Button ||
2452
+// source == skybox7Button ||
2453
+// source == skybox11Button ||
2454
+// source == skybox12Button ||
2455
+// source == skybox13Button ||
2456
+// source == skybox14Button ||
2457
+// source == skybox15Button ||
2458
+// source == skybox16Button ||
2459
+// source == skybox17Button)
2460
+// {
2461
+// ChangeSkybox(source);
2462
+// } else
18352463 if (source == csgItem)
18362464 {
18372465 group(new CSG());
....@@ -1878,30 +2506,30 @@
18782506
18792507 group(g);
18802508 } else
1881
- if (source == loopItem)
2509
+ if (source == loopItem || source == loopButton)
18822510 {
18832511 Composite csg = new GroupLeaf();
18842512 csg.count = 5;
18852513 group(csg);
1886
- Composite child = new cGroup();
2514
+ Composite child = new cGroup("Branch");
18872515 csg.addChild(child);
18882516 child.addChild(csg);
18892517 } else
18902518 if (source == doubleItem)
18912519 {
1892
- Composite csg = new GroupLeaf();
2520
+ Composite csg = new GroupLeaf("Fork");
18932521 csg.count = 5;
18942522 group(csg);
1895
- Composite child = new cGroup();
2523
+ Composite child = new cGroup("Branch A");
18962524 csg.addChild(child);
18972525 child.addChild(csg);
1898
- child = new cGroup();
2526
+ child = new cGroup("Branch B");
18992527 csg.addChild(child);
19002528 child.addChild(csg);
19012529 } else
19022530 if (source == tripleItem)
19032531 {
1904
- Composite csg = new GroupLeaf();
2532
+ Composite csg = new GroupLeaf("Trident");
19052533 csg.count = 4;
19062534 group(csg);
19072535 Composite child = new cGroup();
....@@ -1917,7 +2545,7 @@
19172545 if (source == computeAOItem)
19182546 {
19192547 Globals.drawMode = CameraPane.OCCLUSION;
1920
- Globals.theRenderer.repaint();
2548
+ cameraView.repaint();
19212549 } else
19222550 if (source == recompileItem)
19232551 {
....@@ -1951,6 +2579,46 @@
19512579 {
19522580 DumpObject();
19532581 } else
2582
+ if (source == minButton)
2583
+ {
2584
+ Minimize();
2585
+ } else
2586
+ if (source == maxButton)
2587
+ {
2588
+ Maximize();
2589
+ } else
2590
+ if (source == fullButton)
2591
+ {
2592
+ ToggleFullScreen();
2593
+ } else
2594
+ if (source == undoButton)
2595
+ {
2596
+ // Go to previous version
2597
+ //if (!Undo())
2598
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2599
+ Undo();
2600
+ } else
2601
+ if (source == restoreButton)
2602
+ {
2603
+ // Restore current version
2604
+ Restore();
2605
+ } else
2606
+ if (source == replaceButton)
2607
+ {
2608
+ // Overwrite current version
2609
+ Replace();
2610
+ } else
2611
+ if (source == redoButton)
2612
+ {
2613
+ // Go to next version
2614
+ Redo();
2615
+ } else
2616
+ if (source == saveButton)
2617
+ {
2618
+ // Save a new version
2619
+ if (!Save(true))
2620
+ java.awt.Toolkit.getDefaultToolkit().beep();
2621
+ } else
19542622 if (source == oneStepButton)
19552623 {
19562624 Globals.ONESTEP = true;
....@@ -1958,17 +2626,14 @@
19582626 } else
19592627 if (source == screenfitButton)
19602628 {
1961
- //Reload(lastConverter, lastFilename, true);
19622629 ScreenFit();
19632630 } else
19642631 if (source == screenfitpointButton)
19652632 {
1966
- //Reload(lastConverter, lastFilename, true);
19672633 ScreenFitPoint();
19682634 } else
19692635 if (source == snapobjectButton)
19702636 {
1971
- //Reload(lastConverter, lastFilename, true);
19722637 SnapObject();
19732638 } else
19742639 // if (event.getSource() == recompileButton)
....@@ -2004,6 +2669,14 @@
20042669 if (source == cutItem || source == clearButton)
20052670 {
20062671 loadClipboard(true);
2672
+ } else
2673
+ if (source == undoItem)
2674
+ {
2675
+ Undo();
2676
+ } else
2677
+ if (source == redoItem)
2678
+ {
2679
+ Redo();
20072680 } else
20082681 if (source == duplicateItem)
20092682 {
....@@ -2324,7 +2997,7 @@
23242997 {
23252998 StepAll();
23262999 } else
2327
- if (source == clearItem) // || event.getSource() == clearButton)
3000
+ if (source == deleteItem) // || event.getSource() == clearButton)
23283001 {
23293002 //int indices[] = jList.getSelectedIndices();
23303003 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2336,9 +3009,9 @@
23363009 {
23373010 ClearSelection(true);
23383011 } else
2339
- if (source == grabItem)
3012
+ if (source == grabItem || source == groupButton)
23403013 {
2341
- group(new cGroup(), true);
3014
+ group(new cGroup(), false); // true);
23423015 } else
23433016 if (source == hideItem)
23443017 {
....@@ -2356,11 +3029,11 @@
23563029 {
23573030 makeSomething(new Camera());
23583031 } else
2359
- if (source == compositeItem)
3032
+ if (source == compositeItem || source == compositeButton)
23603033 {
23613034 group(new Composite());
23623035 } else
2363
- if (source == randomItem)
3036
+ if (source == switchItem || source == switchButton)
23643037 {
23653038 RandomNode random = new RandomNode();
23663039 group(random);
....@@ -2462,7 +3135,7 @@
24623135 {
24633136 group(new cLinker());
24643137 } else
2465
- if (source == textureItem)
3138
+ if (source == textureItem || source == textureButton)
24663139 {
24673140 group(new TextureNode());
24683141 } else
....@@ -2482,17 +3155,30 @@
24823155 {
24833156 CastShadow(2);
24843157 } else
2485
- if (source == ungroupItem)
3158
+ if (source == ungroupItem || source == ungroupButton)
24863159 {
2487
- //ungroup();
3160
+ boolean hasRoot = false;
3161
+
24883162 for (int i=0; i<group.selection.size(); i++)
24893163 {
2490
- Ungroup(group.selection.get(i));
3164
+ if (group.selection.get(i) == group)
3165
+ {
3166
+ hasRoot = true;
3167
+ break;
3168
+ }
24913169 }
24923170
2493
- ClearSelection(false);
2494
-
2495
- refreshContents();
3171
+ if (!hasRoot)
3172
+ {
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ Ungroup(group.selection.get(i));
3176
+ }
3177
+
3178
+ ClearSelection(false);
3179
+
3180
+ refreshContents();
3181
+ }
24963182 } else
24973183 if (source == genUVItem)
24983184 {
....@@ -2504,7 +3190,7 @@
25043190 } else
25053191 if (source == genNormalsMESHItem)
25063192 {
2507
- GenNormals(true); // TODO
3193
+ GenNormalsMESH();
25083194 } else
25093195 if (source == genNormalsORGANItem)
25103196 {
....@@ -2569,6 +3255,22 @@
25693255 if (source == unmarkleavesItem)
25703256 {
25713257 MarkLeaves(false);
3258
+ } else
3259
+ if (source == rewindleavesItem)
3260
+ {
3261
+ RewindLeaves(true);
3262
+ } else
3263
+ if (source == unrewindleavesItem)
3264
+ {
3265
+ RewindLeaves(false);
3266
+ } else
3267
+ if (source == randomleavesItem)
3268
+ {
3269
+ RandomLeaves(true);
3270
+ } else
3271
+ if (source == unrandomleavesItem)
3272
+ {
3273
+ RandomLeaves(false);
25723274 } else
25733275 if (source == flipVItem)
25743276 {
....@@ -2777,7 +3479,7 @@
27773479 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27783480 {
27793481 obj = (Object3D)e.nextElement();
2780
- obj.SetBumpTexture(null);
3482
+ obj.ResetBumpTexture();
27813483 }
27823484
27833485 refreshContents();
....@@ -2793,6 +3495,31 @@
27933495
27943496 refreshContents();
27953497 } else
3498
+ if (source == embedTexturesItem)
3499
+ {
3500
+ Object3D obj;
3501
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3502
+ {
3503
+ obj = (Object3D)e.nextElement();
3504
+ obj.EmbedTextures(true);
3505
+ }
3506
+
3507
+ refreshContents();
3508
+ } else
3509
+ if (source == deEmbedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(false);
3516
+ }
3517
+
3518
+ CameraPane.texturepigment.clear();
3519
+ CameraPane.texturebump.clear();
3520
+
3521
+ refreshContents();
3522
+ } else
27963523 if (source == flashSelectionButton)
27973524 {
27983525 CameraPane.flash = true;
....@@ -2804,6 +3531,10 @@
28043531 if (source == twoButton)
28053532 {
28063533 radio.layout = twoButton;
3534
+
3535
+ if (CameraPane.FULLSCREEN)
3536
+ fullscreenLayout = radio.layout;
3537
+
28073538 // bug
28083539 //gridPanel.setDividerLocation(1.0);
28093540 //bigPanel.setDividerLocation(0.0);
....@@ -2836,10 +3567,31 @@
28363567 bigThree.ClearUI();
28373568 bigThree.add(centralPanel);
28383569 bigThree.FlushUI();
3570
+
3571
+ cameraView.requestFocusInWindow();
3572
+
3573
+// refreshContents(true);
3574
+//
3575
+// try
3576
+// {
3577
+// java.awt.Robot bot = new java.awt.Robot();
3578
+// int mask = InputEvent.BUTTON1_MASK;
3579
+// bot.mouseMove(100, 100);
3580
+// bot.mousePress(mask);
3581
+// bot.mouseRelease(mask);
3582
+// }
3583
+// catch (Exception e)
3584
+// {
3585
+//
3586
+// }
3587
+
28393588 } else
28403589 if (source == threeButton)
28413590 {
28423591 radio.layout = threeButton;
3592
+
3593
+ if (CameraPane.FULLSCREEN)
3594
+ fullscreenLayout = radio.layout;
28433595
28443596 // bigThree.remove(scenePanel);
28453597 // bigThree.remove(centralPanel);
....@@ -2869,13 +3621,18 @@
28693621 // centralPanel.setVisible(true);
28703622 // XYZPanel.setVisible(true);
28713623 bigThree.ClearUI();
3624
+ bigThree.add(scenePanel);
28723625 bigThree.add(centralPanel);
2873
- bigThree.add(XYZPanel);
28743626 bigThree.FlushUI();
3627
+
3628
+ cameraView.requestFocusInWindow();
28753629 } else
28763630 if (source == fourButton)
28773631 {
28783632 radio.layout = fourButton;
3633
+
3634
+ if (CameraPane.FULLSCREEN)
3635
+ fullscreenLayout = radio.layout;
28793636
28803637 // bigThree.remove(scenePanel);
28813638 // bigThree.remove(centralPanel);
....@@ -2907,10 +3664,15 @@
29073664 bigThree.ClearUI();
29083665 bigThree.add(scenePanel);
29093666 bigThree.FlushUI();
3667
+
3668
+ cameraView.requestFocusInWindow();
29103669 } else
29113670 if (source == sixButton)
29123671 {
29133672 radio.layout = sixButton;
3673
+
3674
+ if (CameraPane.FULLSCREEN)
3675
+ fullscreenLayout = radio.layout;
29143676
29153677 // bigThree.remove(scenePanel);
29163678 // bigThree.remove(centralPanel);
....@@ -2940,13 +3702,18 @@
29403702 // centralPanel.setVisible(true);
29413703 // XYZPanel.setVisible(false);
29423704 bigThree.ClearUI();
2943
- bigThree.add(scenePanel);
29443705 bigThree.add(centralPanel);
3706
+ bigThree.add(scenePanel);
29453707 bigThree.FlushUI();
3708
+
3709
+ cameraView.requestFocusInWindow();
29463710 } else
29473711 if (source == sevenButton)
29483712 {
29493713 radio.layout = sevenButton;
3714
+
3715
+ if (CameraPane.FULLSCREEN)
3716
+ fullscreenLayout = radio.layout;
29503717
29513718 // bigThree.remove(scenePanel);
29523719 // bigThree.remove(centralPanel);
....@@ -2980,6 +3747,8 @@
29803747 bigThree.add(centralPanel);
29813748 bigThree.add(XYZPanel);
29823749 bigThree.FlushUI();
3750
+
3751
+ cameraView.requestFocusInWindow();
29833752 } else
29843753 if (source == rootButton)
29853754 {
....@@ -2991,6 +3760,7 @@
29913760 EditObject(obj);
29923761 }
29933762
3763
+ cameraView.requestFocusInWindow();
29943764 refreshContents(true);
29953765 } else
29963766 if (source == closeButton)
....@@ -3000,22 +3770,37 @@
30003770 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30013771 {
30023772 ab = (cRadio)e.nextElement();
3003
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3773
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30043774 {
3775
+ // Patch to avoid bug with transparency.
3776
+ if (!ab.hadMaterial)
3777
+ {
3778
+ ab.object.material = null;
3779
+ }
3780
+
30053781 buttonGroup.remove(ab);
30063782 radioPanel.remove(ab);
30073783
3008
- ab.GetObject().editWindow = null;
3784
+ //ab.GetObject().editWindow = null;
3785
+ ab.GetObject().manipWindow = null;
30093786 // ab.GetObject().objectUI = null; // ?????????
30103787
30113788 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30123789 break;
30133790 }
30143791 }
3792
+
3793
+ cameraView.requestFocusInWindow();
30153794 refreshContents(true);
30163795 } else
30173796 if (source == editItem || source == editButton)
30183797 {
3798
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3799
+ {
3800
+ Object3D child = (Object3D)e.nextElement();
3801
+ child.pinned = true;
3802
+ }
3803
+
30193804 EditSelection(false);
30203805 } else
30213806 if (source == uneditButton)
....@@ -3025,10 +3810,11 @@
30253810 Object3D child = (Object3D)e.nextElement();
30263811 if(child.editWindow != null)
30273812 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3813
+ child.pinned = false;
30283814 child.CloseUI();
30293815 listUI.remove(child);
30303816
3031
- child.editWindow = null; // ???????????
3817
+ //child.editWindow = null; // ???????????
30323818 }
30333819 objEditor.ctrlPanel.FlushUI();
30343820 //objEditor.jTree.clearSelection();
....@@ -3041,6 +3827,7 @@
30413827 //copy.ClearUI();
30423828 for (Object3D obj : listUI)
30433829 {
3830
+ obj.pinned = false;
30443831 obj.CloseUI();
30453832 }
30463833 listUI.clear();
....@@ -3050,7 +3837,7 @@
30503837 {
30513838 assert(copy == group);
30523839
3053
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3840
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30543841
30553842 for (Object3D obj : listUI)
30563843 {
....@@ -3099,6 +3886,9 @@
30993886 }
31003887
31013888 copy = group;
3889
+
3890
+ SetUndoStates();
3891
+
31023892 //Globals.theRenderer.object = group;
31033893 if(!useclient)
31043894 {
....@@ -3115,7 +3905,9 @@
31153905 sideView.object = group;
31163906 }
31173907
3118
-// fix "+" issue group.editWindow = this;
3908
+// fix "+" issue
3909
+ //group.editWindow = this;
3910
+ group.manipWindow = this;
31193911
31203912 /*
31213913 currentLayout = radio.layout;
....@@ -3123,18 +3915,27 @@
31233915 currentLayout = sevenButton;
31243916 */
31253917 radio.layout.doClick();
3918
+
3919
+ ClearUnpinned();
3920
+ //Grafreed.Assert(group != null);
3921
+ //Grafreed.Assert(group.selection != null);
3922
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3923
+ if (group.selection == null || group.selection.size() == 1)
3924
+ EditSelection(false);
31263925 keepparent = group.parent;
31273926 // PARENT = NULL or not???
31283927 //group.parent = null; // ROOT
31293928 //group.attributes = -1;
31303929 ResetModel();
3930
+
3931
+ cameraView.requestFocusInWindow();
31313932 refreshContents(true);
31323933 } else if (event.getSource() == editCameraItem)
31333934 {
31343935 cameraView.ProtectCamera();
31353936 cameraView.repaint();
31363937 return;
3137
- } else if (event.getSource() == revertCameraItem)
3938
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31383939 {
31393940 cameraView.RevertCamera();
31403941 cameraView.repaint();
....@@ -3151,7 +3952,6 @@
31513952 }
31523953
31533954 boolean useclient = false;
3154
- cRadio radio;
31553955
31563956 void ToggleRoot()
31573957 {
....@@ -3390,7 +4190,8 @@
33904190
33914191 int size = obj.MemorySize();
33924192
3393
- System.err.println((size/1024) + " KB is the size of " + obj);
4193
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4194
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33944195 }
33954196 }
33964197 catch (Exception e)
....@@ -3471,6 +4272,13 @@
34714272 void GenNormals(boolean crease)
34724273 {
34734274 group.GenNormalsS(crease);
4275
+
4276
+ refreshContents();
4277
+ }
4278
+
4279
+ void GenNormalsMESH()
4280
+ {
4281
+ group.GenNormalsMeshS();
34744282
34754283 refreshContents();
34764284 }
....@@ -3706,7 +4514,7 @@
37064514
37074515 try
37084516 {
3709
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4517
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
37104518 }
37114519 catch (Exception e)
37124520 {
....@@ -4098,6 +4906,18 @@
40984906 refreshContents();
40994907 }
41004908
4909
+ void RewindLeaves(boolean hide)
4910
+ {
4911
+ group.selection.RewindLeaves(hide);
4912
+ refreshContents();
4913
+ }
4914
+
4915
+ void RandomLeaves(boolean hide)
4916
+ {
4917
+ group.selection.RandomLeaves(hide);
4918
+ refreshContents();
4919
+ }
4920
+
41014921 void SetTexRes(int tr)
41024922 {
41034923 group.selection.SetTexRes(tr);
....@@ -4169,28 +4989,25 @@
41694989 // }
41704990 // }
41714991
4172
- static boolean allparams = true;
4173
-
4174
- static Vector<Object3D> listUI = new Vector<Object3D>();
4175
-
41764992 void EditSelection(boolean newWindow)
41774993 {
4994
+ if (group.selection == null)
4995
+ {
4996
+ EditElement(group, newWindow); // ? new
4997
+ return;
4998
+ }
4999
+
41785000 // aConstraints.gridy = 0;
41795001 for (int i=0; i<group.selection.size(); i++)
41805002 {
41815003 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41825004 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4183
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5005
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41845006
41855007 Object3D elem = (Object3D)group.selection.elementAt(i);
41865008 if(elem != group || !newWindow)
41875009 {
4188
- // if (!(elem instanceof Composite))
4189
- // newWindow = false;
4190
- listUI.add(elem);
4191
- elem.openEditWindow(this, newWindow); //, false);
4192
- System.out.println("edit : " + elem);
4193
- elem.editWindow.refreshContents(true); // ? new
5010
+ EditElement(elem, newWindow); // ? new
41945011 }
41955012 }
41965013 }
....@@ -4265,7 +5082,8 @@
42655082 //new Exception().printStackTrace();
42665083
42675084 freezemodel = true;
4268
-
5085
+ ClearUnpinned();
5086
+
42695087 /**/
42705088 //switch (event.id)
42715089 {
....@@ -4273,7 +5091,6 @@
42735091 //case 702: // Event.LIST_DESELECT
42745092 group.deselectAll();
42755093 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4276
- objEditor.ClearInfo(); // .GetMaterial());
42775094 if (tps != null)
42785095 {
42795096 for (int i=0; i < tps.length; i++)
....@@ -4282,10 +5099,8 @@
42825099
42835100 //if (child.parent != null)
42845101 //child.parent.addSelectee(child);
5102
+ objEditor.SetMaterial(child);
42855103 group.addSelectee(child);
4286
- objEditor.SetMaterial(child); // .GetMaterial());
4287
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4288
- System.err.println("info : " + child.GetPath());
42895104 }
42905105 }
42915106 // else
....@@ -4295,20 +5110,28 @@
42955110 // System.err.println("info : " + group.GetPath());
42965111 // }
42975112
4298
- objEditor.SetText(); // jan 2014
4299
-
4300
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5113
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43015114 CameraPane.flash = true;
43025115
4303
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5116
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43045117 // a camera
43055118 {
4306
- CameraPane.camerachangeframe = 0; // don't refuse it
4307
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5119
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5120
+ {
5121
+ CameraPane.camerachangeframe = 0; // don't refuse it
5122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5123
+ }
43085124 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
43095125 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43105126 }
43115127
5128
+ if (tps != null && tps.length == 1)
5129
+ {
5130
+ EditSelection(false);
5131
+ }
5132
+
5133
+ SetPinStates(tps != null && tps.length > 0);
5134
+
43125135 refreshContents();
43135136 //return true;
43145137 }
....@@ -4317,6 +5140,35 @@
43175140
43185141 freezemodel = false;
43195142 }
5143
+
5144
+ void SetPinStates(boolean enabled)
5145
+ {
5146
+ editButton.setEnabled(enabled);
5147
+ uneditButton.setEnabled(enabled);
5148
+ unselectButton.setEnabled(enabled);
5149
+ flashSelectionButton.setEnabled(enabled);
5150
+ }
5151
+
5152
+ void refreshContents(boolean cp)
5153
+ {
5154
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5155
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5156
+ {
5157
+ objEditor.ClearInfo(); // .GetMaterial());
5158
+
5159
+ for (int i=0; i < group.selection.Size(); i++)
5160
+ {
5161
+ Object3D child = (Object3D) group.selection.get(i);
5162
+
5163
+ objEditor.AddInfo(child, this, true);
5164
+ System.err.println("info : " + child.GetPath());
5165
+ }
5166
+
5167
+ objEditor.SetText(); // jan 2014
5168
+ }
5169
+
5170
+ super.refreshContents(cp);
5171
+ }
43205172
43215173 void linkSomething(Object3D thing)
43225174 {
....@@ -4388,6 +5240,7 @@
43885240 {
43895241 if (group.selection.isEmpty())
43905242 return;
5243
+
43915244 Grafreed.clipboardIsTempGroup = false;
43925245 Composite tGroup = null;
43935246 if (group.selection.size() > 0) // 1)
....@@ -4398,6 +5251,8 @@
43985251
43995252 if (cut)
44005253 {
5254
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5255
+// Save();
44015256 //int indices[] = jList.getSelectedIndices();
44025257 //for (int i = indices.length - 1; i >= 0; i--)
44035258 //jList.remove(indices[i]);
....@@ -4487,8 +5342,10 @@
44875342 }
44885343
44895344 }
5345
+
44905346 if (Grafreed.clipboardIsTempGroup)
44915347 Grafreed.clipboard = tGroup;
5348
+
44925349 if (cut)
44935350 {
44945351 ResetModel();
....@@ -4498,6 +5355,10 @@
44985355
44995356 void paste(boolean expand)
45005357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
45015362 // if (GrafreeD.clipboard == null)
45025363 // return;
45035364 boolean first = true;
....@@ -4557,6 +5418,7 @@
45575418 Grafreed.clipboard.get(0).parent = keepparent;
45585419 }
45595420
5421
+ Globals.REPLACEONMAKE = keep;
45605422 ResetModel();
45615423 refreshContents();
45625424 }
....@@ -4692,6 +5554,10 @@
46925554
46935555 void group(Object3D csg, boolean grab)
46945556 {
5557
+ if (Globals.REPLACEONMAKE)
5558
+ Save();
5559
+ boolean keep = Globals.REPLACEONMAKE;
5560
+ Globals.REPLACEONMAKE = false;
46955561 if (//false) // why??
46965562 !group.selection.isEmpty())
46975563 {
....@@ -4805,10 +5671,15 @@
48055671 //node.add(csg);
48065672 //makeSomething(node);
48075673 makeSomething(csg);
5674
+ Globals.REPLACEONMAKE = keep;
48085675 }
48095676
48105677 void Ungroup(Object3D g)
48115678 {
5679
+ if (Globals.REPLACEONMAKE)
5680
+ Save();
5681
+ boolean keep = Globals.REPLACEONMAKE;
5682
+ Globals.REPLACEONMAKE = false;
48125683 if (g instanceof HiddenObject)
48135684 {
48145685 HiddenObject h = (HiddenObject) g;
....@@ -4825,6 +5696,7 @@
48255696 objEditor.makeSomething(g.get(i), false);
48265697 }
48275698 }
5699
+ Globals.REPLACEONMAKE = keep;
48285700 }
48295701
48305702 void ungroup()
....@@ -5113,7 +5985,44 @@
51135985 cButton clearpanelButton;
51145986 cButton unselectButton;
51155987
5988
+ cButton restoreCameraButton;
5989
+
5990
+ cButton saveButton;
51165991 cButton oneStepButton;
5992
+
5993
+ cButton groupButton;
5994
+ cButton ungroupButton;
5995
+ cButton compositeButton;
5996
+ cButton switchButton;
5997
+ cButton loopButton;
5998
+ cButton textureButton;
5999
+
6000
+ cButton skybox1Button;
6001
+ cButton skybox2Button;
6002
+ cButton skybox3Button;
6003
+ cButton skybox4Button;
6004
+ cButton skybox5Button;
6005
+ cButton skybox6Button;
6006
+ cButton skybox7Button;
6007
+
6008
+ cButton skybox11Button;
6009
+ cButton skybox12Button;
6010
+ cButton skybox13Button;
6011
+ cButton skybox14Button;
6012
+ cButton skybox15Button;
6013
+ cButton skybox16Button;
6014
+ cButton skybox17Button;
6015
+
6016
+ cButton gridButton;
6017
+ cButton boxButton;
6018
+ cButton sphereButton;
6019
+ cButton coneButton;
6020
+ cButton torusButton;
6021
+ cButton superButton;
6022
+ cButton kleinButton;
6023
+ cButton particlesButton;
6024
+ cButton overlayButton;
6025
+ cButton lightButton;
51176026
51186027 cButton screenfitButton;
51196028 cButton screenfitpointButton;
....@@ -5126,14 +6035,6 @@
51266035
51276036 cButton setsupportButton;
51286037
5129
- cButton twoButton;
5130
- cButton sixButton;
5131
- cButton threeButton;
5132
- cButton sevenButton;
5133
- cButton fourButton; // full panel
5134
- cButton oneButton; // full XYZ
5135
- //cButton currentLayout;
5136
-
51376038 //
51386039 //Composite
51396040 Object3D // to do !!
....@@ -5143,9 +6044,11 @@
51436044 //JTree jTree;
51446045 private MenuItem lookAtItem;
51456046 private MenuItem lookFromItem;
5146
- private MenuItem switchItem;
6047
+ private MenuItem switchViewItem;
51476048 private MenuItem cutItem;
5148
- private MenuItem duplicateItem;
6049
+ private MenuItem undoItem;
6050
+ private MenuItem redoItem;
6051
+ private JMenuItem duplicateItem;
51496052 private MenuItem cloneItem;
51506053 private MenuItem cloneSupportItem;
51516054 private MenuItem overwriteGeoItem;
....@@ -5173,7 +6076,7 @@
51736076 private MenuItem pasteLinkItem;
51746077 private MenuItem pasteCloneItem;
51756078 private MenuItem pasteExpandItem;
5176
- private MenuItem clearItem;
6079
+ private MenuItem deleteItem;
51776080 private MenuItem clearAllItem;
51786081 private MenuItem genUVItem;
51796082 private MenuItem genNormalsMESHItem;
....@@ -5208,6 +6111,10 @@
52086111 private MenuItem showleavesItem;
52096112 private MenuItem markleavesItem;
52106113 private MenuItem unmarkleavesItem;
6114
+ private MenuItem rewindleavesItem;
6115
+ private MenuItem unrewindleavesItem;
6116
+ private MenuItem randomleavesItem;
6117
+ private MenuItem unrandomleavesItem;
52116118
52126119 private MenuItem flipVItem;
52136120 private MenuItem unflipVItem;
....@@ -5229,7 +6136,7 @@
52296136 private MenuItem frontItem;
52306137 private MenuItem cameraItem;
52316138 private MenuItem compositeItem;
5232
- private MenuItem randomItem;
6139
+ private MenuItem switchItem;
52336140 private MenuItem physicsItem;
52346141 private MenuItem frameselectorItem;
52356142 private MenuItem scriptNodeItem;
....@@ -5253,6 +6160,8 @@
52536160 private MenuItem attachBumpItem;
52546161 private MenuItem detachBumpItem;
52556162 private MenuItem pigmentBumpItem;
6163
+ private MenuItem embedTexturesItem;
6164
+ private MenuItem deEmbedTexturesItem;
52566165
52576166 private MenuItem particleItem;
52586167 private MenuItem ragdollItem;
....@@ -5303,5 +6212,5 @@
53036212
53046213 Menu cameraMenu;
53056214 MenuItem editCameraItem;
5306
- MenuItem revertCameraItem;
6215
+ MenuItem restoreCameraItem;
53076216 }