Normand Briere
2019-08-08 8294241adc5fe698b70e13ebd6780af46ab83f7e
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,335 @@
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, final String t, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(f + "s");
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
+ cameraView.repaint();
354
+ }
355
+
26356 //ObjEditor objEditor;
27357 public void closeUI2()
28358 {
....@@ -60,6 +390,12 @@
60390 this.copy = this.group = group;
61391 //selectees = this.group.selectees;
62392
393
+ if (copy.versionlist == null)
394
+ {
395
+ copy.versionlist = new Object3D[100];
396
+ copy.versionindex = -1;
397
+ }
398
+
63399 if(ui)
64400 SetupUI(objEditor);
65401 }
....@@ -74,16 +410,28 @@
74410 this.copy = this.group = copy;
75411 //selectees = this.group.selectees;
76412
77
- SetupMenu2(objEditor);
413
+ SetupMenu2(this); //objEditor);
78414 SetupUI2(objEditor);
79415 objEditor.SetupUI(true);
80416 SetupViews(objEditor);
81417
82418 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
419
+
420
+ if (copy.versionlist == null)
421
+ {
422
+ copy.versionlist = new Object3D[100];
423
+ copy.versionindex = -1;
424
+
425
+ Save(true);
426
+ }
83427 }
84428
85429 void CloneSelection(boolean supports)
86430 {
431
+ if (Globals.REPLACEONMAKE)
432
+ Save();
433
+ boolean keep = Globals.REPLACEONMAKE;
434
+ Globals.REPLACEONMAKE = false;
87435 // Object3D keep = GrafreeD.clipboard;
88436 //Object3D obj;
89437 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +442,19 @@
94442
95443 makeSomething(clone, i==group.selection.size()-1);
96444 }
445
+ Globals.REPLACEONMAKE = keep;
97446 }
98447
99448 void CloneClipboard(boolean supports)
100449 {
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));
450
+ assert(Grafreed.clipboard.parent == null);
451
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
452
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
453
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
454
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106455 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
456
+ makeSomething(CloneObject(Grafreed.clipboard, false));
457
+ Grafreed.clipboard.get(0).parent = keepparent;
109458 }
110459
111460 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +468,7 @@
119468 // obj.support = null;
120469 if (!supports)
121470 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
471
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123472 obj.parent = parent;
124473 // obj.support = support;
125474 // clone.support = support; // aout 2013
....@@ -148,30 +497,29 @@
148497
149498 //JTextField nameField;
150499
151
- void SetupMenu2(ObjEditor oe)
500
+ void SetupMenu2(GroupEditor oe)
152501 {
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);
502
+ oe.jTree = new cTree();
503
+
164504 Menu menu;
165505 oe.menuBar.add(menu = new Menu("Edit"));
166506 //editItem = menu.add(new MenuItem("Edit"));
167507 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
508
+
509
+// undoItem = menu.add(new MenuItem("Undo"));
510
+// undoItem.addActionListener(this);
511
+// redoItem = menu.add(new MenuItem("Redo"));
512
+// redoItem.addActionListener(this);
513
+// menu.add("-");
514
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169515 duplicateItem.addActionListener(this);
170
- menu.add("-");
171516 cloneItem = menu.add(new MenuItem("Clone"));
172517 cloneItem.addActionListener(this);
518
+ if (Globals.ADVANCED)
519
+ {
173520 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174521 cloneSupportItem.addActionListener(this);
522
+ }
175523 menu.add("-");
176524 cutItem = menu.add(new MenuItem("Cut"));
177525 cutItem.addActionListener(this);
....@@ -179,27 +527,123 @@
179527 copyItem.addActionListener(this);
180528 pasteItem = menu.add(new MenuItem("Paste"));
181529 pasteItem.addActionListener(this);
530
+
531
+ menu.add("-");
532
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
533
+ pasteIntoItem.addActionListener(this);
182534 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183535 pasteLinkItem.addActionListener(this);
184536 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185537 pasteCloneItem.addActionListener(this);
186538 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187539 // pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
540
+ menu.add("-");
541
+ deleteItem = menu.add(new MenuItem("Delete"));
542
+ deleteItem.addActionListener(this);
543
+
544
+ if (Globals.ADVANCED)
545
+ {
546
+ // Deletes the cameras...
190547 clearAllItem = menu.add(new MenuItem("Clear All"));
191548 clearAllItem.addActionListener(this);
549
+ }
550
+
551
+ menuBar.add(cameraMenu = new Menu("View"));
552
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
553
+ //zBufferItem.addActionListener(this);
554
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
555
+ //normalLensItem.addActionListener(this);
556
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
557
+ restoreCameraItem.addActionListener(this);
558
+
559
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
560
+// toggleFullScreenItem.addItemListener(this);
561
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
562
+// cameraMenu.add("-");
563
+//
564
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
565
+// toggleTextureItem.addItemListener(this);
566
+// toggleTextureItem.setState(CameraPane.textureon);
567
+//
568
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
569
+// toggleSwitchItem.addItemListener(this);
570
+// toggleSwitchItem.setState(CameraPane.SWITCH);
571
+
572
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
573
+ toggleHandleItem.addItemListener(this);
574
+ toggleHandleItem.setState(CameraPane.HANDLES);
575
+
576
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
577
+ togglePaintItem.addItemListener(this);
578
+ togglePaintItem.setState(CameraPane.PAINTMODE);
579
+
580
+ if (Globals.ADVANCED)
581
+ {
582
+ cameraMenu.add("-");
583
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
584
+ toggleLiveItem.addItemListener(this);
585
+ toggleLiveItem.setState(Globals.isLIVE());
192586
587
+ cameraMenu.add(stepItem = new MenuItem("Step"));
588
+ stepItem.addActionListener(this);
589
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
590
+ // toggleDLItem.addItemListener(this);
591
+ // toggleDLItem.setState(false);
592
+
593
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
594
+ toggleRenderItem.addItemListener(this);
595
+ toggleRenderItem.setState(!CameraPane.frozen);
596
+
597
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
598
+ toggleDebugItem.addItemListener(this);
599
+ toggleDebugItem.setState(Globals.DEBUG);
600
+
601
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
602
+ toggleFrustumItem.addItemListener(this);
603
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
604
+
605
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
606
+ toggleFootContactItem.addItemListener(this);
607
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
608
+
609
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
610
+ toggleTimelineItem.addItemListener(this);
611
+ }
612
+
613
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
614
+// toggleRootItem.addItemListener(this);
615
+// toggleRootItem.setState(false);
616
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
617
+// animationItem.addItemListener(this);
618
+// animationItem.setState(CameraPane.ANIMATION);
619
+ cameraMenu.add("-");
620
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
621
+ editCameraItem.addActionListener(this);
622
+
623
+ if (Globals.ADVANCED)
624
+ {
625
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
626
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
627
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
628
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
629
+ oe.cameraMenu.add("-");
630
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
631
+ openWindowItem.addActionListener(this);
632
+ editLeafItem.addActionListener(this);
633
+ lookAtItem.addActionListener(this);
634
+ //lookFromItem.addActinoListener(this);
635
+ //switchViewItem.addActionListener(this);
636
+ }
637
+
193638 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);
639
+ if (Globals.ADVANCED)
640
+ {
198641 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199642 revertMeshItem.addActionListener(this);
200643 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201644 resetreferencesItem.addActionListener(this);
202645 menu.add("-");
646
+ }
203647 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204648 overwriteGeoItem.addActionListener(this);
205649 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +655,104 @@
211655 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212656 overwriteUVItem.addActionListener(this);
213657 menu.add("-");
658
+ if (Globals.ADVANCED)
659
+ {
214660 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215661 generateMeshItem.addActionListener(this);
216662 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217663 poseMeshItem.addActionListener(this);
218664 menu.add("-");
665
+ }
219666 resetsupportItem = menu.add(new MenuItem("Reset support"));
220667 resetsupportItem.addActionListener(this);
221668 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222669 linkverticesItem.addActionListener(this);
223670 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224671 relinkverticesItem.addActionListener(this);
672
+
673
+ if (Globals.ADVANCED)
674
+ {
225675 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226676 setMasterItem.addActionListener(this);
677
+ }
227678
228679 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
680
+// grabItem = menu.add(new MenuItem("Grab"));
681
+// grabItem.addActionListener(this);
231682 backItem = menu.add(new MenuItem("Back"));
232683 backItem.addActionListener(this);
233684 frontItem = menu.add(new MenuItem("Front"));
234685 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
686
+// compositeItem = menu.add(new MenuItem("Composite"));
687
+// compositeItem.addActionListener(this);
688
+
689
+ if (Globals.ADVANCED)
690
+ {
691
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238692 hideItem.addActionListener(this);
693
+ }
239694 ungroupItem = menu.add(new MenuItem("Ungroup"));
240695 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);
696
+
697
+// menu.add("-");
698
+//
699
+// switchItem = menu.add(new MenuItem("Switch node"));
700
+// switchItem.addActionListener(this);
701
+ if (Globals.ADVANCED)
702
+ {
248703 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249704 switchGeoItem.addActionListener(this);
250705 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251706 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
707
+ morphItem = menu.add(new MenuItem("Morph Group"));
253708 morphItem.addActionListener(this);
709
+
710
+ menu.add("-");
711
+ physicsItem = menu.add(new MenuItem("Physics"));
712
+ physicsItem.addActionListener(this);
713
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
714
+ frameselectorItem.addActionListener(this);
254715 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255716 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
717
+ }
258718
259719 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
720
+// textureItem = menu.add(new MenuItem("Texture"));
721
+// textureItem.addActionListener(this);
262722 billboardItem = menu.add(new MenuItem("Billboard"));
263723 billboardItem.addActionListener(this);
264724 csgItem = menu.add(new MenuItem("CSG"));
265725 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
726
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267727 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
728
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269729 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
730
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271731 shadowZItem.addActionListener(this);
732
+ attributeItem = menu.add(new MenuItem("Attribute"));
733
+ attributeItem.addActionListener(this);
734
+
735
+ if (Globals.ADVANCED)
736
+ {
737
+ menu.add("-");
272738 linkerItem = menu.add(new MenuItem("Linker"));
273739 linkerItem.addActionListener(this);
274740 templateItem = menu.add(new MenuItem("Template"));
275741 templateItem.addActionListener(this);
276
- attributeItem = menu.add(new MenuItem("Attribute"));
277
- attributeItem.addActionListener(this);
278742 pointflowItem = menu.add(new MenuItem("Point Flow"));
279743 pointflowItem.addActionListener(this);
744
+ }
280745 menu.add("-");
281746 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282747 resetTransformItem.addActionListener(this);
283748 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284749 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
750
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
751
+ resetCentroidXZItem.addActionListener(this);
752
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
753
+ transformGeometryItem.addActionListener(this);
754
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
755
+ transformChildrenItem.addActionListener(this);
287756
288757 oe.menuBar.add(menu = new Menu("Geometry"));
289758 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +763,11 @@
294763 genNormalsCADItem.addActionListener(this);
295764 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296765 genNormalsMESHItem.addActionListener(this);
297
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
766
+ if (Globals.ADVANCED)
767
+ {
768
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
298769 genNormalsMINEItem.addActionListener(this);
770
+ }
299771 stripifyItem = menu.add(new MenuItem("Stripify"));
300772 stripifyItem.addActionListener(this);
301773 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +789,34 @@
317789 reduce34MeshItem.addActionListener(this);
318790 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319791 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322792 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323793 clipMeshItem.addActionListener(this);
794
+
795
+ if (Globals.ADVANCED)
796
+ {
797
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
798
+ smoothMeshItem.addActionListener(this);
799
+ }
324800
325801 oe.menuBar.add(menu = new Menu("Attributes"));
326802 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327803 clearMaterialsItem.addActionListener(this);
804
+ resetAllItem = menu.add(new MenuItem("Reset All"));
805
+ resetAllItem.addActionListener(this);
806
+ stepAllItem = menu.add(new MenuItem("Step All"));
807
+ stepAllItem.addActionListener(this);
328808 menu.add("-");
329809 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330810 liveleavesItem.addActionListener(this);
331811 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332812 unliveleavesItem.addActionListener(this);
813
+ if (Globals.ADVANCED)
814
+ {
333815 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334816 supportleavesItem.addActionListener(this);
335817 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336818 unsupportleavesItem.addActionListener(this);
819
+ }
337820 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338821 hideleavesItem.addActionListener(this);
339822 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +825,14 @@
342825 markleavesItem.addActionListener(this);
343826 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344827 unmarkleavesItem.addActionListener(this);
828
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
829
+ rewindleavesItem.addActionListener(this);
830
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
831
+ unrewindleavesItem.addActionListener(this);
832
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
833
+ randomleavesItem.addActionListener(this);
834
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
835
+ unrandomleavesItem.addActionListener(this);
345836 menu.add("-");
346837 flipVItem = menu.add(new MenuItem("Flip V"));
347838 flipVItem.addActionListener(this);
....@@ -367,45 +858,117 @@
367858 attachBumpItem.addActionListener(this);
368859 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
369860 pigmentBumpItem.addActionListener(this);
861
+ //embedTexturesItem
370862 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
371863 detachPigmentItem.addActionListener(this);
372864 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
373865 detachBumpItem.addActionListener(this);
866
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
867
+ embedTexturesItem.addActionListener(this);
868
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
869
+ deEmbedTexturesItem.addActionListener(this);
374870 menu.add("-");
375871 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
376872 sortbysizeItem.addActionListener(this);
377873 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378874 sortbynameItem.addActionListener(this);
379875 menu.add("-");
876
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
877
+ shareGeometriesItem.addActionListener(this);
878
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
879
+ mergeGeometriesItem.addActionListener(this);
880
+ if (Globals.ADVANCED)
881
+ {
882
+ // Pretty much the same as duplicate and clone.
380883 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381884 extractGeometriesItem.addActionListener(this);
382885 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383886 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);
887
+ }
388888
389889 oe.menuBar.add(menu = new Menu("Insert"));
390890 buildCreateMenu(menu);
391891
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
-
403892 oe.menuBar.add(menu = new Menu("Tools"));
404893 buildToolsMenu(menu);
405894 }
406895
896
+ JTabbedPane resourcecontainer;
897
+ cGridBag currenttab;
898
+ boolean added; // patch for jar
899
+
900
+ int tabcount = 0;
901
+ int colcount = 0;
902
+ int rowcount = 0;
903
+
904
+ int columns = 5;
905
+ int rows = 7;
906
+
907
+ public void ResourceCallBack(String[] path)
908
+ {
909
+ for (int i = 0; i < path.length; i++)
910
+ System.out.print(path[i] + "/");
911
+ System.out.println();
912
+ if (rowcount == 0)
913
+ {
914
+ currenttab = new cGridBag();
915
+ added = false;
916
+ String tabname = String.valueOf((char)('A'+tabcount));
917
+ currenttab.setName(tabname);
918
+ rowcount = 1;
919
+ }
920
+
921
+ if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg"))
922
+ {
923
+ if (!added)
924
+ {
925
+ added = true;
926
+ resourcecontainer.add(currenttab);
927
+ String tabname = String.valueOf((char)('A'+tabcount));
928
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
929
+ }
930
+
931
+ AddTextureButton(path[0], path[1], currenttab);
932
+ if (++colcount >= columns)
933
+ {
934
+ colcount = 0;
935
+ currenttab.Return();
936
+
937
+ if (rowcount++ >= rows)
938
+ {
939
+ rowcount = 0;
940
+ }
941
+ }
942
+ }
943
+ else
944
+ {
945
+// if (!path[path.length-1].equals("icons"))
946
+// resourcecontainer.Return();
947
+ }
948
+ }
949
+
950
+ void CreateTexturePanel(cGridBag container)
951
+ {
952
+ resourcecontainer = new JTabbedPane();
953
+ container.add(resourcecontainer);
954
+
955
+ Grafreed.ParseResources("textures", this);
956
+ }
957
+
407958 void SetupUI2(ObjEditor oe)
408959 {
960
+ // June 2019
961
+ if (oe == null)
962
+ {
963
+ //super.SetupUI2(this);
964
+ //return;
965
+ }
966
+
967
+ if (copy != group)
968
+ {
969
+ //super.SetupUI2(this);
970
+ }
971
+
409972 //new Exception().printStackTrace();
410973
411974 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,110 +997,239 @@
434997 oe.radioPanel.add(dummyButton);
435998 oe.buttonGroup.add(dummyButton);
436999 */
437
- aConstraints.gridy += 1;
1000
+ cGridBag copyOptionsPanel = new cGridBag();
1001
+
1002
+ copyOptionsPanel.preferredHeight = 2;
4381003
4391004 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
4401005
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
1006
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ //minButton.setToolTipText("Minimize window");
1008
+ //minButton.addActionListener(this);
4431009
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
- liveCB.setToolTipText("Enabled animation");
446
- liveCB.addItemListener(this);
447
-
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
450
- trackCB.setToolTipText("Enable tracking");
451
- trackCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
1010
+ if (Globals.ADVANCED)
1011
+ {
1012
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ maxButton.setToolTipText("Maximize window");
1014
+ maxButton.addActionListener(this);
1015
+ }
1016
+
1017
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ fullButton.setToolTipText("Full-screen window");
1019
+ fullButton.addActionListener(this);
1020
+
1021
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4551022 screenfitButton.setToolTipText("Screen fit");
4561023 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
1024
+
1025
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1026
+ restoreCameraButton.setToolTipText("Restore viewpoint");
1027
+ restoreCameraButton.addActionListener(this);
1028
+
1029
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1030
+ saveVersionButton.setToolTipText("Duplicate current version");
1031
+ saveVersionButton.addActionListener(this);
1032
+
1033
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1034
+ deleteVersionButton.setToolTipText("Delete current version");
1035
+ deleteVersionButton.addActionListener(this);
1036
+
1037
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1038
+ previousVersionButton.setToolTipText("Previous version");
1039
+ previousVersionButton.addActionListener(this);
1040
+ previousVersionButton.setEnabled(false);
1041
+
1042
+ cGridBag updown = new cGridBag().setVertical(true);
1043
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ restoreButton.setToolTipText("Undo (restore current version)");
1045
+ restoreButton.addActionListener(this);
1046
+ //restoreButton.setEnabled(false);
1047
+
1048
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ replaceButton.setToolTipText("Save (replace current version)");
1050
+ replaceButton.addActionListener(this);
1051
+ //replaceButton.setEnabled(false);
1052
+
1053
+ copyOptionsPanel.add(updown);
1054
+
1055
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ nextVersionButton.setToolTipText("Next version");
1057
+ nextVersionButton.addActionListener(this);
1058
+ nextVersionButton.setEnabled(false);
1059
+
1060
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1061
+ liveCB.setToolTipText("Enable animation");
1062
+ liveCB.addItemListener(this);
1063
+
1064
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ oneStepButton.setToolTipText("Animate one step forward");
1066
+ oneStepButton.addActionListener(this);
1067
+
1068
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
1069
+ fastCB.setToolTipText("Fast mode");
1070
+ fastCB.addItemListener(this);
1071
+
1072
+ //oe.toolboxPanel.Return();
1073
+
1074
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
1075
+// trackCB.setToolTipText("Enable tracking");
1076
+// trackCB.addItemListener(this);
1077
+
4581078 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
4591079 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
4651080
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
- flashSelectionButton.setToolTipText("Show selection");
473
- flashSelectionButton.addActionListener(this);
474
-
475
- oe.toolbarPanel.add(new cButton(" ", false));
476
-
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
483
- twoButton.setToolTipText("Show center view only");
484
- twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
1081
+ if (Globals.ADVANCED)
1082
+ {
1083
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ snapobjectButton.addActionListener(this);
1085
+ snapobjectButton.setToolTipText("Snap Object");
1086
+
1087
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4861088 fourButton.addActionListener(this);
487
- fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
489
- sixButton.setToolTipText("2-column layout left");
490
- sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
492
- threeButton.setToolTipText("2-column layout right");
1089
+ fourButton.setToolTipText("Show control panel only");
1090
+ }
1091
+
1092
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
1093
+
1094
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1095
+ twoButton.setToolTipText("Show 3D view only");
1096
+ twoButton.addActionListener(this);
1097
+ this.fullscreenLayout = twoButton;
1098
+
1099
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+ threeButton.setToolTipText("Show controls and 3D view");
4931101 threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
495
- sevenButton.setToolTipText("3-column layout");
496
- sevenButton.addActionListener(this);
1102
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1103
+ sixButton.setToolTipText("Show 3D view and controls");
1104
+ sixButton.addActionListener(this);
1105
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
+// sevenButton.setToolTipText("3-column layout");
1107
+// sevenButton.addActionListener(this);
4971108 //
4981109
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
1110
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1111
+ rootButton.setToolTipText("Open selection in new tab");
5011112 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1113
+
1114
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5041115 closeButton.setToolTipText("Close tab");
5051116 closeButton.addActionListener(this);
5061117 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5071118 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509
-
510
- oe.aConstraints.gridx = 1; //
511
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
512
- editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
5161119
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1120
+ cGridBag row1 = new cGridBag();
1121
+
1122
+ // INSERT
1123
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ gridButton.setToolTipText("Create grid");
1125
+ gridButton.addActionListener(this);
1126
+
1127
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1128
+ boxButton.setToolTipText("Create box");
1129
+ boxButton.addActionListener(this);
1130
+
1131
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1132
+ sphereButton.setToolTipText("Create sphere");
1133
+ sphereButton.addActionListener(this);
1134
+
1135
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ coneButton.setToolTipText("Create cone");
1137
+ coneButton.addActionListener(this);
1138
+
1139
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
+ torusButton.setToolTipText("Create torus");
1141
+ torusButton.addActionListener(this);
1142
+
1143
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1144
+ superButton.setToolTipText("Create superellipsoid");
1145
+ superButton.addActionListener(this);
1146
+
1147
+ if (Globals.ADVANCED)
1148
+ {
1149
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1150
+ kleinButton.setToolTipText("Create Klein bottle");
1151
+ kleinButton.addActionListener(this);
1152
+ }
1153
+
1154
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1155
+ particlesButton.setToolTipText("Create particle system");
1156
+ particlesButton.addActionListener(this);
1157
+
1158
+ oe.toolboxPanel.add(row1);
1159
+
1160
+ cGridBag row2 = new cGridBag();
1161
+
1162
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1163
+ groupButton.setToolTipText("Create group");
1164
+ groupButton.addActionListener(this);
1165
+
1166
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1167
+ compositeButton.setToolTipText("Create composite");
1168
+ compositeButton.addActionListener(this);
1169
+
1170
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1171
+ switchButton.setToolTipText("Create item switcher");
1172
+ switchButton.addActionListener(this);
1173
+
1174
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ loopButton.setToolTipText("Create loop");
1176
+ loopButton.addActionListener(this);
1177
+
1178
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1179
+ textureButton.setToolTipText("Create texture");
1180
+ textureButton.addActionListener(this);
1181
+
1182
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ overlayButton.setToolTipText("Create overlay");
1184
+ overlayButton.addActionListener(this);
1185
+
1186
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ lightButton.setToolTipText("Create light");
1188
+ lightButton.addActionListener(this);
1189
+
1190
+ oe.toolboxPanel.add(row2);
1191
+
1192
+ cGridBag textures = new cGridBag();
1193
+
1194
+ CreateTexturePanel(textures);
1195
+
1196
+ oe.toolboxPanel.add(textures);
1197
+
1198
+ textures.preferredHeight = 100;
1199
+
1200
+ CreateSkyboxPanel(oe.skyboxPanel);
1201
+
1202
+ // EDIT panel
1203
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1204
+ editButton.setToolTipText("Pin selection controls");
1205
+ editButton.addActionListener(this);
1206
+
1207
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1208
+ uneditButton.setToolTipText("Unpin and remove selection controls");
5181209 uneditButton.addActionListener(this);
5191210
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1211
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1212
+ allParamsButton.setToolTipText("Show all controls");
5321213 allParamsButton.addActionListener(this);
5331214
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
539
- unselectButton.addActionListener(this);
1215
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ clearPanelButton.setToolTipText("Clear all controls");
1217
+ clearPanelButton.addActionListener(this);
5401218
1219
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ //unselectButton.setToolTipText("Unselect");
1221
+ //unselectButton.addActionListener(this);
1222
+
1223
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1224
+ flashSelectionButton.setToolTipText("Highlight selection");
1225
+ flashSelectionButton.addActionListener(this);
1226
+
1227
+ editCommandsPanel.preferredHeight = 1;
1228
+
1229
+ SetPinStates(false);
1230
+// oe.treePanel.add(commandsPanel);
1231
+// oe.treePanel.Return();
1232
+
5411233 // oe.aConstraints.gridx += 1;
5421234 // oe.aConstraints.weighty = 0;
5431235 // oe.aConstraints.gridwidth = 1;
....@@ -549,47 +1241,32 @@
5491241 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5501242 // gcButton.addActionListener(this);
5511243
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
1244
+ cGridBag jSPPanel = new cGridBag();
1245
+
1246
+ JScrollPane jSP;
5631247 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1248
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5651249 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
570
-
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
575
- colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
578
- materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
581
- textureCB.addItemListener(this);
582
-
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
5851250
1251
+ oe.treePanel.add(jSPPanel);
1252
+ oe.treePanel.Return();
1253
+
1254
+ oe.treePanel.add(copyOptionsPanel);
1255
+ oe.treePanel.Return();
1256
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1257
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1258
+ sliderPane.preferredHeight = 1;
1259
+
1260
+// mainPanel.setDividerLocation(0.1); //1.0);
1261
+ mainPanel.setResizeWeight(0.4);
1262
+
5861263 //jList.addListSelectionListener(this);
5871264 oe.jTree.addTreeSelectionListener(this);
5881265 //jTree.setRootVisible(false);
5891266 //jTree.setEditable(true);
5901267 oe.jTree.setDragEnabled(true);
5911268 //jTree.setPreferredSize(new Dimension(10,10));
592
- jSP.setPreferredSize(new Dimension(100,200));
1269
+ //jSP.setPreferredSize(new Dimension(100,200));
5931270
5941271 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
5951272
....@@ -601,53 +1278,70 @@
6011278 dgr.addDragGestureListener(this);
6021279 }catch(Exception e) {}
6031280 */
604
- radio.layout = sevenButton;
1281
+ radio.layout = threeButton; // sixButton;
6051282 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6061283 }
6071284
6081285 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6091286 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
1287
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1288
+ colorCB.setToolTipText("Copy color when dropped");
1289
+ colorCB.addItemListener(this);
6191290
620
- // constraints.gridy += 1;
1291
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1292
+ materialCB.setToolTipText("Copy material when dropped");
1293
+ materialCB.addItemListener(this);
1294
+
1295
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1296
+ textureCB.setToolTipText("Copy texture when dropped");
1297
+ textureCB.addItemListener(this);
1298
+
1299
+ panel.Return();
1300
+
1301
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1302
+ boxCB.setToolTipText("Display bounding boxes");
1303
+ boxCB.addItemListener(this);
1304
+
1305
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1306
+ zoomBoxCB.setToolTipText("Display only for wheel");
1307
+ zoomBoxCB.addItemListener(this);
1308
+
1309
+ if (true) // Globals.ADVANCED)
1310
+ {
1311
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1312
+// supportCB.setToolTipText("Enable rigging");
1313
+// supportCB.addItemListener(this);
1314
+
1315
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1316
+ freezeCB.setToolTipText("Fast moving camera");
1317
+ freezeCB.addItemListener(this);
1318
+
6211319 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6221320 // localCB.addItemListener(this);
6231321
624
- //constraints.gridy += 1;
1322
+ panel.Return();
1323
+
6251324 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6261325 crowdCB.setToolTipText("Used for crowds");
6271326 crowdCB.addItemListener(this);
6281327
629
- //constraints.gridy += 1;
6301328 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
6311329 smoothCB.setToolTipText("Snapping delay");
6321330 smoothCB.addItemListener(this);
6331331
634
- //constraints.gridy += 1;
635
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636
- slowCB.setToolTipText("Smooth interpolation");
637
- slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
639
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640
- boxCB.setToolTipText("Display bounding boxes");
641
- boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
643
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645
- zoomBoxCB.addItemListener(this);
646
-
1332
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1333
+// slowCB.setToolTipText("Smooth interpolation");
1334
+// slowCB.addItemListener(this);
1335
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1336
+ minshaderCB.setToolTipText("Minimal fast shader");
1337
+ minshaderCB.addItemListener(this);
1338
+
6471339 // constraints.gridy += 1;
6481340 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6491341 // speakerMocapCB.addItemListener(this);
6501342
1343
+ panel.Return();
1344
+
6511345 if (false)
6521346 {
6531347 // handled in scripts
....@@ -662,36 +1356,85 @@
6621356 //constraints.gridy += 1;
6631357 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6641358 smoothfocusCB.addItemListener(this);
1359
+ panel.Return();
6651360 }
6661361
6671362 //constraints.gridx += 1;
6681363 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6691364 // debugCB.addItemListener(this);
6701365
671
- //constraints.gridy += 1;
1366
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1367
+ trackCB.setToolTipText("Enable tracking target");
1368
+ trackCB.addItemListener(this);
1369
+
6721370 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1371
+ oeilCB.setToolTipText("Move camera when tracking");
6731372 oeilCB.addItemListener(this);
6741373
675
- //constraints.gridy += 1;
1374
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1375
+ shadowCB.setToolTipText("When live compute shadows");
1376
+ shadowCB.addItemListener(this);
1377
+
1378
+ panel.Return();
1379
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1380
+ toggleTextureCB.setToolTipText("Load textures");
1381
+ toggleTextureCB.addItemListener(this);
1382
+
1383
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1384
+ toggleSwitchCB.setToolTipText("Choose a single item");
1385
+ toggleSwitchCB.addItemListener(this);
1386
+
1387
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1388
+ autokeepCB.setToolTipText("On structure change");
1389
+ autokeepCB.addItemListener(this);
1390
+
1391
+ panel.Return();
1392
+ if (Globals.ADVANCED)
1393
+ {
6761394 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6771395 lookAtCB.setToolTipText("Look-at target");
6781396 lookAtCB.addItemListener(this);
1397
+ }
1398
+
1399
+ }
1400
+
1401
+ cGridBag fill = new cGridBag();
1402
+ fill.preferredHeight = 200;
1403
+ cGridBag fill2 = new cGridBag();
1404
+ fill2.preferredHeight = 200;
1405
+ cGridBag fill3 = new cGridBag();
1406
+ fill3.preferredHeight = 200;
1407
+
1408
+ panel.add(fill);
1409
+ panel.add(fill2);
1410
+ panel.add(fill3);
6791411
6801412 }
6811413
6821414 void EditObject(Object3D obj)
6831415 {
6841416 cRadio radioButton = new cRadio(obj.name);
1417
+
1418
+ // June 2019. Patch to avoid bug with transparency.
1419
+ radioButton.hadMaterial = obj.material != null;
1420
+ if (!radioButton.hadMaterial)
1421
+ {
1422
+ obj.material = new cMaterial();
1423
+ }
1424
+
6851425 radioButton.SetObject(obj);
686
- radioButton.layout = sevenButton;
1426
+ radioButton.layout = threeButton; // sixButton;
6871427 radioButton.SetCamera(cameraView.renderCamera, false);
6881428 radioButton.addActionListener(this);
6891429 radioPanel.add(radioButton);
6901430 buttonGroup.add(radioButton);
6911431 radioButton.doClick();
6921432 }
1433
+
6931434 void SetupViews(ObjEditor oe)
6941435 {
1436
+ theFrame = this;
1437
+
6951438 oe.SetupViews();
6961439
6971440 System.out.println("SetupViews");
....@@ -700,23 +1443,30 @@
7001443 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7011444 }
7021445
703
- JCheckBox liveCB;
704
- JCheckBox supportCB;
705
- JCheckBox localCB;
706
- JCheckBox crowdCB;
707
- JCheckBox smoothCB;
708
- JCheckBox fastCB;
709
- JCheckBox slowCB;
710
- JCheckBox boxCB;
711
- JCheckBox zoomBoxCB;
712
- JCheckBox trackCB;
713
- JCheckBox smoothfocusCB;
1446
+ cToggleButton liveCB;
1447
+ cCheckBox supportCB;
1448
+ cCheckBox localCB;
1449
+ cCheckBox crowdCB;
1450
+ cCheckBox smoothCB;
1451
+ cCheckBox minshaderCB;
1452
+
1453
+ cToggleButton fastCB;
1454
+ cCheckBox slowCB;
1455
+ cCheckBox boxCB;
1456
+ cCheckBox zoomBoxCB;
1457
+ cCheckBox freezeCB;
1458
+ //cToggleButton trackCB;
1459
+ cCheckBox trackCB;
1460
+ cCheckBox smoothfocusCB;
7141461 // JCheckBox speakerMocapCB;
715
- JCheckBox speakerCameraCB;
716
- JCheckBox speakerFocusCB;
717
- JCheckBox debugCB;
718
- JCheckBox oeilCB;
719
- JCheckBox lookAtCB;
1462
+ cCheckBox speakerCameraCB;
1463
+ cCheckBox speakerFocusCB;
1464
+ cCheckBox debugCB;
1465
+
1466
+ cCheckBox oeilCB;
1467
+ cCheckBox shadowCB;
1468
+ cCheckBox autokeepCB;
1469
+ cCheckBox lookAtCB;
7201470
7211471 // static int COLOR = 1;
7221472 // static int MATERIAL = 2;
....@@ -724,9 +1474,9 @@
7241474
7251475 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7261476
727
- JCheckBox colorCB;
728
- JCheckBox materialCB;
729
- JCheckBox textureCB;
1477
+ cCheckBox colorCB;
1478
+ cCheckBox materialCB;
1479
+ cCheckBox textureCB;
7301480
7311481 public void itemStateChanged(ItemEvent e)
7321482 {
....@@ -754,6 +1504,7 @@
7541504 } else if(e.getSource() == liveCB)
7551505 {
7561506 cameraView.ToggleLive();
1507
+ refreshContents(false);
7571508 }
7581509 else if(e.getSource() == supportCB)
7591510 {
....@@ -769,6 +1520,12 @@
7691520 {
7701521 cameraView.ToggleInertia();
7711522 cameraView.repaint();
1523
+ }
1524
+ else if(e.getSource() == minshaderCB)
1525
+ {
1526
+ Globals.MINSHADER ^= true;
1527
+ cameraView.programInitialized = false;
1528
+ cameraView.repaint();
7721529 }
7731530 else if(e.getSource() == localCB)
7741531 {
....@@ -818,6 +1575,18 @@
8181575 {
8191576 cameraView.ToggleOeil();
8201577 }
1578
+ else if(e.getSource() == shadowCB)
1579
+ {
1580
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1581
+ }
1582
+ else if(e.getSource() == freezeCB)
1583
+ {
1584
+ Globals.FREEZEONMOVE ^= true;
1585
+ }
1586
+ else if(e.getSource() == autokeepCB)
1587
+ {
1588
+ Globals.REPLACEONMAKE ^= true;
1589
+ }
8211590 else if(e.getSource() == lookAtCB)
8221591 {
8231592 cameraView.ToggleLookAt();
....@@ -834,7 +1603,8 @@
8341603
8351604 /**/
8361605 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
837
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1606
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1607
+ TreePath path = objEditor.jTree.getSelectionPath();
8381608 if ((path == null) || (path.getPathCount() <= 1)) {
8391609 // We can't move the root node or an empty selection
8401610 return;
....@@ -897,8 +1667,6 @@
8971667 }
8981668 }
8991669
900
- String string = (String) object;
901
-
9021670 System.out.println("Transfer = " + object + "; drop : " + target);
9031671 // if( object instanceof java.io.File[])
9041672 // {
....@@ -906,7 +1674,11 @@
9061674 // objEditor.DropFile((java.io.File[]) object, true);
9071675 // return;
9081676 // }
909
- if (string.charAt(0) == '/')
1677
+
1678
+ String string = object.toString();
1679
+
1680
+ // File path for Mac and Windows
1681
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9101682 {
9111683 // file(s)
9121684 String[] names = string.split("\n");
....@@ -933,7 +1705,7 @@
9331705
9341706 flashIt = false;
9351707 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1708
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9371709 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9381710
9391711 if (group.selection.size() == 1)
....@@ -949,23 +1721,33 @@
9491721
9501722 assert target == objEditor.jTree;
9511723 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1724
+ Object3D destinationLeaf;
9521725 try {
953
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1726
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9541727 } catch (Exception e) {
9551728 System.out.println("destinationPath : " + destinationPath);
9561729 return;
9571730 }
9581731
959
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1732
+ for (int i=group.selection.size(); --i>=0;)
9601733 {
1734
+ Object3D child = (Object3D)group.selection.elementAt(i);
1735
+
1736
+ // Cannot move into itself
1737
+ if (child == destinationLeaf)
1738
+ return;
1739
+ }
1740
+
1741
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1742
+// {
9611743 loadClipboard(true);
9621744 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
964
- } else {
965
- loadClipboard(false);
966
- objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
968
- }
1745
+ pasteInto(false, false);
1746
+// } else {
1747
+// loadClipboard(false);
1748
+// objEditor.jTree.setSelectionPath(destinationPath);
1749
+// pasteInto(false, false); // true); // ???
1750
+// }
9691751 }
9701752 public void dropActionChanged(DropTargetDragEvent dtde)
9711753 // Called if the user has modified the current drop gesture
....@@ -1070,85 +1852,107 @@
10701852 {
10711853 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10721854 //heightFieldItem.addActionListener(this);
1073
- gridItem = menu.add(new MenuItem("Grid"));
1074
- gridItem.addActionListener(this);
1075
- rectoidItem = menu.add(new MenuItem("Box"));
1076
- rectoidItem.addActionListener(this);
1077
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1078
- ellipsoidItem.addActionListener(this);
1079
- coneItem = menu.add(new MenuItem("Cone"));
1080
- coneItem.addActionListener(this);
1081
- torusItem = menu.add(new MenuItem("Torus"));
1082
- torusItem.addActionListener(this);
1083
- superItem = menu.add(new MenuItem("Superellipsoid"));
1084
- superItem.addActionListener(this);
1855
+// gridItem = menu.add(new MenuItem("Grid"));
1856
+// gridItem.addActionListener(this);
1857
+// rectoidItem = menu.add(new MenuItem("Box"));
1858
+// rectoidItem.addActionListener(this);
1859
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1860
+// ellipsoidItem.addActionListener(this);
1861
+// coneItem = menu.add(new MenuItem("Cone"));
1862
+// coneItem.addActionListener(this);
1863
+// torusItem = menu.add(new MenuItem("Torus"));
1864
+// torusItem.addActionListener(this);
1865
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1866
+// superItem.addActionListener(this);
1867
+
1868
+ cameraItem = menu.add(new MenuItem("Camera"));
1869
+ cameraItem.addActionListener(this);
1870
+
1871
+ if (!Globals.ADVANCED)
1872
+ {
10851873 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10861874 kleinItem.addActionListener(this);
1087
- particleItem = menu.add(new MenuItem("Particle system"));
1088
- particleItem.addActionListener(this);
1875
+ }
1876
+
1877
+// particleItem = menu.add(new MenuItem("Particle system"));
1878
+// particleItem.addActionListener(this);
1879
+ if (Globals.ADVANCED)
1880
+ {
10891881 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901882 ragdollItem.addActionListener(this);
10911883 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921884 ragdoll2Item.addActionListener(this);
1885
+ }
10931886 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1887
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951888 meshItem.addActionListener(this);
10961889 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971890 // meshGroupItem.addActionListener(this);
1891
+ if (Globals.ADVANCED)
1892
+ {
10981893 springItem = menu.add(new MenuItem("Spring"));
10991894 springItem.addActionListener(this);
11001895 flagItem = menu.add(new MenuItem("Flag"));
11011896 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061897 blobItem = menu.add(new MenuItem("Blob"));
11071898 blobItem.addActionListener(this);
11081899 latheItem = menu.add(new MenuItem("Lathe"));
11091900 latheItem.addActionListener(this);
1110
- lightItem = menu.add(new MenuItem("Light"));
1111
- lightItem.addActionListener(this);
1901
+ }
1902
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1903
+ bezierItem.addActionListener(this);
1904
+// overlayItem = menu.add(new MenuItem("Overlay"));
1905
+// overlayItem.addActionListener(this);
1906
+// lightItem = menu.add(new MenuItem("Light"));
1907
+// lightItem.addActionListener(this);
11121908 menu.add("-");
11131909 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11141910 //superLoopItem.addActionListener(this);
1115
- loopItem = menu.add(new MenuItem("Loop"));
1116
- loopItem.addActionListener(this);
1911
+// loopItem = menu.add(new MenuItem("Loop"));
1912
+// loopItem.addActionListener(this);
11171913 doubleItem = menu.add(new MenuItem("Fork"));
11181914 doubleItem.addActionListener(this);
1915
+ if (Globals.ADVANCED)
1916
+ {
11191917 tripleItem = menu.add(new MenuItem("Trident"));
11201918 tripleItem.addActionListener(this);
1919
+ }
11211920 }
11221921
11231922 void buildToolsMenu(Menu menu)
11241923 {
11251924 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261925 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1926
+ animationItem.setState(Globals.ANIMATION);
1927
+
1928
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1929
+ archiveItem.addActionListener(this);
11281930
11291931 menu.add("-");
11301932 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311933 parseverticesItem.addActionListener(this);
11321934 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331935 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1936
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351937 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381938 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391939 reduceMorphItem.addActionListener(this);
11401940 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411941 reduce34MorphItem.addActionListener(this);
1142
-
1143
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1144
- computeAOItem.addActionListener(this);
11451942 menu.add("-");
1146
-
11471943 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481944 memoryItem.addActionListener(this);
1945
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1946
+ computeAOItem.addActionListener(this);
1947
+
1948
+ if (Globals.ADVANCED)
1949
+ {
1950
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1951
+ mirrorItem.addActionListener(this);
1952
+ menu.add("-");
11491953 menu.add(analyzeItem = new MenuItem("Analyze"));
11501954 analyzeItem.addActionListener(this);
1151
- menu.add(dumpItem = new MenuItem("Dump"));
1955
+ menu.add(dumpItem = new MenuItem("Print"));
11521956 dumpItem.addActionListener(this);
11531957 // menu.add(pathItem = new MenuItem("From-to path"));
11541958 // pathItem.addActionListener(this);
....@@ -1166,6 +1970,7 @@
11661970 menu.add("-");
11671971 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681972 editScriptItem.addActionListener(this);
1973
+ }
11691974 }
11701975
11711976 void ScreenFit()
....@@ -1288,9 +2093,34 @@
12882093 shadow.material = new cMaterial(obj.material);
12892094 shadow.material.diffuse = 0.0001f;
12902095 shadow.material.specular = 0.0001f;
2096
+ //shadow.projectedVertices[1].x = 300;
12912097
12922098 makeSomething(shadow);
12932099 }
2100
+
2101
+ private void ClearUnpinned()
2102
+ {
2103
+ //for (Object3D obj : listUI)
2104
+ for (int i=listUI.size(); --i>=0;)
2105
+ {
2106
+ Object3D obj = listUI.elementAt(i);
2107
+ if (!obj.pinned)
2108
+ {
2109
+ obj.CloseUI();
2110
+ listUI.remove(i);
2111
+ }
2112
+ }
2113
+ }
2114
+
2115
+ private void EditElement(Object3D elem, boolean newWindow)
2116
+ {
2117
+ // if (!(elem instanceof Composite))
2118
+ // newWindow = false;
2119
+ listUI.add(elem);
2120
+ elem.openEditWindow(this, newWindow); //, false);
2121
+ System.out.println("edit : " + elem);
2122
+ elem.editWindow.refreshContents(true); // ? new
2123
+ }
12942124
12952125 /**
12962126 * applyExample
....@@ -1494,9 +2324,9 @@
14942324
14952325 void Overwrite(int mask)
14962326 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2327
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14982328 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
2329
+ Object3D content = Grafreed.clipboard.get(0);
15002330
15012331 if (content instanceof cGroup && ((cGroup)content).transientlink )
15022332 content = ((cGroup)content).get(0);
....@@ -1535,7 +2365,7 @@
15352365 {
15362366 ScreenFit();
15372367 } else
1538
- if (source == switchItem)
2368
+ if (source == switchViewItem)
15392369 {
15402370 cVector v1 = new cVector();
15412371 cVector v2 = new cVector();
....@@ -1544,11 +2374,11 @@
15442374 objEditor.cameraView.renderCamera.setAim(v2, v1);
15452375 objEditor.cameraView.repaint();
15462376 } else
1547
- if (source == rectoidItem)
2377
+ if (source == rectoidItem || source == boxButton)
15482378 {
15492379 makeSomething(new Box());
15502380 } else
1551
- if (source == particleItem)
2381
+ if (source == particleItem || source == particlesButton)
15522382 {
15532383 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15542384 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1627,27 +2457,27 @@
16272457
16282458 makeSomething(obj);
16292459 } else
1630
- if (source == gridItem)
2460
+ if (source == gridItem || source == gridButton)
16312461 {
16322462 makeSomething(new Grid());
16332463 } else
1634
- if (source == ellipsoidItem)
2464
+ if (source == ellipsoidItem || source == sphereButton)
16352465 {
16362466 makeSomething(new Sphere());
16372467 } else
1638
- if (source == coneItem)
2468
+ if (source == coneItem || source == coneButton)
16392469 {
16402470 makeSomething(new Cone());
16412471 } else
1642
- if (source == torusItem)
2472
+ if (source == torusItem || source == torusButton)
16432473 {
16442474 makeSomething(new Torus());
16452475 } else
1646
- if (source == superItem)
2476
+ if (source == superItem || source == superButton)
16472477 {
16482478 makeSomething(new Superellipsoid());
16492479 } else
1650
- if (source == kleinItem)
2480
+ if (source == kleinItem || source == kleinButton)
16512481 {
16522482 makeSomething(new Klein());
16532483 } else
....@@ -1667,7 +2497,7 @@
16672497 {
16682498 makeSomething(new BezierSurface());
16692499 } else
1670
- if (source == checkerItem)
2500
+ if (source == overlayItem || source == overlayButton)
16712501 {
16722502 /*
16732503 Object3D obj = new BezierSurface(5,8);
....@@ -1715,10 +2545,27 @@
17152545 s.setup();
17162546 makeSomething(s);
17172547 } else
1718
- if (source == lightItem)
2548
+ if (source == lightItem || source == lightButton)
17192549 {
17202550 makeSomething(new Light());
17212551 } else
2552
+// if (source == skybox1Button ||
2553
+// source == skybox2Button ||
2554
+// source == skybox3Button ||
2555
+// source == skybox4Button ||
2556
+// source == skybox5Button ||
2557
+// source == skybox6Button ||
2558
+// source == skybox7Button ||
2559
+// source == skybox11Button ||
2560
+// source == skybox12Button ||
2561
+// source == skybox13Button ||
2562
+// source == skybox14Button ||
2563
+// source == skybox15Button ||
2564
+// source == skybox16Button ||
2565
+// source == skybox17Button)
2566
+// {
2567
+// ChangeSkybox(source);
2568
+// } else
17222569 if (source == csgItem)
17232570 {
17242571 group(new CSG());
....@@ -1765,30 +2612,30 @@
17652612
17662613 group(g);
17672614 } else
1768
- if (source == loopItem)
2615
+ if (source == loopItem || source == loopButton)
17692616 {
17702617 Composite csg = new GroupLeaf();
17712618 csg.count = 5;
17722619 group(csg);
1773
- Composite child = new cGroup();
2620
+ Composite child = new cGroup("Branch");
17742621 csg.addChild(child);
17752622 child.addChild(csg);
17762623 } else
17772624 if (source == doubleItem)
17782625 {
1779
- Composite csg = new GroupLeaf();
2626
+ Composite csg = new GroupLeaf("Fork");
17802627 csg.count = 5;
17812628 group(csg);
1782
- Composite child = new cGroup();
2629
+ Composite child = new cGroup("Branch A");
17832630 csg.addChild(child);
17842631 child.addChild(csg);
1785
- child = new cGroup();
2632
+ child = new cGroup("Branch B");
17862633 csg.addChild(child);
17872634 child.addChild(csg);
17882635 } else
17892636 if (source == tripleItem)
17902637 {
1791
- Composite csg = new GroupLeaf();
2638
+ Composite csg = new GroupLeaf("Trident");
17922639 csg.count = 4;
17932640 group(csg);
17942641 Composite child = new cGroup();
....@@ -1801,27 +2648,10 @@
18012648 csg.addChild(child);
18022649 child.addChild(csg);
18032650 } else
1804
-
1805
- if (source == importGFDItem)
1806
- {
1807
- ImportGFD();
1808
- } else
1809
- if (source == importVRMLX3DItem)
1810
- {
1811
- ImportVRMLX3D();
1812
- } else
1813
- if (source == import3DSItem)
1814
- {
1815
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1816
- } else
1817
- if (source == importOBJItem)
1818
- {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1820
- } else
18212651 if (source == computeAOItem)
18222652 {
18232653 Globals.drawMode = CameraPane.OCCLUSION;
1824
- Globals.theRenderer.repaint();
2654
+ cameraView.repaint();
18252655 } else
18262656 if (source == recompileItem)
18272657 {
....@@ -1836,7 +2666,7 @@
18362666 if (source == invariantsItem)
18372667 {
18382668 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
2669
+ Grafreed.grafreed.universe.invariants();
18402670 } else
18412671 if (source == memoryItem)
18422672 {
....@@ -1855,19 +2685,68 @@
18552685 {
18562686 DumpObject();
18572687 } else
2688
+ if (source == minButton)
2689
+ {
2690
+ Minimize();
2691
+ } else
2692
+ if (source == maxButton)
2693
+ {
2694
+ Maximize();
2695
+ } else
2696
+ if (source == fullButton)
2697
+ {
2698
+ ToggleFullScreen();
2699
+ } else
2700
+ if (source == previousVersionButton)
2701
+ {
2702
+ // Go to previous version
2703
+ //if (!Undo())
2704
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2705
+ PreviousVersion();
2706
+ } else
2707
+ if (source == restoreButton)
2708
+ {
2709
+ // Restore current version
2710
+ Restore();
2711
+ //restoreButton.setEnabled(false);
2712
+ } else
2713
+ if (source == replaceButton)
2714
+ {
2715
+ // Overwrite current version
2716
+ Replace();
2717
+ //replaceButton.setEnabled(false);
2718
+ } else
2719
+ if (source == nextVersionButton)
2720
+ {
2721
+ // Go to next version
2722
+ NextVersion();
2723
+ } else
2724
+ if (source == saveVersionButton)
2725
+ {
2726
+ // Save a new version
2727
+ if (!Save(true))
2728
+ java.awt.Toolkit.getDefaultToolkit().beep();
2729
+ } else
2730
+ if (source == deleteVersionButton)
2731
+ {
2732
+ // Delete a new version
2733
+ DeleteVersion();
2734
+ } else
2735
+ if (source == oneStepButton)
2736
+ {
2737
+ Globals.ONESTEP = true;
2738
+ cameraView.repaint();
2739
+ } else
18582740 if (source == screenfitButton)
18592741 {
1860
- //Reload(lastConverter, lastFilename, true);
18612742 ScreenFit();
18622743 } else
18632744 if (source == screenfitpointButton)
18642745 {
1865
- //Reload(lastConverter, lastFilename, true);
18662746 ScreenFitPoint();
18672747 } else
18682748 if (source == snapobjectButton)
18692749 {
1870
- //Reload(lastConverter, lastFilename, true);
18712750 SnapObject();
18722751 } else
18732752 // if (event.getSource() == recompileButton)
....@@ -1904,12 +2783,20 @@
19042783 {
19052784 loadClipboard(true);
19062785 } else
2786
+ if (source == undoItem)
2787
+ {
2788
+ PreviousVersion();
2789
+ } else
2790
+ if (source == redoItem)
2791
+ {
2792
+ NextVersion();
2793
+ } else
19072794 if (source == duplicateItem)
19082795 {
1909
- Object3D keep = GrafreeD.clipboard;
2796
+ Object3D keep = Grafreed.clipboard;
19102797 loadClipboard(false);
19112798 paste(false);
1912
- GrafreeD.clipboard = keep;
2799
+ Grafreed.clipboard = keep;
19132800 } else
19142801 if (source == cloneItem)
19152802 {
....@@ -1927,13 +2814,17 @@
19272814 {
19282815 paste(false);
19292816 } else
2817
+ if (source == pasteIntoItem)
2818
+ {
2819
+ pasteInto(true, false);
2820
+ } else
19302821 if (source == pasteLinkItem)
19312822 {
1932
- pasteInto(false);
2823
+ pasteInto(false, false);
19332824 } else
19342825 if (source == pasteCloneItem)
19352826 {
1936
- pasteInto(true);
2827
+ pasteInto(true, true);
19372828 } else
19382829 if (source == pasteExpandItem)
19392830 {
....@@ -2125,9 +3016,9 @@
21253016 // group.selection.get(0).setMasterThis(content); // should be identity
21263017 // refreshContents();
21273018 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3019
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21293020 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
3021
+ Object3D content = Grafreed.clipboard.get(0);
21313022
21323023 if (content instanceof cGroup && ((cGroup)content).transientlink )
21333024 content = ((cGroup)content).get(0);
....@@ -2135,11 +3026,11 @@
21353026 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21363027 for (int i=0; i<group.selection.size(); i++)
21373028 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
3029
+ boolean random = CameraPane.SWITCH;
3030
+ CameraPane.SWITCH = false; // parse all random nodes
21403031 group.selection.get(i).linkVerticesThis(content);
21413032 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
3033
+ CameraPane.SWITCH = random;
21433034 }
21443035 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21453036 refreshContents();
....@@ -2149,20 +3040,20 @@
21493040 {
21503041 for (int i=0; i<group.selection.size(); i++)
21513042 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
3043
+ boolean random = CameraPane.SWITCH;
3044
+ CameraPane.SWITCH = false; // parse all random nodes
21543045 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
3046
+ CameraPane.SWITCH = random;
21563047 }
21573048
21583049 refreshContents();
21593050 } else
21603051 if (source == relinkverticesItem)
21613052 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
3053
+ boolean random = CameraPane.SWITCH;
3054
+ CameraPane.SWITCH = false; // parse all random nodes
21643055 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
3056
+ CameraPane.SWITCH = random;
21663057
21673058 refreshContents();
21683059 } else
....@@ -2177,9 +3068,9 @@
21773068 } else
21783069 if (source == setMasterItem)
21793070 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
3071
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21813072 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
3073
+ Object3D content = Grafreed.clipboard.get(0);
21833074
21843075 if (content instanceof cGroup && ((cGroup)content).transientlink )
21853076 content = ((cGroup)content).get(0);
....@@ -2192,9 +3083,9 @@
21923083 {
21933084 if (group.selection.size() == 1)
21943085 {
2195
- if (GrafreeD.clipboard.size() == 1)
3086
+ if (Grafreed.clipboard.size() == 1)
21963087 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
3088
+ Object3D content = Grafreed.clipboard.get(0);
21983089
21993090 if (content instanceof cGroup && ((cGroup)content).transientlink )
22003091 content = ((cGroup)content).get(0);
....@@ -2211,7 +3102,7 @@
22113102 {
22123103 RevertMeshes();
22133104 } else
2214
- if (source == resetMeshItem)
3105
+ if (source == resetAllItem)
22153106 {
22163107 ResetAll();
22173108 } else
....@@ -2219,7 +3110,7 @@
22193110 {
22203111 StepAll();
22213112 } else
2222
- if (source == clearItem) // || event.getSource() == clearButton)
3113
+ if (source == deleteItem) // || event.getSource() == clearButton)
22233114 {
22243115 //int indices[] = jList.getSelectedIndices();
22253116 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2231,9 +3122,9 @@
22313122 {
22323123 ClearSelection(true);
22333124 } else
2234
- if (source == grabItem)
3125
+ if (source == grabItem || source == groupButton)
22353126 {
2236
- group(new cGroup(), true);
3127
+ group(new cGroup(), false); // true);
22373128 } else
22383129 if (source == hideItem)
22393130 {
....@@ -2251,16 +3142,16 @@
22513142 {
22523143 makeSomething(new Camera());
22533144 } else
2254
- if (source == compositeItem)
3145
+ if (source == compositeItem || source == compositeButton)
22553146 {
22563147 group(new Composite());
22573148 } else
2258
- if (source == randomItem)
3149
+ if (source == switchItem || source == switchButton)
22593150 {
22603151 RandomNode random = new RandomNode();
22613152 group(random);
22623153 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
3154
+ random.name = random.get(0).name + "Switch";
22643155 } else
22653156 if (source == physicsItem)
22663157 {
....@@ -2357,7 +3248,7 @@
23573248 {
23583249 group(new cLinker());
23593250 } else
2360
- if (source == textureItem)
3251
+ if (source == textureItem || source == textureButton)
23613252 {
23623253 group(new TextureNode());
23633254 } else
....@@ -2377,17 +3268,30 @@
23773268 {
23783269 CastShadow(2);
23793270 } else
2380
- if (source == ungroupItem)
3271
+ if (source == ungroupItem || source == ungroupButton)
23813272 {
2382
- //ungroup();
3273
+ boolean hasRoot = false;
3274
+
23833275 for (int i=0; i<group.selection.size(); i++)
23843276 {
2385
- Ungroup(group.selection.get(i));
3277
+ if (group.selection.get(i) == group)
3278
+ {
3279
+ hasRoot = true;
3280
+ break;
3281
+ }
23863282 }
23873283
2388
- ClearSelection(false);
2389
-
2390
- refreshContents();
3284
+ if (!hasRoot)
3285
+ {
3286
+ for (int i=0; i<group.selection.size(); i++)
3287
+ {
3288
+ Ungroup(group.selection.get(i));
3289
+ }
3290
+
3291
+ ClearSelection(false);
3292
+
3293
+ refreshContents();
3294
+ }
23913295 } else
23923296 if (source == genUVItem)
23933297 {
....@@ -2399,7 +3303,7 @@
23993303 } else
24003304 if (source == genNormalsMESHItem)
24013305 {
2402
- GenNormals(true); // TODO
3306
+ GenNormalsMESH();
24033307 } else
24043308 if (source == genNormalsORGANItem)
24053309 {
....@@ -2464,6 +3368,22 @@
24643368 if (source == unmarkleavesItem)
24653369 {
24663370 MarkLeaves(false);
3371
+ } else
3372
+ if (source == rewindleavesItem)
3373
+ {
3374
+ RewindLeaves(true);
3375
+ } else
3376
+ if (source == unrewindleavesItem)
3377
+ {
3378
+ RewindLeaves(false);
3379
+ } else
3380
+ if (source == randomleavesItem)
3381
+ {
3382
+ RandomLeaves(true);
3383
+ } else
3384
+ if (source == unrandomleavesItem)
3385
+ {
3386
+ RandomLeaves(false);
24673387 } else
24683388 if (source == flipVItem)
24693389 {
....@@ -2549,9 +3469,13 @@
25493469 {
25503470 SmoothMesh();
25513471 } else
2552
- if (source == transformgeometryItem)
3472
+ if (source == transformGeometryItem)
25533473 {
25543474 TransformGeometry();
3475
+ } else
3476
+ if (source == transformChildrenItem)
3477
+ {
3478
+ TransformChildren();
25553479 } else
25563480 if (source == resetTransformItem)
25573481 {
....@@ -2559,7 +3483,11 @@
25593483 } else
25603484 if (source == resetCentroidItem)
25613485 {
2562
- ResetCentroid();
3486
+ ResetCentroid(true);
3487
+ } else
3488
+ if (source == resetCentroidXZItem)
3489
+ {
3490
+ ResetCentroid(false);
25633491 } else
25643492 if (source == resetParentItem)
25653493 {
....@@ -2664,7 +3592,7 @@
26643592 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26653593 {
26663594 obj = (Object3D)e.nextElement();
2667
- obj.SetBumpTexture(null);
3595
+ obj.ResetBumpTexture();
26683596 }
26693597
26703598 refreshContents();
....@@ -2680,6 +3608,31 @@
26803608
26813609 refreshContents();
26823610 } else
3611
+ if (source == embedTexturesItem)
3612
+ {
3613
+ Object3D obj;
3614
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3615
+ {
3616
+ obj = (Object3D)e.nextElement();
3617
+ obj.EmbedTextures(true);
3618
+ }
3619
+
3620
+ refreshContents();
3621
+ } else
3622
+ if (source == deEmbedTexturesItem)
3623
+ {
3624
+ Object3D obj;
3625
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3626
+ {
3627
+ obj = (Object3D)e.nextElement();
3628
+ obj.EmbedTextures(false);
3629
+ }
3630
+
3631
+ CameraPane.texturepigment.clear();
3632
+ CameraPane.texturebump.clear();
3633
+
3634
+ refreshContents();
3635
+ } else
26833636 if (source == flashSelectionButton)
26843637 {
26853638 CameraPane.flash = true;
....@@ -2691,6 +3644,10 @@
26913644 if (source == twoButton)
26923645 {
26933646 radio.layout = twoButton;
3647
+
3648
+ if (CameraPane.FULLSCREEN)
3649
+ fullscreenLayout = radio.layout;
3650
+
26943651 // bug
26953652 //gridPanel.setDividerLocation(1.0);
26963653 //bigPanel.setDividerLocation(0.0);
....@@ -2723,10 +3680,31 @@
27233680 bigThree.ClearUI();
27243681 bigThree.add(centralPanel);
27253682 bigThree.FlushUI();
3683
+
3684
+ cameraView.requestFocusInWindow();
3685
+
3686
+// refreshContents(true);
3687
+//
3688
+// try
3689
+// {
3690
+// java.awt.Robot bot = new java.awt.Robot();
3691
+// int mask = InputEvent.BUTTON1_MASK;
3692
+// bot.mouseMove(100, 100);
3693
+// bot.mousePress(mask);
3694
+// bot.mouseRelease(mask);
3695
+// }
3696
+// catch (Exception e)
3697
+// {
3698
+//
3699
+// }
3700
+
27263701 } else
27273702 if (source == threeButton)
27283703 {
27293704 radio.layout = threeButton;
3705
+
3706
+ if (CameraPane.FULLSCREEN)
3707
+ fullscreenLayout = radio.layout;
27303708
27313709 // bigThree.remove(scenePanel);
27323710 // bigThree.remove(centralPanel);
....@@ -2756,13 +3734,18 @@
27563734 // centralPanel.setVisible(true);
27573735 // XYZPanel.setVisible(true);
27583736 bigThree.ClearUI();
3737
+ bigThree.add(scenePanel);
27593738 bigThree.add(centralPanel);
2760
- bigThree.add(XYZPanel);
27613739 bigThree.FlushUI();
3740
+
3741
+ cameraView.requestFocusInWindow();
27623742 } else
27633743 if (source == fourButton)
27643744 {
27653745 radio.layout = fourButton;
3746
+
3747
+ if (CameraPane.FULLSCREEN)
3748
+ fullscreenLayout = radio.layout;
27663749
27673750 // bigThree.remove(scenePanel);
27683751 // bigThree.remove(centralPanel);
....@@ -2794,10 +3777,15 @@
27943777 bigThree.ClearUI();
27953778 bigThree.add(scenePanel);
27963779 bigThree.FlushUI();
3780
+
3781
+ cameraView.requestFocusInWindow();
27973782 } else
27983783 if (source == sixButton)
27993784 {
28003785 radio.layout = sixButton;
3786
+
3787
+ if (CameraPane.FULLSCREEN)
3788
+ fullscreenLayout = radio.layout;
28013789
28023790 // bigThree.remove(scenePanel);
28033791 // bigThree.remove(centralPanel);
....@@ -2827,13 +3815,18 @@
28273815 // centralPanel.setVisible(true);
28283816 // XYZPanel.setVisible(false);
28293817 bigThree.ClearUI();
2830
- bigThree.add(scenePanel);
28313818 bigThree.add(centralPanel);
3819
+ bigThree.add(scenePanel);
28323820 bigThree.FlushUI();
3821
+
3822
+ cameraView.requestFocusInWindow();
28333823 } else
28343824 if (source == sevenButton)
28353825 {
28363826 radio.layout = sevenButton;
3827
+
3828
+ if (CameraPane.FULLSCREEN)
3829
+ fullscreenLayout = radio.layout;
28373830
28383831 // bigThree.remove(scenePanel);
28393832 // bigThree.remove(centralPanel);
....@@ -2867,6 +3860,8 @@
28673860 bigThree.add(centralPanel);
28683861 bigThree.add(XYZPanel);
28693862 bigThree.FlushUI();
3863
+
3864
+ cameraView.requestFocusInWindow();
28703865 } else
28713866 if (source == rootButton)
28723867 {
....@@ -2878,6 +3873,7 @@
28783873 EditObject(obj);
28793874 }
28803875
3876
+ cameraView.requestFocusInWindow();
28813877 refreshContents(true);
28823878 } else
28833879 if (source == closeButton)
....@@ -2887,22 +3883,37 @@
28873883 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28883884 {
28893885 ab = (cRadio)e.nextElement();
2890
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3886
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28913887 {
3888
+ // Patch to avoid bug with transparency.
3889
+ if (!ab.hadMaterial)
3890
+ {
3891
+ ab.object.material = null;
3892
+ }
3893
+
28923894 buttonGroup.remove(ab);
28933895 radioPanel.remove(ab);
28943896
2895
- ab.GetObject().editWindow = null;
3897
+ //ab.GetObject().editWindow = null;
3898
+ ab.GetObject().manipWindow = null;
28963899 // ab.GetObject().objectUI = null; // ?????????
28973900
28983901 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28993902 break;
29003903 }
29013904 }
3905
+
3906
+ cameraView.requestFocusInWindow();
29023907 refreshContents(true);
29033908 } else
29043909 if (source == editItem || source == editButton)
29053910 {
3911
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3912
+ {
3913
+ Object3D child = (Object3D)e.nextElement();
3914
+ child.pinned = true;
3915
+ }
3916
+
29063917 EditSelection(false);
29073918 } else
29083919 if (source == uneditButton)
....@@ -2911,13 +3922,14 @@
29113922 {
29123923 Object3D child = (Object3D)e.nextElement();
29133924 if(child.editWindow != null)
2914
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3925
+ child.pinned = false;
29153926 child.CloseUI();
29163927 listUI.remove(child);
3928
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29173929
2918
- child.editWindow = null; // ???????????
3930
+ //child.editWindow = null; // ???????????
29193931 }
2920
- objEditor.ctrlPanel.validate();
3932
+ objEditor.ctrlPanel.FlushUI();
29213933 //objEditor.jTree.clearSelection();
29223934 //objEditor.ResetSliders();
29233935 refreshContents(true);
....@@ -2928,16 +3940,18 @@
29283940 //copy.ClearUI();
29293941 for (Object3D obj : listUI)
29303942 {
3943
+ obj.pinned = false;
29313944 obj.CloseUI();
29323945 }
29333946 listUI.clear();
3947
+ SetPinStates(group.selection.size() > 0);
29343948 refreshContents(true);
29353949 } else
29363950 if (source == allParamsButton)
29373951 {
29383952 assert(copy == group);
29393953
2940
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3954
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29413955
29423956 for (Object3D obj : listUI)
29433957 {
....@@ -2986,6 +4000,9 @@
29864000 }
29874001
29884002 copy = group;
4003
+
4004
+ SetUndoStates();
4005
+
29894006 //Globals.theRenderer.object = group;
29904007 if(!useclient)
29914008 {
....@@ -3001,20 +4018,49 @@
30014018 frontView.object = group;
30024019 sideView.object = group;
30034020 }
3004
- group.editWindow = this;
4021
+
4022
+// fix "+" issue
4023
+ //group.editWindow = this;
4024
+ group.manipWindow = this;
4025
+
30054026 /*
30064027 currentLayout = radio.layout;
30074028 if (currentLayout == null)
30084029 currentLayout = sevenButton;
30094030 */
30104031 radio.layout.doClick();
4032
+
4033
+ ClearUnpinned();
4034
+
4035
+ //Grafreed.Assert(group != null);
4036
+ //Grafreed.Assert(group.selection != null);
4037
+ SetPinStates(group.selection == null || group.selection.size() > 0);
4038
+ if (group.selection == null || group.selection.size() == 1)
4039
+ EditSelection(false);
30114040 keepparent = group.parent;
30124041 // PARENT = NULL or not???
30134042 //group.parent = null; // ROOT
30144043 //group.attributes = -1;
30154044 ResetModel();
4045
+
4046
+ cameraView.requestFocusInWindow();
30164047 refreshContents(true);
3017
- }
4048
+ } else if (event.getSource() == editCameraItem)
4049
+ {
4050
+ cameraView.ProtectCamera();
4051
+ cameraView.requestFocusInWindow();
4052
+ cameraView.repaint();
4053
+ return;
4054
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
4055
+ {
4056
+ cameraView.RevertCamera();
4057
+ cameraView.requestFocusInWindow();
4058
+ cameraView.repaint();
4059
+ return;
4060
+ // } else if (event.getSource() == textureButton)
4061
+ // {
4062
+ // return; // true;
4063
+ }
30184064 else
30194065 {
30204066 //return super.action(event, arg);
....@@ -3023,7 +4069,6 @@
30234069 }
30244070
30254071 boolean useclient = false;
3026
- cRadio radio;
30274072
30284073 void ToggleRoot()
30294074 {
....@@ -3075,6 +4120,28 @@
30754120 refreshContents();
30764121 }
30774122
4123
+ void TransformChildren()
4124
+ {
4125
+ Object3D obj;
4126
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4127
+ {
4128
+ obj = (Object3D)e.nextElement();
4129
+ obj.KeepTextureMatrices();
4130
+ obj.TransformChildren();
4131
+ obj.RestoreTextureMatrices();
4132
+
4133
+// if (obj.parent == null)
4134
+// {
4135
+// System.out.println("NULL PARENT!");
4136
+// new Exception().printStackTrace();
4137
+// }
4138
+// else
4139
+// TouchTransform(obj);
4140
+// //obj.parent.Touch();
4141
+ }
4142
+
4143
+ refreshContents();
4144
+ }
30784145
30794146 void ResetTransform()
30804147 {
....@@ -3187,7 +4254,7 @@
31874254 refreshContents();
31884255 }
31894256
3190
- void ResetCentroid()
4257
+ void ResetCentroid(boolean full)
31914258 {
31924259 Object3D obj;
31934260 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +4269,16 @@
32024269 LA.matIdentity(Object3D.mat);
32034270 obj.getBounds(minima, maxima, false);
32044271 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4272
+ if (full)
4273
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32064274 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32074275 obj.TransformMesh(Object3D.mat);
4276
+
32084277 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4278
+ if (full)
4279
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32104280 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4281
+
32114282 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32124283 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32134284 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3236,7 +4307,8 @@
32364307
32374308 int size = obj.MemorySize();
32384309
3239
- System.err.println((size/1024) + " KB is the size of " + obj);
4310
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4311
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32404312 }
32414313 }
32424314 catch (Exception e)
....@@ -3273,9 +4345,9 @@
32734345 obj = (Object3D)e.nextElement();
32744346
32754347 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
4348
+ Grafreed.AnalyzeObject(obj);
32774349 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
4350
+ Grafreed.AnalyzeObject(obj.bRep);
32794351
32804352 // System.err.println((size/1024) + " KB is the size of " + obj);
32814353 }
....@@ -3317,6 +4389,13 @@
33174389 void GenNormals(boolean crease)
33184390 {
33194391 group.GenNormalsS(crease);
4392
+
4393
+ refreshContents();
4394
+ }
4395
+
4396
+ void GenNormalsMESH()
4397
+ {
4398
+ group.GenNormalsMeshS();
33204399
33214400 refreshContents();
33224401 }
....@@ -3489,8 +4568,8 @@
34894568
34904569 void ParseVertices()
34914570 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
4571
+ boolean epsequal = Grafreed.epsequal;
4572
+ Grafreed.epsequal = true;
34944573
34954574 for (int i=0; i<group.selection.size(); i++)
34964575 {
....@@ -3515,7 +4594,7 @@
35154594 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35164595 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35174596
3518
- g.add(GrafreeD.clipboard);
4597
+ g.add(Grafreed.clipboard);
35194598
35204599 buffer.add(g);
35214600 }
....@@ -3530,7 +4609,7 @@
35304609 makeSomething(buffer, i==group.selection.size()-1);
35314610 }
35324611
3533
- GrafreeD.epsequal = epsequal;
4612
+ Grafreed.epsequal = epsequal;
35344613
35354614 refreshContents();
35364615 }
....@@ -3548,7 +4627,16 @@
35484627 String pigment = Object3D.GetPigment(tex);
35494628 //String bump = Object3D.GetBump(tex);
35504629
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4630
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4631
+
4632
+ try
4633
+ {
4634
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4635
+ }
4636
+ catch (Exception e)
4637
+ {
4638
+ System.err.println("FAIL: " + node);
4639
+ }
35524640
35534641 double s = v.s;
35544642
....@@ -3636,11 +4724,11 @@
36364724
36374725 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36384726
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
4727
+ boolean random = CameraPane.SWITCH;
4728
+ CameraPane.SWITCH = false; // parse all random nodes
36414729 lowres.linkVerticesThis(null);
36424730 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
4731
+ CameraPane.SWITCH = random;
36444732
36454733 System.err.flush();
36464734
....@@ -3680,7 +4768,7 @@
36804768 return;
36814769
36824770 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
4771
+ Object3D ref = Grafreed.clipboard.get(0);
36844772
36854773 Object3D newgroup = new Object3D("Po:" + poses.name);
36864774
....@@ -3874,9 +4962,9 @@
38744962
38754963 void ClipMesh()
38764964 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4965
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38784966 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
4967
+ Object3D content = Grafreed.clipboard.get(0);
38804968
38814969 if (content instanceof cGroup && ((cGroup)content).transientlink )
38824970 content = ((cGroup)content).get(0);
....@@ -3885,7 +4973,7 @@
38854973 // {
38864974 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874975 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4976
+ group.selection.ClipMesh(Grafreed.clipboard);
38894977 }
38904978 // group.selection.ClipMesh(GrafreeD.clipboard);
38914979 System.out.println("DONE.");
....@@ -3932,6 +5020,18 @@
39325020 void MarkLeaves(boolean hide)
39335021 {
39345022 group.selection.MarkLeaves(hide);
5023
+ refreshContents();
5024
+ }
5025
+
5026
+ void RewindLeaves(boolean hide)
5027
+ {
5028
+ group.selection.RewindLeaves(hide);
5029
+ refreshContents();
5030
+ }
5031
+
5032
+ void RandomLeaves(boolean hide)
5033
+ {
5034
+ group.selection.RandomLeaves(hide);
39355035 refreshContents();
39365036 }
39375037
....@@ -4006,28 +5106,25 @@
40065106 // }
40075107 // }
40085108
4009
- static boolean allparams = true;
4010
-
4011
- static Vector<Object3D> listUI = new Vector<Object3D>();
4012
-
40135109 void EditSelection(boolean newWindow)
40145110 {
5111
+ if (group.selection == null)
5112
+ {
5113
+ EditElement(group, newWindow); // ? new
5114
+ return;
5115
+ }
5116
+
40155117 // aConstraints.gridy = 0;
40165118 for (int i=0; i<group.selection.size(); i++)
40175119 {
40185120 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40195121 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4020
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5122
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40215123
40225124 Object3D elem = (Object3D)group.selection.elementAt(i);
4023
- if(elem != group)
5125
+ if(elem != group || !newWindow)
40245126 {
4025
- // if (!(elem instanceof Composite))
4026
- // newWindow = false;
4027
- listUI.add(elem);
4028
- elem.openEditWindow(this, newWindow); //, false);
4029
- System.out.println("edit : " + elem);
4030
- elem.editWindow.refreshContents(true); // ? new
5127
+ EditElement(elem, newWindow); // ? new
40315128 }
40325129 }
40335130 }
....@@ -4090,9 +5187,7 @@
40905187
40915188 freezemodel = false;
40925189 }
4093
-
4094
- boolean flashIt = true;
4095
-
5190
+
40965191 public void valueChanged(TreeSelectionEvent e)
40975192 //public boolean handleEvent(Event event)
40985193 {
....@@ -4102,7 +5197,8 @@
41025197 //new Exception().printStackTrace();
41035198
41045199 freezemodel = true;
4105
-
5200
+ ClearUnpinned();
5201
+
41065202 /**/
41075203 //switch (event.id)
41085204 {
....@@ -4110,7 +5206,6 @@
41105206 //case 702: // Event.LIST_DESELECT
41115207 group.deselectAll();
41125208 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4113
- objEditor.ClearInfo(); // .GetMaterial());
41145209 if (tps != null)
41155210 {
41165211 for (int i=0; i < tps.length; i++)
....@@ -4119,33 +5214,39 @@
41195214
41205215 //if (child.parent != null)
41215216 //child.parent.addSelectee(child);
5217
+ objEditor.SetMaterial(child);
41225218 group.addSelectee(child);
4123
- objEditor.SetMaterial(child); // .GetMaterial());
4124
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4125
- System.err.println("info : " + child.GetPath());
41265219 }
41275220 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
5221
+// else
5222
+// {
5223
+// objEditor.SetMaterial(group); // .GetMaterial());
5224
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5225
+// System.err.println("info : " + group.GetPath());
5226
+// }
41345227
4135
- objEditor.SetText(); // jan 2014
4136
-
4137
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5228
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41385229 CameraPane.flash = true;
41395230
4140
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5231
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41415232 // a camera
41425233 {
4143
- CameraPane.camerachangeframe = 0; // don't refuse it
4144
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5234
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5235
+ {
5236
+ CameraPane.camerachangeframe = 0; // don't refuse it
5237
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5238
+ }
41455239 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41465240 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41475241 }
41485242
5243
+ if (tps != null && tps.length == 1)
5244
+ {
5245
+ EditSelection(false);
5246
+ }
5247
+
5248
+ SetPinStates(tps != null && tps.length > 0);
5249
+
41495250 refreshContents();
41505251 //return true;
41515252 }
....@@ -4154,6 +5255,37 @@
41545255
41555256 freezemodel = false;
41565257 }
5258
+
5259
+ void SetPinStates(boolean enabled)
5260
+ {
5261
+ editButton.setEnabled(enabled);
5262
+ uneditButton.setEnabled(enabled);
5263
+ //unselectButton.setEnabled(enabled);
5264
+ flashSelectionButton.setEnabled(enabled);
5265
+
5266
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5267
+ }
5268
+
5269
+ void refreshContents(boolean cp)
5270
+ {
5271
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5272
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5273
+ {
5274
+ objEditor.ClearInfo(); // .GetMaterial());
5275
+
5276
+ for (int i=0; i < group.selection.Size(); i++)
5277
+ {
5278
+ Object3D child = (Object3D) group.selection.get(i);
5279
+
5280
+ objEditor.AddInfo(child, this, true);
5281
+ System.err.println("info : " + child.GetPath());
5282
+ }
5283
+
5284
+ objEditor.SetText(); // jan 2014
5285
+ }
5286
+
5287
+ super.refreshContents(cp);
5288
+ }
41575289
41585290 void linkSomething(Object3D thing)
41595291 {
....@@ -4225,16 +5357,19 @@
42255357 {
42265358 if (group.selection.isEmpty())
42275359 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
5360
+
5361
+ Grafreed.clipboardIsTempGroup = false;
42295362 Composite tGroup = null;
42305363 if (group.selection.size() > 0) // 1)
42315364 {
42325365 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
5366
+ Grafreed.clipboardIsTempGroup = true;
42345367 }
42355368
42365369 if (cut)
42375370 {
5371
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5372
+// Save();
42385373 //int indices[] = jList.getSelectedIndices();
42395374 //for (int i = indices.length - 1; i >= 0; i--)
42405375 //jList.remove(indices[i]);
....@@ -4270,16 +5405,16 @@
42705405 //System.out.println("cut " + child);
42715406 //System.out.println("parent = " + child.parent);
42725407 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
5408
+ if (Grafreed.clipboardIsTempGroup)
42745409 tGroup.add/*Child*/(tmp);
42755410 else
4276
- GrafreeD.clipboard = tmp;
5411
+ Grafreed.clipboard = tmp;
42775412 }
42785413 else
4279
- if (GrafreeD.clipboardIsTempGroup)
5414
+ if (Grafreed.clipboardIsTempGroup)
42805415 tGroup.add/*Child*/(child);
42815416 else
4282
- GrafreeD.clipboard = child;
5417
+ Grafreed.clipboard = child;
42835418 }
42845419
42855420 //ResetModel();
....@@ -4311,21 +5446,23 @@
43115446 //System.out.println("cut " + elem);
43125447 //System.out.println("parent = " + elem.parent);
43135448 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
5449
+ if (Grafreed.clipboardIsTempGroup)
43155450 tGroup.add/*Child*/(tmp);
43165451 else
4317
- GrafreeD.clipboard = tmp;
5452
+ Grafreed.clipboard = tmp;
43185453 }
43195454 else
4320
- if (GrafreeD.clipboardIsTempGroup)
5455
+ if (Grafreed.clipboardIsTempGroup)
43215456 tGroup.add/*Child*/(child);
43225457 else
4323
- GrafreeD.clipboard = child;
5458
+ Grafreed.clipboard = child;
43245459 }
43255460
43265461 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
5462
+
5463
+ if (Grafreed.clipboardIsTempGroup)
5464
+ Grafreed.clipboard = tGroup;
5465
+
43295466 if (cut)
43305467 {
43315468 ResetModel();
....@@ -4335,11 +5472,15 @@
43355472
43365473 void paste(boolean expand)
43375474 {
5475
+ if (Globals.REPLACEONMAKE)
5476
+ Save();
5477
+ boolean keep = Globals.REPLACEONMAKE;
5478
+ Globals.REPLACEONMAKE = false;
43385479 // if (GrafreeD.clipboard == null)
43395480 // return;
43405481 boolean first = true;
43415482
4342
- if (GrafreeD.clipboardIsTempGroup)
5483
+ if (Grafreed.clipboardIsTempGroup)
43435484 {
43445485 Composite temp;
43455486
....@@ -4350,7 +5491,7 @@
43505491 temp = (Composite)Applet3D.clipboard.deepCopy();
43515492 */
43525493 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5494
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43545495 {
43555496 Object3D child = (Object3D)e.nextElement();
43565497
....@@ -4384,21 +5525,22 @@
43845525 //Object3D cb = Applet3D.clipboard;
43855526 //temp.addChild(cb);
43865527 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4387
- assert(GrafreeD.clipboard.parent == null);
4388
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4389
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4390
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4391
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5528
+ assert(Grafreed.clipboard.parent == null);
5529
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5530
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5531
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5532
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43925533 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
5534
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5535
+ Grafreed.clipboard.get(0).parent = keepparent;
43955536 }
43965537
5538
+ Globals.REPLACEONMAKE = keep;
43975539 ResetModel();
43985540 refreshContents();
43995541 }
44005542
4401
- void pasteInto(boolean copyit)
5543
+ void pasteInto(boolean copyit, boolean clone)
44025544 {
44035545 // if (GrafreeD.clipboard == null)
44045546 // return;
....@@ -4427,15 +5569,22 @@
44275569 if (copyit)
44285570 {
44295571 // paste(false);
4430
- CloneClipboard(false); // sept 2014
5572
+ if (clone)
5573
+ {
5574
+ CloneClipboard(false); // sept 2014
5575
+ }
5576
+ else
5577
+ {
5578
+ paste(false);
5579
+ }
44315580 }
44325581 else
44335582 {
44345583 boolean first = true;
44355584
4436
- if (GrafreeD.clipboardIsTempGroup)
5585
+ if (Grafreed.clipboardIsTempGroup)
44375586 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
5587
+ Composite temp = (Composite)Grafreed.clipboard;
44395588 Object3D copy;
44405589 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44415590 {
....@@ -4445,7 +5594,7 @@
44455594 }
44465595 } else
44475596 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
5597
+ linkSomething(Grafreed.clipboard); //.get(0));
44495598 }
44505599 }
44515600 }
....@@ -4522,6 +5671,10 @@
45225671
45235672 void group(Object3D csg, boolean grab)
45245673 {
5674
+ if (Globals.REPLACEONMAKE)
5675
+ Save();
5676
+ boolean keep = Globals.REPLACEONMAKE;
5677
+ Globals.REPLACEONMAKE = false;
45255678 if (//false) // why??
45265679 !group.selection.isEmpty())
45275680 {
....@@ -4635,10 +5788,15 @@
46355788 //node.add(csg);
46365789 //makeSomething(node);
46375790 makeSomething(csg);
5791
+ Globals.REPLACEONMAKE = keep;
46385792 }
46395793
46405794 void Ungroup(Object3D g)
46415795 {
5796
+ if (Globals.REPLACEONMAKE)
5797
+ Save();
5798
+ boolean keep = Globals.REPLACEONMAKE;
5799
+ Globals.REPLACEONMAKE = false;
46425800 if (g instanceof HiddenObject)
46435801 {
46445802 HiddenObject h = (HiddenObject) g;
....@@ -4655,6 +5813,7 @@
46555813 objEditor.makeSomething(g.get(i), false);
46565814 }
46575815 }
5816
+ Globals.REPLACEONMAKE = keep;
46585817 }
46595818
46605819 void ungroup()
....@@ -4850,21 +6009,6 @@
48506009 }
48516010 */
48526011
4853
- void ImportGFD()
4854
- {
4855
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4856
- browser.show();
4857
- String filename = browser.getFile();
4858
- if (filename != null && filename.length() > 0)
4859
- {
4860
- String fullname = browser.getDirectory() + filename;
4861
-
4862
- //Object3D readobj =
4863
- objEditor.ReadGFD(fullname, objEditor);
4864
- //makeSomething(readobj);
4865
- }
4866
- }
4867
-
48686012 /*
48696013 public void Callback(Object obj)
48706014 {
....@@ -4888,26 +6032,9 @@
48886032 }
48896033 */
48906034
4891
- void ImportVRMLX3D()
4892
- {
4893
- if (GrafreeD.standAlone)
4894
- {
4895
- /**/
4896
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4897
- browser.show();
4898
- String filename = browser.getFile();
4899
- if (filename != null && filename.length() > 0)
4900
- {
4901
- String fullname = browser.getDirectory() + filename;
4902
- LoadVRMLX3D(fullname);
4903
- }
4904
- /**/
4905
- }
4906
- }
4907
-
49086035 String GetFile(String dialogName)
49096036 {
4910
- if (GrafreeD.standAlone)
6037
+ if (Grafreed.standAlone)
49116038 {
49126039 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49136040 browser.show();
....@@ -4971,10 +6098,48 @@
49716098 cButton flashSelectionButton;
49726099 cButton editButton;
49736100 cButton uneditButton;
6101
+ JCheckBox allParamsButton;
49746102 cButton clearpanelButton;
4975
- cButton allParamsButton;
49766103 cButton unselectButton;
49776104
6105
+ cButton restoreCameraButton;
6106
+
6107
+ cButton oneStepButton;
6108
+
6109
+ cButton groupButton;
6110
+ cButton ungroupButton;
6111
+ cButton compositeButton;
6112
+ cButton switchButton;
6113
+ cButton loopButton;
6114
+ cButton textureButton;
6115
+
6116
+ cButton skybox1Button;
6117
+ cButton skybox2Button;
6118
+ cButton skybox3Button;
6119
+ cButton skybox4Button;
6120
+ cButton skybox5Button;
6121
+ cButton skybox6Button;
6122
+ cButton skybox7Button;
6123
+
6124
+ cButton skybox11Button;
6125
+ cButton skybox12Button;
6126
+ cButton skybox13Button;
6127
+ cButton skybox14Button;
6128
+ cButton skybox15Button;
6129
+ cButton skybox16Button;
6130
+ cButton skybox17Button;
6131
+
6132
+ cButton gridButton;
6133
+ cButton boxButton;
6134
+ cButton sphereButton;
6135
+ cButton coneButton;
6136
+ cButton torusButton;
6137
+ cButton superButton;
6138
+ cButton kleinButton;
6139
+ cButton particlesButton;
6140
+ cButton overlayButton;
6141
+ cButton lightButton;
6142
+
49786143 cButton screenfitButton;
49796144 cButton screenfitpointButton;
49806145 cButton snapobjectButton;
....@@ -4986,14 +6151,6 @@
49866151
49876152 cButton setsupportButton;
49886153
4989
- cButton twoButton;
4990
- cButton sixButton;
4991
- cButton threeButton;
4992
- cButton sevenButton;
4993
- cButton fourButton; // full panel
4994
- cButton oneButton; // full XYZ
4995
- //cButton currentLayout;
4996
-
49976154 //
49986155 //Composite
49996156 Object3D // to do !!
....@@ -5003,9 +6160,11 @@
50036160 //JTree jTree;
50046161 private MenuItem lookAtItem;
50056162 private MenuItem lookFromItem;
5006
- private MenuItem switchItem;
6163
+ private MenuItem switchViewItem;
50076164 private MenuItem cutItem;
5008
- private MenuItem duplicateItem;
6165
+ private MenuItem undoItem;
6166
+ private MenuItem redoItem;
6167
+ private JMenuItem duplicateItem;
50096168 private MenuItem cloneItem;
50106169 private MenuItem cloneSupportItem;
50116170 private MenuItem overwriteGeoItem;
....@@ -5018,7 +6177,7 @@
50186177 private MenuItem linkverticesItem;
50196178 private MenuItem relinkverticesItem;
50206179 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
6180
+ private MenuItem resetAllItem;
50226181 private MenuItem stepAllItem;
50236182 private MenuItem revertMeshItem;
50246183 private MenuItem poseMeshItem;
....@@ -5029,10 +6188,11 @@
50296188 private MenuItem mergeGeometriesItem;
50306189 private MenuItem copyItem;
50316190 private MenuItem pasteItem;
6191
+ private MenuItem pasteIntoItem;
50326192 private MenuItem pasteLinkItem;
50336193 private MenuItem pasteCloneItem;
50346194 private MenuItem pasteExpandItem;
5035
- private MenuItem clearItem;
6195
+ private MenuItem deleteItem;
50366196 private MenuItem clearAllItem;
50376197 private MenuItem genUVItem;
50386198 private MenuItem genNormalsMESHItem;
....@@ -5067,6 +6227,10 @@
50676227 private MenuItem showleavesItem;
50686228 private MenuItem markleavesItem;
50696229 private MenuItem unmarkleavesItem;
6230
+ private MenuItem rewindleavesItem;
6231
+ private MenuItem unrewindleavesItem;
6232
+ private MenuItem randomleavesItem;
6233
+ private MenuItem unrandomleavesItem;
50706234
50716235 private MenuItem flipVItem;
50726236 private MenuItem unflipVItem;
....@@ -5078,15 +6242,17 @@
50786242 private MenuItem panoTexturesItem;
50796243
50806244 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
6245
+ private MenuItem resetCentroidXZItem;
50826246 private MenuItem resetTransformItem;
6247
+ private MenuItem transformGeometryItem;
6248
+ private MenuItem transformChildrenItem;
50836249 private MenuItem hideItem;
50846250 private MenuItem grabItem;
50856251 private MenuItem backItem;
50866252 private MenuItem frontItem;
50876253 private MenuItem cameraItem;
50886254 private MenuItem compositeItem;
5089
- private MenuItem randomItem;
6255
+ private MenuItem switchItem;
50906256 private MenuItem physicsItem;
50916257 private MenuItem frameselectorItem;
50926258 private MenuItem scriptNodeItem;
....@@ -5110,6 +6276,8 @@
51106276 private MenuItem attachBumpItem;
51116277 private MenuItem detachBumpItem;
51126278 private MenuItem pigmentBumpItem;
6279
+ private MenuItem embedTexturesItem;
6280
+ private MenuItem deEmbedTexturesItem;
51136281
51146282 private MenuItem particleItem;
51156283 private MenuItem ragdollItem;
....@@ -5126,7 +6294,7 @@
51266294 private MenuItem blobItem;
51276295 private MenuItem latheItem;
51286296 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
6297
+ private MenuItem overlayItem;
51306298 private MenuItem meshItem;
51316299 // private MenuItem meshGroupItem;
51326300 private MenuItem springItem;
....@@ -5148,11 +6316,6 @@
51486316 private MenuItem doubleItem;
51496317 private MenuItem tripleItem;
51506318
5151
- private MenuItem importGFDItem;
5152
- private MenuItem importVRMLX3DItem;
5153
- private MenuItem import3DSItem;
5154
- private MenuItem importOBJItem;
5155
-
51566319 private MenuItem computeAOItem;
51576320 private MenuItem recompileItem;
51586321 private MenuItem editScriptItem;
....@@ -5162,4 +6325,8 @@
51626325 private MenuItem analyzeItem;
51636326 private MenuItem dumpItem;
51646327 //boolean freezemodel = false;
6328
+
6329
+ Menu cameraMenu;
6330
+ MenuItem editCameraItem;
6331
+ MenuItem restoreCameraItem;
51656332 }