Normand Briere
2019-07-30 475f8cbdbd96fdbf8f5b216ffebb31a51f25c2f9
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -22,6 +23,240 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("default", "skycube", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("park", "Stairs", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("penguins", "wrath", row5);
152
+ AddSkyboxButton("penguins", "yonder", row5);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "Greenlands", row6);
160
+ AddSkyboxButton("daz", "MountainTrail", row6);
161
+ AddSkyboxButton("daz", "Oasis", row6);
162
+ /*
163
+Autumn
164
+Greenlands
165
+MountainTrail
166
+Oasis
167
+TheRock
168
+TopOfTheWorld
169
+Winter
170
+ */
171
+
172
+ tab0.add(row0);
173
+ tab0.add(row1);
174
+ tab0.add(row2);
175
+ tab0.add(row3);
176
+ tab0.add(row4);
177
+ tab0.add(row5);
178
+ tab0.add(row6);
179
+
180
+ for (int i=5; --i>=0;)
181
+ {
182
+ //oe.toolboxPanel.Return();
183
+ //tab0.add(new cGridBag());
184
+ }
185
+ }
186
+
187
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
188
+ {
189
+ cGridBag tab0 = new cGridBag().setVertical(true);
190
+
191
+ tab0.setName("Night");
192
+ skyboxpanel.add(tab0);
193
+
194
+ cGridBag row0 = new cGridBag();
195
+ cGridBag row1 = new cGridBag();
196
+ cGridBag row2 = new cGridBag();
197
+ cGridBag row3 = new cGridBag();
198
+ cGridBag row4 = new cGridBag();
199
+ cGridBag row5 = new cGridBag();
200
+ cGridBag row6 = new cGridBag();
201
+
202
+ AddSkyboxButton("night", "NightPath", row0);
203
+ AddSkyboxButton("night", "PondNight", row0);
204
+ AddSkyboxButton("night", "Powerlines", row0);
205
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
206
+
207
+ AddSkyboxButton("urban", "CNTower", row1);
208
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
209
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
210
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
211
+
212
+ AddSkyboxButton("penguins", "kenon_star", row2);
213
+ AddSkyboxButton("indoors", "DallasW", row2);
214
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row2);
215
+ AddSkyboxButton("indoors", "Vasa", row2);
216
+
217
+ AddSkyboxButton("winter", "Backyard", row3);
218
+ AddSkyboxButton("winter", "Creek", row3);
219
+ AddSkyboxButton("winter", "FootballField3", row3);
220
+ AddSkyboxButton("winter", "Forest", row3);
221
+
222
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
223
+ AddSkyboxButton("winter", "House", row4);
224
+ AddSkyboxButton("winter", "IceLake", row4);
225
+ AddSkyboxButton("winter", "IceRiver", row4);
226
+
227
+ AddSkyboxButton("winter", "Park3", row5);
228
+ AddSkyboxButton("winter", "PondWinter", row5);
229
+ AddSkyboxButton("winter", "Tantolunden5", row5);
230
+ AddSkyboxButton("winter", "Vindelalven", row5);
231
+
232
+ AddSkyboxButton("daz", "TheRock", row6);
233
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
234
+ AddSkyboxButton("daz", "Winter", row6);
235
+ AddSkyboxButton("penguins", "desertdawn", row6);
236
+
237
+ tab0.add(row0);
238
+ tab0.add(row1);
239
+ tab0.add(row2);
240
+ tab0.add(row3);
241
+ tab0.add(row4);
242
+ tab0.add(row5);
243
+ tab0.add(row6);
244
+
245
+ for (int i=5; --i>=0;)
246
+ {
247
+ //oe.toolboxPanel.Return();
248
+ //tab0.add(new cGridBag());
249
+ }
250
+ }
251
+
252
+ public void ChangeSkybox(String name)
253
+ {
254
+ //cameraView.envyoff = false;
255
+ group.skyboxname = name;
256
+ group.skyboxext = "jpg";
257
+ cameraView.repaint();
258
+ }
259
+
25260 //ObjEditor objEditor;
26261 public void closeUI2()
27262 {
....@@ -59,6 +294,12 @@
59294 this.copy = this.group = group;
60295 //selectees = this.group.selectees;
61296
297
+ if (copy.versions == null)
298
+ {
299
+ copy.versions = new byte[100][];
300
+ copy.versionindex = -1;
301
+ }
302
+
62303 if(ui)
63304 SetupUI(objEditor);
64305 }
....@@ -73,16 +314,28 @@
73314 this.copy = this.group = copy;
74315 //selectees = this.group.selectees;
75316
76
- SetupMenu2(objEditor);
317
+ SetupMenu2(this); //objEditor);
77318 SetupUI2(objEditor);
78319 objEditor.SetupUI(true);
79320 SetupViews(objEditor);
80321
81322 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
323
+
324
+ if (copy.versions == null)
325
+ {
326
+ copy.versions = new byte[100][];
327
+ copy.versionindex = -1;
328
+
329
+ Save(true);
330
+ }
82331 }
83332
84333 void CloneSelection(boolean supports)
85334 {
335
+ if (Globals.REPLACEONMAKE)
336
+ Save();
337
+ boolean keep = Globals.REPLACEONMAKE;
338
+ Globals.REPLACEONMAKE = false;
86339 // Object3D keep = GrafreeD.clipboard;
87340 //Object3D obj;
88341 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +346,19 @@
93346
94347 makeSomething(clone, i==group.selection.size()-1);
95348 }
349
+ Globals.REPLACEONMAKE = keep;
96350 }
97351
98352 void CloneClipboard(boolean supports)
99353 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
354
+ assert(Grafreed.clipboard.parent == null);
355
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
356
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
357
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
358
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105359 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
360
+ makeSomething(CloneObject(Grafreed.clipboard, false));
361
+ Grafreed.clipboard.get(0).parent = keepparent;
108362 }
109363
110364 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +372,7 @@
118372 // obj.support = null;
119373 if (!supports)
120374 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
375
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122376 obj.parent = parent;
123377 // obj.support = support;
124378 // clone.support = support; // aout 2013
....@@ -147,30 +401,29 @@
147401
148402 //JTextField nameField;
149403
150
- void SetupMenu2(ObjEditor oe)
404
+ void SetupMenu2(GroupEditor oe)
151405 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
406
+ oe.jTree = new cTree();
407
+
163408 Menu menu;
164409 oe.menuBar.add(menu = new Menu("Edit"));
165410 //editItem = menu.add(new MenuItem("Edit"));
166411 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
412
+
413
+// undoItem = menu.add(new MenuItem("Undo"));
414
+// undoItem.addActionListener(this);
415
+// redoItem = menu.add(new MenuItem("Redo"));
416
+// redoItem.addActionListener(this);
417
+// menu.add("-");
418
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168419 duplicateItem.addActionListener(this);
169
- menu.add("-");
170420 cloneItem = menu.add(new MenuItem("Clone"));
171421 cloneItem.addActionListener(this);
422
+ if (Globals.ADVANCED)
423
+ {
172424 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173425 cloneSupportItem.addActionListener(this);
426
+ }
174427 menu.add("-");
175428 cutItem = menu.add(new MenuItem("Cut"));
176429 cutItem.addActionListener(this);
....@@ -178,27 +431,123 @@
178431 copyItem.addActionListener(this);
179432 pasteItem = menu.add(new MenuItem("Paste"));
180433 pasteItem.addActionListener(this);
434
+
435
+ menu.add("-");
436
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
437
+ pasteIntoItem.addActionListener(this);
181438 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182439 pasteLinkItem.addActionListener(this);
183440 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184441 pasteCloneItem.addActionListener(this);
185442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186443 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
444
+ menu.add("-");
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
447
+
448
+ if (Globals.ADVANCED)
449
+ {
450
+ // Deletes the cameras...
189451 clearAllItem = menu.add(new MenuItem("Clear All"));
190452 clearAllItem.addActionListener(this);
453
+ }
454
+
455
+ menuBar.add(cameraMenu = new Menu("View"));
456
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
457
+ //zBufferItem.addActionListener(this);
458
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
459
+ //normalLensItem.addActionListener(this);
460
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
461
+ restoreCameraItem.addActionListener(this);
462
+
463
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
464
+// toggleFullScreenItem.addItemListener(this);
465
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
466
+// cameraMenu.add("-");
467
+//
468
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
469
+// toggleTextureItem.addItemListener(this);
470
+// toggleTextureItem.setState(CameraPane.textureon);
471
+//
472
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
473
+// toggleSwitchItem.addItemListener(this);
474
+// toggleSwitchItem.setState(CameraPane.SWITCH);
475
+
476
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
477
+ toggleHandleItem.addItemListener(this);
478
+ toggleHandleItem.setState(CameraPane.HANDLES);
479
+
480
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
481
+ togglePaintItem.addItemListener(this);
482
+ togglePaintItem.setState(CameraPane.PAINTMODE);
483
+
484
+ if (Globals.ADVANCED)
485
+ {
486
+ cameraMenu.add("-");
487
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
488
+ toggleLiveItem.addItemListener(this);
489
+ toggleLiveItem.setState(Globals.isLIVE());
191490
491
+ cameraMenu.add(stepItem = new MenuItem("Step"));
492
+ stepItem.addActionListener(this);
493
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
494
+ // toggleDLItem.addItemListener(this);
495
+ // toggleDLItem.setState(false);
496
+
497
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
498
+ toggleRenderItem.addItemListener(this);
499
+ toggleRenderItem.setState(!CameraPane.frozen);
500
+
501
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
502
+ toggleDebugItem.addItemListener(this);
503
+ toggleDebugItem.setState(Globals.DEBUG);
504
+
505
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
506
+ toggleFrustumItem.addItemListener(this);
507
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
508
+
509
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
510
+ toggleFootContactItem.addItemListener(this);
511
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
512
+
513
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
514
+ toggleTimelineItem.addItemListener(this);
515
+ }
516
+
517
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
518
+// toggleRootItem.addItemListener(this);
519
+// toggleRootItem.setState(false);
520
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
521
+// animationItem.addItemListener(this);
522
+// animationItem.setState(CameraPane.ANIMATION);
523
+ cameraMenu.add("-");
524
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
525
+ editCameraItem.addActionListener(this);
526
+
527
+ if (Globals.ADVANCED)
528
+ {
529
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
530
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
531
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
532
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
533
+ oe.cameraMenu.add("-");
534
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
535
+ openWindowItem.addActionListener(this);
536
+ editLeafItem.addActionListener(this);
537
+ lookAtItem.addActionListener(this);
538
+ //lookFromItem.addActinoListener(this);
539
+ //switchViewItem.addActionListener(this);
540
+ }
541
+
192542 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
543
+ if (Globals.ADVANCED)
544
+ {
197545 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198546 revertMeshItem.addActionListener(this);
199547 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200548 resetreferencesItem.addActionListener(this);
201549 menu.add("-");
550
+ }
202551 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203552 overwriteGeoItem.addActionListener(this);
204553 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +559,104 @@
210559 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211560 overwriteUVItem.addActionListener(this);
212561 menu.add("-");
562
+ if (Globals.ADVANCED)
563
+ {
213564 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214565 generateMeshItem.addActionListener(this);
215566 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216567 poseMeshItem.addActionListener(this);
217568 menu.add("-");
569
+ }
218570 resetsupportItem = menu.add(new MenuItem("Reset support"));
219571 resetsupportItem.addActionListener(this);
220572 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221573 linkverticesItem.addActionListener(this);
222574 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223575 relinkverticesItem.addActionListener(this);
576
+
577
+ if (Globals.ADVANCED)
578
+ {
224579 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225580 setMasterItem.addActionListener(this);
581
+ }
226582
227583 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
584
+// grabItem = menu.add(new MenuItem("Grab"));
585
+// grabItem.addActionListener(this);
230586 backItem = menu.add(new MenuItem("Back"));
231587 backItem.addActionListener(this);
232588 frontItem = menu.add(new MenuItem("Front"));
233589 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
590
+// compositeItem = menu.add(new MenuItem("Composite"));
591
+// compositeItem.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
595
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237596 hideItem.addActionListener(this);
597
+ }
238598 ungroupItem = menu.add(new MenuItem("Ungroup"));
239599 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
600
+
601
+// menu.add("-");
602
+//
603
+// switchItem = menu.add(new MenuItem("Switch node"));
604
+// switchItem.addActionListener(this);
605
+ if (Globals.ADVANCED)
606
+ {
247607 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248608 switchGeoItem.addActionListener(this);
249609 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250610 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
611
+ morphItem = menu.add(new MenuItem("Morph Group"));
252612 morphItem.addActionListener(this);
613
+
614
+ menu.add("-");
615
+ physicsItem = menu.add(new MenuItem("Physics"));
616
+ physicsItem.addActionListener(this);
617
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
618
+ frameselectorItem.addActionListener(this);
253619 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254620 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
621
+ }
257622
258623 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
624
+// textureItem = menu.add(new MenuItem("Texture"));
625
+// textureItem.addActionListener(this);
261626 billboardItem = menu.add(new MenuItem("Billboard"));
262627 billboardItem.addActionListener(this);
263628 csgItem = menu.add(new MenuItem("CSG"));
264629 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
630
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266631 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
632
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268633 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
634
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270635 shadowZItem.addActionListener(this);
636
+ attributeItem = menu.add(new MenuItem("Attribute"));
637
+ attributeItem.addActionListener(this);
638
+
639
+ if (Globals.ADVANCED)
640
+ {
641
+ menu.add("-");
271642 linkerItem = menu.add(new MenuItem("Linker"));
272643 linkerItem.addActionListener(this);
273644 templateItem = menu.add(new MenuItem("Template"));
274645 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277646 pointflowItem = menu.add(new MenuItem("Point Flow"));
278647 pointflowItem.addActionListener(this);
648
+ }
279649 menu.add("-");
280650 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281651 resetTransformItem.addActionListener(this);
282652 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283653 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
654
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
655
+ resetCentroidXZItem.addActionListener(this);
656
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
657
+ transformGeometryItem.addActionListener(this);
658
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
659
+ transformChildrenItem.addActionListener(this);
286660
287661 oe.menuBar.add(menu = new Menu("Geometry"));
288662 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +667,11 @@
293667 genNormalsCADItem.addActionListener(this);
294668 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295669 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
670
+ if (Globals.ADVANCED)
671
+ {
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297673 genNormalsMINEItem.addActionListener(this);
674
+ }
298675 stripifyItem = menu.add(new MenuItem("Stripify"));
299676 stripifyItem.addActionListener(this);
300677 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +693,34 @@
316693 reduce34MeshItem.addActionListener(this);
317694 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318695 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321696 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322697 clipMeshItem.addActionListener(this);
698
+
699
+ if (Globals.ADVANCED)
700
+ {
701
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
702
+ smoothMeshItem.addActionListener(this);
703
+ }
323704
324705 oe.menuBar.add(menu = new Menu("Attributes"));
325706 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326707 clearMaterialsItem.addActionListener(this);
708
+ resetAllItem = menu.add(new MenuItem("Reset All"));
709
+ resetAllItem.addActionListener(this);
710
+ stepAllItem = menu.add(new MenuItem("Step All"));
711
+ stepAllItem.addActionListener(this);
327712 menu.add("-");
328713 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329714 liveleavesItem.addActionListener(this);
330715 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331716 unliveleavesItem.addActionListener(this);
717
+ if (Globals.ADVANCED)
718
+ {
332719 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333720 supportleavesItem.addActionListener(this);
334721 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335722 unsupportleavesItem.addActionListener(this);
723
+ }
336724 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337725 hideleavesItem.addActionListener(this);
338726 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +729,14 @@
341729 markleavesItem.addActionListener(this);
342730 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343731 unmarkleavesItem.addActionListener(this);
732
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
733
+ rewindleavesItem.addActionListener(this);
734
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
735
+ unrewindleavesItem.addActionListener(this);
736
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
737
+ randomleavesItem.addActionListener(this);
738
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
739
+ unrandomleavesItem.addActionListener(this);
344740 menu.add("-");
345741 flipVItem = menu.add(new MenuItem("Flip V"));
346742 flipVItem.addActionListener(this);
....@@ -366,45 +762,56 @@
366762 attachBumpItem.addActionListener(this);
367763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
369766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370767 detachPigmentItem.addActionListener(this);
371768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372769 detachBumpItem.addActionListener(this);
770
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
771
+ embedTexturesItem.addActionListener(this);
772
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
773
+ deEmbedTexturesItem.addActionListener(this);
373774 menu.add("-");
374775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375776 sortbysizeItem.addActionListener(this);
376777 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377778 sortbynameItem.addActionListener(this);
378779 menu.add("-");
780
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
781
+ shareGeometriesItem.addActionListener(this);
782
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
783
+ mergeGeometriesItem.addActionListener(this);
784
+ if (Globals.ADVANCED)
785
+ {
786
+ // Pretty much the same as duplicate and clone.
379787 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380788 extractGeometriesItem.addActionListener(this);
381789 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382790 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
791
+ }
387792
388793 oe.menuBar.add(menu = new Menu("Insert"));
389794 buildCreateMenu(menu);
390795
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402796 oe.menuBar.add(menu = new Menu("Tools"));
403797 buildToolsMenu(menu);
404798 }
405799
800
+
406801 void SetupUI2(ObjEditor oe)
407802 {
803
+ // June 2019
804
+ if (oe == null)
805
+ {
806
+ //super.SetupUI2(this);
807
+ //return;
808
+ }
809
+
810
+ if (copy != group)
811
+ {
812
+ //super.SetupUI2(this);
813
+ }
814
+
408815 //new Exception().printStackTrace();
409816
410817 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +840,238 @@
433840 oe.radioPanel.add(dummyButton);
434841 oe.buttonGroup.add(dummyButton);
435842 */
436
- aConstraints.gridy += 1;
843
+ cGridBag copyOptionsPanel = new cGridBag();
844
+
845
+ copyOptionsPanel.preferredHeight = 2;
437846
438847 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439848
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
849
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
850
+ //minButton.setToolTipText("Minimize window");
851
+ //minButton.addActionListener(this);
442852
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
853
+ if (Globals.ADVANCED)
854
+ {
855
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
856
+ maxButton.setToolTipText("Maximize window");
857
+ maxButton.addActionListener(this);
858
+ }
859
+
860
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
861
+ fullButton.setToolTipText("Full-screen window");
862
+ fullButton.addActionListener(this);
863
+
864
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454865 screenfitButton.setToolTipText("Screen fit");
455866 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
867
+
868
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
869
+ restoreCameraButton.setToolTipText("Restore viewpoint");
870
+ restoreCameraButton.addActionListener(this);
871
+
872
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
+ saveButton.setToolTipText("New version");
874
+ saveButton.addActionListener(this);
875
+
876
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
877
+ undoButton.setToolTipText("Previous version");
878
+ undoButton.addActionListener(this);
879
+ undoButton.setEnabled(false);
880
+
881
+ cGridBag updown = new cGridBag().setVertical(true);
882
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
883
+ restoreButton.setToolTipText("Restore current");
884
+ restoreButton.addActionListener(this);
885
+ restoreButton.setEnabled(false);
886
+
887
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
888
+ replaceButton.setToolTipText("Replace current");
889
+ replaceButton.addActionListener(this);
890
+ replaceButton.setEnabled(false);
891
+
892
+ copyOptionsPanel.add(updown);
893
+
894
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
895
+ redoButton.setToolTipText("Next version");
896
+ redoButton.addActionListener(this);
897
+ redoButton.setEnabled(false);
898
+
899
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
900
+ liveCB.setToolTipText("Enable animation");
901
+ liveCB.addItemListener(this);
902
+
903
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
904
+ oneStepButton.setToolTipText("Animate one step forward");
905
+ oneStepButton.addActionListener(this);
906
+
907
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
908
+ fastCB.setToolTipText("Fast mode");
909
+ fastCB.addItemListener(this);
910
+
911
+ //oe.toolboxPanel.Return();
912
+
913
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
914
+// trackCB.setToolTipText("Enable tracking");
915
+// trackCB.addItemListener(this);
916
+
457917 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458918 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464919
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
473
-
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
482
- twoButton.setToolTipText("Show center view only");
483
- twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
920
+ if (Globals.ADVANCED)
921
+ {
922
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ snapobjectButton.addActionListener(this);
924
+ snapobjectButton.setToolTipText("Snap Object");
925
+
926
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485927 fourButton.addActionListener(this);
486
- fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
488
- sixButton.setToolTipText("2-column layout left");
489
- sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
491
- threeButton.setToolTipText("2-column layout right");
928
+ fourButton.setToolTipText("Show control panel only");
929
+ }
930
+
931
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
932
+
933
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
+ twoButton.setToolTipText("Show 3D view only");
935
+ twoButton.addActionListener(this);
936
+ this.fullscreenLayout = twoButton;
937
+
938
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ threeButton.setToolTipText("Show controls and 3D view");
492940 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
494
- sevenButton.setToolTipText("3-column layout");
495
- sevenButton.addActionListener(this);
941
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+ sixButton.setToolTipText("Show 3D view and controls");
943
+ sixButton.addActionListener(this);
944
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+// sevenButton.setToolTipText("3-column layout");
946
+// sevenButton.addActionListener(this);
496947 //
497948
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
949
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ rootButton.setToolTipText("Open selection in new tab");
500951 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
952
+
953
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503954 closeButton.setToolTipText("Close tab");
504955 closeButton.addActionListener(this);
505956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506957 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515958
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
959
+ cGridBag row1 = new cGridBag();
960
+
961
+ // INSERT
962
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
963
+ gridButton.setToolTipText("Create grid");
964
+ gridButton.addActionListener(this);
965
+
966
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ boxButton.setToolTipText("Create box");
968
+ boxButton.addActionListener(this);
969
+
970
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
971
+ sphereButton.setToolTipText("Create sphere");
972
+ sphereButton.addActionListener(this);
973
+
974
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
975
+ coneButton.setToolTipText("Create cone");
976
+ coneButton.addActionListener(this);
977
+
978
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
979
+ torusButton.setToolTipText("Create torus");
980
+ torusButton.addActionListener(this);
981
+
982
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
983
+ superButton.setToolTipText("Create superellipsoid");
984
+ superButton.addActionListener(this);
985
+
986
+ if (Globals.ADVANCED)
987
+ {
988
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ kleinButton.setToolTipText("Create Klein bottle");
990
+ kleinButton.addActionListener(this);
991
+ }
992
+
993
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
994
+ particlesButton.setToolTipText("Create particle system");
995
+ particlesButton.addActionListener(this);
996
+
997
+ oe.toolboxPanel.add(row1);
998
+
999
+ cGridBag row2 = new cGridBag();
1000
+
1001
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1002
+ groupButton.setToolTipText("Create group");
1003
+ groupButton.addActionListener(this);
1004
+
1005
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1006
+ compositeButton.setToolTipText("Create composite");
1007
+ compositeButton.addActionListener(this);
1008
+
1009
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1010
+ switchButton.setToolTipText("Create item switcher");
1011
+ switchButton.addActionListener(this);
1012
+
1013
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1014
+ loopButton.setToolTipText("Create loop");
1015
+ loopButton.addActionListener(this);
1016
+
1017
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ textureButton.setToolTipText("Create texture");
1019
+ textureButton.addActionListener(this);
1020
+
1021
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1022
+ overlayButton.setToolTipText("Create overlay");
1023
+ overlayButton.addActionListener(this);
1024
+
1025
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1026
+ lightButton.setToolTipText("Create light");
1027
+ lightButton.addActionListener(this);
1028
+
1029
+ oe.toolboxPanel.add(row2);
1030
+
1031
+ // ENVYMAPS
1032
+ cGridBag skyboxpane = new cGridBag();
1033
+ skyboxpane.preferredHeight = 100;
1034
+
1035
+ oe.toolboxPanel.add(skyboxpane);
1036
+
1037
+ JTabbedPane skyboxpanel = new JTabbedPane();
1038
+ skyboxpane.add(skyboxpanel);
1039
+
1040
+ AddSkyboxTab0(skyboxpanel);
1041
+ AddSkyboxTab1(skyboxpanel);
1042
+ AddSkyboxTab2(skyboxpanel);
1043
+
1044
+ // EDIT panel
1045
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ editButton.setToolTipText("Pin selection controls");
1047
+ editButton.addActionListener(this);
1048
+
1049
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ uneditButton.setToolTipText("Remove selection controls");
5171051 uneditButton.addActionListener(this);
5181052
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1053
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1054
+ allParamsButton.setToolTipText("Show all controle");
5311055 allParamsButton.addActionListener(this);
5321056
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
1057
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
+ clearPanelButton.setToolTipText("Clear edit panel");
1059
+ clearPanelButton.addActionListener(this);
1060
+
1061
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1062
+ unselectButton.setToolTipText("Unselect");
5381063 unselectButton.addActionListener(this);
5391064
1065
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+ flashSelectionButton.setToolTipText("Highlight selection");
1067
+ flashSelectionButton.addActionListener(this);
1068
+
1069
+ editCommandsPanel.preferredHeight = 1;
1070
+
1071
+ SetPinStates(false);
1072
+// oe.treePanel.add(commandsPanel);
1073
+// oe.treePanel.Return();
1074
+
5401075 // oe.aConstraints.gridx += 1;
5411076 // oe.aConstraints.weighty = 0;
5421077 // oe.aConstraints.gridwidth = 1;
....@@ -548,47 +1083,32 @@
5481083 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5491084 // gcButton.addActionListener(this);
5501085
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
1086
+ cGridBag jSPPanel = new cGridBag();
1087
+
1088
+ JScrollPane jSP;
5621089 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1090
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5641091 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
5841092
1093
+ oe.treePanel.add(jSPPanel);
1094
+ oe.treePanel.Return();
1095
+
1096
+ oe.treePanel.add(copyOptionsPanel);
1097
+ oe.treePanel.Return();
1098
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
+ sliderPane.preferredHeight = 1;
1101
+
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
1104
+
5851105 //jList.addListSelectionListener(this);
5861106 oe.jTree.addTreeSelectionListener(this);
5871107 //jTree.setRootVisible(false);
5881108 //jTree.setEditable(true);
5891109 oe.jTree.setDragEnabled(true);
5901110 //jTree.setPreferredSize(new Dimension(10,10));
591
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
5921112
5931113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
5941114
....@@ -600,97 +1120,160 @@
6001120 dgr.addDragGestureListener(this);
6011121 }catch(Exception e) {}
6021122 */
603
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
6041124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6051125 }
6061126
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1127
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6081128 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
1129
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1130
+ colorCB.setToolTipText("Copy color when dropped");
1131
+ colorCB.addItemListener(this);
6181132
619
- // constraints.gridy += 1;
1133
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1134
+ materialCB.setToolTipText("Copy material when dropped");
1135
+ materialCB.addItemListener(this);
1136
+
1137
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1138
+ textureCB.setToolTipText("Copy texture when dropped");
1139
+ textureCB.addItemListener(this);
1140
+
1141
+ panel.Return();
1142
+
1143
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1144
+ boxCB.setToolTipText("Display bounding boxes");
1145
+ boxCB.addItemListener(this);
1146
+
1147
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1148
+ zoomBoxCB.setToolTipText("Display only for wheel");
1149
+ zoomBoxCB.addItemListener(this);
1150
+
1151
+ if (true) // Globals.ADVANCED)
1152
+ {
1153
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1154
+// supportCB.setToolTipText("Enable rigging");
1155
+// supportCB.addItemListener(this);
1156
+
1157
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1158
+ freezeCB.setToolTipText("Fast moving camera");
1159
+ freezeCB.addItemListener(this);
1160
+
6201161 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6211162 // localCB.addItemListener(this);
6221163
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
1164
+ panel.Return();
1165
+
1166
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6251167 crowdCB.setToolTipText("Used for crowds");
6261168 crowdCB.addItemListener(this);
6271169
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
1170
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
6301171 smoothCB.setToolTipText("Snapping delay");
6311172 smoothCB.addItemListener(this);
6321173
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
1174
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
6351175 slowCB.setToolTipText("Smooth interpolation");
6361176 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
1177
+
6461178 // constraints.gridy += 1;
6471179 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6481180 // speakerMocapCB.addItemListener(this);
6491181
1182
+ panel.Return();
1183
+
6501184 if (false)
6511185 {
6521186 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
1187
+ //constraints.gridy += 1;
1188
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
6551189 speakerCameraCB.addItemListener(this);
6561190
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
1191
+ //constraints.gridy += 1;
1192
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
6591193 speakerFocusCB.addItemListener(this);
6601194
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
1195
+ //constraints.gridy += 1;
1196
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6631197 smoothfocusCB.addItemListener(this);
1198
+ panel.Return();
6641199 }
6651200
6661201 //constraints.gridx += 1;
6671202 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6681203 // debugCB.addItemListener(this);
6691204
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
1205
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1206
+ trackCB.setToolTipText("Enable tracking target");
1207
+ trackCB.addItemListener(this);
1208
+
1209
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1210
+ oeilCB.setToolTipText("Move camera when tracking");
6721211 oeilCB.addItemListener(this);
6731212
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
1213
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1214
+ shadowCB.setToolTipText("When live compute shadows");
1215
+ shadowCB.addItemListener(this);
1216
+
1217
+ panel.Return();
1218
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1219
+ toggleTextureCB.setToolTipText("Load textures");
1220
+ toggleTextureCB.addItemListener(this);
1221
+
1222
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1223
+ toggleSwitchCB.setToolTipText("Choose a single item");
1224
+ toggleSwitchCB.addItemListener(this);
1225
+
1226
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1227
+ autokeepCB.setToolTipText("On structure change");
1228
+ autokeepCB.addItemListener(this);
1229
+
1230
+ panel.Return();
1231
+ if (Globals.ADVANCED)
1232
+ {
1233
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6761234 lookAtCB.setToolTipText("Look-at target");
6771235 lookAtCB.addItemListener(this);
1236
+ }
1237
+
1238
+ }
1239
+
1240
+ cGridBag fill = new cGridBag();
1241
+ fill.preferredHeight = 200;
1242
+ cGridBag fill2 = new cGridBag();
1243
+ fill2.preferredHeight = 200;
1244
+ cGridBag fill3 = new cGridBag();
1245
+ fill3.preferredHeight = 200;
1246
+
1247
+ panel.add(fill);
1248
+ panel.add(fill2);
1249
+ panel.add(fill3);
6781250
6791251 }
6801252
6811253 void EditObject(Object3D obj)
6821254 {
6831255 cRadio radioButton = new cRadio(obj.name);
1256
+
1257
+ // June 2019. Patch to avoid bug with transparency.
1258
+ radioButton.hadMaterial = obj.material != null;
1259
+ if (!radioButton.hadMaterial)
1260
+ {
1261
+ obj.material = new cMaterial();
1262
+ }
1263
+
6841264 radioButton.SetObject(obj);
685
- radioButton.layout = sevenButton;
1265
+ radioButton.layout = sixButton; // sevenButton;
6861266 radioButton.SetCamera(cameraView.renderCamera, false);
6871267 radioButton.addActionListener(this);
6881268 radioPanel.add(radioButton);
6891269 buttonGroup.add(radioButton);
6901270 radioButton.doClick();
6911271 }
1272
+
6921273 void SetupViews(ObjEditor oe)
6931274 {
1275
+ theFrame = this;
1276
+
6941277 oe.SetupViews();
6951278
6961279 System.out.println("SetupViews");
....@@ -699,23 +1282,28 @@
6991282 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001283 }
7011284
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
1285
+ cToggleButton liveCB;
1286
+ cCheckBox supportCB;
1287
+ cCheckBox localCB;
1288
+ cCheckBox crowdCB;
1289
+ cCheckBox smoothCB;
1290
+ cToggleButton fastCB;
1291
+ cCheckBox slowCB;
1292
+ cCheckBox boxCB;
1293
+ cCheckBox zoomBoxCB;
1294
+ cCheckBox freezeCB;
1295
+ //cToggleButton trackCB;
1296
+ cCheckBox trackCB;
1297
+ cCheckBox smoothfocusCB;
7131298 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1299
+ cCheckBox speakerCameraCB;
1300
+ cCheckBox speakerFocusCB;
1301
+ cCheckBox debugCB;
1302
+
1303
+ cCheckBox oeilCB;
1304
+ cCheckBox shadowCB;
1305
+ cCheckBox autokeepCB;
1306
+ cCheckBox lookAtCB;
7191307
7201308 // static int COLOR = 1;
7211309 // static int MATERIAL = 2;
....@@ -723,9 +1311,9 @@
7231311
7241312 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251313
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1314
+ cCheckBox colorCB;
1315
+ cCheckBox materialCB;
1316
+ cCheckBox textureCB;
7291317
7301318 public void itemStateChanged(ItemEvent e)
7311319 {
....@@ -753,6 +1341,7 @@
7531341 } else if(e.getSource() == liveCB)
7541342 {
7551343 cameraView.ToggleLive();
1344
+ refreshContents(false);
7561345 }
7571346 else if(e.getSource() == supportCB)
7581347 {
....@@ -817,6 +1406,18 @@
8171406 {
8181407 cameraView.ToggleOeil();
8191408 }
1409
+ else if(e.getSource() == shadowCB)
1410
+ {
1411
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1412
+ }
1413
+ else if(e.getSource() == freezeCB)
1414
+ {
1415
+ Globals.FREEZEONMOVE ^= true;
1416
+ }
1417
+ else if(e.getSource() == autokeepCB)
1418
+ {
1419
+ Globals.REPLACEONMAKE ^= true;
1420
+ }
8201421 else if(e.getSource() == lookAtCB)
8211422 {
8221423 cameraView.ToggleLookAt();
....@@ -833,7 +1434,8 @@
8331434
8341435 /**/
8351436 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1437
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1438
+ TreePath path = objEditor.jTree.getSelectionPath();
8371439 if ((path == null) || (path.getPathCount() <= 1)) {
8381440 // We can't move the root node or an empty selection
8391441 return;
....@@ -896,8 +1498,6 @@
8961498 }
8971499 }
8981500
899
- String string = (String) object;
900
-
9011501 System.out.println("Transfer = " + object + "; drop : " + target);
9021502 // if( object instanceof java.io.File[])
9031503 // {
....@@ -905,7 +1505,11 @@
9051505 // objEditor.DropFile((java.io.File[]) object, true);
9061506 // return;
9071507 // }
908
- if (string.charAt(0) == '/')
1508
+
1509
+ String string = object.toString();
1510
+
1511
+ // File path for Mac and Windows
1512
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091513 {
9101514 // file(s)
9111515 String[] names = string.split("\n");
....@@ -932,7 +1536,7 @@
9321536
9331537 flashIt = false;
9341538 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1539
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361540 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371541
9381542 if (group.selection.size() == 1)
....@@ -948,23 +1552,33 @@
9481552
9491553 assert target == objEditor.jTree;
9501554 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1555
+ Object3D destinationLeaf;
9511556 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1557
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531558 } catch (Exception e) {
9541559 System.out.println("destinationPath : " + destinationPath);
9551560 return;
9561561 }
9571562
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1563
+ for (int i=group.selection.size(); --i>=0;)
9591564 {
1565
+ Object3D child = (Object3D)group.selection.elementAt(i);
1566
+
1567
+ // Cannot move into itself
1568
+ if (child == destinationLeaf)
1569
+ return;
1570
+ }
1571
+
1572
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1573
+// {
9601574 loadClipboard(true);
9611575 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1576
+ pasteInto(false, false);
1577
+// } else {
1578
+// loadClipboard(false);
1579
+// objEditor.jTree.setSelectionPath(destinationPath);
1580
+// pasteInto(false, false); // true); // ???
1581
+// }
9681582 }
9691583 public void dropActionChanged(DropTargetDragEvent dtde)
9701584 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1683,107 @@
10691683 {
10701684 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711685 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1686
+// gridItem = menu.add(new MenuItem("Grid"));
1687
+// gridItem.addActionListener(this);
1688
+// rectoidItem = menu.add(new MenuItem("Box"));
1689
+// rectoidItem.addActionListener(this);
1690
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1691
+// ellipsoidItem.addActionListener(this);
1692
+// coneItem = menu.add(new MenuItem("Cone"));
1693
+// coneItem.addActionListener(this);
1694
+// torusItem = menu.add(new MenuItem("Torus"));
1695
+// torusItem.addActionListener(this);
1696
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1697
+// superItem.addActionListener(this);
1698
+
1699
+ cameraItem = menu.add(new MenuItem("Camera"));
1700
+ cameraItem.addActionListener(this);
1701
+
1702
+ if (!Globals.ADVANCED)
1703
+ {
10841704 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851705 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1706
+ }
1707
+
1708
+// particleItem = menu.add(new MenuItem("Particle system"));
1709
+// particleItem.addActionListener(this);
1710
+ if (Globals.ADVANCED)
1711
+ {
10881712 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891713 ragdollItem.addActionListener(this);
10901714 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911715 ragdoll2Item.addActionListener(this);
1716
+ }
10921717 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1718
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941719 meshItem.addActionListener(this);
10951720 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961721 // meshGroupItem.addActionListener(this);
1722
+ if (Globals.ADVANCED)
1723
+ {
10971724 springItem = menu.add(new MenuItem("Spring"));
10981725 springItem.addActionListener(this);
10991726 flagItem = menu.add(new MenuItem("Flag"));
11001727 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051728 blobItem = menu.add(new MenuItem("Blob"));
11061729 blobItem.addActionListener(this);
11071730 latheItem = menu.add(new MenuItem("Lathe"));
11081731 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1732
+ }
1733
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1734
+ bezierItem.addActionListener(this);
1735
+// overlayItem = menu.add(new MenuItem("Overlay"));
1736
+// overlayItem.addActionListener(this);
1737
+// lightItem = menu.add(new MenuItem("Light"));
1738
+// lightItem.addActionListener(this);
11111739 menu.add("-");
11121740 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131741 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1742
+// loopItem = menu.add(new MenuItem("Loop"));
1743
+// loopItem.addActionListener(this);
11161744 doubleItem = menu.add(new MenuItem("Fork"));
11171745 doubleItem.addActionListener(this);
1746
+ if (Globals.ADVANCED)
1747
+ {
11181748 tripleItem = menu.add(new MenuItem("Trident"));
11191749 tripleItem.addActionListener(this);
1750
+ }
11201751 }
11211752
11221753 void buildToolsMenu(Menu menu)
11231754 {
11241755 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251756 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1757
+ animationItem.setState(Globals.ANIMATION);
1758
+
1759
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1760
+ archiveItem.addActionListener(this);
11271761
11281762 menu.add("-");
11291763 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301764 parseverticesItem.addActionListener(this);
11311765 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321766 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1767
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341768 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371769 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381770 reduceMorphItem.addActionListener(this);
11391771 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401772 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441773 menu.add("-");
1145
-
11461774 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471775 memoryItem.addActionListener(this);
1776
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1777
+ computeAOItem.addActionListener(this);
1778
+
1779
+ if (Globals.ADVANCED)
1780
+ {
1781
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1782
+ mirrorItem.addActionListener(this);
1783
+ menu.add("-");
11481784 menu.add(analyzeItem = new MenuItem("Analyze"));
11491785 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1786
+ menu.add(dumpItem = new MenuItem("Print"));
11511787 dumpItem.addActionListener(this);
11521788 // menu.add(pathItem = new MenuItem("From-to path"));
11531789 // pathItem.addActionListener(this);
....@@ -1165,6 +1801,7 @@
11651801 menu.add("-");
11661802 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671803 editScriptItem.addActionListener(this);
1804
+ }
11681805 }
11691806
11701807 void ScreenFit()
....@@ -1287,9 +1924,34 @@
12871924 shadow.material = new cMaterial(obj.material);
12881925 shadow.material.diffuse = 0.0001f;
12891926 shadow.material.specular = 0.0001f;
1927
+ //shadow.projectedVertices[1].x = 300;
12901928
12911929 makeSomething(shadow);
12921930 }
1931
+
1932
+ private void ClearUnpinned()
1933
+ {
1934
+ //for (Object3D obj : listUI)
1935
+ for (int i=listUI.size(); --i>=0;)
1936
+ {
1937
+ Object3D obj = listUI.elementAt(i);
1938
+ if (!obj.pinned)
1939
+ {
1940
+ obj.CloseUI();
1941
+ listUI.remove(i);
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ private void EditElement(Object3D elem, boolean newWindow)
1947
+ {
1948
+ // if (!(elem instanceof Composite))
1949
+ // newWindow = false;
1950
+ listUI.add(elem);
1951
+ elem.openEditWindow(this, newWindow); //, false);
1952
+ System.out.println("edit : " + elem);
1953
+ elem.editWindow.refreshContents(true); // ? new
1954
+ }
12931955
12941956 /**
12951957 * applyExample
....@@ -1493,9 +2155,9 @@
14932155
14942156 void Overwrite(int mask)
14952157 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2158
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14972159 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
2160
+ Object3D content = Grafreed.clipboard.get(0);
14992161
15002162 if (content instanceof cGroup && ((cGroup)content).transientlink )
15012163 content = ((cGroup)content).get(0);
....@@ -1518,6 +2180,7 @@
15182180 //
15192181 public void actionPerformed(ActionEvent event) // , Object arg)
15202182 {
2183
+ Object source = event.getSource();
15212184 /*
15222185 if (event.getSource() == nameField)
15232186 {
....@@ -1529,11 +2192,11 @@
15292192 }
15302193 else
15312194 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2195
+ if (source == lookAtItem || source == lookFromItem)
15332196 {
15342197 ScreenFit();
15352198 } else
1536
- if (event.getSource() == switchItem)
2199
+ if (source == switchViewItem)
15372200 {
15382201 cVector v1 = new cVector();
15392202 cVector v2 = new cVector();
....@@ -1542,11 +2205,11 @@
15422205 objEditor.cameraView.renderCamera.setAim(v2, v1);
15432206 objEditor.cameraView.repaint();
15442207 } else
1545
- if (event.getSource() == rectoidItem)
2208
+ if (source == rectoidItem || source == boxButton)
15462209 {
15472210 makeSomething(new Box());
15482211 } else
1549
- if (event.getSource() == particleItem)
2212
+ if (source == particleItem || source == particlesButton)
15502213 {
15512214 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15522215 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +2230,9 @@
15672230 applyExample(particleGeom, "SMOKE");
15682231 makeSomething(particleGeom);
15692232 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2233
+ if (source == ragdollItem || source == ragdoll2Item)
15712234 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2235
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15732236
15742237 ragdoll.toParent = LA.newMatrix();
15752238 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +2250,7 @@
15872250 } else
15882251 /*
15892252 */
1590
- if (event.getSource() == heightFieldItem)
2253
+ if (source == heightFieldItem)
15912254 {
15922255 Object3D obj = new Object3D();
15932256
....@@ -1625,31 +2288,31 @@
16252288
16262289 makeSomething(obj);
16272290 } else
1628
- if (event.getSource() == gridItem)
2291
+ if (source == gridItem || source == gridButton)
16292292 {
16302293 makeSomething(new Grid());
16312294 } else
1632
- if (event.getSource() == ellipsoidItem)
2295
+ if (source == ellipsoidItem || source == sphereButton)
16332296 {
16342297 makeSomething(new Sphere());
16352298 } else
1636
- if (event.getSource() == coneItem)
2299
+ if (source == coneItem || source == coneButton)
16372300 {
16382301 makeSomething(new Cone());
16392302 } else
1640
- if (event.getSource() == torusItem)
2303
+ if (source == torusItem || source == torusButton)
16412304 {
16422305 makeSomething(new Torus());
16432306 } else
1644
- if (event.getSource() == superItem)
2307
+ if (source == superItem || source == superButton)
16452308 {
16462309 makeSomething(new Superellipsoid());
16472310 } else
1648
- if (event.getSource() == kleinItem)
2311
+ if (source == kleinItem || source == kleinButton)
16492312 {
16502313 makeSomething(new Klein());
16512314 } else
1652
- if (event.getSource() == blobItem)
2315
+ if (source == blobItem)
16532316 {
16542317 Blob blob = new Blob();
16552318 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +2320,15 @@
16572320 //blob.retile();
16582321 makeSomething(blob);
16592322 } else
1660
- if (event.getSource() == latheItem)
2323
+ if (source == latheItem)
16612324 {
16622325 makeSomething(new Lathe());
16632326 } else
1664
- if (event.getSource() == bezierItem)
2327
+ if (source == bezierItem)
16652328 {
16662329 makeSomething(new BezierSurface());
16672330 } else
1668
- if (event.getSource() == checkerItem)
2331
+ if (source == overlayItem || source == overlayButton)
16692332 {
16702333 /*
16712334 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +2343,7 @@
16802343 */
16812344 makeSomething(new Checker());
16822345 } else
1683
- if (event.getSource() == meshItem)
2346
+ if (source == meshItem)
16842347 {
16852348 Object3D itemtomake = new Object3D();
16862349 Object3D child;
....@@ -1701,35 +2364,52 @@
17012364 makeSomething(child);
17022365 }
17032366 } else
1704
- if (event.getSource() == springItem)
2367
+ if (source == springItem)
17052368 {
17062369 cSpring s = new cSpring();
17072370 s.setup();
17082371 makeSomething(s);
17092372 } else
1710
- if (event.getSource() == flagItem)
2373
+ if (source == flagItem)
17112374 {
17122375 cSpring s = new cFlag();
17132376 s.setup();
17142377 makeSomething(s);
17152378 } else
1716
- if (event.getSource() == lightItem)
2379
+ if (source == lightItem || source == lightButton)
17172380 {
17182381 makeSomething(new Light());
17192382 } else
1720
- if (event.getSource() == csgItem)
2383
+// if (source == skybox1Button ||
2384
+// source == skybox2Button ||
2385
+// source == skybox3Button ||
2386
+// source == skybox4Button ||
2387
+// source == skybox5Button ||
2388
+// source == skybox6Button ||
2389
+// source == skybox7Button ||
2390
+// source == skybox11Button ||
2391
+// source == skybox12Button ||
2392
+// source == skybox13Button ||
2393
+// source == skybox14Button ||
2394
+// source == skybox15Button ||
2395
+// source == skybox16Button ||
2396
+// source == skybox17Button)
2397
+// {
2398
+// ChangeSkybox(source);
2399
+// } else
2400
+ if (source == csgItem)
17212401 {
17222402 group(new CSG());
17232403 } else
1724
- if (event.getSource() == templateItem)
2404
+ if (source == templateItem)
17252405 {
17262406 group(new cTemplate());
17272407 } else
1728
- if (event.getSource() == attributeItem)
2408
+ if (source == attributeItem)
17292409 {
17302410 makeSomething(new Attribute());
17312411 } else
1732
- if (event.getSource() == pointflowItem)
2412
+ if (source == pointflowItem)
17332413 {
17342414 makeSomething(new PointFlow());
17352415 } else
....@@ -1741,7 +2421,7 @@
17412421 } else
17422422 */
17432423
1744
- if (event.getSource() == superLoopItem)
2424
+ if (source == superLoopItem)
17452425 {
17462426 Composite g = new cGroup();
17472427 for (int i=0; i<15; i++)
....@@ -1763,30 +2443,30 @@
17632443
17642444 group(g);
17652445 } else
1766
- if (event.getSource() == loopItem)
2446
+ if (source == loopItem || source == loopButton)
17672447 {
17682448 Composite csg = new GroupLeaf();
17692449 csg.count = 5;
17702450 group(csg);
1771
- Composite child = new cGroup();
2451
+ Composite child = new cGroup("Branch");
17722452 csg.addChild(child);
17732453 child.addChild(csg);
17742454 } else
1775
- if (event.getSource() == doubleItem)
2455
+ if (source == doubleItem)
17762456 {
1777
- Composite csg = new GroupLeaf();
2457
+ Composite csg = new GroupLeaf("Fork");
17782458 csg.count = 5;
17792459 group(csg);
1780
- Composite child = new cGroup();
2460
+ Composite child = new cGroup("Branch A");
17812461 csg.addChild(child);
17822462 child.addChild(csg);
1783
- child = new cGroup();
2463
+ child = new cGroup("Branch B");
17842464 csg.addChild(child);
17852465 child.addChild(csg);
17862466 } else
1787
- if (event.getSource() == tripleItem)
2467
+ if (source == tripleItem)
17882468 {
1789
- Composite csg = new GroupLeaf();
2469
+ Composite csg = new GroupLeaf("Trident");
17902470 csg.count = 4;
17912471 group(csg);
17922472 Composite child = new cGroup();
....@@ -1799,73 +2479,98 @@
17992479 csg.addChild(child);
18002480 child.addChild(csg);
18012481 } else
1802
-
1803
- if (event.getSource() == importGFDItem)
1804
- {
1805
- ImportGFD();
1806
- } else
1807
- if (event.getSource() == importVRMLX3DItem)
1808
- {
1809
- ImportVRMLX3D();
1810
- } else
1811
- if (event.getSource() == import3DSItem)
1812
- {
1813
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1814
- } else
1815
- if (event.getSource() == importOBJItem)
1816
- {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1818
- } else
1819
- if (event.getSource() == computeAOItem)
2482
+ if (source == computeAOItem)
18202483 {
18212484 Globals.drawMode = CameraPane.OCCLUSION;
1822
- Globals.theRenderer.repaint();
2485
+ cameraView.repaint();
18232486 } else
1824
- if (event.getSource() == recompileItem)
2487
+ if (source == recompileItem)
18252488 {
18262489 Recompile();
18272490 refreshContents();
18282491 } else
1829
- if (event.getSource() == editScriptItem)
2492
+ if (source == editScriptItem)
18302493 {
18312494 OpenDialog();
18322495 refreshContents();
18332496 } else
1834
- if (event.getSource() == invariantsItem)
2497
+ if (source == invariantsItem)
18352498 {
18362499 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2500
+ Grafreed.grafreeD.universe.invariants();
18382501 } else
1839
- if (event.getSource() == memoryItem)
2502
+ if (source == memoryItem)
18402503 {
18412504 //System.out.println("Invariants:");
18422505 PrintMemory();
18432506 } else
1844
- if (event.getSource() == pathItem)
2507
+ if (source == pathItem)
18452508 {
18462509 PrintPath();
18472510 } else
1848
- if (event.getSource() == analyzeItem)
2511
+ if (source == analyzeItem)
18492512 {
18502513 AnalyzeObject();
18512514 } else
1852
- if (event.getSource() == dumpItem)
2515
+ if (source == dumpItem)
18532516 {
18542517 DumpObject();
18552518 } else
1856
- if (event.getSource() == screenfitButton)
2519
+ if (source == minButton)
18572520 {
1858
- //Reload(lastConverter, lastFilename, true);
2521
+ Minimize();
2522
+ } else
2523
+ if (source == maxButton)
2524
+ {
2525
+ Maximize();
2526
+ } else
2527
+ if (source == fullButton)
2528
+ {
2529
+ ToggleFullScreen();
2530
+ } else
2531
+ if (source == undoButton)
2532
+ {
2533
+ // Go to previous version
2534
+ //if (!Undo())
2535
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2536
+ Undo();
2537
+ } else
2538
+ if (source == restoreButton)
2539
+ {
2540
+ // Restore current version
2541
+ Restore();
2542
+ } else
2543
+ if (source == replaceButton)
2544
+ {
2545
+ // Overwrite current version
2546
+ Replace();
2547
+ } else
2548
+ if (source == redoButton)
2549
+ {
2550
+ // Go to next version
2551
+ Redo();
2552
+ } else
2553
+ if (source == saveButton)
2554
+ {
2555
+ // Save a new version
2556
+ if (!Save(true))
2557
+ java.awt.Toolkit.getDefaultToolkit().beep();
2558
+ } else
2559
+ if (source == oneStepButton)
2560
+ {
2561
+ Globals.ONESTEP = true;
2562
+ cameraView.repaint();
2563
+ } else
2564
+ if (source == screenfitButton)
2565
+ {
18592566 ScreenFit();
18602567 } else
1861
- if (event.getSource() == screenfitpointButton)
2568
+ if (source == screenfitpointButton)
18622569 {
1863
- //Reload(lastConverter, lastFilename, true);
18642570 ScreenFitPoint();
18652571 } else
1866
- if (event.getSource() == snapobjectButton)
2572
+ if (source == snapobjectButton)
18672573 {
1868
- //Reload(lastConverter, lastFilename, true);
18692574 SnapObject();
18702575 } else
18712576 // if (event.getSource() == recompileButton)
....@@ -1874,13 +2579,13 @@
18742579 // Recompile();
18752580 // refreshContents();
18762581 // } else
1877
- if (event.getSource() == gcButton)
2582
+ if (source == gcButton)
18782583 {
18792584 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802585 System.gc();
18812586 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822587 } else
1883
- if (event.getSource() == editLeafItem)
2588
+ if (source == editLeafItem)
18842589 {
18852590 Object3D obj;
18862591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2599,74 @@
18942599 }
18952600 refreshContents(true);
18962601 } else
1897
- if (event.getSource() == openWindowItem)
2602
+ if (source == openWindowItem)
18982603 {
18992604 EditSelection(true);
19002605 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2606
+ if (source == cutItem || source == clearButton)
19022607 {
19032608 loadClipboard(true);
19042609 } else
1905
- if (event.getSource() == duplicateItem)
2610
+ if (source == undoItem)
19062611 {
1907
- Object3D keep = GrafreeD.clipboard;
2612
+ Undo();
2613
+ } else
2614
+ if (source == redoItem)
2615
+ {
2616
+ Redo();
2617
+ } else
2618
+ if (source == duplicateItem)
2619
+ {
2620
+ Object3D keep = Grafreed.clipboard;
19082621 loadClipboard(false);
19092622 paste(false);
1910
- GrafreeD.clipboard = keep;
2623
+ Grafreed.clipboard = keep;
19112624 } else
1912
- if (event.getSource() == cloneItem)
2625
+ if (source == cloneItem)
19132626 {
19142627 CloneSelection(false);
19152628 } else
1916
- if (event.getSource() == cloneSupportItem)
2629
+ if (source == cloneSupportItem)
19172630 {
19182631 CloneSelection(true);
19192632 } else
1920
- if (event.getSource() == copyItem)
2633
+ if (source == copyItem)
19212634 {
19222635 loadClipboard(false);
19232636 } else
1924
- if (event.getSource() == pasteItem)
2637
+ if (source == pasteItem)
19252638 {
19262639 paste(false);
19272640 } else
1928
- if (event.getSource() == pasteLinkItem)
2641
+ if (source == pasteIntoItem)
19292642 {
1930
- pasteInto(false);
2643
+ pasteInto(true, false);
19312644 } else
1932
- if (event.getSource() == pasteCloneItem)
2645
+ if (source == pasteLinkItem)
19332646 {
1934
- pasteInto(true);
2647
+ pasteInto(false, false);
19352648 } else
1936
- if (event.getSource() == pasteExpandItem)
2649
+ if (source == pasteCloneItem)
2650
+ {
2651
+ pasteInto(true, true);
2652
+ } else
2653
+ if (source == pasteExpandItem)
19372654 {
19382655 paste(true);
19392656 } else
1940
- if (event.getSource() == synchronizeItem)
2657
+ if (source == synchronizeItem)
19412658 {
19422659 Overwrite(Object3D.TRANSFORM);
19432660 } else
1944
- if (event.getSource() == overwriteNameItem)
2661
+ if (source == overwriteNameItem)
19452662 {
19462663 Overwrite(Object3D.NAME);
19472664 } else
1948
- if (event.getSource() == overwriteUVItem)
2665
+ if (source == overwriteUVItem)
19492666 {
19502667 Overwrite(Object3D.UV);
19512668 } else
1952
- if (event.getSource() == overwriteMatItem)
2669
+ if (source == overwriteMatItem)
19532670 {
19542671 /* july 2015
19552672 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2686,7 @@
19692686
19702687 Overwrite(dropAttributes);
19712688 }
1972
- if (event.getSource() == overwriteGeoItem)
2689
+ if (source == overwriteGeoItem)
19732690 {
19742691 Overwrite(Object3D.GEOMETRY);
19752692 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2703,7 @@
19862703 // refreshContents();
19872704 // }
19882705 } else
1989
- if (event.getSource() == generateMeshItem)
2706
+ if (source == generateMeshItem)
19902707 {
19912708 //if (group.selection.size() == 1)
19922709 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2714,7 @@
19972714 ResetModel();
19982715 refreshContents();
19992716 } else
2000
- if (event.getSource() == extractGeometriesItem)
2717
+ if (source == extractGeometriesItem)
20012718 {
20022719 boolean one = false;
20032720
....@@ -2024,7 +2741,7 @@
20242741 ResetModel();
20252742 refreshContents();
20262743 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2744
+ if (source == cloneGeometriesItem)
20282745 {
20292746 boolean one = false;
20302747
....@@ -2050,7 +2767,7 @@
20502767 ResetModel();
20512768 refreshContents();
20522769 } else
2053
- if (event.getSource() == shareGeometriesItem)
2770
+ if (source == shareGeometriesItem)
20542771 {
20552772 boolean one = false;
20562773
....@@ -2080,7 +2797,7 @@
20802797 refreshContents();
20812798 }
20822799 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2800
+ if (source == mergeGeometriesItem)
20842801 {
20852802 boolean one = false;
20862803
....@@ -2110,7 +2827,7 @@
21102827 ResetModel();
21112828 refreshContents();
21122829 } else
2113
- if (event.getSource() == linkverticesItem)
2830
+ if (source == linkverticesItem)
21142831 {
21152832 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162833 // {
....@@ -2123,9 +2840,9 @@
21232840 // group.selection.get(0).setMasterThis(content); // should be identity
21242841 // refreshContents();
21252842 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2843
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272844 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2845
+ Object3D content = Grafreed.clipboard.get(0);
21292846
21302847 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312848 content = ((cGroup)content).get(0);
....@@ -2133,38 +2850,38 @@
21332850 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342851 for (int i=0; i<group.selection.size(); i++)
21352852 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2853
+ boolean random = CameraPane.SWITCH;
2854
+ CameraPane.SWITCH = false; // parse all random nodes
21382855 group.selection.get(i).linkVerticesThis(content);
21392856 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2857
+ CameraPane.SWITCH = random;
21412858 }
21422859 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432860 refreshContents();
21442861 }
21452862 } else
2146
- if (event.getSource() == resetsupportItem)
2863
+ if (source == resetsupportItem)
21472864 {
21482865 for (int i=0; i<group.selection.size(); i++)
21492866 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2867
+ boolean random = CameraPane.SWITCH;
2868
+ CameraPane.SWITCH = false; // parse all random nodes
21522869 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2870
+ CameraPane.SWITCH = random;
21542871 }
21552872
21562873 refreshContents();
21572874 } else
2158
- if (event.getSource() == relinkverticesItem)
2875
+ if (source == relinkverticesItem)
21592876 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2877
+ boolean random = CameraPane.SWITCH;
2878
+ CameraPane.SWITCH = false; // parse all random nodes
21622879 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2880
+ CameraPane.SWITCH = random;
21642881
21652882 refreshContents();
21662883 } else
2167
- if (event.getSource() == resetreferencesItem)
2884
+ if (source == resetreferencesItem)
21682885 {
21692886 for (int i=0; i<group.selection.size(); i++)
21702887 {
....@@ -2173,11 +2890,11 @@
21732890
21742891 refreshContents();
21752892 } else
2176
- if (event.getSource() == setMasterItem)
2893
+ if (source == setMasterItem)
21772894 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2895
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792896 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2897
+ Object3D content = Grafreed.clipboard.get(0);
21812898
21822899 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832900 content = ((cGroup)content).get(0);
....@@ -2186,13 +2903,13 @@
21862903 refreshContents();
21872904 }
21882905 } else
2189
- if (event.getSource() == poseMeshItem)
2906
+ if (source == poseMeshItem)
21902907 {
21912908 if (group.selection.size() == 1)
21922909 {
2193
- if (GrafreeD.clipboard.size() == 1)
2910
+ if (Grafreed.clipboard.size() == 1)
21942911 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2912
+ Object3D content = Grafreed.clipboard.get(0);
21962913
21972914 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982915 content = ((cGroup)content).get(0);
....@@ -2205,19 +2922,19 @@
22052922 }
22062923
22072924 } else
2208
- if (event.getSource() == revertMeshItem)
2925
+ if (source == revertMeshItem)
22092926 {
22102927 RevertMeshes();
22112928 } else
2212
- if (event.getSource() == resetMeshItem)
2929
+ if (source == resetAllItem)
22132930 {
22142931 ResetAll();
22152932 } else
2216
- if (event.getSource() == stepAllItem)
2933
+ if (source == stepAllItem)
22172934 {
22182935 StepAll();
22192936 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
22212938 {
22222939 //int indices[] = jList.getSelectedIndices();
22232940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2942,46 @@
22252942
22262943 ClearSelection(false);
22272944 } else
2228
- if (event.getSource() == clearAllItem)
2945
+ if (source == clearAllItem)
22292946 {
22302947 ClearSelection(true);
22312948 } else
2232
- if (event.getSource() == grabItem)
2949
+ if (source == grabItem || source == groupButton)
22332950 {
2234
- group(new cGroup(), true);
2951
+ group(new cGroup(), false); // true);
22352952 } else
2236
- if (event.getSource() == hideItem)
2953
+ if (source == hideItem)
22372954 {
22382955 group(new HiddenObject());
22392956 } else
2240
- if (event.getSource() == frontItem)
2957
+ if (source == frontItem)
22412958 {
22422959 front();
22432960 } else
2244
- if (event.getSource() == backItem)
2961
+ if (source == backItem)
22452962 {
22462963 back();
22472964 } else
2248
- if (event.getSource() == cameraItem)
2965
+ if (source == cameraItem)
22492966 {
22502967 makeSomething(new Camera());
22512968 } else
2252
- if (event.getSource() == compositeItem)
2969
+ if (source == compositeItem || source == compositeButton)
22532970 {
22542971 group(new Composite());
22552972 } else
2256
- if (event.getSource() == randomItem)
2973
+ if (source == switchItem || source == switchButton)
22572974 {
22582975 RandomNode random = new RandomNode();
22592976 group(random);
22602977 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2978
+ random.name = random.get(0).name + "Switch";
22622979 } else
2263
- if (event.getSource() == physicsItem)
2980
+ if (source == physicsItem)
22642981 {
22652982 group(new PhysicsNode());
22662983 } else
2267
- if (event.getSource() == frameselectorItem)
2984
+ if (source == frameselectorItem)
22682985 {
22692986 for (int i=0; i<group.selection.size(); i++)
22702987 {
....@@ -2276,7 +2993,7 @@
22762993 ResetModel();
22772994 refreshContents();
22782995 } else
2279
- if (event.getSource() == switchGeoItem)
2996
+ if (source == switchGeoItem)
22802997 {
22812998 for (int i=0; i<group.selection.size(); i++)
22822999 {
....@@ -2288,7 +3005,7 @@
22883005 ResetModel();
22893006 refreshContents();
22903007 } else
2291
- if (event.getSource() == switchTransfoItem)
3008
+ if (source == switchTransfoItem)
22923009 {
22933010 for (int i=0; i<group.selection.size(); i++)
22943011 {
....@@ -2300,7 +3017,7 @@
23003017 ResetModel();
23013018 refreshContents();
23023019 } else
2303
- if (event.getSource() == morphItem)
3020
+ if (source == morphItem)
23043021 {
23053022 for (int i=0; i<group.selection.size(); i++)
23063023 {
....@@ -2312,7 +3029,7 @@
23123029 ResetModel();
23133030 refreshContents();
23143031 } else
2315
- if (event.getSource() == scriptNodeItem)
3032
+ if (source == scriptNodeItem)
23163033 {
23173034 boolean atleastone = false;
23183035
....@@ -2351,215 +3068,252 @@
23513068 }
23523069 }
23533070 } else
2354
- if (event.getSource() == linkerItem)
3071
+ if (source == linkerItem)
23553072 {
23563073 group(new cLinker());
23573074 } else
2358
- if (event.getSource() == textureItem)
3075
+ if (source == textureItem || source == textureButton)
23593076 {
23603077 group(new TextureNode());
23613078 } else
2362
- if (event.getSource() == billboardItem)
3079
+ if (source == billboardItem)
23633080 {
23643081 group(new BillboardNode());
23653082 } else
2366
- if (event.getSource() == shadowXItem)
3083
+ if (source == shadowXItem)
23673084 {
23683085 CastShadow(0);
23693086 } else
2370
- if (event.getSource() == shadowYItem)
3087
+ if (source == shadowYItem)
23713088 {
23723089 CastShadow(1);
23733090 } else
2374
- if (event.getSource() == shadowZItem)
3091
+ if (source == shadowZItem)
23753092 {
23763093 CastShadow(2);
23773094 } else
2378
- if (event.getSource() == ungroupItem)
3095
+ if (source == ungroupItem || source == ungroupButton)
23793096 {
2380
- //ungroup();
3097
+ boolean hasRoot = false;
3098
+
23813099 for (int i=0; i<group.selection.size(); i++)
23823100 {
2383
- Ungroup(group.selection.get(i));
3101
+ if (group.selection.get(i) == group)
3102
+ {
3103
+ hasRoot = true;
3104
+ break;
3105
+ }
23843106 }
23853107
2386
- ClearSelection(false);
2387
-
2388
- refreshContents();
3108
+ if (!hasRoot)
3109
+ {
3110
+ for (int i=0; i<group.selection.size(); i++)
3111
+ {
3112
+ Ungroup(group.selection.get(i));
3113
+ }
3114
+
3115
+ ClearSelection(false);
3116
+
3117
+ refreshContents();
3118
+ }
23893119 } else
2390
- if (event.getSource() == genUVItem)
3120
+ if (source == genUVItem)
23913121 {
23923122 GenUV();
23933123 } else
2394
- if (event.getSource() == genNormalsCADItem)
3124
+ if (source == genNormalsCADItem)
23953125 {
23963126 GenNormals(true);
23973127 } else
2398
- if (event.getSource() == genNormalsMESHItem)
3128
+ if (source == genNormalsMESHItem)
23993129 {
2400
- GenNormals(true); // TODO
3130
+ GenNormalsMESH();
24013131 } else
2402
- if (event.getSource() == genNormalsORGANItem)
3132
+ if (source == genNormalsORGANItem)
24033133 {
24043134 GenNormals(false);
24053135 } else
2406
- if (event.getSource() == genNormalsMINEItem)
3136
+ if (source == genNormalsMINEItem)
24073137 {
24083138 GenNormalsMINE();
24093139 } else
2410
- if (event.getSource() == stripifyItem)
3140
+ if (source == stripifyItem)
24113141 {
24123142 Stripify();
24133143 } else
2414
- if (event.getSource() == unstripifyItem)
3144
+ if (source == unstripifyItem)
24153145 {
24163146 Unstripify();
24173147 } else
2418
- if (event.getSource() == trimItem)
3148
+ if (source == trimItem)
24193149 {
24203150 Trim();
24213151 } else
2422
- if (event.getSource() == untrimItem)
3152
+ if (source == untrimItem)
24233153 {
24243154 Untrim();
24253155 } else
2426
- if (event.getSource() == clearColorsItem)
3156
+ if (source == clearColorsItem)
24273157 {
24283158 ClearColors();
24293159 } else
2430
- if (event.getSource() == clearMaterialsItem)
3160
+ if (source == clearMaterialsItem)
24313161 {
24323162 ClearMaterials();
24333163 } else
2434
- if (event.getSource() == liveleavesItem)
3164
+ if (source == liveleavesItem)
24353165 {
24363166 LiveLeaves(true);
24373167 } else
2438
- if (event.getSource() == unliveleavesItem)
3168
+ if (source == unliveleavesItem)
24393169 {
24403170 LiveLeaves(false);
24413171 } else
2442
- if (event.getSource() == supportleavesItem)
3172
+ if (source == supportleavesItem)
24433173 {
24443174 SupportLeaves(true);
24453175 } else
2446
- if (event.getSource() == unsupportleavesItem)
3176
+ if (source == unsupportleavesItem)
24473177 {
24483178 SupportLeaves(false);
24493179 } else
2450
- if (event.getSource() == hideleavesItem)
3180
+ if (source == hideleavesItem)
24513181 {
24523182 HideLeaves(true);
24533183 } else
2454
- if (event.getSource() == showleavesItem)
3184
+ if (source == showleavesItem)
24553185 {
24563186 HideLeaves(false);
24573187 } else
2458
- if (event.getSource() == markleavesItem)
3188
+ if (source == markleavesItem)
24593189 {
24603190 MarkLeaves(true);
24613191 } else
2462
- if (event.getSource() == unmarkleavesItem)
3192
+ if (source == unmarkleavesItem)
24633193 {
24643194 MarkLeaves(false);
24653195 } else
2466
- if (event.getSource() == flipVItem)
3196
+ if (source == rewindleavesItem)
3197
+ {
3198
+ RewindLeaves(true);
3199
+ } else
3200
+ if (source == unrewindleavesItem)
3201
+ {
3202
+ RewindLeaves(false);
3203
+ } else
3204
+ if (source == randomleavesItem)
3205
+ {
3206
+ RandomLeaves(true);
3207
+ } else
3208
+ if (source == unrandomleavesItem)
3209
+ {
3210
+ RandomLeaves(false);
3211
+ } else
3212
+ if (source == flipVItem)
24673213 {
24683214 FlipV(true);
24693215 } else
2470
- if (event.getSource() == unflipVItem)
3216
+ if (source == unflipVItem)
24713217 {
24723218 FlipV(false);
24733219 } else
2474
- if (event.getSource() == lowTexturesItem)
3220
+ if (source == lowTexturesItem)
24753221 {
24763222 SetTexRes(0);
24773223 } else
2478
- if (event.getSource() == normalTexturesItem)
3224
+ if (source == normalTexturesItem)
24793225 {
24803226 SetTexRes(1);
24813227 } else
2482
- if (event.getSource() == highTexturesItem)
3228
+ if (source == highTexturesItem)
24833229 {
24843230 SetTexRes(2);
24853231 } else
2486
- if (event.getSource() == veryhighTexturesItem)
3232
+ if (source == veryhighTexturesItem)
24873233 {
24883234 SetTexRes(3);
24893235 } else
2490
- if (event.getSource() == maxTexturesItem)
3236
+ if (source == maxTexturesItem)
24913237 {
24923238 SetTexRes(4);
24933239 } else
2494
- if (event.getSource() == panoTexturesItem)
3240
+ if (source == panoTexturesItem)
24953241 {
24963242 SetTexRes(5);
24973243 } else
2498
- if (event.getSource() == reverseNormalsItem)
3244
+ if (source == reverseNormalsItem)
24993245 {
25003246 ReverseNormals();
25013247 } else
2502
- if (event.getSource() == parseverticesItem)
3248
+ if (source == parseverticesItem)
25033249 {
25043250 ParseVertices();
25053251 } else
2506
- if (event.getSource() == textureFieldItem)
3252
+ if (source == textureFieldItem)
25073253 {
25083254 TextureVertices();
25093255 } else
2510
- if (event.getSource() == alignItem)
3256
+ if (source == alignItem)
25113257 {
25123258 Align();
25133259 } else
2514
- if (event.getSource() == mirrorItem)
3260
+ if (source == mirrorItem)
25153261 {
25163262 MirrorPoses();
25173263 } else
2518
- if (event.getSource() == reduceMorphItem)
3264
+ if (source == reduceMorphItem)
25193265 {
25203266 MeshReduction(false);
25213267 } else
2522
- if (event.getSource() == reduce34MorphItem)
3268
+ if (source == reduce34MorphItem)
25233269 {
25243270 MeshReduction(true);
25253271 } else
2526
- if (event.getSource() == reverseTrianglesItem)
3272
+ if (source == reverseTrianglesItem)
25273273 {
25283274 ReverseTriangles();
25293275 } else
2530
- if (event.getSource() == reduceMeshItem)
3276
+ if (source == reduceMeshItem)
25313277 {
25323278 ReduceMesh(false);
25333279 } else
2534
- if (event.getSource() == reduce34MeshItem)
3280
+ if (source == reduce34MeshItem)
25353281 {
25363282 ReduceMesh(true);
25373283 } else
2538
- if (event.getSource() == increaseMeshItem)
3284
+ if (source == increaseMeshItem)
25393285 {
25403286 IncreaseMesh();
25413287 } else
2542
- if (event.getSource() == clipMeshItem)
3288
+ if (source == clipMeshItem)
25433289 {
25443290 ClipMesh();
25453291 } else
2546
- if (event.getSource() == smoothMeshItem)
3292
+ if (source == smoothMeshItem)
25473293 {
25483294 SmoothMesh();
25493295 } else
2550
- if (event.getSource() == transformgeometryItem)
3296
+ if (source == transformGeometryItem)
25513297 {
25523298 TransformGeometry();
25533299 } else
2554
- if (event.getSource() == resetTransformItem)
3300
+ if (source == transformChildrenItem)
3301
+ {
3302
+ TransformChildren();
3303
+ } else
3304
+ if (source == resetTransformItem)
25553305 {
25563306 ResetTransform();
25573307 } else
2558
- if (event.getSource() == resetCentroidItem)
3308
+ if (source == resetCentroidItem)
25593309 {
2560
- ResetCentroid();
3310
+ ResetCentroid(true);
25613311 } else
2562
- if (event.getSource() == resetParentItem)
3312
+ if (source == resetCentroidXZItem)
3313
+ {
3314
+ ResetCentroid(false);
3315
+ } else
3316
+ if (source == resetParentItem)
25633317 {
25643318 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25653319 {
....@@ -2569,7 +3323,7 @@
25693323
25703324 refreshContents();
25713325 } else
2572
- if (event.getSource() == repairParentItem)
3326
+ if (source == repairParentItem)
25733327 {
25743328 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25753329 {
....@@ -2583,7 +3337,7 @@
25833337
25843338 refreshContents();
25853339 } else
2586
- if (event.getSource() == repairShadowItem)
3340
+ if (source == repairShadowItem)
25873341 {
25883342 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25893343 {
....@@ -2597,7 +3351,7 @@
25973351
25983352 refreshContents();
25993353 } else
2600
- if (event.getSource() == sortbysizeItem)
3354
+ if (source == sortbysizeItem)
26013355 {
26023356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26033357 {
....@@ -2609,7 +3363,7 @@
26093363 ResetModel();
26103364 refreshContents();
26113365 } else
2612
- if (event.getSource() == sortbynameItem)
3366
+ if (source == sortbynameItem)
26133367 {
26143368 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26153369 {
....@@ -2621,7 +3375,7 @@
26213375 ResetModel();
26223376 refreshContents();
26233377 } else
2624
- if (event.getSource() == attachPigmentItem)
3378
+ if (source == attachPigmentItem)
26253379 {
26263380 String texture = GetFile("Attach pigment");
26273381 Object3D obj;
....@@ -2633,7 +3387,7 @@
26333387
26343388 refreshContents();
26353389 } else
2636
- if (event.getSource() == detachPigmentItem)
3390
+ if (source == detachPigmentItem)
26373391 {
26383392 Object3D obj;
26393393 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +3398,7 @@
26443398
26453399 refreshContents();
26463400 } else
2647
- if (event.getSource() == attachBumpItem)
3401
+ if (source == attachBumpItem)
26483402 {
26493403 String texture = GetFile("Attach bump");
26503404 Object3D obj;
....@@ -2656,18 +3410,18 @@
26563410
26573411 refreshContents();
26583412 } else
2659
- if (event.getSource() == detachBumpItem)
3413
+ if (source == detachBumpItem)
26603414 {
26613415 Object3D obj;
26623416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26633417 {
26643418 obj = (Object3D)e.nextElement();
2665
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
26663420 }
26673421
26683422 refreshContents();
26693423 } else
2670
- if (event.getSource() == pigmentBumpItem)
3424
+ if (source == pigmentBumpItem)
26713425 {
26723426 Object3D obj;
26733427 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +3432,262 @@
26783432
26793433 refreshContents();
26803434 } else
2681
- if (event.getSource() == flashSelectionButton)
3435
+ if (source == embedTexturesItem)
3436
+ {
3437
+ Object3D obj;
3438
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3439
+ {
3440
+ obj = (Object3D)e.nextElement();
3441
+ obj.EmbedTextures(true);
3442
+ }
3443
+
3444
+ refreshContents();
3445
+ } else
3446
+ if (source == deEmbedTexturesItem)
3447
+ {
3448
+ Object3D obj;
3449
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3450
+ {
3451
+ obj = (Object3D)e.nextElement();
3452
+ obj.EmbedTextures(false);
3453
+ }
3454
+
3455
+ CameraPane.texturepigment.clear();
3456
+ CameraPane.texturebump.clear();
3457
+
3458
+ refreshContents();
3459
+ } else
3460
+ if (source == flashSelectionButton)
26823461 {
26833462 CameraPane.flash = true;
26843463 refreshContents();
26853464 } else
2686
- if (event.getSource() == oneButton)
3465
+ if (source == oneButton)
26873466 {
26883467 } else
2689
- if (event.getSource() == twoButton)
3468
+ if (source == twoButton)
26903469 {
26913470 radio.layout = twoButton;
3471
+
3472
+ if (CameraPane.FULLSCREEN)
3473
+ fullscreenLayout = radio.layout;
3474
+
26923475 // bug
26933476 //gridPanel.setDividerLocation(1.0);
26943477 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3478
+// bigThree.remove(scenePanel);
3479
+// bigThree.remove(centralPanel);
3480
+// bigThree.remove(XYZPanel);
3481
+// aWindowConstraints.gridx = 0;
3482
+// aWindowConstraints.gridy = 0;
3483
+// aWindowConstraints.gridwidth = 1;
3484
+// // aConstraints.gridheight = 3;
3485
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3486
+// aWindowConstraints.weightx = 0;
3487
+// aWindowConstraints.weighty = 1;
3488
+// //bigThree.add(jtp, aWindowConstraints);
3489
+// aWindowConstraints.weightx = 1;
3490
+// aWindowConstraints.gridwidth = 3;
3491
+// // aConstraints.gridheight = 3;
3492
+// aWindowConstraints.gridx = 1;
3493
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3494
+// bigThree.add(centralPanel, aWindowConstraints);
3495
+// aWindowConstraints.weightx = 0;
3496
+// aWindowConstraints.gridx = 4;
3497
+// aWindowConstraints.gridwidth = 1;
3498
+// // aConstraints.gridheight = 3;
3499
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3500
+// //bigThree.add(XYZPanel, aWindowConstraints);
3501
+// scenePanel.setVisible(false);
3502
+// centralPanel.setVisible(true);
3503
+// XYZPanel.setVisible(false);
3504
+ bigThree.ClearUI();
3505
+ bigThree.add(centralPanel);
3506
+ bigThree.FlushUI();
3507
+
3508
+ cameraView.requestFocusInWindow();
3509
+
3510
+// refreshContents(true);
3511
+//
3512
+// try
3513
+// {
3514
+// java.awt.Robot bot = new java.awt.Robot();
3515
+// int mask = InputEvent.BUTTON1_MASK;
3516
+// bot.mouseMove(100, 100);
3517
+// bot.mousePress(mask);
3518
+// bot.mouseRelease(mask);
3519
+// }
3520
+// catch (Exception e)
3521
+// {
3522
+//
3523
+// }
3524
+
27193525 } else
2720
- if (event.getSource() == threeButton)
3526
+ if (source == threeButton)
27213527 {
27223528 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
3529
+
3530
+ if (CameraPane.FULLSCREEN)
3531
+ fullscreenLayout = radio.layout;
3532
+
3533
+// bigThree.remove(scenePanel);
3534
+// bigThree.remove(centralPanel);
3535
+// bigThree.remove(XYZPanel);
3536
+// aWindowConstraints.gridx = 0;
3537
+// aWindowConstraints.gridy = 0;
3538
+// aWindowConstraints.gridwidth = 1;
3539
+// // aConstraints.gridheight = 3;
3540
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3541
+// aWindowConstraints.weightx = 0;
3542
+// aWindowConstraints.weighty = 1;
3543
+// //bigThree.add(jtp, aWindowConstraints);
3544
+// aWindowConstraints.weightx = 1;
3545
+// aWindowConstraints.gridwidth = 3;
3546
+// // aConstraints.gridheight = 3;
3547
+// aWindowConstraints.gridx = 1;
3548
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3549
+// bigThree.add(centralPanel, aWindowConstraints);
3550
+// aWindowConstraints.weightx = 0;
3551
+// aWindowConstraints.gridx = 4;
3552
+// aWindowConstraints.gridwidth = 1;
3553
+// // aConstraints.gridheight = 3;
3554
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3555
+// bigThree.add(XYZPanel, aWindowConstraints);
3556
+// bigThree.validate();
3557
+// scenePanel.setVisible(false);
3558
+// centralPanel.setVisible(true);
3559
+// XYZPanel.setVisible(true);
3560
+ bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
3562
+ bigThree.add(centralPanel);
3563
+ bigThree.FlushUI();
3564
+
3565
+ cameraView.requestFocusInWindow();
27473566 } else
2748
- if (event.getSource() == fourButton)
3567
+ if (source == fourButton)
27493568 {
27503569 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
3570
+
3571
+ if (CameraPane.FULLSCREEN)
3572
+ fullscreenLayout = radio.layout;
3573
+
3574
+// bigThree.remove(scenePanel);
3575
+// bigThree.remove(centralPanel);
3576
+// bigThree.remove(XYZPanel);
3577
+// aWindowConstraints.gridx = 0;
3578
+// aWindowConstraints.gridy = 0;
3579
+// aWindowConstraints.gridwidth = 1;
3580
+// // aWindowConstraints.gridheight = 3;
3581
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3582
+// aWindowConstraints.weightx = 1;
3583
+// aWindowConstraints.weighty = 1;
3584
+// bigThree.add(scenePanel, aWindowConstraints);
3585
+// aWindowConstraints.weightx = 1;
3586
+// aWindowConstraints.gridwidth = 3;
3587
+// // aConstraints.gridheight = 3;
3588
+// aWindowConstraints.gridx = 1;
3589
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3590
+// //bigThree.add(cameraPanel, aWindowConstraints);
3591
+// aWindowConstraints.weightx = 0;
3592
+// aWindowConstraints.gridx = 4;
3593
+// aWindowConstraints.gridwidth = 1;
3594
+// // aWindowConstraints.gridheight = 3;
3595
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3596
+// //bigThree.add(XYZPanel, aWindowConstraints);
3597
+// bigThree.validate();
3598
+// scenePanel.setVisible(true);
3599
+// centralPanel.setVisible(false);
3600
+// XYZPanel.setVisible(false);
3601
+ bigThree.ClearUI();
3602
+ bigThree.add(scenePanel);
3603
+ bigThree.FlushUI();
3604
+
3605
+ cameraView.requestFocusInWindow();
27753606 } else
2776
- if (event.getSource() == sixButton)
3607
+ if (source == sixButton)
27773608 {
27783609 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
3610
+
3611
+ if (CameraPane.FULLSCREEN)
3612
+ fullscreenLayout = radio.layout;
3613
+
3614
+// bigThree.remove(scenePanel);
3615
+// bigThree.remove(centralPanel);
3616
+// bigThree.remove(XYZPanel);
3617
+// aWindowConstraints.gridx = 0;
3618
+// aWindowConstraints.gridy = 0;
3619
+// aWindowConstraints.gridwidth = 1;
3620
+// // aConstraints.gridheight = 3;
3621
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3622
+// aWindowConstraints.weightx = 0;
3623
+// aWindowConstraints.weighty = 1;
3624
+// bigThree.add(scenePanel, aWindowConstraints);
3625
+// aWindowConstraints.weightx = 1;
3626
+// aWindowConstraints.gridwidth = 3;
3627
+// // aWindowConstraints.gridheight = 3;
3628
+// aWindowConstraints.gridx = 1;
3629
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3630
+// bigThree.add(centralPanel, aWindowConstraints);
3631
+// aWindowConstraints.weightx = 0;
3632
+// aWindowConstraints.gridx = 4;
3633
+// aWindowConstraints.gridwidth = 1;
3634
+// // aWindowConstraints.gridheight = 3;
3635
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3636
+// //bigThree.add(XYZPanel, aConstraints);
3637
+// bigThree.validate();
3638
+// scenePanel.setVisible(true);
3639
+// centralPanel.setVisible(true);
3640
+// XYZPanel.setVisible(false);
3641
+ bigThree.ClearUI();
3642
+ bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
3644
+ bigThree.FlushUI();
3645
+
3646
+ cameraView.requestFocusInWindow();
28033647 } else
2804
- if (event.getSource() == sevenButton)
3648
+ if (source == sevenButton)
28053649 {
28063650 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
3651
+
3652
+ if (CameraPane.FULLSCREEN)
3653
+ fullscreenLayout = radio.layout;
3654
+
3655
+// bigThree.remove(scenePanel);
3656
+// bigThree.remove(centralPanel);
3657
+// bigThree.remove(XYZPanel);
3658
+// aWindowConstraints.gridx = 0;
3659
+// aWindowConstraints.gridy = 0;
3660
+// aWindowConstraints.gridwidth = 1;
3661
+// // aWindowConstraints.gridheight = 3;
3662
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3663
+// aWindowConstraints.weightx = 0;
3664
+// aWindowConstraints.weighty = 1;
3665
+// bigThree.add(scenePanel, aWindowConstraints);
3666
+// aWindowConstraints.weightx = 1;
3667
+// aWindowConstraints.gridwidth = 3;
3668
+// // aWindowConstraints.gridheight = 3;
3669
+// aWindowConstraints.gridx = 1;
3670
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3671
+// bigThree.add(centralPanel, aWindowConstraints);
3672
+// aWindowConstraints.weightx = 0;
3673
+// aWindowConstraints.gridx = 4;
3674
+// aWindowConstraints.gridwidth = 1;
3675
+// // aConstraints.gridheight = 3;
3676
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3677
+// bigThree.add(XYZPanel, aWindowConstraints);
3678
+// bigThree.validate();
3679
+// scenePanel.setVisible(true);
3680
+// centralPanel.setVisible(true);
3681
+// XYZPanel.setVisible(true);
3682
+ bigThree.ClearUI();
3683
+ bigThree.add(scenePanel);
3684
+ bigThree.add(centralPanel);
3685
+ bigThree.add(XYZPanel);
3686
+ bigThree.FlushUI();
3687
+
3688
+ cameraView.requestFocusInWindow();
28313689 } else
2832
- if (event.getSource() == rootButton)
3690
+ if (source == rootButton)
28333691 {
28343692 Object3D obj;
28353693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,66 +3697,84 @@
28393697 EditObject(obj);
28403698 }
28413699
3700
+ cameraView.requestFocusInWindow();
28423701 refreshContents(true);
28433702 } else
2844
- if (event.getSource() == closeButton)
3703
+ if (source == closeButton)
28453704 {
28463705 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473706 cRadio ab;
28483707 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493708 {
28503709 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3710
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523711 {
3712
+ // Patch to avoid bug with transparency.
3713
+ if (!ab.hadMaterial)
3714
+ {
3715
+ ab.object.material = null;
3716
+ }
3717
+
28533718 buttonGroup.remove(ab);
28543719 radioPanel.remove(ab);
28553720
2856
- ab.GetObject().editWindow = null;
3721
+ //ab.GetObject().editWindow = null;
3722
+ ab.GetObject().manipWindow = null;
28573723 // ab.GetObject().objectUI = null; // ?????????
28583724
28593725 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28603726 break;
28613727 }
28623728 }
3729
+
3730
+ cameraView.requestFocusInWindow();
28633731 refreshContents(true);
28643732 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3733
+ if (source == editItem || source == editButton)
28663734 {
3735
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3736
+ {
3737
+ Object3D child = (Object3D)e.nextElement();
3738
+ child.pinned = true;
3739
+ }
3740
+
28673741 EditSelection(false);
28683742 } else
2869
- if (event.getSource() == uneditButton)
3743
+ if (source == uneditButton)
28703744 {
28713745 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723746 {
28733747 Object3D child = (Object3D)e.nextElement();
28743748 if(child.editWindow != null)
28753749 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3750
+ child.pinned = false;
28763751 child.CloseUI();
28773752 listUI.remove(child);
28783753
2879
- child.editWindow = null; // ???????????
3754
+ //child.editWindow = null; // ???????????
28803755 }
2881
- objEditor.ctrlPanel.revalidate();
3756
+ objEditor.ctrlPanel.FlushUI();
28823757 //objEditor.jTree.clearSelection();
28833758 //objEditor.ResetSliders();
28843759 refreshContents(true);
28853760 } else
2886
- if (event.getSource() == clearPanelButton)
3761
+ if (source == clearPanelButton)
28873762 {
28883763 assert(copy == group);
28893764 //copy.ClearUI();
28903765 for (Object3D obj : listUI)
28913766 {
3767
+ obj.pinned = false;
28923768 obj.CloseUI();
28933769 }
28943770 listUI.clear();
28953771 refreshContents(true);
28963772 } else
2897
- if (event.getSource() == allParamsButton)
3773
+ if (source == allParamsButton)
28983774 {
28993775 assert(copy == group);
29003776
2901
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3777
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29023778
29033779 for (Object3D obj : listUI)
29043780 {
....@@ -2915,19 +3791,19 @@
29153791
29163792 refreshContents(true);
29173793 } else
2918
- if (event.getSource() == unselectButton)
3794
+ if (source == unselectButton)
29193795 {
29203796 objEditor.jTree.clearSelection();
29213797 // ?? oct 2012 GrafreeD.clipboard.clear();
29223798 objEditor.ResetSliders();
29233799 refreshContents(true);
29243800 } else
2925
- if(event.getSource() instanceof cRadio)
3801
+ if(source instanceof cRadio)
29263802 {
29273803 group.parent = keepparent;
29283804 group.attributes = 0;
29293805 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3806
+ /*cRadio*/ radio = (cRadio)source;
29313807 Object3D obj = radio.GetObject();
29323808 System.out.println("Edit " + obj);
29333809 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2947,6 +3823,9 @@
29473823 }
29483824
29493825 copy = group;
3826
+
3827
+ SetUndoStates();
3828
+
29503829 //Globals.theRenderer.object = group;
29513830 if(!useclient)
29523831 {
....@@ -2962,20 +3841,46 @@
29623841 frontView.object = group;
29633842 sideView.object = group;
29643843 }
2965
- group.editWindow = this;
3844
+
3845
+// fix "+" issue
3846
+ //group.editWindow = this;
3847
+ group.manipWindow = this;
3848
+
29663849 /*
29673850 currentLayout = radio.layout;
29683851 if (currentLayout == null)
29693852 currentLayout = sevenButton;
29703853 */
29713854 radio.layout.doClick();
3855
+
3856
+ ClearUnpinned();
3857
+ //Grafreed.Assert(group != null);
3858
+ //Grafreed.Assert(group.selection != null);
3859
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3860
+ if (group.selection == null || group.selection.size() == 1)
3861
+ EditSelection(false);
29723862 keepparent = group.parent;
29733863 // PARENT = NULL or not???
29743864 //group.parent = null; // ROOT
29753865 //group.attributes = -1;
29763866 ResetModel();
3867
+
3868
+ cameraView.requestFocusInWindow();
29773869 refreshContents(true);
2978
- }
3870
+ } else if (event.getSource() == editCameraItem)
3871
+ {
3872
+ cameraView.ProtectCamera();
3873
+ cameraView.repaint();
3874
+ return;
3875
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3876
+ {
3877
+ cameraView.RevertCamera();
3878
+ cameraView.repaint();
3879
+ return;
3880
+ // } else if (event.getSource() == textureButton)
3881
+ // {
3882
+ // return; // true;
3883
+ }
29793884 else
29803885 {
29813886 //return super.action(event, arg);
....@@ -2984,7 +3889,6 @@
29843889 }
29853890
29863891 boolean useclient = false;
2987
- cRadio radio;
29883892
29893893 void ToggleRoot()
29903894 {
....@@ -3036,6 +3940,28 @@
30363940 refreshContents();
30373941 }
30383942
3943
+ void TransformChildren()
3944
+ {
3945
+ Object3D obj;
3946
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3947
+ {
3948
+ obj = (Object3D)e.nextElement();
3949
+ obj.KeepTextureMatrices();
3950
+ obj.TransformChildren();
3951
+ obj.RestoreTextureMatrices();
3952
+
3953
+// if (obj.parent == null)
3954
+// {
3955
+// System.out.println("NULL PARENT!");
3956
+// new Exception().printStackTrace();
3957
+// }
3958
+// else
3959
+// TouchTransform(obj);
3960
+// //obj.parent.Touch();
3961
+ }
3962
+
3963
+ refreshContents();
3964
+ }
30393965
30403966 void ResetTransform()
30413967 {
....@@ -3148,7 +4074,7 @@
31484074 refreshContents();
31494075 }
31504076
3151
- void ResetCentroid()
4077
+ void ResetCentroid(boolean full)
31524078 {
31534079 Object3D obj;
31544080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +4089,16 @@
31634089 LA.matIdentity(Object3D.mat);
31644090 obj.getBounds(minima, maxima, false);
31654091 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4092
+ if (full)
4093
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31674094 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31684095 obj.TransformMesh(Object3D.mat);
4096
+
31694097 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4098
+ if (full)
4099
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31714100 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4101
+
31724102 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31734103 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31744104 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +4127,8 @@
31974127
31984128 int size = obj.MemorySize();
31994129
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
4130
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4131
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32014132 }
32024133 }
32034134 catch (Exception e)
....@@ -3234,9 +4165,9 @@
32344165 obj = (Object3D)e.nextElement();
32354166
32364167 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
4168
+ Grafreed.AnalyzeObject(obj);
32384169 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
4170
+ Grafreed.AnalyzeObject(obj.bRep);
32404171
32414172 // System.err.println((size/1024) + " KB is the size of " + obj);
32424173 }
....@@ -3278,6 +4209,13 @@
32784209 void GenNormals(boolean crease)
32794210 {
32804211 group.GenNormalsS(crease);
4212
+
4213
+ refreshContents();
4214
+ }
4215
+
4216
+ void GenNormalsMESH()
4217
+ {
4218
+ group.GenNormalsMeshS();
32814219
32824220 refreshContents();
32834221 }
....@@ -3450,8 +4388,8 @@
34504388
34514389 void ParseVertices()
34524390 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
4391
+ boolean epsequal = Grafreed.epsequal;
4392
+ Grafreed.epsequal = true;
34554393
34564394 for (int i=0; i<group.selection.size(); i++)
34574395 {
....@@ -3476,7 +4414,7 @@
34764414 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34774415 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34784416
3479
- g.add(GrafreeD.clipboard);
4417
+ g.add(Grafreed.clipboard);
34804418
34814419 buffer.add(g);
34824420 }
....@@ -3491,7 +4429,7 @@
34914429 makeSomething(buffer, i==group.selection.size()-1);
34924430 }
34934431
3494
- GrafreeD.epsequal = epsequal;
4432
+ Grafreed.epsequal = epsequal;
34954433
34964434 refreshContents();
34974435 }
....@@ -3509,7 +4447,16 @@
35094447 String pigment = Object3D.GetPigment(tex);
35104448 //String bump = Object3D.GetBump(tex);
35114449
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4450
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4451
+
4452
+ try
4453
+ {
4454
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4455
+ }
4456
+ catch (Exception e)
4457
+ {
4458
+ System.err.println("FAIL: " + node);
4459
+ }
35134460
35144461 double s = v.s;
35154462
....@@ -3597,11 +4544,11 @@
35974544
35984545 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35994546
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
4547
+ boolean random = CameraPane.SWITCH;
4548
+ CameraPane.SWITCH = false; // parse all random nodes
36024549 lowres.linkVerticesThis(null);
36034550 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
4551
+ CameraPane.SWITCH = random;
36054552
36064553 System.err.flush();
36074554
....@@ -3641,7 +4588,7 @@
36414588 return;
36424589
36434590 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4591
+ Object3D ref = Grafreed.clipboard.get(0);
36454592
36464593 Object3D newgroup = new Object3D("Po:" + poses.name);
36474594
....@@ -3835,9 +4782,9 @@
38354782
38364783 void ClipMesh()
38374784 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4785
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394786 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4787
+ Object3D content = Grafreed.clipboard.get(0);
38414788
38424789 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434790 content = ((cGroup)content).get(0);
....@@ -3846,7 +4793,7 @@
38464793 // {
38474794 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484795 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4796
+ group.selection.ClipMesh(Grafreed.clipboard);
38504797 }
38514798 // group.selection.ClipMesh(GrafreeD.clipboard);
38524799 System.out.println("DONE.");
....@@ -3893,6 +4840,18 @@
38934840 void MarkLeaves(boolean hide)
38944841 {
38954842 group.selection.MarkLeaves(hide);
4843
+ refreshContents();
4844
+ }
4845
+
4846
+ void RewindLeaves(boolean hide)
4847
+ {
4848
+ group.selection.RewindLeaves(hide);
4849
+ refreshContents();
4850
+ }
4851
+
4852
+ void RandomLeaves(boolean hide)
4853
+ {
4854
+ group.selection.RandomLeaves(hide);
38964855 refreshContents();
38974856 }
38984857
....@@ -3967,28 +4926,25 @@
39674926 // }
39684927 // }
39694928
3970
- static boolean allparams = true;
3971
-
3972
- static Vector<Object3D> listUI = new Vector<Object3D>();
3973
-
39744929 void EditSelection(boolean newWindow)
39754930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
39764937 // aConstraints.gridy = 0;
39774938 for (int i=0; i<group.selection.size(); i++)
39784939 {
39794940 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39804941 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3981
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4942
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824943
39834944 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4945
+ if(elem != group || !newWindow)
39854946 {
3986
- // if (!(elem instanceof Composite))
3987
- // newWindow = false;
3988
- listUI.add(elem);
3989
- elem.openEditWindow(this, newWindow); //, false);
3990
- System.out.println("edit : " + elem);
3991
- elem.editWindow.refreshContents(true); // ? new
4947
+ EditElement(elem, newWindow); // ? new
39924948 }
39934949 }
39944950 }
....@@ -4063,7 +5019,8 @@
40635019 //new Exception().printStackTrace();
40645020
40655021 freezemodel = true;
4066
-
5022
+ ClearUnpinned();
5023
+
40675024 /**/
40685025 //switch (event.id)
40695026 {
....@@ -4071,7 +5028,6 @@
40715028 //case 702: // Event.LIST_DESELECT
40725029 group.deselectAll();
40735030 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40755031 if (tps != null)
40765032 {
40775033 for (int i=0; i < tps.length; i++)
....@@ -4080,33 +5036,39 @@
40805036
40815037 //if (child.parent != null)
40825038 //child.parent.addSelectee(child);
5039
+ objEditor.SetMaterial(child);
40835040 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40875041 }
40885042 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
5043
+// else
5044
+// {
5045
+// objEditor.SetMaterial(group); // .GetMaterial());
5046
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5047
+// System.err.println("info : " + group.GetPath());
5048
+// }
40955049
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5050
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40995051 CameraPane.flash = true;
41005052
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5053
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41025054 // a camera
41035055 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5056
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5057
+ {
5058
+ CameraPane.camerachangeframe = 0; // don't refuse it
5059
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5060
+ }
41065061 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41075062 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41085063 }
41095064
5065
+ if (tps != null && tps.length == 1)
5066
+ {
5067
+ EditSelection(false);
5068
+ }
5069
+
5070
+ SetPinStates(tps != null && tps.length > 0);
5071
+
41105072 refreshContents();
41115073 //return true;
41125074 }
....@@ -4115,6 +5077,35 @@
41155077
41165078 freezemodel = false;
41175079 }
5080
+
5081
+ void SetPinStates(boolean enabled)
5082
+ {
5083
+ editButton.setEnabled(enabled);
5084
+ uneditButton.setEnabled(enabled);
5085
+ unselectButton.setEnabled(enabled);
5086
+ flashSelectionButton.setEnabled(enabled);
5087
+ }
5088
+
5089
+ void refreshContents(boolean cp)
5090
+ {
5091
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5092
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5093
+ {
5094
+ objEditor.ClearInfo(); // .GetMaterial());
5095
+
5096
+ for (int i=0; i < group.selection.Size(); i++)
5097
+ {
5098
+ Object3D child = (Object3D) group.selection.get(i);
5099
+
5100
+ objEditor.AddInfo(child, this, true);
5101
+ System.err.println("info : " + child.GetPath());
5102
+ }
5103
+
5104
+ objEditor.SetText(); // jan 2014
5105
+ }
5106
+
5107
+ super.refreshContents(cp);
5108
+ }
41185109
41195110 void linkSomething(Object3D thing)
41205111 {
....@@ -4186,16 +5177,19 @@
41865177 {
41875178 if (group.selection.isEmpty())
41885179 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
5180
+
5181
+ Grafreed.clipboardIsTempGroup = false;
41905182 Composite tGroup = null;
41915183 if (group.selection.size() > 0) // 1)
41925184 {
41935185 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
5186
+ Grafreed.clipboardIsTempGroup = true;
41955187 }
41965188
41975189 if (cut)
41985190 {
5191
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5192
+// Save();
41995193 //int indices[] = jList.getSelectedIndices();
42005194 //for (int i = indices.length - 1; i >= 0; i--)
42015195 //jList.remove(indices[i]);
....@@ -4231,16 +5225,16 @@
42315225 //System.out.println("cut " + child);
42325226 //System.out.println("parent = " + child.parent);
42335227 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
5228
+ if (Grafreed.clipboardIsTempGroup)
42355229 tGroup.add/*Child*/(tmp);
42365230 else
4237
- GrafreeD.clipboard = tmp;
5231
+ Grafreed.clipboard = tmp;
42385232 }
42395233 else
4240
- if (GrafreeD.clipboardIsTempGroup)
5234
+ if (Grafreed.clipboardIsTempGroup)
42415235 tGroup.add/*Child*/(child);
42425236 else
4243
- GrafreeD.clipboard = child;
5237
+ Grafreed.clipboard = child;
42445238 }
42455239
42465240 //ResetModel();
....@@ -4272,21 +5266,23 @@
42725266 //System.out.println("cut " + elem);
42735267 //System.out.println("parent = " + elem.parent);
42745268 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
5269
+ if (Grafreed.clipboardIsTempGroup)
42765270 tGroup.add/*Child*/(tmp);
42775271 else
4278
- GrafreeD.clipboard = tmp;
5272
+ Grafreed.clipboard = tmp;
42795273 }
42805274 else
4281
- if (GrafreeD.clipboardIsTempGroup)
5275
+ if (Grafreed.clipboardIsTempGroup)
42825276 tGroup.add/*Child*/(child);
42835277 else
4284
- GrafreeD.clipboard = child;
5278
+ Grafreed.clipboard = child;
42855279 }
42865280
42875281 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
5282
+
5283
+ if (Grafreed.clipboardIsTempGroup)
5284
+ Grafreed.clipboard = tGroup;
5285
+
42905286 if (cut)
42915287 {
42925288 ResetModel();
....@@ -4296,11 +5292,15 @@
42965292
42975293 void paste(boolean expand)
42985294 {
5295
+ if (Globals.REPLACEONMAKE)
5296
+ Save();
5297
+ boolean keep = Globals.REPLACEONMAKE;
5298
+ Globals.REPLACEONMAKE = false;
42995299 // if (GrafreeD.clipboard == null)
43005300 // return;
43015301 boolean first = true;
43025302
4303
- if (GrafreeD.clipboardIsTempGroup)
5303
+ if (Grafreed.clipboardIsTempGroup)
43045304 {
43055305 Composite temp;
43065306
....@@ -4311,7 +5311,7 @@
43115311 temp = (Composite)Applet3D.clipboard.deepCopy();
43125312 */
43135313 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5314
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43155315 {
43165316 Object3D child = (Object3D)e.nextElement();
43175317
....@@ -4345,21 +5345,22 @@
43455345 //Object3D cb = Applet3D.clipboard;
43465346 //temp.addChild(cb);
43475347 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5348
+ assert(Grafreed.clipboard.parent == null);
5349
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5350
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5351
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5352
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43535353 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
5354
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5355
+ Grafreed.clipboard.get(0).parent = keepparent;
43565356 }
43575357
5358
+ Globals.REPLACEONMAKE = keep;
43585359 ResetModel();
43595360 refreshContents();
43605361 }
43615362
4362
- void pasteInto(boolean copyit)
5363
+ void pasteInto(boolean copyit, boolean clone)
43635364 {
43645365 // if (GrafreeD.clipboard == null)
43655366 // return;
....@@ -4388,15 +5389,22 @@
43885389 if (copyit)
43895390 {
43905391 // paste(false);
4391
- CloneClipboard(false); // sept 2014
5392
+ if (clone)
5393
+ {
5394
+ CloneClipboard(false); // sept 2014
5395
+ }
5396
+ else
5397
+ {
5398
+ paste(false);
5399
+ }
43925400 }
43935401 else
43945402 {
43955403 boolean first = true;
43965404
4397
- if (GrafreeD.clipboardIsTempGroup)
5405
+ if (Grafreed.clipboardIsTempGroup)
43985406 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
5407
+ Composite temp = (Composite)Grafreed.clipboard;
44005408 Object3D copy;
44015409 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44025410 {
....@@ -4406,7 +5414,7 @@
44065414 }
44075415 } else
44085416 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
5417
+ linkSomething(Grafreed.clipboard); //.get(0));
44105418 }
44115419 }
44125420 }
....@@ -4483,6 +5491,10 @@
44835491
44845492 void group(Object3D csg, boolean grab)
44855493 {
5494
+ if (Globals.REPLACEONMAKE)
5495
+ Save();
5496
+ boolean keep = Globals.REPLACEONMAKE;
5497
+ Globals.REPLACEONMAKE = false;
44865498 if (//false) // why??
44875499 !group.selection.isEmpty())
44885500 {
....@@ -4596,10 +5608,15 @@
45965608 //node.add(csg);
45975609 //makeSomething(node);
45985610 makeSomething(csg);
5611
+ Globals.REPLACEONMAKE = keep;
45995612 }
46005613
46015614 void Ungroup(Object3D g)
46025615 {
5616
+ if (Globals.REPLACEONMAKE)
5617
+ Save();
5618
+ boolean keep = Globals.REPLACEONMAKE;
5619
+ Globals.REPLACEONMAKE = false;
46035620 if (g instanceof HiddenObject)
46045621 {
46055622 HiddenObject h = (HiddenObject) g;
....@@ -4616,6 +5633,7 @@
46165633 objEditor.makeSomething(g.get(i), false);
46175634 }
46185635 }
5636
+ Globals.REPLACEONMAKE = keep;
46195637 }
46205638
46215639 void ungroup()
....@@ -4811,21 +5829,6 @@
48115829 }
48125830 */
48135831
4814
- void ImportGFD()
4815
- {
4816
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4817
- browser.show();
4818
- String filename = browser.getFile();
4819
- if (filename != null && filename.length() > 0)
4820
- {
4821
- String fullname = browser.getDirectory() + filename;
4822
-
4823
- //Object3D readobj =
4824
- objEditor.ReadGFD(fullname, objEditor);
4825
- //makeSomething(readobj);
4826
- }
4827
- }
4828
-
48295832 /*
48305833 public void Callback(Object obj)
48315834 {
....@@ -4849,26 +5852,9 @@
48495852 }
48505853 */
48515854
4852
- void ImportVRMLX3D()
4853
- {
4854
- if (GrafreeD.standAlone)
4855
- {
4856
- /**/
4857
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4858
- browser.show();
4859
- String filename = browser.getFile();
4860
- if (filename != null && filename.length() > 0)
4861
- {
4862
- String fullname = browser.getDirectory() + filename;
4863
- LoadVRMLX3D(fullname);
4864
- }
4865
- /**/
4866
- }
4867
- }
4868
-
48695855 String GetFile(String dialogName)
48705856 {
4871
- if (GrafreeD.standAlone)
5857
+ if (Grafreed.standAlone)
48725858 {
48735859 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745860 browser.show();
....@@ -4932,10 +5918,49 @@
49325918 cButton flashSelectionButton;
49335919 cButton editButton;
49345920 cButton uneditButton;
5921
+ JCheckBox allParamsButton;
49355922 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375923 cButton unselectButton;
49385924
5925
+ cButton restoreCameraButton;
5926
+
5927
+ cButton saveButton;
5928
+ cButton oneStepButton;
5929
+
5930
+ cButton groupButton;
5931
+ cButton ungroupButton;
5932
+ cButton compositeButton;
5933
+ cButton switchButton;
5934
+ cButton loopButton;
5935
+ cButton textureButton;
5936
+
5937
+ cButton skybox1Button;
5938
+ cButton skybox2Button;
5939
+ cButton skybox3Button;
5940
+ cButton skybox4Button;
5941
+ cButton skybox5Button;
5942
+ cButton skybox6Button;
5943
+ cButton skybox7Button;
5944
+
5945
+ cButton skybox11Button;
5946
+ cButton skybox12Button;
5947
+ cButton skybox13Button;
5948
+ cButton skybox14Button;
5949
+ cButton skybox15Button;
5950
+ cButton skybox16Button;
5951
+ cButton skybox17Button;
5952
+
5953
+ cButton gridButton;
5954
+ cButton boxButton;
5955
+ cButton sphereButton;
5956
+ cButton coneButton;
5957
+ cButton torusButton;
5958
+ cButton superButton;
5959
+ cButton kleinButton;
5960
+ cButton particlesButton;
5961
+ cButton overlayButton;
5962
+ cButton lightButton;
5963
+
49395964 cButton screenfitButton;
49405965 cButton screenfitpointButton;
49415966 cButton snapobjectButton;
....@@ -4947,14 +5972,6 @@
49475972
49485973 cButton setsupportButton;
49495974
4950
- cButton twoButton;
4951
- cButton sixButton;
4952
- cButton threeButton;
4953
- cButton sevenButton;
4954
- cButton fourButton; // full panel
4955
- cButton oneButton; // full XYZ
4956
- //cButton currentLayout;
4957
-
49585975 //
49595976 //Composite
49605977 Object3D // to do !!
....@@ -4964,9 +5981,11 @@
49645981 //JTree jTree;
49655982 private MenuItem lookAtItem;
49665983 private MenuItem lookFromItem;
4967
- private MenuItem switchItem;
5984
+ private MenuItem switchViewItem;
49685985 private MenuItem cutItem;
4969
- private MenuItem duplicateItem;
5986
+ private MenuItem undoItem;
5987
+ private MenuItem redoItem;
5988
+ private JMenuItem duplicateItem;
49705989 private MenuItem cloneItem;
49715990 private MenuItem cloneSupportItem;
49725991 private MenuItem overwriteGeoItem;
....@@ -4979,7 +5998,7 @@
49795998 private MenuItem linkverticesItem;
49805999 private MenuItem relinkverticesItem;
49816000 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
6001
+ private MenuItem resetAllItem;
49836002 private MenuItem stepAllItem;
49846003 private MenuItem revertMeshItem;
49856004 private MenuItem poseMeshItem;
....@@ -4990,10 +6009,11 @@
49906009 private MenuItem mergeGeometriesItem;
49916010 private MenuItem copyItem;
49926011 private MenuItem pasteItem;
6012
+ private MenuItem pasteIntoItem;
49936013 private MenuItem pasteLinkItem;
49946014 private MenuItem pasteCloneItem;
49956015 private MenuItem pasteExpandItem;
4996
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
49976017 private MenuItem clearAllItem;
49986018 private MenuItem genUVItem;
49996019 private MenuItem genNormalsMESHItem;
....@@ -5028,6 +6048,10 @@
50286048 private MenuItem showleavesItem;
50296049 private MenuItem markleavesItem;
50306050 private MenuItem unmarkleavesItem;
6051
+ private MenuItem rewindleavesItem;
6052
+ private MenuItem unrewindleavesItem;
6053
+ private MenuItem randomleavesItem;
6054
+ private MenuItem unrandomleavesItem;
50316055
50326056 private MenuItem flipVItem;
50336057 private MenuItem unflipVItem;
....@@ -5039,15 +6063,17 @@
50396063 private MenuItem panoTexturesItem;
50406064
50416065 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
6066
+ private MenuItem resetCentroidXZItem;
50436067 private MenuItem resetTransformItem;
6068
+ private MenuItem transformGeometryItem;
6069
+ private MenuItem transformChildrenItem;
50446070 private MenuItem hideItem;
50456071 private MenuItem grabItem;
50466072 private MenuItem backItem;
50476073 private MenuItem frontItem;
50486074 private MenuItem cameraItem;
50496075 private MenuItem compositeItem;
5050
- private MenuItem randomItem;
6076
+ private MenuItem switchItem;
50516077 private MenuItem physicsItem;
50526078 private MenuItem frameselectorItem;
50536079 private MenuItem scriptNodeItem;
....@@ -5071,6 +6097,8 @@
50716097 private MenuItem attachBumpItem;
50726098 private MenuItem detachBumpItem;
50736099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
50746102
50756103 private MenuItem particleItem;
50766104 private MenuItem ragdollItem;
....@@ -5087,7 +6115,7 @@
50876115 private MenuItem blobItem;
50886116 private MenuItem latheItem;
50896117 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
6118
+ private MenuItem overlayItem;
50916119 private MenuItem meshItem;
50926120 // private MenuItem meshGroupItem;
50936121 private MenuItem springItem;
....@@ -5109,11 +6137,6 @@
51096137 private MenuItem doubleItem;
51106138 private MenuItem tripleItem;
51116139
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51176140 private MenuItem computeAOItem;
51186141 private MenuItem recompileItem;
51196142 private MenuItem editScriptItem;
....@@ -5123,4 +6146,8 @@
51236146 private MenuItem analyzeItem;
51246147 private MenuItem dumpItem;
51256148 //boolean freezemodel = false;
6149
+
6150
+ Menu cameraMenu;
6151
+ MenuItem editCameraItem;
6152
+ MenuItem restoreCameraItem;
51266153 }