Normand Briere
2019-08-09 912749d2520afedd9b56458d771400c261fe2b88
GroupEditor.java
....@@ -16,6 +16,7 @@
1616 //import buoy.widget.BFileChooser;
1717
1818 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1920 ObjectUI,
2021 Runnable,
2122 ActionListener,
....@@ -23,6 +24,341 @@
2324 DragGestureListener, DragSourceListener, DropTargetListener,
2425 ItemListener // ListSelectionListener
2526 {
27
+
28
+ public void AddSkyboxButton(String f, String s, cGridBag row)
29
+ {
30
+ cButton skyboxButton;
31
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
33
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
+ skyboxButton.setToolTipText(s);
35
+ skyboxButton.addActionListener(new ActionListener()
36
+ {
37
+ @Override
38
+ public void actionPerformed(ActionEvent e)
39
+ {
40
+ ChangeSkybox(path);
41
+ }
42
+ });
43
+ }
44
+
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(c + count);
51
+ textureButton.addActionListener(new ActionListener()
52
+ {
53
+ @Override
54
+ public void actionPerformed(ActionEvent e)
55
+ {
56
+ ChangeTexture(path + t);
57
+ }
58
+ });
59
+ }
60
+
61
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
62
+ {
63
+ cGridBag tab0 = new cGridBag().setVertical(true);
64
+
65
+ tab0.setName("Urban");
66
+ skyboxpanel.add(tab0);
67
+
68
+ cGridBag row0 = new cGridBag();
69
+ cGridBag row1 = new cGridBag();
70
+ cGridBag row2 = new cGridBag();
71
+ cGridBag row3 = new cGridBag();
72
+ cGridBag row4 = new cGridBag();
73
+ cGridBag row5 = new cGridBag();
74
+ cGridBag row6 = new cGridBag();
75
+
76
+ AddSkyboxButton("default", "rgb", row0);
77
+ //AddSkyboxButton("default", "cornell", row0);
78
+ AddSkyboxButton("penguins", "dust", row0);
79
+ AddSkyboxButton("penguins", "tropic", row0);
80
+ AddSkyboxButton("penguins", "yonder", row0);
81
+
82
+ AddSkyboxButton("default", "uffizi", row1);
83
+ AddSkyboxButton("bridge", "Bridge", row1);
84
+ AddSkyboxButton("bridge", "Bridge2", row1);
85
+ AddSkyboxButton("urban", "GamlaStan2", row1);
86
+
87
+ AddSkyboxButton("urban", "Parliament", row2);
88
+ AddSkyboxButton("urban", "Roundabout", row2);
89
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
90
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
91
+
92
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
93
+ AddSkyboxButton("urban", "UnionSquare", row3);
94
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
95
+ AddSkyboxButton("park", "BerzeliiPark", row3);
96
+
97
+ AddSkyboxButton("park", "Buddha", row4);
98
+ AddSkyboxButton("park", "CNTower2", row4);
99
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
100
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
101
+
102
+ AddSkyboxButton("park", "Park", row5);
103
+ AddSkyboxButton("park", "Pond", row5);
104
+ AddSkyboxButton("park", "Skansen", row5);
105
+ AddSkyboxButton("park", "Skansen2", row5);
106
+
107
+ AddSkyboxButton("park", "Skansen3", row6);
108
+ AddSkyboxButton("park", "Skansen4", row6);
109
+ AddSkyboxButton("park", "Skansen5", row6);
110
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
111
+
112
+ tab0.add(row0);
113
+ tab0.add(row1);
114
+ tab0.add(row2);
115
+ tab0.add(row3);
116
+ tab0.add(row4);
117
+ tab0.add(row5);
118
+ tab0.add(row6);
119
+
120
+ for (int i=5; --i>=0;)
121
+ {
122
+ //oe.toolboxPanel.Return();
123
+ //tab0.add(new cGridBag());
124
+ }
125
+ }
126
+
127
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
128
+ {
129
+ cGridBag tab0 = new cGridBag().setVertical(true);
130
+
131
+ tab0.setName("Nature");
132
+ skyboxpanel.add(tab0);
133
+
134
+ cGridBag row0 = new cGridBag();
135
+ cGridBag row1 = new cGridBag();
136
+ cGridBag row2 = new cGridBag();
137
+ cGridBag row3 = new cGridBag();
138
+ cGridBag row4 = new cGridBag();
139
+ cGridBag row5 = new cGridBag();
140
+ cGridBag row6 = new cGridBag();
141
+
142
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
143
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
144
+ AddSkyboxButton("beach", "PalmTrees", row0);
145
+ AddSkyboxButton("beach", "Tenerife", row0);
146
+
147
+ AddSkyboxButton("beach", "Tenerife2", row1);
148
+ AddSkyboxButton("beach", "Tenerife3", row1);
149
+ AddSkyboxButton("field", "FishPond", row1);
150
+ AddSkyboxButton("field", "Footballfield", row1);
151
+
152
+ AddSkyboxButton("field", "Meadow", row2);
153
+ AddSkyboxButton("field", "Sorsele", row2);
154
+ AddSkyboxButton("field", "Sorsele2", row2);
155
+ AddSkyboxButton("field", "Sorsele3", row2);
156
+
157
+ AddSkyboxButton("forest", "Brudslojan", row3);
158
+ AddSkyboxButton("forest", "Langholmen2", row3);
159
+ AddSkyboxButton("forest", "Plants", row3);
160
+ AddSkyboxButton("mountain", "Maskonaive", row3);
161
+
162
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
163
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
164
+ AddSkyboxButton("mountain", "Teide", row4);
165
+ AddSkyboxButton("park", "Tantolunden4", row4);
166
+
167
+ AddSkyboxButton("park", "Stairs", row5);
168
+ AddSkyboxButton("default", "skycube", row6);
169
+ AddSkyboxButton("rocky", "Langholmen", row5);
170
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
171
+
172
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
173
+ AddSkyboxButton("default", "CloudyHills", row6);
174
+ AddSkyboxButton("daz", "Autumn", row6);
175
+ AddSkyboxButton("daz", "MountainTrail", row6);
176
+ /*
177
+Autumn
178
+Greenlands
179
+MountainTrail
180
+Oasis
181
+TheRock
182
+TopOfTheWorld
183
+Winter
184
+ */
185
+
186
+ tab0.add(row0);
187
+ tab0.add(row1);
188
+ tab0.add(row2);
189
+ tab0.add(row3);
190
+ tab0.add(row4);
191
+ tab0.add(row5);
192
+ tab0.add(row6);
193
+
194
+ for (int i=5; --i>=0;)
195
+ {
196
+ //oe.toolboxPanel.Return();
197
+ //tab0.add(new cGridBag());
198
+ }
199
+ }
200
+
201
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
202
+ {
203
+ cGridBag tab0 = new cGridBag().setVertical(true);
204
+
205
+ tab0.setName("Night");
206
+ skyboxpanel.add(tab0);
207
+
208
+ cGridBag row0 = new cGridBag();
209
+ cGridBag row1 = new cGridBag();
210
+ cGridBag row2 = new cGridBag();
211
+ cGridBag row3 = new cGridBag();
212
+ cGridBag row4 = new cGridBag();
213
+ cGridBag row5 = new cGridBag();
214
+ cGridBag row6 = new cGridBag();
215
+
216
+ AddSkyboxButton("night", "NightPath", row0);
217
+ AddSkyboxButton("night", "PondNight", row0);
218
+ AddSkyboxButton("night", "Powerlines", row0);
219
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
220
+
221
+ AddSkyboxButton("urban", "CNTower", row1);
222
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
223
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
224
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
225
+
226
+ AddSkyboxButton("penguins", "kenon_star", row2);
227
+ AddSkyboxButton("persson", "corona", row2);
228
+ AddSkyboxButton("persson", "spaceskybox", row2);
229
+ AddSkyboxButton("indoors", "Vasa", row2);
230
+
231
+ AddSkyboxButton("winter", "Backyard", row3);
232
+ AddSkyboxButton("winter", "Creek", row3);
233
+ AddSkyboxButton("winter", "FootballField3", row3);
234
+ AddSkyboxButton("winter", "Forest", row3);
235
+
236
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
237
+ AddSkyboxButton("winter", "House", row4);
238
+ AddSkyboxButton("winter", "IceLake", row4);
239
+ AddSkyboxButton("winter", "IceRiver", row4);
240
+
241
+ AddSkyboxButton("winter", "Park3", row5);
242
+ AddSkyboxButton("winter", "PondWinter", row5);
243
+ AddSkyboxButton("winter", "Tantolunden5", row5);
244
+ AddSkyboxButton("winter", "Vindelalven", row5);
245
+
246
+ AddSkyboxButton("daz", "TheRock", row6);
247
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
248
+ AddSkyboxButton("daz", "Winter", row6);
249
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
250
+
251
+ tab0.add(row0);
252
+ tab0.add(row1);
253
+ tab0.add(row2);
254
+ tab0.add(row3);
255
+ tab0.add(row4);
256
+ tab0.add(row5);
257
+ tab0.add(row6);
258
+
259
+ for (int i=5; --i>=0;)
260
+ {
261
+ //oe.toolboxPanel.Return();
262
+ //tab0.add(new cGridBag());
263
+ }
264
+ }
265
+
266
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
267
+ {
268
+ cGridBag tab0 = new cGridBag().setVertical(true);
269
+
270
+ tab0.setName("Others");
271
+ skyboxpanel.add(tab0);
272
+
273
+ cGridBag row0 = new cGridBag();
274
+ cGridBag row1 = new cGridBag();
275
+ cGridBag row2 = new cGridBag();
276
+ cGridBag row3 = new cGridBag();
277
+ cGridBag row4 = new cGridBag();
278
+ cGridBag row5 = new cGridBag();
279
+ cGridBag row6 = new cGridBag();
280
+
281
+ AddSkyboxButton("mayhem", "afterrain", row0);
282
+ AddSkyboxButton("mayhem", "aqua4", row0);
283
+ AddSkyboxButton("mayhem", "aqua9", row0);
284
+ AddSkyboxButton("mayhem", "flame", row0);
285
+
286
+ AddSkyboxButton("mayhem", "h2s", row1);
287
+ AddSkyboxButton("mayhem", "prehistoric", row1);
288
+ AddSkyboxButton("mayhem", "scorched", row1);
289
+ AddSkyboxButton("penguins", "desertdawn", row1);
290
+
291
+ AddSkyboxButton("persson", "Citadella", row2);
292
+ AddSkyboxButton("persson", "Citadella2", row2);
293
+ AddSkyboxButton("persson", "clouds1", row2);
294
+ AddSkyboxButton("penguins", "wrath", row2);
295
+
296
+ AddSkyboxButton("persson", "FishermansBastion", row3);
297
+ AddSkyboxButton("persson", "HeroesSquare", row3);
298
+ AddSkyboxButton("indoors", "DallasW", row3);
299
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
300
+
301
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
302
+ AddSkyboxButton("persson", "PereaBeach1", row4);
303
+ AddSkyboxButton("persson", "PereaBeach2", row4);
304
+ AddSkyboxButton("persson", "redeclipse", row4);
305
+
306
+ AddSkyboxButton("daz", "Greenlands", row5);
307
+ AddSkyboxButton("daz", "Oasis", row5);
308
+ AddSkyboxButton("elyvisions", "arch3", row5);
309
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
310
+
311
+ AddSkyboxButton("elyvisions", "rainbow", row6);
312
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
313
+ AddSkyboxButton("elyvisions", "heaven", row6);
314
+ AddSkyboxButton("elyvisions", "hot", row6);
315
+
316
+ tab0.add(row0);
317
+ tab0.add(row1);
318
+ tab0.add(row2);
319
+ tab0.add(row3);
320
+ tab0.add(row4);
321
+ tab0.add(row5);
322
+ tab0.add(row6);
323
+
324
+ for (int i=5; --i>=0;)
325
+ {
326
+ //oe.toolboxPanel.Return();
327
+ //tab0.add(new cGridBag());
328
+ }
329
+ }
330
+
331
+ public void ChangeSkybox(String skybox)
332
+ {
333
+ //cameraView.envyoff = false;
334
+ group.skyboxname = skybox;
335
+ group.skyboxext = "jpg";
336
+ cameraView.repaint();
337
+ }
338
+
339
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
340
+ {
341
+ JTabbedPane skyboxpane = new JTabbedPane();
342
+
343
+ AddSkyboxTab0(skyboxpane);
344
+ AddSkyboxTab1(skyboxpane);
345
+ AddSkyboxTab2(skyboxpane);
346
+ AddSkyboxTab3(skyboxpane);
347
+
348
+ skyboxPanel.add(skyboxpane);
349
+ }
350
+
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ for (int i=0; i<group.selection.size(); i++)
354
+ {
355
+ Object3D obj = group.selection.get(i);
356
+ obj.SetPigmentTexture("@" + texture);
357
+ }
358
+
359
+ refreshContents();
360
+ }
361
+
26362 //ObjEditor objEditor;
27363 public void closeUI2()
28364 {
....@@ -60,6 +396,12 @@
60396 this.copy = this.group = group;
61397 //selectees = this.group.selectees;
62398
399
+ if (copy.versionlist == null)
400
+ {
401
+ copy.versionlist = new Object3D[100];
402
+ copy.versionindex = -1;
403
+ }
404
+
63405 if(ui)
64406 SetupUI(objEditor);
65407 }
....@@ -74,16 +416,28 @@
74416 this.copy = this.group = copy;
75417 //selectees = this.group.selectees;
76418
77
- SetupMenu2(objEditor);
419
+ SetupMenu2(this); //objEditor);
78420 SetupUI2(objEditor);
79421 objEditor.SetupUI(true);
80422 SetupViews(objEditor);
81423
82424 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
425
+
426
+ if (copy.versionlist == null)
427
+ {
428
+ copy.versionlist = new Object3D[100];
429
+ copy.versionindex = -1;
430
+
431
+ Save(true);
432
+ }
83433 }
84434
85435 void CloneSelection(boolean supports)
86436 {
437
+ if (Globals.REPLACEONMAKE)
438
+ Save();
439
+ boolean keep = Globals.REPLACEONMAKE;
440
+ Globals.REPLACEONMAKE = false;
87441 // Object3D keep = GrafreeD.clipboard;
88442 //Object3D obj;
89443 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +448,19 @@
94448
95449 makeSomething(clone, i==group.selection.size()-1);
96450 }
451
+ Globals.REPLACEONMAKE = keep;
97452 }
98453
99454 void CloneClipboard(boolean supports)
100455 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
456
+ assert(Grafreed.clipboard.parent == null);
457
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
458
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
459
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
460
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106461 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
462
+ makeSomething(CloneObject(Grafreed.clipboard, false));
463
+ Grafreed.clipboard.get(0).parent = keepparent;
109464 }
110465
111466 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +474,7 @@
119474 // obj.support = null;
120475 if (!supports)
121476 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
477
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123478 obj.parent = parent;
124479 // obj.support = support;
125480 // clone.support = support; // aout 2013
....@@ -148,30 +503,29 @@
148503
149504 //JTextField nameField;
150505
151
- void SetupMenu2(ObjEditor oe)
506
+ void SetupMenu2(GroupEditor oe)
152507 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
508
+ oe.jTree = new cTree();
509
+
164510 Menu menu;
165511 oe.menuBar.add(menu = new Menu("Edit"));
166512 //editItem = menu.add(new MenuItem("Edit"));
167513 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
514
+
515
+// undoItem = menu.add(new MenuItem("Undo"));
516
+// undoItem.addActionListener(this);
517
+// redoItem = menu.add(new MenuItem("Redo"));
518
+// redoItem.addActionListener(this);
519
+// menu.add("-");
520
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169521 duplicateItem.addActionListener(this);
170
- menu.add("-");
171522 cloneItem = menu.add(new MenuItem("Clone"));
172523 cloneItem.addActionListener(this);
524
+ if (Globals.ADVANCED)
525
+ {
173526 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174527 cloneSupportItem.addActionListener(this);
528
+ }
175529 menu.add("-");
176530 cutItem = menu.add(new MenuItem("Cut"));
177531 cutItem.addActionListener(this);
....@@ -179,27 +533,123 @@
179533 copyItem.addActionListener(this);
180534 pasteItem = menu.add(new MenuItem("Paste"));
181535 pasteItem.addActionListener(this);
536
+
537
+ menu.add("-");
538
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
539
+ pasteIntoItem.addActionListener(this);
182540 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183541 pasteLinkItem.addActionListener(this);
184542 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185543 pasteCloneItem.addActionListener(this);
186544 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187545 // pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
546
+ menu.add("-");
547
+ deleteItem = menu.add(new MenuItem("Delete"));
548
+ deleteItem.addActionListener(this);
549
+
550
+ if (Globals.ADVANCED)
551
+ {
552
+ // Deletes the cameras...
190553 clearAllItem = menu.add(new MenuItem("Clear All"));
191554 clearAllItem.addActionListener(this);
555
+ }
556
+
557
+ menuBar.add(cameraMenu = new Menu("View"));
558
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
559
+ //zBufferItem.addActionListener(this);
560
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
561
+ //normalLensItem.addActionListener(this);
562
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
563
+ restoreCameraItem.addActionListener(this);
564
+
565
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
566
+// toggleFullScreenItem.addItemListener(this);
567
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
568
+// cameraMenu.add("-");
569
+//
570
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
571
+// toggleTextureItem.addItemListener(this);
572
+// toggleTextureItem.setState(CameraPane.textureon);
573
+//
574
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
575
+// toggleSwitchItem.addItemListener(this);
576
+// toggleSwitchItem.setState(CameraPane.SWITCH);
577
+
578
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
579
+ toggleHandleItem.addItemListener(this);
580
+ toggleHandleItem.setState(CameraPane.HANDLES);
581
+
582
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
583
+ togglePaintItem.addItemListener(this);
584
+ togglePaintItem.setState(CameraPane.PAINTMODE);
585
+
586
+ if (Globals.ADVANCED)
587
+ {
588
+ cameraMenu.add("-");
589
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
590
+ toggleLiveItem.addItemListener(this);
591
+ toggleLiveItem.setState(Globals.isLIVE());
192592
593
+ cameraMenu.add(stepItem = new MenuItem("Step"));
594
+ stepItem.addActionListener(this);
595
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
596
+ // toggleDLItem.addItemListener(this);
597
+ // toggleDLItem.setState(false);
598
+
599
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
600
+ toggleRenderItem.addItemListener(this);
601
+ toggleRenderItem.setState(!CameraPane.frozen);
602
+
603
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
604
+ toggleDebugItem.addItemListener(this);
605
+ toggleDebugItem.setState(Globals.DEBUG);
606
+
607
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
608
+ toggleFrustumItem.addItemListener(this);
609
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
610
+
611
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
612
+ toggleFootContactItem.addItemListener(this);
613
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
614
+
615
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
616
+ toggleTimelineItem.addItemListener(this);
617
+ }
618
+
619
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
620
+// toggleRootItem.addItemListener(this);
621
+// toggleRootItem.setState(false);
622
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
623
+// animationItem.addItemListener(this);
624
+// animationItem.setState(CameraPane.ANIMATION);
625
+ cameraMenu.add("-");
626
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
627
+ editCameraItem.addActionListener(this);
628
+
629
+ if (Globals.ADVANCED)
630
+ {
631
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
632
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
633
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
634
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
635
+ oe.cameraMenu.add("-");
636
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
637
+ openWindowItem.addActionListener(this);
638
+ editLeafItem.addActionListener(this);
639
+ lookAtItem.addActionListener(this);
640
+ //lookFromItem.addActinoListener(this);
641
+ //switchViewItem.addActionListener(this);
642
+ }
643
+
193644 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
645
+ if (Globals.ADVANCED)
646
+ {
198647 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199648 revertMeshItem.addActionListener(this);
200649 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201650 resetreferencesItem.addActionListener(this);
202651 menu.add("-");
652
+ }
203653 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204654 overwriteGeoItem.addActionListener(this);
205655 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +661,104 @@
211661 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212662 overwriteUVItem.addActionListener(this);
213663 menu.add("-");
664
+ if (Globals.ADVANCED)
665
+ {
214666 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215667 generateMeshItem.addActionListener(this);
216668 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217669 poseMeshItem.addActionListener(this);
218670 menu.add("-");
671
+ }
219672 resetsupportItem = menu.add(new MenuItem("Reset support"));
220673 resetsupportItem.addActionListener(this);
221674 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222675 linkverticesItem.addActionListener(this);
223676 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224677 relinkverticesItem.addActionListener(this);
678
+
679
+ if (Globals.ADVANCED)
680
+ {
225681 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226682 setMasterItem.addActionListener(this);
683
+ }
227684
228685 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
686
+// grabItem = menu.add(new MenuItem("Grab"));
687
+// grabItem.addActionListener(this);
231688 backItem = menu.add(new MenuItem("Back"));
232689 backItem.addActionListener(this);
233690 frontItem = menu.add(new MenuItem("Front"));
234691 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
692
+// compositeItem = menu.add(new MenuItem("Composite"));
693
+// compositeItem.addActionListener(this);
694
+
695
+ if (Globals.ADVANCED)
696
+ {
697
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238698 hideItem.addActionListener(this);
699
+ }
239700 ungroupItem = menu.add(new MenuItem("Ungroup"));
240701 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
702
+
703
+// menu.add("-");
704
+//
705
+// switchItem = menu.add(new MenuItem("Switch node"));
706
+// switchItem.addActionListener(this);
707
+ if (Globals.ADVANCED)
708
+ {
248709 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249710 switchGeoItem.addActionListener(this);
250711 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251712 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
713
+ morphItem = menu.add(new MenuItem("Morph Group"));
253714 morphItem.addActionListener(this);
715
+
716
+ menu.add("-");
717
+ physicsItem = menu.add(new MenuItem("Physics"));
718
+ physicsItem.addActionListener(this);
719
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
720
+ frameselectorItem.addActionListener(this);
254721 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255722 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
723
+ }
258724
259725 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
726
+// textureItem = menu.add(new MenuItem("Texture"));
727
+// textureItem.addActionListener(this);
262728 billboardItem = menu.add(new MenuItem("Billboard"));
263729 billboardItem.addActionListener(this);
264730 csgItem = menu.add(new MenuItem("CSG"));
265731 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
732
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267733 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
734
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269735 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
736
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271737 shadowZItem.addActionListener(this);
738
+ attributeItem = menu.add(new MenuItem("Attribute"));
739
+ attributeItem.addActionListener(this);
740
+
741
+ if (Globals.ADVANCED)
742
+ {
743
+ menu.add("-");
272744 linkerItem = menu.add(new MenuItem("Linker"));
273745 linkerItem.addActionListener(this);
274746 templateItem = menu.add(new MenuItem("Template"));
275747 templateItem.addActionListener(this);
276
- attributeItem = menu.add(new MenuItem("Attribute"));
277
- attributeItem.addActionListener(this);
278748 pointflowItem = menu.add(new MenuItem("Point Flow"));
279749 pointflowItem.addActionListener(this);
750
+ }
280751 menu.add("-");
281752 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282753 resetTransformItem.addActionListener(this);
283754 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284755 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
756
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
757
+ resetCentroidXZItem.addActionListener(this);
758
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
759
+ transformGeometryItem.addActionListener(this);
760
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
761
+ transformChildrenItem.addActionListener(this);
287762
288763 oe.menuBar.add(menu = new Menu("Geometry"));
289764 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +769,11 @@
294769 genNormalsCADItem.addActionListener(this);
295770 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296771 genNormalsMESHItem.addActionListener(this);
297
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
772
+ if (Globals.ADVANCED)
773
+ {
774
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
298775 genNormalsMINEItem.addActionListener(this);
776
+ }
299777 stripifyItem = menu.add(new MenuItem("Stripify"));
300778 stripifyItem.addActionListener(this);
301779 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +795,34 @@
317795 reduce34MeshItem.addActionListener(this);
318796 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319797 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322798 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323799 clipMeshItem.addActionListener(this);
800
+
801
+ if (Globals.ADVANCED)
802
+ {
803
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
804
+ smoothMeshItem.addActionListener(this);
805
+ }
324806
325807 oe.menuBar.add(menu = new Menu("Attributes"));
326808 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327809 clearMaterialsItem.addActionListener(this);
810
+ resetAllItem = menu.add(new MenuItem("Reset All"));
811
+ resetAllItem.addActionListener(this);
812
+ stepAllItem = menu.add(new MenuItem("Step All"));
813
+ stepAllItem.addActionListener(this);
328814 menu.add("-");
329815 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330816 liveleavesItem.addActionListener(this);
331817 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332818 unliveleavesItem.addActionListener(this);
819
+ if (Globals.ADVANCED)
820
+ {
333821 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334822 supportleavesItem.addActionListener(this);
335823 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336824 unsupportleavesItem.addActionListener(this);
825
+ }
337826 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338827 hideleavesItem.addActionListener(this);
339828 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +831,14 @@
342831 markleavesItem.addActionListener(this);
343832 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344833 unmarkleavesItem.addActionListener(this);
834
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
835
+ rewindleavesItem.addActionListener(this);
836
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
837
+ unrewindleavesItem.addActionListener(this);
838
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
839
+ randomleavesItem.addActionListener(this);
840
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
841
+ unrandomleavesItem.addActionListener(this);
345842 menu.add("-");
346843 flipVItem = menu.add(new MenuItem("Flip V"));
347844 flipVItem.addActionListener(this);
....@@ -367,45 +864,123 @@
367864 attachBumpItem.addActionListener(this);
368865 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
369866 pigmentBumpItem.addActionListener(this);
867
+ //embedTexturesItem
370868 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
371869 detachPigmentItem.addActionListener(this);
372870 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
373871 detachBumpItem.addActionListener(this);
872
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
873
+ embedTexturesItem.addActionListener(this);
874
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
875
+ deEmbedTexturesItem.addActionListener(this);
374876 menu.add("-");
375877 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
376878 sortbysizeItem.addActionListener(this);
377879 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378880 sortbynameItem.addActionListener(this);
379881 menu.add("-");
882
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
883
+ shareGeometriesItem.addActionListener(this);
884
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
885
+ mergeGeometriesItem.addActionListener(this);
886
+ if (Globals.ADVANCED)
887
+ {
888
+ // Pretty much the same as duplicate and clone.
380889 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381890 extractGeometriesItem.addActionListener(this);
382891 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383892 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
893
+ }
388894
389895 oe.menuBar.add(menu = new Menu("Insert"));
390896 buildCreateMenu(menu);
391897
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403898 oe.menuBar.add(menu = new Menu("Tools"));
404899 buildToolsMenu(menu);
405900 }
406901
902
+ JTabbedPane resourcecontainer;
903
+ cGridBag currenttab;
904
+ boolean added; // patch for jar
905
+
906
+ int tabcount = 0;
907
+ int colcount = 0;
908
+ int rowcount = 0;
909
+ int texturecount = 0;
910
+
911
+ int columns = 5;
912
+ int rows = 7;
913
+
914
+ public void ResourceCallBack(String[] path)
915
+ {
916
+// for (int i = 0; i < path.length; i++)
917
+// System.out.print(path[i] + "/");
918
+// System.out.println();
919
+
920
+ if (//rowcount == 0 ||
921
+ path.length == 1)
922
+ {
923
+ currenttab = new cGridBag();
924
+ added = false;
925
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
926
+ currenttab.setName(tabname);
927
+ rowcount = 1;
928
+ colcount = 0;
929
+ texturecount = 0;
930
+ }
931
+
932
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
933
+ {
934
+ if (!added)
935
+ {
936
+ added = true;
937
+ resourcecontainer.add(currenttab);
938
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
939
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
940
+ }
941
+
942
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
943
+
944
+ if (++colcount >= columns)
945
+ {
946
+ colcount = 0;
947
+ currenttab.Return();
948
+
949
+ if (rowcount++ >= rows)
950
+ {
951
+ rowcount = 0;
952
+ }
953
+ }
954
+ }
955
+ else
956
+ {
957
+// if (!path[path.length-1].equals("icons"))
958
+// resourcecontainer.Return();
959
+ }
960
+ }
961
+
962
+ void CreateTexturePanel(cGridBag container)
963
+ {
964
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
965
+ container.add(resourcecontainer);
966
+
967
+ Grafreed.ParseResources("textures", this);
968
+ }
969
+
407970 void SetupUI2(ObjEditor oe)
408971 {
972
+ // June 2019
973
+ if (oe == null)
974
+ {
975
+ //super.SetupUI2(this);
976
+ //return;
977
+ }
978
+
979
+ if (copy != group)
980
+ {
981
+ //super.SetupUI2(this);
982
+ }
983
+
409984 //new Exception().printStackTrace();
410985
411986 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,98 +1009,239 @@
4341009 oe.radioPanel.add(dummyButton);
4351010 oe.buttonGroup.add(dummyButton);
4361011 */
1012
+ cGridBag copyOptionsPanel = new cGridBag();
1013
+
1014
+ copyOptionsPanel.preferredHeight = 2;
1015
+
4371016 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
4381017
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
441
- liveCB.addItemListener(this);
442
-
443
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
444
- trackCB.setToolTipText("Enable tracking");
445
- trackCB.addItemListener(this);
446
-
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1018
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ //minButton.setToolTipText("Minimize window");
1020
+ //minButton.addActionListener(this);
1021
+
1022
+ if (Globals.ADVANCED)
1023
+ {
1024
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ maxButton.setToolTipText("Maximize window");
1026
+ maxButton.addActionListener(this);
1027
+ }
1028
+
1029
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1030
+ fullButton.setToolTipText("Full-screen window");
1031
+ fullButton.addActionListener(this);
1032
+
1033
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4481034 screenfitButton.setToolTipText("Screen fit");
4491035 screenfitButton.addActionListener(this);
4501036
1037
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1038
+ restoreCameraButton.setToolTipText("Restore viewpoint");
1039
+ restoreCameraButton.addActionListener(this);
1040
+
1041
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1042
+ saveVersionButton.setToolTipText("Duplicate current version");
1043
+ saveVersionButton.addActionListener(this);
1044
+
1045
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ deleteVersionButton.setToolTipText("Delete current version");
1047
+ deleteVersionButton.addActionListener(this);
1048
+
1049
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ previousVersionButton.setToolTipText("Previous version");
1051
+ previousVersionButton.addActionListener(this);
1052
+ previousVersionButton.setEnabled(false);
1053
+
1054
+ cGridBag updown = new cGridBag().setVertical(true);
1055
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ restoreButton.setToolTipText("Undo (restore current version)");
1057
+ restoreButton.addActionListener(this);
1058
+ //restoreButton.setEnabled(false);
1059
+
1060
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ replaceButton.setToolTipText("Save (replace current version)");
1062
+ replaceButton.addActionListener(this);
1063
+ //replaceButton.setEnabled(false);
1064
+
1065
+ copyOptionsPanel.add(updown);
1066
+
1067
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ nextVersionButton.setToolTipText("Next version");
1069
+ nextVersionButton.addActionListener(this);
1070
+ nextVersionButton.setEnabled(false);
1071
+
1072
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1073
+ liveCB.setToolTipText("Enable animation");
1074
+ liveCB.addItemListener(this);
1075
+
1076
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1077
+ oneStepButton.setToolTipText("Animate one step forward");
1078
+ oneStepButton.addActionListener(this);
1079
+
1080
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
1081
+ fastCB.setToolTipText("Fast mode");
1082
+ fastCB.addItemListener(this);
1083
+
1084
+ //oe.toolboxPanel.Return();
1085
+
1086
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
1087
+// trackCB.setToolTipText("Enable tracking");
1088
+// trackCB.addItemListener(this);
1089
+
4511090 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
4521091 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
4581092
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
- flashSelectionButton.setToolTipText("Show selection");
466
- flashSelectionButton.addActionListener(this);
467
-
468
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
-
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
- twoButton.setToolTipText("Show center view only");
472
- twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1093
+ if (Globals.ADVANCED)
1094
+ {
1095
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1096
+ snapobjectButton.addActionListener(this);
1097
+ snapobjectButton.setToolTipText("Snap Object");
1098
+
1099
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4741100 fourButton.addActionListener(this);
475
- fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
- sixButton.setToolTipText("2-column layout left");
478
- sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
- threeButton.setToolTipText("2-column layout right");
1101
+ fourButton.setToolTipText("Show control panel only");
1102
+ }
1103
+
1104
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
1105
+
1106
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1107
+ twoButton.setToolTipText("Show 3D view only");
1108
+ twoButton.addActionListener(this);
1109
+ this.fullscreenLayout = twoButton;
1110
+
1111
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1112
+ threeButton.setToolTipText("Show controls and 3D view");
4811113 threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
- sevenButton.setToolTipText("3-column layout");
484
- sevenButton.addActionListener(this);
1114
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1115
+ sixButton.setToolTipText("Show 3D view and controls");
1116
+ sixButton.addActionListener(this);
1117
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+// sevenButton.setToolTipText("3-column layout");
1119
+// sevenButton.addActionListener(this);
4851120 //
4861121
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- rootButton.setToolTipText("Edit object in new tab");
1122
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1123
+ rootButton.setToolTipText("Open selection in new tab");
4891124 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1125
+
1126
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4921127 closeButton.setToolTipText("Close tab");
4931128 closeButton.addActionListener(this);
4941129 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
4951130 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
-
498
- oe.aConstraints.gridx = 1; //
499
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
500
- editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
5041131
505
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1132
+ cGridBag row1 = new cGridBag();
1133
+
1134
+ // INSERT
1135
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ gridButton.setToolTipText("Create grid");
1137
+ gridButton.addActionListener(this);
1138
+
1139
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
+ boxButton.setToolTipText("Create box");
1141
+ boxButton.addActionListener(this);
1142
+
1143
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1144
+ sphereButton.setToolTipText("Create sphere");
1145
+ sphereButton.addActionListener(this);
1146
+
1147
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1148
+ coneButton.setToolTipText("Create cone");
1149
+ coneButton.addActionListener(this);
1150
+
1151
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1152
+ torusButton.setToolTipText("Create torus");
1153
+ torusButton.addActionListener(this);
1154
+
1155
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1156
+ superButton.setToolTipText("Create superellipsoid");
1157
+ superButton.addActionListener(this);
1158
+
1159
+ if (Globals.ADVANCED)
1160
+ {
1161
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1162
+ kleinButton.setToolTipText("Create Klein bottle");
1163
+ kleinButton.addActionListener(this);
1164
+ }
1165
+
1166
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1167
+ particlesButton.setToolTipText("Create particle system");
1168
+ particlesButton.addActionListener(this);
1169
+
1170
+ oe.toolboxPanel.add(row1);
1171
+
1172
+ cGridBag row2 = new cGridBag();
1173
+
1174
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ groupButton.setToolTipText("Create group");
1176
+ groupButton.addActionListener(this);
1177
+
1178
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1179
+ compositeButton.setToolTipText("Create composite");
1180
+ compositeButton.addActionListener(this);
1181
+
1182
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ switchButton.setToolTipText("Create item switcher");
1184
+ switchButton.addActionListener(this);
1185
+
1186
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ loopButton.setToolTipText("Create loop");
1188
+ loopButton.addActionListener(this);
1189
+
1190
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1191
+ textureButton.setToolTipText("Create texture");
1192
+ textureButton.addActionListener(this);
1193
+
1194
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1195
+ overlayButton.setToolTipText("Create overlay");
1196
+ overlayButton.addActionListener(this);
1197
+
1198
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1199
+ lightButton.setToolTipText("Create light");
1200
+ lightButton.addActionListener(this);
1201
+
1202
+ oe.toolboxPanel.add(row2);
1203
+
1204
+ cGridBag textures = new cGridBag();
1205
+
1206
+ CreateTexturePanel(textures);
1207
+
1208
+ oe.toolboxPanel.add(textures);
1209
+
1210
+ textures.preferredHeight = 100;
1211
+
1212
+ CreateSkyboxPanel(oe.skyboxPanel);
1213
+
1214
+ // EDIT panel
1215
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ editButton.setToolTipText("Pin selection controls");
1217
+ editButton.addActionListener(this);
1218
+
1219
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ uneditButton.setToolTipText("Unpin and remove selection controls");
5061221 uneditButton.addActionListener(this);
5071222
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
513
- clearPanelButton.addActionListener(this);
514
-
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1223
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1224
+ allParamsButton.setToolTipText("Show all controls");
5201225 allParamsButton.addActionListener(this);
5211226
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
527
- unselectButton.addActionListener(this);
1227
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1228
+ clearPanelButton.setToolTipText("Clear all controls");
1229
+ clearPanelButton.addActionListener(this);
5281230
1231
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ //unselectButton.setToolTipText("Unselect");
1233
+ //unselectButton.addActionListener(this);
1234
+
1235
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1236
+ flashSelectionButton.setToolTipText("Highlight selection");
1237
+ flashSelectionButton.addActionListener(this);
1238
+
1239
+ editCommandsPanel.preferredHeight = 1;
1240
+
1241
+ SetPinStates(false);
1242
+// oe.treePanel.add(commandsPanel);
1243
+// oe.treePanel.Return();
1244
+
5291245 // oe.aConstraints.gridx += 1;
5301246 // oe.aConstraints.weighty = 0;
5311247 // oe.aConstraints.gridwidth = 1;
....@@ -537,47 +1253,32 @@
5371253 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5381254 // gcButton.addActionListener(this);
5391255
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
1256
+ cGridBag jSPPanel = new cGridBag();
1257
+
1258
+ JScrollPane jSP;
5511259 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1260
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5531261 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
558
-
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
563
- colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
566
- materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
569
- textureCB.addItemListener(this);
570
-
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
5731262
1263
+ oe.treePanel.add(jSPPanel);
1264
+ oe.treePanel.Return();
1265
+
1266
+ oe.treePanel.add(copyOptionsPanel);
1267
+ oe.treePanel.Return();
1268
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1269
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1270
+ sliderPane.preferredHeight = 1;
1271
+
1272
+// mainPanel.setDividerLocation(0.1); //1.0);
1273
+ mainPanel.setResizeWeight(0.4);
1274
+
5741275 //jList.addListSelectionListener(this);
5751276 oe.jTree.addTreeSelectionListener(this);
5761277 //jTree.setRootVisible(false);
5771278 //jTree.setEditable(true);
5781279 oe.jTree.setDragEnabled(true);
5791280 //jTree.setPreferredSize(new Dimension(10,10));
580
- jSP.setPreferredSize(new Dimension(100,200));
1281
+ //jSP.setPreferredSize(new Dimension(100,200));
5811282
5821283 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
5831284
....@@ -589,53 +1290,70 @@
5891290 dgr.addDragGestureListener(this);
5901291 }catch(Exception e) {}
5911292 */
592
- radio.layout = sevenButton;
1293
+ radio.layout = threeButton; // sixButton;
5931294 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
5941295 }
5951296
5961297 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
5971298 {
598
- //constraints.gridx = 0;
599
- //constraints.gridy = 0;
600
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
- fastCB.setToolTipText("Fast mode");
602
- fastCB.addItemListener(this);
603
- //constraints.gridy += 1;
604
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
- supportCB.setToolTipText("Enabled rigging");
606
- supportCB.addItemListener(this);
1299
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1300
+ colorCB.setToolTipText("Copy color when dropped");
1301
+ colorCB.addItemListener(this);
6071302
608
- // constraints.gridy += 1;
1303
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1304
+ materialCB.setToolTipText("Copy material when dropped");
1305
+ materialCB.addItemListener(this);
1306
+
1307
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1308
+ textureCB.setToolTipText("Copy texture when dropped");
1309
+ textureCB.addItemListener(this);
1310
+
1311
+ panel.Return();
1312
+
1313
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1314
+ boxCB.setToolTipText("Display bounding boxes");
1315
+ boxCB.addItemListener(this);
1316
+
1317
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1318
+ zoomBoxCB.setToolTipText("Display only for wheel");
1319
+ zoomBoxCB.addItemListener(this);
1320
+
1321
+ if (true) // Globals.ADVANCED)
1322
+ {
1323
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1324
+// supportCB.setToolTipText("Enable rigging");
1325
+// supportCB.addItemListener(this);
1326
+
1327
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1328
+ freezeCB.setToolTipText("Fast moving camera");
1329
+ freezeCB.addItemListener(this);
1330
+
6091331 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6101332 // localCB.addItemListener(this);
6111333
612
- //constraints.gridy += 1;
1334
+ panel.Return();
1335
+
6131336 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6141337 crowdCB.setToolTipText("Used for crowds");
6151338 crowdCB.addItemListener(this);
6161339
617
- //constraints.gridy += 1;
6181340 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
6191341 smoothCB.setToolTipText("Snapping delay");
6201342 smoothCB.addItemListener(this);
6211343
622
- //constraints.gridy += 1;
623
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
- slowCB.setToolTipText("Smooth interpolation");
625
- slowCB.addItemListener(this);
626
- //constraints.gridy += 1;
627
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628
- boxCB.setToolTipText("Display bounding boxes");
629
- boxCB.addItemListener(this);
630
- //constraints.gridy += 1;
631
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633
- zoomBoxCB.addItemListener(this);
634
-
1344
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1345
+// slowCB.setToolTipText("Smooth interpolation");
1346
+// slowCB.addItemListener(this);
1347
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1348
+ minshaderCB.setToolTipText("Minimal fast shader");
1349
+ minshaderCB.addItemListener(this);
1350
+
6351351 // constraints.gridy += 1;
6361352 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6371353 // speakerMocapCB.addItemListener(this);
6381354
1355
+ panel.Return();
1356
+
6391357 if (false)
6401358 {
6411359 // handled in scripts
....@@ -650,36 +1368,85 @@
6501368 //constraints.gridy += 1;
6511369 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6521370 smoothfocusCB.addItemListener(this);
1371
+ panel.Return();
6531372 }
6541373
6551374 //constraints.gridx += 1;
6561375 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6571376 // debugCB.addItemListener(this);
6581377
659
- //constraints.gridy += 1;
1378
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1379
+ trackCB.setToolTipText("Enable tracking target");
1380
+ trackCB.addItemListener(this);
1381
+
6601382 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1383
+ oeilCB.setToolTipText("Move camera when tracking");
6611384 oeilCB.addItemListener(this);
6621385
663
- //constraints.gridy += 1;
1386
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1387
+ shadowCB.setToolTipText("When live compute shadows");
1388
+ shadowCB.addItemListener(this);
1389
+
1390
+ panel.Return();
1391
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1392
+ toggleTextureCB.setToolTipText("Load textures");
1393
+ toggleTextureCB.addItemListener(this);
1394
+
1395
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1396
+ toggleSwitchCB.setToolTipText("Choose a single item");
1397
+ toggleSwitchCB.addItemListener(this);
1398
+
1399
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1400
+ autokeepCB.setToolTipText("On structure change");
1401
+ autokeepCB.addItemListener(this);
1402
+
1403
+ panel.Return();
1404
+ if (Globals.ADVANCED)
1405
+ {
6641406 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6651407 lookAtCB.setToolTipText("Look-at target");
6661408 lookAtCB.addItemListener(this);
1409
+ }
1410
+
1411
+ }
1412
+
1413
+ cGridBag fill = new cGridBag();
1414
+ fill.preferredHeight = 200;
1415
+ cGridBag fill2 = new cGridBag();
1416
+ fill2.preferredHeight = 200;
1417
+ cGridBag fill3 = new cGridBag();
1418
+ fill3.preferredHeight = 200;
1419
+
1420
+ panel.add(fill);
1421
+ panel.add(fill2);
1422
+ panel.add(fill3);
6671423
6681424 }
6691425
6701426 void EditObject(Object3D obj)
6711427 {
6721428 cRadio radioButton = new cRadio(obj.name);
1429
+
1430
+ // June 2019. Patch to avoid bug with transparency.
1431
+ radioButton.hadMaterial = obj.material != null;
1432
+ if (!radioButton.hadMaterial)
1433
+ {
1434
+ obj.material = new cMaterial();
1435
+ }
1436
+
6731437 radioButton.SetObject(obj);
674
- radioButton.layout = sevenButton;
1438
+ radioButton.layout = threeButton; // sixButton;
6751439 radioButton.SetCamera(cameraView.renderCamera, false);
6761440 radioButton.addActionListener(this);
6771441 radioPanel.add(radioButton);
6781442 buttonGroup.add(radioButton);
6791443 radioButton.doClick();
6801444 }
1445
+
6811446 void SetupViews(ObjEditor oe)
6821447 {
1448
+ theFrame = this;
1449
+
6831450 oe.SetupViews();
6841451
6851452 System.out.println("SetupViews");
....@@ -688,23 +1455,30 @@
6881455 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6891456 }
6901457
691
- JCheckBox liveCB;
692
- JCheckBox supportCB;
693
- JCheckBox localCB;
694
- JCheckBox crowdCB;
695
- JCheckBox smoothCB;
696
- JCheckBox fastCB;
697
- JCheckBox slowCB;
698
- JCheckBox boxCB;
699
- JCheckBox zoomBoxCB;
700
- JCheckBox trackCB;
701
- JCheckBox smoothfocusCB;
1458
+ cToggleButton liveCB;
1459
+ cCheckBox supportCB;
1460
+ cCheckBox localCB;
1461
+ cCheckBox crowdCB;
1462
+ cCheckBox smoothCB;
1463
+ cCheckBox minshaderCB;
1464
+
1465
+ cToggleButton fastCB;
1466
+ cCheckBox slowCB;
1467
+ cCheckBox boxCB;
1468
+ cCheckBox zoomBoxCB;
1469
+ cCheckBox freezeCB;
1470
+ //cToggleButton trackCB;
1471
+ cCheckBox trackCB;
1472
+ cCheckBox smoothfocusCB;
7021473 // JCheckBox speakerMocapCB;
703
- JCheckBox speakerCameraCB;
704
- JCheckBox speakerFocusCB;
705
- JCheckBox debugCB;
706
- JCheckBox oeilCB;
707
- JCheckBox lookAtCB;
1474
+ cCheckBox speakerCameraCB;
1475
+ cCheckBox speakerFocusCB;
1476
+ cCheckBox debugCB;
1477
+
1478
+ cCheckBox oeilCB;
1479
+ cCheckBox shadowCB;
1480
+ cCheckBox autokeepCB;
1481
+ cCheckBox lookAtCB;
7081482
7091483 // static int COLOR = 1;
7101484 // static int MATERIAL = 2;
....@@ -712,9 +1486,9 @@
7121486
7131487 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7141488
715
- JCheckBox colorCB;
716
- JCheckBox materialCB;
717
- JCheckBox textureCB;
1489
+ cCheckBox colorCB;
1490
+ cCheckBox materialCB;
1491
+ cCheckBox textureCB;
7181492
7191493 public void itemStateChanged(ItemEvent e)
7201494 {
....@@ -742,6 +1516,7 @@
7421516 } else if(e.getSource() == liveCB)
7431517 {
7441518 cameraView.ToggleLive();
1519
+ refreshContents(false);
7451520 }
7461521 else if(e.getSource() == supportCB)
7471522 {
....@@ -757,6 +1532,12 @@
7571532 {
7581533 cameraView.ToggleInertia();
7591534 cameraView.repaint();
1535
+ }
1536
+ else if(e.getSource() == minshaderCB)
1537
+ {
1538
+ Globals.MINSHADER ^= true;
1539
+ cameraView.programInitialized = false;
1540
+ cameraView.repaint();
7601541 }
7611542 else if(e.getSource() == localCB)
7621543 {
....@@ -806,6 +1587,18 @@
8061587 {
8071588 cameraView.ToggleOeil();
8081589 }
1590
+ else if(e.getSource() == shadowCB)
1591
+ {
1592
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1593
+ }
1594
+ else if(e.getSource() == freezeCB)
1595
+ {
1596
+ Globals.FREEZEONMOVE ^= true;
1597
+ }
1598
+ else if(e.getSource() == autokeepCB)
1599
+ {
1600
+ Globals.REPLACEONMAKE ^= true;
1601
+ }
8091602 else if(e.getSource() == lookAtCB)
8101603 {
8111604 cameraView.ToggleLookAt();
....@@ -822,7 +1615,8 @@
8221615
8231616 /**/
8241617 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
825
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1618
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1619
+ TreePath path = objEditor.jTree.getSelectionPath();
8261620 if ((path == null) || (path.getPathCount() <= 1)) {
8271621 // We can't move the root node or an empty selection
8281622 return;
....@@ -885,8 +1679,6 @@
8851679 }
8861680 }
8871681
888
- String string = (String) object;
889
-
8901682 System.out.println("Transfer = " + object + "; drop : " + target);
8911683 // if( object instanceof java.io.File[])
8921684 // {
....@@ -894,7 +1686,11 @@
8941686 // objEditor.DropFile((java.io.File[]) object, true);
8951687 // return;
8961688 // }
897
- if (string.charAt(0) == '/')
1689
+
1690
+ String string = object.toString();
1691
+
1692
+ // File path for Mac and Windows
1693
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8981694 {
8991695 // file(s)
9001696 String[] names = string.split("\n");
....@@ -921,7 +1717,7 @@
9211717
9221718 flashIt = false;
9231719 CameraPane pane = (CameraPane) target;
924
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1720
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9251721 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9261722
9271723 if (group.selection.size() == 1)
....@@ -937,23 +1733,33 @@
9371733
9381734 assert target == objEditor.jTree;
9391735 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1736
+ Object3D destinationLeaf;
9401737 try {
941
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1738
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9421739 } catch (Exception e) {
9431740 System.out.println("destinationPath : " + destinationPath);
9441741 return;
9451742 }
9461743
947
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1744
+ for (int i=group.selection.size(); --i>=0;)
9481745 {
1746
+ Object3D child = (Object3D)group.selection.elementAt(i);
1747
+
1748
+ // Cannot move into itself
1749
+ if (child == destinationLeaf)
1750
+ return;
1751
+ }
1752
+
1753
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1754
+// {
9491755 loadClipboard(true);
9501756 objEditor.jTree.setSelectionPath(destinationPath);
951
- pasteInto(false);
952
- } else {
953
- loadClipboard(false);
954
- objEditor.jTree.setSelectionPath(destinationPath);
955
- pasteInto(false); // true); // ???
956
- }
1757
+ pasteInto(false, false);
1758
+// } else {
1759
+// loadClipboard(false);
1760
+// objEditor.jTree.setSelectionPath(destinationPath);
1761
+// pasteInto(false, false); // true); // ???
1762
+// }
9571763 }
9581764 public void dropActionChanged(DropTargetDragEvent dtde)
9591765 // Called if the user has modified the current drop gesture
....@@ -1058,85 +1864,107 @@
10581864 {
10591865 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10601866 //heightFieldItem.addActionListener(this);
1061
- gridItem = menu.add(new MenuItem("Grid"));
1062
- gridItem.addActionListener(this);
1063
- rectoidItem = menu.add(new MenuItem("Box"));
1064
- rectoidItem.addActionListener(this);
1065
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1066
- ellipsoidItem.addActionListener(this);
1067
- coneItem = menu.add(new MenuItem("Cone"));
1068
- coneItem.addActionListener(this);
1069
- torusItem = menu.add(new MenuItem("Torus"));
1070
- torusItem.addActionListener(this);
1071
- superItem = menu.add(new MenuItem("Superellipsoid"));
1072
- superItem.addActionListener(this);
1867
+// gridItem = menu.add(new MenuItem("Grid"));
1868
+// gridItem.addActionListener(this);
1869
+// rectoidItem = menu.add(new MenuItem("Box"));
1870
+// rectoidItem.addActionListener(this);
1871
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1872
+// ellipsoidItem.addActionListener(this);
1873
+// coneItem = menu.add(new MenuItem("Cone"));
1874
+// coneItem.addActionListener(this);
1875
+// torusItem = menu.add(new MenuItem("Torus"));
1876
+// torusItem.addActionListener(this);
1877
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1878
+// superItem.addActionListener(this);
1879
+
1880
+ cameraItem = menu.add(new MenuItem("Camera"));
1881
+ cameraItem.addActionListener(this);
1882
+
1883
+ if (!Globals.ADVANCED)
1884
+ {
10731885 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10741886 kleinItem.addActionListener(this);
1075
- particleItem = menu.add(new MenuItem("Particle system"));
1076
- particleItem.addActionListener(this);
1887
+ }
1888
+
1889
+// particleItem = menu.add(new MenuItem("Particle system"));
1890
+// particleItem.addActionListener(this);
1891
+ if (Globals.ADVANCED)
1892
+ {
10771893 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10781894 ragdollItem.addActionListener(this);
10791895 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10801896 ragdoll2Item.addActionListener(this);
1897
+ }
10811898 menu.add("-");
1082
- meshItem = menu.add(new MenuItem("Mesh"));
1899
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10831900 meshItem.addActionListener(this);
10841901 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10851902 // meshGroupItem.addActionListener(this);
1903
+ if (Globals.ADVANCED)
1904
+ {
10861905 springItem = menu.add(new MenuItem("Spring"));
10871906 springItem.addActionListener(this);
10881907 flagItem = menu.add(new MenuItem("Flag"));
10891908 flagItem.addActionListener(this);
1090
- bezierItem = menu.add(new MenuItem("Patch"));
1091
- bezierItem.addActionListener(this);
1092
- checkerItem = menu.add(new MenuItem("Checker"));
1093
- checkerItem.addActionListener(this);
10941909 blobItem = menu.add(new MenuItem("Blob"));
10951910 blobItem.addActionListener(this);
10961911 latheItem = menu.add(new MenuItem("Lathe"));
10971912 latheItem.addActionListener(this);
1098
- lightItem = menu.add(new MenuItem("Light"));
1099
- lightItem.addActionListener(this);
1913
+ }
1914
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1915
+ bezierItem.addActionListener(this);
1916
+// overlayItem = menu.add(new MenuItem("Overlay"));
1917
+// overlayItem.addActionListener(this);
1918
+// lightItem = menu.add(new MenuItem("Light"));
1919
+// lightItem.addActionListener(this);
11001920 menu.add("-");
11011921 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11021922 //superLoopItem.addActionListener(this);
1103
- loopItem = menu.add(new MenuItem("Loop"));
1104
- loopItem.addActionListener(this);
1923
+// loopItem = menu.add(new MenuItem("Loop"));
1924
+// loopItem.addActionListener(this);
11051925 doubleItem = menu.add(new MenuItem("Fork"));
11061926 doubleItem.addActionListener(this);
1927
+ if (Globals.ADVANCED)
1928
+ {
11071929 tripleItem = menu.add(new MenuItem("Trident"));
11081930 tripleItem.addActionListener(this);
1931
+ }
11091932 }
11101933
11111934 void buildToolsMenu(Menu menu)
11121935 {
11131936 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11141937 animationItem.addItemListener(this);
1115
- animationItem.setState(CameraPane.ANIMATION);
1938
+ animationItem.setState(Globals.ANIMATION);
1939
+
1940
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1941
+ archiveItem.addActionListener(this);
11161942
11171943 menu.add("-");
11181944 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11191945 parseverticesItem.addActionListener(this);
11201946 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11211947 textureFieldItem.addActionListener(this);
1122
- alignItem = menu.add(new MenuItem("Align"));
1948
+ alignItem = menu.add(new MenuItem("Align Objects"));
11231949 alignItem.addActionListener(this);
1124
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1125
- mirrorItem.addActionListener(this);
11261950 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11271951 reduceMorphItem.addActionListener(this);
11281952 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11291953 reduce34MorphItem.addActionListener(this);
1130
-
1131
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1132
- computeAOItem.addActionListener(this);
11331954 menu.add("-");
1134
-
11351955 menu.add(memoryItem = new MenuItem("Memory Usage"));
11361956 memoryItem.addActionListener(this);
1957
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1958
+ computeAOItem.addActionListener(this);
1959
+
1960
+ if (Globals.ADVANCED)
1961
+ {
1962
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1963
+ mirrorItem.addActionListener(this);
1964
+ menu.add("-");
11371965 menu.add(analyzeItem = new MenuItem("Analyze"));
11381966 analyzeItem.addActionListener(this);
1139
- menu.add(dumpItem = new MenuItem("Dump"));
1967
+ menu.add(dumpItem = new MenuItem("Print"));
11401968 dumpItem.addActionListener(this);
11411969 // menu.add(pathItem = new MenuItem("From-to path"));
11421970 // pathItem.addActionListener(this);
....@@ -1154,6 +1982,7 @@
11541982 menu.add("-");
11551983 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11561984 editScriptItem.addActionListener(this);
1985
+ }
11571986 }
11581987
11591988 void ScreenFit()
....@@ -1276,9 +2105,34 @@
12762105 shadow.material = new cMaterial(obj.material);
12772106 shadow.material.diffuse = 0.0001f;
12782107 shadow.material.specular = 0.0001f;
2108
+ //shadow.projectedVertices[1].x = 300;
12792109
12802110 makeSomething(shadow);
12812111 }
2112
+
2113
+ private void ClearUnpinned()
2114
+ {
2115
+ //for (Object3D obj : listUI)
2116
+ for (int i=listUI.size(); --i>=0;)
2117
+ {
2118
+ Object3D obj = listUI.elementAt(i);
2119
+ if (!obj.pinned)
2120
+ {
2121
+ obj.CloseUI();
2122
+ listUI.remove(i);
2123
+ }
2124
+ }
2125
+ }
2126
+
2127
+ private void EditElement(Object3D elem, boolean newWindow)
2128
+ {
2129
+ // if (!(elem instanceof Composite))
2130
+ // newWindow = false;
2131
+ listUI.add(elem);
2132
+ elem.openEditWindow(this, newWindow); //, false);
2133
+ System.out.println("edit : " + elem);
2134
+ elem.editWindow.refreshContents(true); // ? new
2135
+ }
12822136
12832137 /**
12842138 * applyExample
....@@ -1482,9 +2336,9 @@
14822336
14832337 void Overwrite(int mask)
14842338 {
1485
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2339
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14862340 {
1487
- Object3D content = GrafreeD.clipboard.get(0);
2341
+ Object3D content = Grafreed.clipboard.get(0);
14882342
14892343 if (content instanceof cGroup && ((cGroup)content).transientlink )
14902344 content = ((cGroup)content).get(0);
....@@ -1523,7 +2377,7 @@
15232377 {
15242378 ScreenFit();
15252379 } else
1526
- if (source == switchItem)
2380
+ if (source == switchViewItem)
15272381 {
15282382 cVector v1 = new cVector();
15292383 cVector v2 = new cVector();
....@@ -1532,11 +2386,11 @@
15322386 objEditor.cameraView.renderCamera.setAim(v2, v1);
15332387 objEditor.cameraView.repaint();
15342388 } else
1535
- if (source == rectoidItem)
2389
+ if (source == rectoidItem || source == boxButton)
15362390 {
15372391 makeSomething(new Box());
15382392 } else
1539
- if (source == particleItem)
2393
+ if (source == particleItem || source == particlesButton)
15402394 {
15412395 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15422396 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1615,27 +2469,27 @@
16152469
16162470 makeSomething(obj);
16172471 } else
1618
- if (source == gridItem)
2472
+ if (source == gridItem || source == gridButton)
16192473 {
16202474 makeSomething(new Grid());
16212475 } else
1622
- if (source == ellipsoidItem)
2476
+ if (source == ellipsoidItem || source == sphereButton)
16232477 {
16242478 makeSomething(new Sphere());
16252479 } else
1626
- if (source == coneItem)
2480
+ if (source == coneItem || source == coneButton)
16272481 {
16282482 makeSomething(new Cone());
16292483 } else
1630
- if (source == torusItem)
2484
+ if (source == torusItem || source == torusButton)
16312485 {
16322486 makeSomething(new Torus());
16332487 } else
1634
- if (source == superItem)
2488
+ if (source == superItem || source == superButton)
16352489 {
16362490 makeSomething(new Superellipsoid());
16372491 } else
1638
- if (source == kleinItem)
2492
+ if (source == kleinItem || source == kleinButton)
16392493 {
16402494 makeSomething(new Klein());
16412495 } else
....@@ -1655,7 +2509,7 @@
16552509 {
16562510 makeSomething(new BezierSurface());
16572511 } else
1658
- if (source == checkerItem)
2512
+ if (source == overlayItem || source == overlayButton)
16592513 {
16602514 /*
16612515 Object3D obj = new BezierSurface(5,8);
....@@ -1703,10 +2557,27 @@
17032557 s.setup();
17042558 makeSomething(s);
17052559 } else
1706
- if (source == lightItem)
2560
+ if (source == lightItem || source == lightButton)
17072561 {
17082562 makeSomething(new Light());
17092563 } else
2564
+// if (source == skybox1Button ||
2565
+// source == skybox2Button ||
2566
+// source == skybox3Button ||
2567
+// source == skybox4Button ||
2568
+// source == skybox5Button ||
2569
+// source == skybox6Button ||
2570
+// source == skybox7Button ||
2571
+// source == skybox11Button ||
2572
+// source == skybox12Button ||
2573
+// source == skybox13Button ||
2574
+// source == skybox14Button ||
2575
+// source == skybox15Button ||
2576
+// source == skybox16Button ||
2577
+// source == skybox17Button)
2578
+// {
2579
+// ChangeSkybox(source);
2580
+// } else
17102581 if (source == csgItem)
17112582 {
17122583 group(new CSG());
....@@ -1753,30 +2624,30 @@
17532624
17542625 group(g);
17552626 } else
1756
- if (source == loopItem)
2627
+ if (source == loopItem || source == loopButton)
17572628 {
17582629 Composite csg = new GroupLeaf();
17592630 csg.count = 5;
17602631 group(csg);
1761
- Composite child = new cGroup();
2632
+ Composite child = new cGroup("Branch");
17622633 csg.addChild(child);
17632634 child.addChild(csg);
17642635 } else
17652636 if (source == doubleItem)
17662637 {
1767
- Composite csg = new GroupLeaf();
2638
+ Composite csg = new GroupLeaf("Fork");
17682639 csg.count = 5;
17692640 group(csg);
1770
- Composite child = new cGroup();
2641
+ Composite child = new cGroup("Branch A");
17712642 csg.addChild(child);
17722643 child.addChild(csg);
1773
- child = new cGroup();
2644
+ child = new cGroup("Branch B");
17742645 csg.addChild(child);
17752646 child.addChild(csg);
17762647 } else
17772648 if (source == tripleItem)
17782649 {
1779
- Composite csg = new GroupLeaf();
2650
+ Composite csg = new GroupLeaf("Trident");
17802651 csg.count = 4;
17812652 group(csg);
17822653 Composite child = new cGroup();
....@@ -1789,27 +2660,10 @@
17892660 csg.addChild(child);
17902661 child.addChild(csg);
17912662 } else
1792
-
1793
- if (source == importGFDItem)
1794
- {
1795
- ImportGFD();
1796
- } else
1797
- if (source == importVRMLX3DItem)
1798
- {
1799
- ImportVRMLX3D();
1800
- } else
1801
- if (source == import3DSItem)
1802
- {
1803
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1804
- } else
1805
- if (source == importOBJItem)
1806
- {
1807
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1808
- } else
18092663 if (source == computeAOItem)
18102664 {
18112665 Globals.drawMode = CameraPane.OCCLUSION;
1812
- Globals.theRenderer.repaint();
2666
+ cameraView.repaint();
18132667 } else
18142668 if (source == recompileItem)
18152669 {
....@@ -1824,7 +2678,7 @@
18242678 if (source == invariantsItem)
18252679 {
18262680 System.out.println("Invariants:");
1827
- GrafreeD.grafreeD.universe.invariants();
2681
+ Grafreed.grafreed.universe.invariants();
18282682 } else
18292683 if (source == memoryItem)
18302684 {
....@@ -1843,19 +2697,68 @@
18432697 {
18442698 DumpObject();
18452699 } else
2700
+ if (source == minButton)
2701
+ {
2702
+ Minimize();
2703
+ } else
2704
+ if (source == maxButton)
2705
+ {
2706
+ Maximize();
2707
+ } else
2708
+ if (source == fullButton)
2709
+ {
2710
+ ToggleFullScreen();
2711
+ } else
2712
+ if (source == previousVersionButton)
2713
+ {
2714
+ // Go to previous version
2715
+ //if (!Undo())
2716
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2717
+ PreviousVersion();
2718
+ } else
2719
+ if (source == restoreButton)
2720
+ {
2721
+ // Restore current version
2722
+ Restore();
2723
+ //restoreButton.setEnabled(false);
2724
+ } else
2725
+ if (source == replaceButton)
2726
+ {
2727
+ // Overwrite current version
2728
+ Replace();
2729
+ //replaceButton.setEnabled(false);
2730
+ } else
2731
+ if (source == nextVersionButton)
2732
+ {
2733
+ // Go to next version
2734
+ NextVersion();
2735
+ } else
2736
+ if (source == saveVersionButton)
2737
+ {
2738
+ // Save a new version
2739
+ if (!Save(true))
2740
+ java.awt.Toolkit.getDefaultToolkit().beep();
2741
+ } else
2742
+ if (source == deleteVersionButton)
2743
+ {
2744
+ // Delete a new version
2745
+ DeleteVersion();
2746
+ } else
2747
+ if (source == oneStepButton)
2748
+ {
2749
+ Globals.ONESTEP = true;
2750
+ cameraView.repaint();
2751
+ } else
18462752 if (source == screenfitButton)
18472753 {
1848
- //Reload(lastConverter, lastFilename, true);
18492754 ScreenFit();
18502755 } else
18512756 if (source == screenfitpointButton)
18522757 {
1853
- //Reload(lastConverter, lastFilename, true);
18542758 ScreenFitPoint();
18552759 } else
18562760 if (source == snapobjectButton)
18572761 {
1858
- //Reload(lastConverter, lastFilename, true);
18592762 SnapObject();
18602763 } else
18612764 // if (event.getSource() == recompileButton)
....@@ -1892,12 +2795,20 @@
18922795 {
18932796 loadClipboard(true);
18942797 } else
2798
+ if (source == undoItem)
2799
+ {
2800
+ PreviousVersion();
2801
+ } else
2802
+ if (source == redoItem)
2803
+ {
2804
+ NextVersion();
2805
+ } else
18952806 if (source == duplicateItem)
18962807 {
1897
- Object3D keep = GrafreeD.clipboard;
2808
+ Object3D keep = Grafreed.clipboard;
18982809 loadClipboard(false);
18992810 paste(false);
1900
- GrafreeD.clipboard = keep;
2811
+ Grafreed.clipboard = keep;
19012812 } else
19022813 if (source == cloneItem)
19032814 {
....@@ -1915,13 +2826,17 @@
19152826 {
19162827 paste(false);
19172828 } else
2829
+ if (source == pasteIntoItem)
2830
+ {
2831
+ pasteInto(true, false);
2832
+ } else
19182833 if (source == pasteLinkItem)
19192834 {
1920
- pasteInto(false);
2835
+ pasteInto(false, false);
19212836 } else
19222837 if (source == pasteCloneItem)
19232838 {
1924
- pasteInto(true);
2839
+ pasteInto(true, true);
19252840 } else
19262841 if (source == pasteExpandItem)
19272842 {
....@@ -2113,9 +3028,9 @@
21133028 // group.selection.get(0).setMasterThis(content); // should be identity
21143029 // refreshContents();
21153030 // }
2116
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3031
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21173032 {
2118
- Object3D content = GrafreeD.clipboard.get(0);
3033
+ Object3D content = Grafreed.clipboard.get(0);
21193034
21203035 if (content instanceof cGroup && ((cGroup)content).transientlink )
21213036 content = ((cGroup)content).get(0);
....@@ -2123,11 +3038,11 @@
21233038 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21243039 for (int i=0; i<group.selection.size(); i++)
21253040 {
2126
- boolean random = CameraPane.RANDOM;
2127
- CameraPane.RANDOM = false; // parse all random nodes
3041
+ boolean random = CameraPane.SWITCH;
3042
+ CameraPane.SWITCH = false; // parse all random nodes
21283043 group.selection.get(i).linkVerticesThis(content);
21293044 // group.selection.get(i).setMasterThis(content); // should be identity
2130
- CameraPane.RANDOM = random;
3045
+ CameraPane.SWITCH = random;
21313046 }
21323047 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21333048 refreshContents();
....@@ -2137,20 +3052,20 @@
21373052 {
21383053 for (int i=0; i<group.selection.size(); i++)
21393054 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
3055
+ boolean random = CameraPane.SWITCH;
3056
+ CameraPane.SWITCH = false; // parse all random nodes
21423057 group.selection.get(i).linkVerticesThis(null);
2143
- CameraPane.RANDOM = random;
3058
+ CameraPane.SWITCH = random;
21443059 }
21453060
21463061 refreshContents();
21473062 } else
21483063 if (source == relinkverticesItem)
21493064 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
3065
+ boolean random = CameraPane.SWITCH;
3066
+ CameraPane.SWITCH = false; // parse all random nodes
21523067 group.selection.RelinkToSupport();
2153
- CameraPane.RANDOM = random;
3068
+ CameraPane.SWITCH = random;
21543069
21553070 refreshContents();
21563071 } else
....@@ -2165,9 +3080,9 @@
21653080 } else
21663081 if (source == setMasterItem)
21673082 {
2168
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
3083
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21693084 {
2170
- Object3D content = GrafreeD.clipboard.get(0);
3085
+ Object3D content = Grafreed.clipboard.get(0);
21713086
21723087 if (content instanceof cGroup && ((cGroup)content).transientlink )
21733088 content = ((cGroup)content).get(0);
....@@ -2180,9 +3095,9 @@
21803095 {
21813096 if (group.selection.size() == 1)
21823097 {
2183
- if (GrafreeD.clipboard.size() == 1)
3098
+ if (Grafreed.clipboard.size() == 1)
21843099 {
2185
- Object3D content = GrafreeD.clipboard.get(0);
3100
+ Object3D content = Grafreed.clipboard.get(0);
21863101
21873102 if (content instanceof cGroup && ((cGroup)content).transientlink )
21883103 content = ((cGroup)content).get(0);
....@@ -2199,7 +3114,7 @@
21993114 {
22003115 RevertMeshes();
22013116 } else
2202
- if (source == resetMeshItem)
3117
+ if (source == resetAllItem)
22033118 {
22043119 ResetAll();
22053120 } else
....@@ -2207,7 +3122,7 @@
22073122 {
22083123 StepAll();
22093124 } else
2210
- if (source == clearItem) // || event.getSource() == clearButton)
3125
+ if (source == deleteItem) // || event.getSource() == clearButton)
22113126 {
22123127 //int indices[] = jList.getSelectedIndices();
22133128 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2219,9 +3134,9 @@
22193134 {
22203135 ClearSelection(true);
22213136 } else
2222
- if (source == grabItem)
3137
+ if (source == grabItem || source == groupButton)
22233138 {
2224
- group(new cGroup(), true);
3139
+ group(new cGroup(), false); // true);
22253140 } else
22263141 if (source == hideItem)
22273142 {
....@@ -2239,16 +3154,16 @@
22393154 {
22403155 makeSomething(new Camera());
22413156 } else
2242
- if (source == compositeItem)
3157
+ if (source == compositeItem || source == compositeButton)
22433158 {
22443159 group(new Composite());
22453160 } else
2246
- if (source == randomItem)
3161
+ if (source == switchItem || source == switchButton)
22473162 {
22483163 RandomNode random = new RandomNode();
22493164 group(random);
22503165 if (random.size() > 0)
2251
- random.name = random.get(0).name + "Rnd";
3166
+ random.name = random.get(0).name + "Switch";
22523167 } else
22533168 if (source == physicsItem)
22543169 {
....@@ -2345,7 +3260,7 @@
23453260 {
23463261 group(new cLinker());
23473262 } else
2348
- if (source == textureItem)
3263
+ if (source == textureItem || source == textureButton)
23493264 {
23503265 group(new TextureNode());
23513266 } else
....@@ -2365,17 +3280,30 @@
23653280 {
23663281 CastShadow(2);
23673282 } else
2368
- if (source == ungroupItem)
3283
+ if (source == ungroupItem || source == ungroupButton)
23693284 {
2370
- //ungroup();
3285
+ boolean hasRoot = false;
3286
+
23713287 for (int i=0; i<group.selection.size(); i++)
23723288 {
2373
- Ungroup(group.selection.get(i));
3289
+ if (group.selection.get(i) == group)
3290
+ {
3291
+ hasRoot = true;
3292
+ break;
3293
+ }
23743294 }
23753295
2376
- ClearSelection(false);
2377
-
2378
- refreshContents();
3296
+ if (!hasRoot)
3297
+ {
3298
+ for (int i=0; i<group.selection.size(); i++)
3299
+ {
3300
+ Ungroup(group.selection.get(i));
3301
+ }
3302
+
3303
+ ClearSelection(false);
3304
+
3305
+ refreshContents();
3306
+ }
23793307 } else
23803308 if (source == genUVItem)
23813309 {
....@@ -2387,7 +3315,7 @@
23873315 } else
23883316 if (source == genNormalsMESHItem)
23893317 {
2390
- GenNormals(true); // TODO
3318
+ GenNormalsMESH();
23913319 } else
23923320 if (source == genNormalsORGANItem)
23933321 {
....@@ -2452,6 +3380,22 @@
24523380 if (source == unmarkleavesItem)
24533381 {
24543382 MarkLeaves(false);
3383
+ } else
3384
+ if (source == rewindleavesItem)
3385
+ {
3386
+ RewindLeaves(true);
3387
+ } else
3388
+ if (source == unrewindleavesItem)
3389
+ {
3390
+ RewindLeaves(false);
3391
+ } else
3392
+ if (source == randomleavesItem)
3393
+ {
3394
+ RandomLeaves(true);
3395
+ } else
3396
+ if (source == unrandomleavesItem)
3397
+ {
3398
+ RandomLeaves(false);
24553399 } else
24563400 if (source == flipVItem)
24573401 {
....@@ -2537,9 +3481,13 @@
25373481 {
25383482 SmoothMesh();
25393483 } else
2540
- if (source == transformgeometryItem)
3484
+ if (source == transformGeometryItem)
25413485 {
25423486 TransformGeometry();
3487
+ } else
3488
+ if (source == transformChildrenItem)
3489
+ {
3490
+ TransformChildren();
25433491 } else
25443492 if (source == resetTransformItem)
25453493 {
....@@ -2547,7 +3495,11 @@
25473495 } else
25483496 if (source == resetCentroidItem)
25493497 {
2550
- ResetCentroid();
3498
+ ResetCentroid(true);
3499
+ } else
3500
+ if (source == resetCentroidXZItem)
3501
+ {
3502
+ ResetCentroid(false);
25513503 } else
25523504 if (source == resetParentItem)
25533505 {
....@@ -2652,7 +3604,7 @@
26523604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26533605 {
26543606 obj = (Object3D)e.nextElement();
2655
- obj.SetBumpTexture(null);
3607
+ obj.ResetBumpTexture();
26563608 }
26573609
26583610 refreshContents();
....@@ -2668,6 +3620,31 @@
26683620
26693621 refreshContents();
26703622 } else
3623
+ if (source == embedTexturesItem)
3624
+ {
3625
+ Object3D obj;
3626
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3627
+ {
3628
+ obj = (Object3D)e.nextElement();
3629
+ obj.EmbedTextures(true);
3630
+ }
3631
+
3632
+ refreshContents();
3633
+ } else
3634
+ if (source == deEmbedTexturesItem)
3635
+ {
3636
+ Object3D obj;
3637
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3638
+ {
3639
+ obj = (Object3D)e.nextElement();
3640
+ obj.EmbedTextures(false);
3641
+ }
3642
+
3643
+ CameraPane.texturepigment.clear();
3644
+ CameraPane.texturebump.clear();
3645
+
3646
+ refreshContents();
3647
+ } else
26713648 if (source == flashSelectionButton)
26723649 {
26733650 CameraPane.flash = true;
....@@ -2679,6 +3656,10 @@
26793656 if (source == twoButton)
26803657 {
26813658 radio.layout = twoButton;
3659
+
3660
+ if (CameraPane.FULLSCREEN)
3661
+ fullscreenLayout = radio.layout;
3662
+
26823663 // bug
26833664 //gridPanel.setDividerLocation(1.0);
26843665 //bigPanel.setDividerLocation(0.0);
....@@ -2711,10 +3692,31 @@
27113692 bigThree.ClearUI();
27123693 bigThree.add(centralPanel);
27133694 bigThree.FlushUI();
3695
+
3696
+ cameraView.requestFocusInWindow();
3697
+
3698
+// refreshContents(true);
3699
+//
3700
+// try
3701
+// {
3702
+// java.awt.Robot bot = new java.awt.Robot();
3703
+// int mask = InputEvent.BUTTON1_MASK;
3704
+// bot.mouseMove(100, 100);
3705
+// bot.mousePress(mask);
3706
+// bot.mouseRelease(mask);
3707
+// }
3708
+// catch (Exception e)
3709
+// {
3710
+//
3711
+// }
3712
+
27143713 } else
27153714 if (source == threeButton)
27163715 {
27173716 radio.layout = threeButton;
3717
+
3718
+ if (CameraPane.FULLSCREEN)
3719
+ fullscreenLayout = radio.layout;
27183720
27193721 // bigThree.remove(scenePanel);
27203722 // bigThree.remove(centralPanel);
....@@ -2744,13 +3746,18 @@
27443746 // centralPanel.setVisible(true);
27453747 // XYZPanel.setVisible(true);
27463748 bigThree.ClearUI();
3749
+ bigThree.add(scenePanel);
27473750 bigThree.add(centralPanel);
2748
- bigThree.add(XYZPanel);
27493751 bigThree.FlushUI();
3752
+
3753
+ cameraView.requestFocusInWindow();
27503754 } else
27513755 if (source == fourButton)
27523756 {
27533757 radio.layout = fourButton;
3758
+
3759
+ if (CameraPane.FULLSCREEN)
3760
+ fullscreenLayout = radio.layout;
27543761
27553762 // bigThree.remove(scenePanel);
27563763 // bigThree.remove(centralPanel);
....@@ -2782,10 +3789,15 @@
27823789 bigThree.ClearUI();
27833790 bigThree.add(scenePanel);
27843791 bigThree.FlushUI();
3792
+
3793
+ cameraView.requestFocusInWindow();
27853794 } else
27863795 if (source == sixButton)
27873796 {
27883797 radio.layout = sixButton;
3798
+
3799
+ if (CameraPane.FULLSCREEN)
3800
+ fullscreenLayout = radio.layout;
27893801
27903802 // bigThree.remove(scenePanel);
27913803 // bigThree.remove(centralPanel);
....@@ -2815,13 +3827,18 @@
28153827 // centralPanel.setVisible(true);
28163828 // XYZPanel.setVisible(false);
28173829 bigThree.ClearUI();
2818
- bigThree.add(scenePanel);
28193830 bigThree.add(centralPanel);
3831
+ bigThree.add(scenePanel);
28203832 bigThree.FlushUI();
3833
+
3834
+ cameraView.requestFocusInWindow();
28213835 } else
28223836 if (source == sevenButton)
28233837 {
28243838 radio.layout = sevenButton;
3839
+
3840
+ if (CameraPane.FULLSCREEN)
3841
+ fullscreenLayout = radio.layout;
28253842
28263843 // bigThree.remove(scenePanel);
28273844 // bigThree.remove(centralPanel);
....@@ -2855,6 +3872,8 @@
28553872 bigThree.add(centralPanel);
28563873 bigThree.add(XYZPanel);
28573874 bigThree.FlushUI();
3875
+
3876
+ cameraView.requestFocusInWindow();
28583877 } else
28593878 if (source == rootButton)
28603879 {
....@@ -2866,6 +3885,7 @@
28663885 EditObject(obj);
28673886 }
28683887
3888
+ cameraView.requestFocusInWindow();
28693889 refreshContents(true);
28703890 } else
28713891 if (source == closeButton)
....@@ -2875,22 +3895,37 @@
28753895 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28763896 {
28773897 ab = (cRadio)e.nextElement();
2878
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3898
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28793899 {
3900
+ // Patch to avoid bug with transparency.
3901
+ if (!ab.hadMaterial)
3902
+ {
3903
+ ab.object.material = null;
3904
+ }
3905
+
28803906 buttonGroup.remove(ab);
28813907 radioPanel.remove(ab);
28823908
2883
- ab.GetObject().editWindow = null;
3909
+ //ab.GetObject().editWindow = null;
3910
+ ab.GetObject().manipWindow = null;
28843911 // ab.GetObject().objectUI = null; // ?????????
28853912
28863913 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28873914 break;
28883915 }
28893916 }
3917
+
3918
+ cameraView.requestFocusInWindow();
28903919 refreshContents(true);
28913920 } else
28923921 if (source == editItem || source == editButton)
28933922 {
3923
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3924
+ {
3925
+ Object3D child = (Object3D)e.nextElement();
3926
+ child.pinned = true;
3927
+ }
3928
+
28943929 EditSelection(false);
28953930 } else
28963931 if (source == uneditButton)
....@@ -2899,13 +3934,14 @@
28993934 {
29003935 Object3D child = (Object3D)e.nextElement();
29013936 if(child.editWindow != null)
2902
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3937
+ child.pinned = false;
29033938 child.CloseUI();
29043939 listUI.remove(child);
3940
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29053941
2906
- child.editWindow = null; // ???????????
3942
+ //child.editWindow = null; // ???????????
29073943 }
2908
- objEditor.ctrlPanel.validate();
3944
+ objEditor.ctrlPanel.FlushUI();
29093945 //objEditor.jTree.clearSelection();
29103946 //objEditor.ResetSliders();
29113947 refreshContents(true);
....@@ -2916,16 +3952,18 @@
29163952 //copy.ClearUI();
29173953 for (Object3D obj : listUI)
29183954 {
3955
+ obj.pinned = false;
29193956 obj.CloseUI();
29203957 }
29213958 listUI.clear();
3959
+ SetPinStates(group.selection.size() > 0);
29223960 refreshContents(true);
29233961 } else
29243962 if (source == allParamsButton)
29253963 {
29263964 assert(copy == group);
29273965
2928
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3966
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29293967
29303968 for (Object3D obj : listUI)
29313969 {
....@@ -2974,6 +4012,9 @@
29744012 }
29754013
29764014 copy = group;
4015
+
4016
+ SetUndoStates();
4017
+
29774018 //Globals.theRenderer.object = group;
29784019 if(!useclient)
29794020 {
....@@ -2989,20 +4030,49 @@
29894030 frontView.object = group;
29904031 sideView.object = group;
29914032 }
2992
- group.editWindow = this;
4033
+
4034
+// fix "+" issue
4035
+ //group.editWindow = this;
4036
+ group.manipWindow = this;
4037
+
29934038 /*
29944039 currentLayout = radio.layout;
29954040 if (currentLayout == null)
29964041 currentLayout = sevenButton;
29974042 */
29984043 radio.layout.doClick();
4044
+
4045
+ ClearUnpinned();
4046
+
4047
+ //Grafreed.Assert(group != null);
4048
+ //Grafreed.Assert(group.selection != null);
4049
+ SetPinStates(group.selection == null || group.selection.size() > 0);
4050
+ if (group.selection == null || group.selection.size() == 1)
4051
+ EditSelection(false);
29994052 keepparent = group.parent;
30004053 // PARENT = NULL or not???
30014054 //group.parent = null; // ROOT
30024055 //group.attributes = -1;
30034056 ResetModel();
4057
+
4058
+ cameraView.requestFocusInWindow();
30044059 refreshContents(true);
3005
- }
4060
+ } else if (event.getSource() == editCameraItem)
4061
+ {
4062
+ cameraView.ProtectCamera();
4063
+ cameraView.requestFocusInWindow();
4064
+ cameraView.repaint();
4065
+ return;
4066
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
4067
+ {
4068
+ cameraView.RevertCamera();
4069
+ cameraView.requestFocusInWindow();
4070
+ cameraView.repaint();
4071
+ return;
4072
+ // } else if (event.getSource() == textureButton)
4073
+ // {
4074
+ // return; // true;
4075
+ }
30064076 else
30074077 {
30084078 //return super.action(event, arg);
....@@ -3011,7 +4081,6 @@
30114081 }
30124082
30134083 boolean useclient = false;
3014
- cRadio radio;
30154084
30164085 void ToggleRoot()
30174086 {
....@@ -3063,6 +4132,28 @@
30634132 refreshContents();
30644133 }
30654134
4135
+ void TransformChildren()
4136
+ {
4137
+ Object3D obj;
4138
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4139
+ {
4140
+ obj = (Object3D)e.nextElement();
4141
+ obj.KeepTextureMatrices();
4142
+ obj.TransformChildren();
4143
+ obj.RestoreTextureMatrices();
4144
+
4145
+// if (obj.parent == null)
4146
+// {
4147
+// System.out.println("NULL PARENT!");
4148
+// new Exception().printStackTrace();
4149
+// }
4150
+// else
4151
+// TouchTransform(obj);
4152
+// //obj.parent.Touch();
4153
+ }
4154
+
4155
+ refreshContents();
4156
+ }
30664157
30674158 void ResetTransform()
30684159 {
....@@ -3175,7 +4266,7 @@
31754266 refreshContents();
31764267 }
31774268
3178
- void ResetCentroid()
4269
+ void ResetCentroid(boolean full)
31794270 {
31804271 Object3D obj;
31814272 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3190,12 +4281,16 @@
31904281 LA.matIdentity(Object3D.mat);
31914282 obj.getBounds(minima, maxima, false);
31924283 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3193
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4284
+ if (full)
4285
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31944286 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31954287 obj.TransformMesh(Object3D.mat);
4288
+
31964289 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3197
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4290
+ if (full)
4291
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31984292 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4293
+
31994294 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32004295 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32014296 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3224,7 +4319,8 @@
32244319
32254320 int size = obj.MemorySize();
32264321
3227
- System.err.println((size/1024) + " KB is the size of " + obj);
4322
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4323
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32284324 }
32294325 }
32304326 catch (Exception e)
....@@ -3261,9 +4357,9 @@
32614357 obj = (Object3D)e.nextElement();
32624358
32634359 System.out.println("Object is: " + obj);
3264
- GrafreeD.AnalyzeObject(obj);
4360
+ Grafreed.AnalyzeObject(obj);
32654361 System.out.println("Boundary rep: " + obj.bRep);
3266
- GrafreeD.AnalyzeObject(obj.bRep);
4362
+ Grafreed.AnalyzeObject(obj.bRep);
32674363
32684364 // System.err.println((size/1024) + " KB is the size of " + obj);
32694365 }
....@@ -3305,6 +4401,13 @@
33054401 void GenNormals(boolean crease)
33064402 {
33074403 group.GenNormalsS(crease);
4404
+
4405
+ refreshContents();
4406
+ }
4407
+
4408
+ void GenNormalsMESH()
4409
+ {
4410
+ group.GenNormalsMeshS();
33084411
33094412 refreshContents();
33104413 }
....@@ -3477,8 +4580,8 @@
34774580
34784581 void ParseVertices()
34794582 {
3480
- boolean epsequal = GrafreeD.epsequal;
3481
- GrafreeD.epsequal = true;
4583
+ boolean epsequal = Grafreed.epsequal;
4584
+ Grafreed.epsequal = true;
34824585
34834586 for (int i=0; i<group.selection.size(); i++)
34844587 {
....@@ -3503,7 +4606,7 @@
35034606 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35044607 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35054608
3506
- g.add(GrafreeD.clipboard);
4609
+ g.add(Grafreed.clipboard);
35074610
35084611 buffer.add(g);
35094612 }
....@@ -3518,7 +4621,7 @@
35184621 makeSomething(buffer, i==group.selection.size()-1);
35194622 }
35204623
3521
- GrafreeD.epsequal = epsequal;
4624
+ Grafreed.epsequal = epsequal;
35224625
35234626 refreshContents();
35244627 }
....@@ -3536,7 +4639,16 @@
35364639 String pigment = Object3D.GetPigment(tex);
35374640 //String bump = Object3D.GetBump(tex);
35384641
3539
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4642
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4643
+
4644
+ try
4645
+ {
4646
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4647
+ }
4648
+ catch (Exception e)
4649
+ {
4650
+ System.err.println("FAIL: " + node);
4651
+ }
35404652
35414653 double s = v.s;
35424654
....@@ -3624,11 +4736,11 @@
36244736
36254737 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36264738
3627
- boolean random = CameraPane.RANDOM;
3628
- CameraPane.RANDOM = false; // parse all random nodes
4739
+ boolean random = CameraPane.SWITCH;
4740
+ CameraPane.SWITCH = false; // parse all random nodes
36294741 lowres.linkVerticesThis(null);
36304742 lowres.linkVerticesThis(sn);
3631
- CameraPane.RANDOM = random;
4743
+ CameraPane.SWITCH = random;
36324744
36334745 System.err.flush();
36344746
....@@ -3668,7 +4780,7 @@
36684780 return;
36694781
36704782 Object3D poses = group.selection.get(0);
3671
- Object3D ref = GrafreeD.clipboard.get(0);
4783
+ Object3D ref = Grafreed.clipboard.get(0);
36724784
36734785 Object3D newgroup = new Object3D("Po:" + poses.name);
36744786
....@@ -3862,9 +4974,9 @@
38624974
38634975 void ClipMesh()
38644976 {
3865
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4977
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38664978 {
3867
- Object3D content = GrafreeD.clipboard.get(0);
4979
+ Object3D content = Grafreed.clipboard.get(0);
38684980
38694981 if (content instanceof cGroup && ((cGroup)content).transientlink )
38704982 content = ((cGroup)content).get(0);
....@@ -3873,7 +4985,7 @@
38734985 // {
38744986 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38754987 // }
3876
- group.selection.ClipMesh(GrafreeD.clipboard);
4988
+ group.selection.ClipMesh(Grafreed.clipboard);
38774989 }
38784990 // group.selection.ClipMesh(GrafreeD.clipboard);
38794991 System.out.println("DONE.");
....@@ -3920,6 +5032,18 @@
39205032 void MarkLeaves(boolean hide)
39215033 {
39225034 group.selection.MarkLeaves(hide);
5035
+ refreshContents();
5036
+ }
5037
+
5038
+ void RewindLeaves(boolean hide)
5039
+ {
5040
+ group.selection.RewindLeaves(hide);
5041
+ refreshContents();
5042
+ }
5043
+
5044
+ void RandomLeaves(boolean hide)
5045
+ {
5046
+ group.selection.RandomLeaves(hide);
39235047 refreshContents();
39245048 }
39255049
....@@ -3994,28 +5118,25 @@
39945118 // }
39955119 // }
39965120
3997
- static boolean allparams = true;
3998
-
3999
- static Vector<Object3D> listUI = new Vector<Object3D>();
4000
-
40015121 void EditSelection(boolean newWindow)
40025122 {
5123
+ if (group.selection == null)
5124
+ {
5125
+ EditElement(group, newWindow); // ? new
5126
+ return;
5127
+ }
5128
+
40035129 // aConstraints.gridy = 0;
40045130 for (int i=0; i<group.selection.size(); i++)
40055131 {
40065132 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40075133 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4008
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5134
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40095135
40105136 Object3D elem = (Object3D)group.selection.elementAt(i);
4011
- if(elem != group)
5137
+ if(elem != group || !newWindow)
40125138 {
4013
- // if (!(elem instanceof Composite))
4014
- // newWindow = false;
4015
- listUI.add(elem);
4016
- elem.openEditWindow(this, newWindow); //, false);
4017
- System.out.println("edit : " + elem);
4018
- elem.editWindow.refreshContents(true); // ? new
5139
+ EditElement(elem, newWindow); // ? new
40195140 }
40205141 }
40215142 }
....@@ -4078,9 +5199,7 @@
40785199
40795200 freezemodel = false;
40805201 }
4081
-
4082
- boolean flashIt = true;
4083
-
5202
+
40845203 public void valueChanged(TreeSelectionEvent e)
40855204 //public boolean handleEvent(Event event)
40865205 {
....@@ -4090,7 +5209,8 @@
40905209 //new Exception().printStackTrace();
40915210
40925211 freezemodel = true;
4093
-
5212
+ ClearUnpinned();
5213
+
40945214 /**/
40955215 //switch (event.id)
40965216 {
....@@ -4098,7 +5218,6 @@
40985218 //case 702: // Event.LIST_DESELECT
40995219 group.deselectAll();
41005220 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4101
- objEditor.ClearInfo(); // .GetMaterial());
41025221 if (tps != null)
41035222 {
41045223 for (int i=0; i < tps.length; i++)
....@@ -4107,33 +5226,39 @@
41075226
41085227 //if (child.parent != null)
41095228 //child.parent.addSelectee(child);
5229
+ objEditor.SetMaterial(child);
41105230 group.addSelectee(child);
4111
- objEditor.SetMaterial(child); // .GetMaterial());
4112
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4113
- System.err.println("info : " + child.GetPath());
41145231 }
41155232 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
5233
+// else
5234
+// {
5235
+// objEditor.SetMaterial(group); // .GetMaterial());
5236
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5237
+// System.err.println("info : " + group.GetPath());
5238
+// }
41225239
4123
- objEditor.SetText(); // jan 2014
4124
-
4125
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5240
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41265241 CameraPane.flash = true;
41275242
4128
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5243
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41295244 // a camera
41305245 {
4131
- CameraPane.camerachangeframe = 0; // don't refuse it
4132
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5246
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5247
+ {
5248
+ CameraPane.camerachangeframe = 0; // don't refuse it
5249
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5250
+ }
41335251 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41345252 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41355253 }
41365254
5255
+ if (tps != null && tps.length == 1)
5256
+ {
5257
+ EditSelection(false);
5258
+ }
5259
+
5260
+ SetPinStates(tps != null && tps.length > 0);
5261
+
41375262 refreshContents();
41385263 //return true;
41395264 }
....@@ -4142,6 +5267,37 @@
41425267
41435268 freezemodel = false;
41445269 }
5270
+
5271
+ void SetPinStates(boolean enabled)
5272
+ {
5273
+ editButton.setEnabled(enabled);
5274
+ uneditButton.setEnabled(enabled);
5275
+ //unselectButton.setEnabled(enabled);
5276
+ flashSelectionButton.setEnabled(enabled);
5277
+
5278
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5279
+ }
5280
+
5281
+ void refreshContents(boolean cp)
5282
+ {
5283
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5284
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5285
+ {
5286
+ objEditor.ClearInfo(); // .GetMaterial());
5287
+
5288
+ for (int i=0; i < group.selection.Size(); i++)
5289
+ {
5290
+ Object3D child = (Object3D) group.selection.get(i);
5291
+
5292
+ objEditor.AddInfo(child, this, true);
5293
+ System.err.println("info : " + child.GetPath());
5294
+ }
5295
+
5296
+ objEditor.SetText(); // jan 2014
5297
+ }
5298
+
5299
+ super.refreshContents(cp);
5300
+ }
41455301
41465302 void linkSomething(Object3D thing)
41475303 {
....@@ -4213,16 +5369,19 @@
42135369 {
42145370 if (group.selection.isEmpty())
42155371 return;
4216
- GrafreeD.clipboardIsTempGroup = false;
5372
+
5373
+ Grafreed.clipboardIsTempGroup = false;
42175374 Composite tGroup = null;
42185375 if (group.selection.size() > 0) // 1)
42195376 {
42205377 tGroup = new cGroup();
4221
- GrafreeD.clipboardIsTempGroup = true;
5378
+ Grafreed.clipboardIsTempGroup = true;
42225379 }
42235380
42245381 if (cut)
42255382 {
5383
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5384
+// Save();
42265385 //int indices[] = jList.getSelectedIndices();
42275386 //for (int i = indices.length - 1; i >= 0; i--)
42285387 //jList.remove(indices[i]);
....@@ -4258,16 +5417,16 @@
42585417 //System.out.println("cut " + child);
42595418 //System.out.println("parent = " + child.parent);
42605419 // tmp.addChild(child);
4261
- if (GrafreeD.clipboardIsTempGroup)
5420
+ if (Grafreed.clipboardIsTempGroup)
42625421 tGroup.add/*Child*/(tmp);
42635422 else
4264
- GrafreeD.clipboard = tmp;
5423
+ Grafreed.clipboard = tmp;
42655424 }
42665425 else
4267
- if (GrafreeD.clipboardIsTempGroup)
5426
+ if (Grafreed.clipboardIsTempGroup)
42685427 tGroup.add/*Child*/(child);
42695428 else
4270
- GrafreeD.clipboard = child;
5429
+ Grafreed.clipboard = child;
42715430 }
42725431
42735432 //ResetModel();
....@@ -4299,21 +5458,23 @@
42995458 //System.out.println("cut " + elem);
43005459 //System.out.println("parent = " + elem.parent);
43015460 // tmp.addChild(elem);
4302
- if (GrafreeD.clipboardIsTempGroup)
5461
+ if (Grafreed.clipboardIsTempGroup)
43035462 tGroup.add/*Child*/(tmp);
43045463 else
4305
- GrafreeD.clipboard = tmp;
5464
+ Grafreed.clipboard = tmp;
43065465 }
43075466 else
4308
- if (GrafreeD.clipboardIsTempGroup)
5467
+ if (Grafreed.clipboardIsTempGroup)
43095468 tGroup.add/*Child*/(child);
43105469 else
4311
- GrafreeD.clipboard = child;
5470
+ Grafreed.clipboard = child;
43125471 }
43135472
43145473 }
4315
- if (GrafreeD.clipboardIsTempGroup)
4316
- GrafreeD.clipboard = tGroup;
5474
+
5475
+ if (Grafreed.clipboardIsTempGroup)
5476
+ Grafreed.clipboard = tGroup;
5477
+
43175478 if (cut)
43185479 {
43195480 ResetModel();
....@@ -4323,11 +5484,15 @@
43235484
43245485 void paste(boolean expand)
43255486 {
5487
+ if (Globals.REPLACEONMAKE)
5488
+ Save();
5489
+ boolean keep = Globals.REPLACEONMAKE;
5490
+ Globals.REPLACEONMAKE = false;
43265491 // if (GrafreeD.clipboard == null)
43275492 // return;
43285493 boolean first = true;
43295494
4330
- if (GrafreeD.clipboardIsTempGroup)
5495
+ if (Grafreed.clipboardIsTempGroup)
43315496 {
43325497 Composite temp;
43335498
....@@ -4338,7 +5503,7 @@
43385503 temp = (Composite)Applet3D.clipboard.deepCopy();
43395504 */
43405505 Object3D elem;
4341
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5506
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43425507 {
43435508 Object3D child = (Object3D)e.nextElement();
43445509
....@@ -4372,21 +5537,22 @@
43725537 //Object3D cb = Applet3D.clipboard;
43735538 //temp.addChild(cb);
43745539 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4375
- assert(GrafreeD.clipboard.parent == null);
4376
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4377
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4378
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4379
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5540
+ assert(Grafreed.clipboard.parent == null);
5541
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5542
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5543
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5544
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43805545 else
4381
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4382
- GrafreeD.clipboard.get(0).parent = keepparent;
5546
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5547
+ Grafreed.clipboard.get(0).parent = keepparent;
43835548 }
43845549
5550
+ Globals.REPLACEONMAKE = keep;
43855551 ResetModel();
43865552 refreshContents();
43875553 }
43885554
4389
- void pasteInto(boolean copyit)
5555
+ void pasteInto(boolean copyit, boolean clone)
43905556 {
43915557 // if (GrafreeD.clipboard == null)
43925558 // return;
....@@ -4415,15 +5581,22 @@
44155581 if (copyit)
44165582 {
44175583 // paste(false);
4418
- CloneClipboard(false); // sept 2014
5584
+ if (clone)
5585
+ {
5586
+ CloneClipboard(false); // sept 2014
5587
+ }
5588
+ else
5589
+ {
5590
+ paste(false);
5591
+ }
44195592 }
44205593 else
44215594 {
44225595 boolean first = true;
44235596
4424
- if (GrafreeD.clipboardIsTempGroup)
5597
+ if (Grafreed.clipboardIsTempGroup)
44255598 {
4426
- Composite temp = (Composite)GrafreeD.clipboard;
5599
+ Composite temp = (Composite)Grafreed.clipboard;
44275600 Object3D copy;
44285601 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44295602 {
....@@ -4433,7 +5606,7 @@
44335606 }
44345607 } else
44355608 {
4436
- linkSomething(GrafreeD.clipboard); //.get(0));
5609
+ linkSomething(Grafreed.clipboard); //.get(0));
44375610 }
44385611 }
44395612 }
....@@ -4510,6 +5683,10 @@
45105683
45115684 void group(Object3D csg, boolean grab)
45125685 {
5686
+ if (Globals.REPLACEONMAKE)
5687
+ Save();
5688
+ boolean keep = Globals.REPLACEONMAKE;
5689
+ Globals.REPLACEONMAKE = false;
45135690 if (//false) // why??
45145691 !group.selection.isEmpty())
45155692 {
....@@ -4623,10 +5800,15 @@
46235800 //node.add(csg);
46245801 //makeSomething(node);
46255802 makeSomething(csg);
5803
+ Globals.REPLACEONMAKE = keep;
46265804 }
46275805
46285806 void Ungroup(Object3D g)
46295807 {
5808
+ if (Globals.REPLACEONMAKE)
5809
+ Save();
5810
+ boolean keep = Globals.REPLACEONMAKE;
5811
+ Globals.REPLACEONMAKE = false;
46305812 if (g instanceof HiddenObject)
46315813 {
46325814 HiddenObject h = (HiddenObject) g;
....@@ -4643,6 +5825,7 @@
46435825 objEditor.makeSomething(g.get(i), false);
46445826 }
46455827 }
5828
+ Globals.REPLACEONMAKE = keep;
46465829 }
46475830
46485831 void ungroup()
....@@ -4838,21 +6021,6 @@
48386021 }
48396022 */
48406023
4841
- void ImportGFD()
4842
- {
4843
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4844
- browser.show();
4845
- String filename = browser.getFile();
4846
- if (filename != null && filename.length() > 0)
4847
- {
4848
- String fullname = browser.getDirectory() + filename;
4849
-
4850
- //Object3D readobj =
4851
- objEditor.ReadGFD(fullname, objEditor);
4852
- //makeSomething(readobj);
4853
- }
4854
- }
4855
-
48566024 /*
48576025 public void Callback(Object obj)
48586026 {
....@@ -4876,26 +6044,9 @@
48766044 }
48776045 */
48786046
4879
- void ImportVRMLX3D()
4880
- {
4881
- if (GrafreeD.standAlone)
4882
- {
4883
- /**/
4884
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4885
- browser.show();
4886
- String filename = browser.getFile();
4887
- if (filename != null && filename.length() > 0)
4888
- {
4889
- String fullname = browser.getDirectory() + filename;
4890
- LoadVRMLX3D(fullname);
4891
- }
4892
- /**/
4893
- }
4894
- }
4895
-
48966047 String GetFile(String dialogName)
48976048 {
4898
- if (GrafreeD.standAlone)
6049
+ if (Grafreed.standAlone)
48996050 {
49006051 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49016052 browser.show();
....@@ -4959,10 +6110,48 @@
49596110 cButton flashSelectionButton;
49606111 cButton editButton;
49616112 cButton uneditButton;
6113
+ JCheckBox allParamsButton;
49626114 cButton clearpanelButton;
4963
- cButton allParamsButton;
49646115 cButton unselectButton;
49656116
6117
+ cButton restoreCameraButton;
6118
+
6119
+ cButton oneStepButton;
6120
+
6121
+ cButton groupButton;
6122
+ cButton ungroupButton;
6123
+ cButton compositeButton;
6124
+ cButton switchButton;
6125
+ cButton loopButton;
6126
+ cButton textureButton;
6127
+
6128
+ cButton skybox1Button;
6129
+ cButton skybox2Button;
6130
+ cButton skybox3Button;
6131
+ cButton skybox4Button;
6132
+ cButton skybox5Button;
6133
+ cButton skybox6Button;
6134
+ cButton skybox7Button;
6135
+
6136
+ cButton skybox11Button;
6137
+ cButton skybox12Button;
6138
+ cButton skybox13Button;
6139
+ cButton skybox14Button;
6140
+ cButton skybox15Button;
6141
+ cButton skybox16Button;
6142
+ cButton skybox17Button;
6143
+
6144
+ cButton gridButton;
6145
+ cButton boxButton;
6146
+ cButton sphereButton;
6147
+ cButton coneButton;
6148
+ cButton torusButton;
6149
+ cButton superButton;
6150
+ cButton kleinButton;
6151
+ cButton particlesButton;
6152
+ cButton overlayButton;
6153
+ cButton lightButton;
6154
+
49666155 cButton screenfitButton;
49676156 cButton screenfitpointButton;
49686157 cButton snapobjectButton;
....@@ -4974,14 +6163,6 @@
49746163
49756164 cButton setsupportButton;
49766165
4977
- cButton twoButton;
4978
- cButton sixButton;
4979
- cButton threeButton;
4980
- cButton sevenButton;
4981
- cButton fourButton; // full panel
4982
- cButton oneButton; // full XYZ
4983
- //cButton currentLayout;
4984
-
49856166 //
49866167 //Composite
49876168 Object3D // to do !!
....@@ -4991,9 +6172,11 @@
49916172 //JTree jTree;
49926173 private MenuItem lookAtItem;
49936174 private MenuItem lookFromItem;
4994
- private MenuItem switchItem;
6175
+ private MenuItem switchViewItem;
49956176 private MenuItem cutItem;
4996
- private MenuItem duplicateItem;
6177
+ private MenuItem undoItem;
6178
+ private MenuItem redoItem;
6179
+ private JMenuItem duplicateItem;
49976180 private MenuItem cloneItem;
49986181 private MenuItem cloneSupportItem;
49996182 private MenuItem overwriteGeoItem;
....@@ -5006,7 +6189,7 @@
50066189 private MenuItem linkverticesItem;
50076190 private MenuItem relinkverticesItem;
50086191 private MenuItem setMasterItem;
5009
- private MenuItem resetMeshItem;
6192
+ private MenuItem resetAllItem;
50106193 private MenuItem stepAllItem;
50116194 private MenuItem revertMeshItem;
50126195 private MenuItem poseMeshItem;
....@@ -5017,10 +6200,11 @@
50176200 private MenuItem mergeGeometriesItem;
50186201 private MenuItem copyItem;
50196202 private MenuItem pasteItem;
6203
+ private MenuItem pasteIntoItem;
50206204 private MenuItem pasteLinkItem;
50216205 private MenuItem pasteCloneItem;
50226206 private MenuItem pasteExpandItem;
5023
- private MenuItem clearItem;
6207
+ private MenuItem deleteItem;
50246208 private MenuItem clearAllItem;
50256209 private MenuItem genUVItem;
50266210 private MenuItem genNormalsMESHItem;
....@@ -5055,6 +6239,10 @@
50556239 private MenuItem showleavesItem;
50566240 private MenuItem markleavesItem;
50576241 private MenuItem unmarkleavesItem;
6242
+ private MenuItem rewindleavesItem;
6243
+ private MenuItem unrewindleavesItem;
6244
+ private MenuItem randomleavesItem;
6245
+ private MenuItem unrandomleavesItem;
50586246
50596247 private MenuItem flipVItem;
50606248 private MenuItem unflipVItem;
....@@ -5066,15 +6254,17 @@
50666254 private MenuItem panoTexturesItem;
50676255
50686256 private MenuItem resetCentroidItem;
5069
- private MenuItem transformgeometryItem;
6257
+ private MenuItem resetCentroidXZItem;
50706258 private MenuItem resetTransformItem;
6259
+ private MenuItem transformGeometryItem;
6260
+ private MenuItem transformChildrenItem;
50716261 private MenuItem hideItem;
50726262 private MenuItem grabItem;
50736263 private MenuItem backItem;
50746264 private MenuItem frontItem;
50756265 private MenuItem cameraItem;
50766266 private MenuItem compositeItem;
5077
- private MenuItem randomItem;
6267
+ private MenuItem switchItem;
50786268 private MenuItem physicsItem;
50796269 private MenuItem frameselectorItem;
50806270 private MenuItem scriptNodeItem;
....@@ -5098,6 +6288,8 @@
50986288 private MenuItem attachBumpItem;
50996289 private MenuItem detachBumpItem;
51006290 private MenuItem pigmentBumpItem;
6291
+ private MenuItem embedTexturesItem;
6292
+ private MenuItem deEmbedTexturesItem;
51016293
51026294 private MenuItem particleItem;
51036295 private MenuItem ragdollItem;
....@@ -5114,7 +6306,7 @@
51146306 private MenuItem blobItem;
51156307 private MenuItem latheItem;
51166308 private MenuItem bezierItem;
5117
- private MenuItem checkerItem;
6309
+ private MenuItem overlayItem;
51186310 private MenuItem meshItem;
51196311 // private MenuItem meshGroupItem;
51206312 private MenuItem springItem;
....@@ -5136,11 +6328,6 @@
51366328 private MenuItem doubleItem;
51376329 private MenuItem tripleItem;
51386330
5139
- private MenuItem importGFDItem;
5140
- private MenuItem importVRMLX3DItem;
5141
- private MenuItem import3DSItem;
5142
- private MenuItem importOBJItem;
5143
-
51446331 private MenuItem computeAOItem;
51456332 private MenuItem recompileItem;
51466333 private MenuItem editScriptItem;
....@@ -5150,4 +6337,8 @@
51506337 private MenuItem analyzeItem;
51516338 private MenuItem dumpItem;
51526339 //boolean freezemodel = false;
6340
+
6341
+ Menu cameraMenu;
6342
+ MenuItem editCameraItem;
6343
+ MenuItem restoreCameraItem;
51536344 }