Normand Briere
2019-07-28 d7fd07756f4095cb87dc25d89fcffcbda092e2cf
GroupEditor.java
....@@ -23,6 +23,237 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ //row.add(skyboxButton = GetButton(path + "/" + s + ".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("default", "uffizi", row0);
62
+ AddSkyboxButton("default", "CloudyHills", row0);
63
+
64
+ AddSkyboxButton("default", "skycube", row1);
65
+ AddSkyboxButton("bridge", "Bridge", row1);
66
+ AddSkyboxButton("bridge", "Bridge2", row1);
67
+ AddSkyboxButton("urban", "GamlaStan2", row1);
68
+
69
+ AddSkyboxButton("urban", "Parliament", row2);
70
+ AddSkyboxButton("urban", "Roundabout", row2);
71
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
73
+
74
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
75
+ AddSkyboxButton("urban", "UnionSquare", row3);
76
+ AddSkyboxButton("park", "BerzeliiPark", row3);
77
+ AddSkyboxButton("park", "Buddha", row3);
78
+
79
+ AddSkyboxButton("park", "CNTower2", row4);
80
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
81
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
82
+ AddSkyboxButton("park", "Park", row4);
83
+
84
+ AddSkyboxButton("park", "Pond", row5);
85
+ AddSkyboxButton("park", "Skansen", row5);
86
+ AddSkyboxButton("park", "Skansen2", row5);
87
+ AddSkyboxButton("park", "Skansen3", row5);
88
+
89
+ AddSkyboxButton("park", "Skansen4", row6);
90
+ AddSkyboxButton("park", "Skansen5", row6);
91
+ AddSkyboxButton("park", "Stairs", row6);
92
+ AddSkyboxButton("park", "Tantolunden4", row6);
93
+
94
+ tab0.add(row0);
95
+ tab0.add(row1);
96
+ tab0.add(row2);
97
+ tab0.add(row3);
98
+ tab0.add(row4);
99
+ tab0.add(row5);
100
+ tab0.add(row6);
101
+
102
+ for (int i=5; --i>=0;)
103
+ {
104
+ //oe.toolboxPanel.Return();
105
+ //tab0.add(new cGridBag());
106
+ }
107
+ }
108
+
109
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
110
+ {
111
+ cGridBag tab0 = new cGridBag().setVertical(true);
112
+
113
+ tab0.setName("Nature");
114
+ skyboxpanel.add(tab0);
115
+
116
+ cGridBag row0 = new cGridBag();
117
+ cGridBag row1 = new cGridBag();
118
+ cGridBag row2 = new cGridBag();
119
+ cGridBag row3 = new cGridBag();
120
+ cGridBag row4 = new cGridBag();
121
+ cGridBag row5 = new cGridBag();
122
+ cGridBag row6 = new cGridBag();
123
+
124
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
125
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
126
+ AddSkyboxButton("beach", "PalmTrees", row0);
127
+ AddSkyboxButton("beach", "Tenerife", row0);
128
+
129
+ AddSkyboxButton("beach", "Tenerife2", row1);
130
+ AddSkyboxButton("beach", "Tenerife3", row1);
131
+ AddSkyboxButton("field", "FishPond", row1);
132
+ AddSkyboxButton("field", "Footballfield", row1);
133
+
134
+ AddSkyboxButton("field", "Meadow", row2);
135
+ AddSkyboxButton("field", "Sorsele", row2);
136
+ AddSkyboxButton("field", "Sorsele2", row2);
137
+ AddSkyboxButton("field", "Sorsele3", row2);
138
+
139
+ AddSkyboxButton("forest", "Brudslojan", row3);
140
+ AddSkyboxButton("forest", "Langholmen2", row3);
141
+ AddSkyboxButton("forest", "Plants", row3);
142
+ AddSkyboxButton("mountain", "Maskonaive", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
146
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+
149
+ AddSkyboxButton("rocky", "Langholmen", row5);
150
+ AddSkyboxButton("rocky", "Riddarfjarden", row5);
151
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
152
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
153
+ /*
154
+Kastellholmen
155
+Langholmen
156
+Riddarfjarden
157
+Skinnarviksberget
158
+Tanto
159
+Tantolunden2
160
+Tantolunden6
161
+ */
162
+
163
+ tab0.add(row0);
164
+ tab0.add(row1);
165
+ tab0.add(row2);
166
+ tab0.add(row3);
167
+ tab0.add(row4);
168
+ tab0.add(row5);
169
+ tab0.add(row6);
170
+
171
+ for (int i=5; --i>=0;)
172
+ {
173
+ //oe.toolboxPanel.Return();
174
+ //tab0.add(new cGridBag());
175
+ }
176
+ }
177
+
178
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
179
+ {
180
+ cGridBag tab0 = new cGridBag().setVertical(true);
181
+
182
+ tab0.setName("Night");
183
+ skyboxpanel.add(tab0);
184
+
185
+ cGridBag row0 = new cGridBag();
186
+ cGridBag row1 = new cGridBag();
187
+ cGridBag row2 = new cGridBag();
188
+ cGridBag row3 = new cGridBag();
189
+ cGridBag row4 = new cGridBag();
190
+ cGridBag row5 = new cGridBag();
191
+ cGridBag row6 = new cGridBag();
192
+
193
+ AddSkyboxButton("night", "NightPath", row0);
194
+ AddSkyboxButton("night", "PondNight", row0);
195
+ AddSkyboxButton("night", "Powerlines", row0);
196
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
197
+
198
+ AddSkyboxButton("urban", "CNTower", row1);
199
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
200
+ AddSkyboxButton("indoors", "DallasW", row1);
201
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row1);
202
+
203
+ AddSkyboxButton("indoors", "Vasa", row2);
204
+ AddSkyboxButton("winter", "Backyard", row2);
205
+ AddSkyboxButton("winter", "Creek", row2);
206
+ AddSkyboxButton("winter", "FootballField3", row2);
207
+
208
+ AddSkyboxButton("winter", "Forest", row3);
209
+ AddSkyboxButton("winter", "HornstullsStrand2", row3);
210
+ AddSkyboxButton("winter", "House", row3);
211
+ AddSkyboxButton("winter", "IceLake", row3);
212
+
213
+ AddSkyboxButton("winter", "IceRiver", row4);
214
+ AddSkyboxButton("winter", "Park3", row4);
215
+ AddSkyboxButton("winter", "PondWinter", row4);
216
+
217
+ AddSkyboxButton("winter", "Tantolunden5", row5);
218
+ AddSkyboxButton("winter", "Vindelalven", row5);
219
+ /*
220
+Backyard
221
+Creek
222
+FootballField3
223
+Forest
224
+HornstullsStrand2
225
+House
226
+IceLake
227
+IceRiver
228
+Park3
229
+PondWinter
230
+Tantolunden5
231
+Vindelalven *
232
+ */
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void ChangeSkybox(String name)
250
+ {
251
+ cameraView.envyoff = false;
252
+ cameraView.skyboxname = name;
253
+ cameraView.skyboxext = "jpg";
254
+ cameraView.repaint();
255
+ }
256
+
26257 //ObjEditor objEditor;
27258 public void closeUI2()
28259 {
....@@ -60,6 +291,12 @@
60291 this.copy = this.group = group;
61292 //selectees = this.group.selectees;
62293
294
+ if (copy.versions == null)
295
+ {
296
+ copy.versions = new byte[100][];
297
+ copy.versionindex = -1;
298
+ }
299
+
63300 if(ui)
64301 SetupUI(objEditor);
65302 }
....@@ -80,10 +317,22 @@
80317 SetupViews(objEditor);
81318
82319 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
320
+
321
+ if (copy.versions == null)
322
+ {
323
+ copy.versions = new byte[100][];
324
+ copy.versionindex = -1;
325
+
326
+ Save(true);
327
+ }
83328 }
84329
85330 void CloneSelection(boolean supports)
86331 {
332
+ if (Globals.REPLACEONMAKE)
333
+ Save();
334
+ boolean keep = Globals.REPLACEONMAKE;
335
+ Globals.REPLACEONMAKE = false;
87336 // Object3D keep = GrafreeD.clipboard;
88337 //Object3D obj;
89338 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +343,7 @@
94343
95344 makeSomething(clone, i==group.selection.size()-1);
96345 }
346
+ Globals.REPLACEONMAKE = keep;
97347 }
98348
99349 void CloneClipboard(boolean supports)
....@@ -189,8 +439,8 @@
189439 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190440 // pasteExpandItem.addActionListener(this);
191441 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
442
+ deleteItem = menu.add(new MenuItem("Delete"));
443
+ deleteItem.addActionListener(this);
194444
195445 if (Globals.ADVANCED)
196446 {
....@@ -220,7 +470,7 @@
220470 // toggleSwitchItem.addItemListener(this);
221471 // toggleSwitchItem.setState(CameraPane.SWITCH);
222472
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
473
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224474 toggleHandleItem.addItemListener(this);
225475 toggleHandleItem.setState(CameraPane.HANDLES);
226476
....@@ -380,13 +630,14 @@
380630 shadowYItem.addActionListener(this);
381631 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382632 shadowZItem.addActionListener(this);
633
+ attributeItem = menu.add(new MenuItem("Attribute"));
634
+ attributeItem.addActionListener(this);
635
+
383636 if (Globals.ADVANCED)
384637 {
385638 menu.add("-");
386639 linkerItem = menu.add(new MenuItem("Linker"));
387640 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390641 templateItem = menu.add(new MenuItem("Template"));
391642 templateItem.addActionListener(this);
392643 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -415,7 +666,7 @@
415666 genNormalsMESHItem.addActionListener(this);
416667 if (Globals.ADVANCED)
417668 {
418
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
669
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
419670 genNormalsMINEItem.addActionListener(this);
420671 }
421672 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -508,10 +759,15 @@
508759 attachBumpItem.addActionListener(this);
509760 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
510761 pigmentBumpItem.addActionListener(this);
762
+ //embedTexturesItem
511763 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
512764 detachPigmentItem.addActionListener(this);
513765 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
514766 detachBumpItem.addActionListener(this);
767
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
768
+ embedTexturesItem.addActionListener(this);
769
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
770
+ deEmbedTexturesItem.addActionListener(this);
515771 menu.add("-");
516772 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
517773 sortbysizeItem.addActionListener(this);
....@@ -538,6 +794,7 @@
538794 buildToolsMenu(menu);
539795 }
540796
797
+
541798 void SetupUI2(ObjEditor oe)
542799 {
543800 // June 2019
....@@ -590,48 +847,66 @@
590847 //minButton.setToolTipText("Minimize window");
591848 //minButton.addActionListener(this);
592849
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
850
+ if (Globals.ADVANCED)
851
+ {
852
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
853
+ maxButton.setToolTipText("Maximize window");
854
+ maxButton.addActionListener(this);
855
+ }
596856
597857 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598858 fullButton.setToolTipText("Full-screen window");
599859 fullButton.addActionListener(this);
600860
861
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
862
+ screenfitButton.setToolTipText("Screen fit");
863
+ screenfitButton.addActionListener(this);
864
+
601865 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602866 restoreCameraButton.setToolTipText("Restore viewpoint");
603867 restoreCameraButton.addActionListener(this);
604868
869
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
870
+ saveButton.setToolTipText("New version");
871
+ saveButton.addActionListener(this);
872
+
605873 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
874
+ undoButton.setToolTipText("Previous version");
607875 undoButton.addActionListener(this);
876
+ undoButton.setEnabled(false);
877
+
878
+ cGridBag updown = new cGridBag().setVertical(true);
879
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
880
+ restoreButton.setToolTipText("Restore current");
881
+ restoreButton.addActionListener(this);
882
+ restoreButton.setEnabled(false);
883
+
884
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
885
+ replaceButton.setToolTipText("Replace current");
886
+ replaceButton.addActionListener(this);
887
+ replaceButton.setEnabled(false);
888
+
889
+ copyOptionsPanel.add(updown);
608890
609891 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
- redoButton.setToolTipText("Redo changes");
892
+ redoButton.setToolTipText("Next version");
611893 redoButton.addActionListener(this);
894
+ redoButton.setEnabled(false);
612895
613
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
- saveButton.setToolTipText("Save changes");
615
- saveButton.addActionListener(this);
616
-
617
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
896
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618897 liveCB.setToolTipText("Enable animation");
619898 liveCB.addItemListener(this);
620899
621
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
900
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622901 oneStepButton.setToolTipText("Animate one step forward");
623902 oneStepButton.addActionListener(this);
624903
625
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
904
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626905 fastCB.setToolTipText("Fast mode");
627906 fastCB.addItemListener(this);
628907
629908 //oe.toolboxPanel.Return();
630909
631
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
- screenfitButton.setToolTipText("Screen fit");
633
- screenfitButton.addActionListener(this);
634
-
635910 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636911 // trackCB.setToolTipText("Enable tracking");
637912 // trackCB.addItemListener(this);
....@@ -644,31 +919,32 @@
644919 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645920 snapobjectButton.addActionListener(this);
646921 snapobjectButton.setToolTipText("Snap Object");
922
+
923
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
924
+ fourButton.addActionListener(this);
925
+ fourButton.setToolTipText("Show control panel only");
647926 }
648927
649928 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
650929
651
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- twoButton.setToolTipText("Show center view only");
930
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ twoButton.setToolTipText("Show 3D view only");
653932 twoButton.addActionListener(this);
654933 this.fullscreenLayout = twoButton;
655934
656
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
- fourButton.addActionListener(this);
658
- fourButton.setToolTipText("Show left panel only");
659
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
- sixButton.setToolTipText("2-column layout left");
661
- sixButton.addActionListener(this);
662
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
663
- threeButton.setToolTipText("2-column layout right");
935
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ threeButton.setToolTipText("Show controls and 3D view");
664937 threeButton.addActionListener(this);
665
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
- sevenButton.setToolTipText("3-column layout");
667
- sevenButton.addActionListener(this);
938
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ sixButton.setToolTipText("Show 3D view and controls");
940
+ sixButton.addActionListener(this);
941
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+// sevenButton.setToolTipText("3-column layout");
943
+// sevenButton.addActionListener(this);
668944 //
669945
670
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- rootButton.setToolTipText("Edit selection in new tab");
946
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
947
+ rootButton.setToolTipText("Open selection in new tab");
672948 rootButton.addActionListener(this);
673949
674950 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -677,28 +953,30 @@
677953 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
678954 //clearButton.addActionListener(this);
679955
956
+ cGridBag row1 = new cGridBag();
957
+
680958 // INSERT
681
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
959
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682960 gridButton.setToolTipText("Create grid");
683961 gridButton.addActionListener(this);
684962
685
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
963
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686964 boxButton.setToolTipText("Create box");
687965 boxButton.addActionListener(this);
688966
689
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690968 sphereButton.setToolTipText("Create sphere");
691969 sphereButton.addActionListener(this);
692970
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
971
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694972 coneButton.setToolTipText("Create cone");
695973 coneButton.addActionListener(this);
696974
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
975
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698976 torusButton.setToolTipText("Create torus");
699977 torusButton.addActionListener(this);
700978
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
979
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702980 superButton.setToolTipText("Create superellipsoid");
703981 superButton.addActionListener(this);
704982
....@@ -709,51 +987,68 @@
709987 kleinButton.addActionListener(this);
710988 }
711989
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
990
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713991 particlesButton.setToolTipText("Create particle system");
714992 particlesButton.addActionListener(this);
715993
716
- oe.toolboxPanel.Return();
994
+ oe.toolboxPanel.add(row1);
717995
718
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ cGridBag row2 = new cGridBag();
997
+
998
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719999 groupButton.setToolTipText("Create group");
7201000 groupButton.addActionListener(this);
7211001
722
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1002
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7231003 compositeButton.setToolTipText("Create composite");
7241004 compositeButton.addActionListener(this);
7251005
726
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
- switchButton.setToolTipText("Create switch");
1006
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ switchButton.setToolTipText("Create item switcher");
7281008 switchButton.addActionListener(this);
7291009
730
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1010
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7311011 loopButton.setToolTipText("Create loop");
7321012 loopButton.addActionListener(this);
7331013
734
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1014
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7351015 textureButton.setToolTipText("Create texture");
7361016 textureButton.addActionListener(this);
7371017
738
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7391019 overlayButton.setToolTipText("Create overlay");
7401020 overlayButton.addActionListener(this);
7411021
742
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1022
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7431023 lightButton.setToolTipText("Create light");
7441024 lightButton.addActionListener(this);
7451025
1026
+ oe.toolboxPanel.add(row2);
1027
+
1028
+ // ENVYMAPS
1029
+ cGridBag skyboxpane = new cGridBag();
1030
+ skyboxpane.preferredHeight = 100;
1031
+
1032
+ oe.toolboxPanel.add(skyboxpane);
1033
+
1034
+ JTabbedPane skyboxpanel = new JTabbedPane();
1035
+ skyboxpane.add(skyboxpanel);
1036
+
1037
+ AddSkyboxTab0(skyboxpanel);
1038
+ AddSkyboxTab1(skyboxpanel);
1039
+ AddSkyboxTab2(skyboxpanel);
1040
+
7461041 // EDIT panel
747
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
- editButton.setToolTipText("Edit selection");
1042
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1043
+ editButton.setToolTipText("Pin selection controls");
7491044 editButton.addActionListener(this);
7501045
751
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
- uneditButton.setToolTipText("Unedit selection");
1046
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ uneditButton.setToolTipText("Remove selection controls");
7531048 uneditButton.addActionListener(this);
7541049
7551050 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
- allParamsButton.setToolTipText("Edit all params");
1051
+ allParamsButton.setToolTipText("Show all controle");
7571052 allParamsButton.addActionListener(this);
7581053
7591054 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -770,6 +1065,7 @@
7701065
7711066 editCommandsPanel.preferredHeight = 1;
7721067
1068
+ SetPinStates(false);
7731069 // oe.treePanel.add(commandsPanel);
7741070 // oe.treePanel.Return();
7751071
....@@ -796,9 +1092,12 @@
7961092
7971093 oe.treePanel.add(copyOptionsPanel);
7981094 oe.treePanel.Return();
1095
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1096
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1097
+ sliderPane.preferredHeight = 1;
7991098
800
-// mainPanel.setDividerLocation(0.5); //1.0);
801
-// mainPanel.setResizeWeight(0.5);
1099
+// mainPanel.setDividerLocation(0.1); //1.0);
1100
+ mainPanel.setResizeWeight(0.4);
8021101
8031102 //jList.addListSelectionListener(this);
8041103 oe.jTree.addTreeSelectionListener(this);
....@@ -806,7 +1105,7 @@
8061105 //jTree.setEditable(true);
8071106 oe.jTree.setDragEnabled(true);
8081107 //jTree.setPreferredSize(new Dimension(10,10));
809
- jSP.setPreferredSize(new Dimension(100,200));
1108
+ //jSP.setPreferredSize(new Dimension(100,200));
8101109
8111110 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8121111
....@@ -818,7 +1117,7 @@
8181117 dgr.addDragGestureListener(this);
8191118 }catch(Exception e) {}
8201119 */
821
- radio.layout = sevenButton;
1120
+ radio.layout = sixButton; // sevenButton;
8221121 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8231122 }
8241123
....@@ -843,14 +1142,18 @@
8431142 boxCB.addItemListener(this);
8441143
8451144 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1145
+ zoomBoxCB.setToolTipText("Display only for wheel");
8471146 zoomBoxCB.addItemListener(this);
8481147
8491148 if (true) // Globals.ADVANCED)
8501149 {
851
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
- supportCB.setToolTipText("Enable rigging");
853
- supportCB.addItemListener(this);
1150
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1151
+// supportCB.setToolTipText("Enable rigging");
1152
+// supportCB.addItemListener(this);
1153
+
1154
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1155
+ freezeCB.setToolTipText("Fast moving camera");
1156
+ freezeCB.addItemListener(this);
8541157
8551158 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8561159 // localCB.addItemListener(this);
....@@ -905,7 +1208,7 @@
9051208 oeilCB.addItemListener(this);
9061209
9071210 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
- shadowCB.setToolTipText("Compute shadows when live");
1211
+ shadowCB.setToolTipText("When live compute shadows");
9091212 shadowCB.addItemListener(this);
9101213
9111214 panel.Return();
....@@ -914,12 +1217,12 @@
9141217 toggleTextureCB.addItemListener(this);
9151218
9161219 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
- toggleSwitchCB.setToolTipText("Use switch");
1220
+ toggleSwitchCB.setToolTipText("Choose a single item");
9181221 toggleSwitchCB.addItemListener(this);
9191222
920
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
- autosaveCB.setToolTipText("Auto-save on structure change");
922
- autosaveCB.addItemListener(this);
1223
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1224
+ autokeepCB.setToolTipText("On structure change");
1225
+ autokeepCB.addItemListener(this);
9231226
9241227 panel.Return();
9251228 if (Globals.ADVANCED)
....@@ -948,7 +1251,7 @@
9481251 {
9491252 cRadio radioButton = new cRadio(obj.name);
9501253
951
- // Patch to avoid bug with transparency.
1254
+ // June 2019. Patch to avoid bug with transparency.
9521255 radioButton.hadMaterial = obj.material != null;
9531256 if (!radioButton.hadMaterial)
9541257 {
....@@ -956,7 +1259,7 @@
9561259 }
9571260
9581261 radioButton.SetObject(obj);
959
- radioButton.layout = sevenButton;
1262
+ radioButton.layout = sixButton; // sevenButton;
9601263 radioButton.SetCamera(cameraView.renderCamera, false);
9611264 radioButton.addActionListener(this);
9621265 radioPanel.add(radioButton);
....@@ -985,6 +1288,7 @@
9851288 cCheckBox slowCB;
9861289 cCheckBox boxCB;
9871290 cCheckBox zoomBoxCB;
1291
+ cCheckBox freezeCB;
9881292 //cToggleButton trackCB;
9891293 cCheckBox trackCB;
9901294 cCheckBox smoothfocusCB;
....@@ -995,7 +1299,7 @@
9951299
9961300 cCheckBox oeilCB;
9971301 cCheckBox shadowCB;
998
- cCheckBox autosaveCB;
1302
+ cCheckBox autokeepCB;
9991303 cCheckBox lookAtCB;
10001304
10011305 // static int COLOR = 1;
....@@ -1103,9 +1407,13 @@
11031407 {
11041408 Globals.COMPUTESHADOWWHENLIVE ^= true;
11051409 }
1106
- else if(e.getSource() == autosaveCB)
1410
+ else if(e.getSource() == freezeCB)
11071411 {
1108
- Globals.SAVEONMAKE ^= true;
1412
+ Globals.FREEZEONMOVE ^= true;
1413
+ }
1414
+ else if(e.getSource() == autokeepCB)
1415
+ {
1416
+ Globals.REPLACEONMAKE ^= true;
11091417 }
11101418 else if(e.getSource() == lookAtCB)
11111419 {
....@@ -1187,8 +1495,6 @@
11871495 }
11881496 }
11891497
1190
- String string = (String) object;
1191
-
11921498 System.out.println("Transfer = " + object + "; drop : " + target);
11931499 // if( object instanceof java.io.File[])
11941500 // {
....@@ -1196,6 +1502,8 @@
11961502 // objEditor.DropFile((java.io.File[]) object, true);
11971503 // return;
11981504 // }
1505
+
1506
+ String string = object.toString();
11991507
12001508 // File path for Mac and Windows
12011509 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1445,6 +1753,9 @@
14451753 animationItem.addItemListener(this);
14461754 animationItem.setState(Globals.ANIMATION);
14471755
1756
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1757
+ archiveItem.addActionListener(this);
1758
+
14481759 menu.add("-");
14491760 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14501761 parseverticesItem.addActionListener(this);
....@@ -1457,6 +1768,8 @@
14571768 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14581769 reduce34MorphItem.addActionListener(this);
14591770 menu.add("-");
1771
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1772
+ memoryItem.addActionListener(this);
14601773 menu.add(computeAOItem = new MenuItem("Compute AO"));
14611774 computeAOItem.addActionListener(this);
14621775
....@@ -1465,8 +1778,6 @@
14651778 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14661779 mirrorItem.addActionListener(this);
14671780 menu.add("-");
1468
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1469
- memoryItem.addActionListener(this);
14701781 menu.add(analyzeItem = new MenuItem("Analyze"));
14711782 analyzeItem.addActionListener(this);
14721783 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1614,6 +1925,30 @@
16141925
16151926 makeSomething(shadow);
16161927 }
1928
+
1929
+ private void ClearUnpinned()
1930
+ {
1931
+ //for (Object3D obj : listUI)
1932
+ for (int i=listUI.size(); --i>=0;)
1933
+ {
1934
+ Object3D obj = listUI.elementAt(i);
1935
+ if (!obj.pinned)
1936
+ {
1937
+ obj.CloseUI();
1938
+ listUI.remove(i);
1939
+ }
1940
+ }
1941
+ }
1942
+
1943
+ private void EditElement(Object3D elem, boolean newWindow)
1944
+ {
1945
+ // if (!(elem instanceof Composite))
1946
+ // newWindow = false;
1947
+ listUI.add(elem);
1948
+ elem.openEditWindow(this, newWindow); //, false);
1949
+ System.out.println("edit : " + elem);
1950
+ elem.editWindow.refreshContents(true); // ? new
1951
+ }
16171952
16181953 /**
16191954 * applyExample
....@@ -2042,6 +2377,23 @@
20422377 {
20432378 makeSomething(new Light());
20442379 } else
2380
+// if (source == skybox1Button ||
2381
+// source == skybox2Button ||
2382
+// source == skybox3Button ||
2383
+// source == skybox4Button ||
2384
+// source == skybox5Button ||
2385
+// source == skybox6Button ||
2386
+// source == skybox7Button ||
2387
+// source == skybox11Button ||
2388
+// source == skybox12Button ||
2389
+// source == skybox13Button ||
2390
+// source == skybox14Button ||
2391
+// source == skybox15Button ||
2392
+// source == skybox16Button ||
2393
+// source == skybox17Button)
2394
+// {
2395
+// ChangeSkybox(source);
2396
+// } else
20452397 if (source == csgItem)
20462398 {
20472399 group(new CSG());
....@@ -2093,25 +2445,25 @@
20932445 Composite csg = new GroupLeaf();
20942446 csg.count = 5;
20952447 group(csg);
2096
- Composite child = new cGroup();
2448
+ Composite child = new cGroup("Branch");
20972449 csg.addChild(child);
20982450 child.addChild(csg);
20992451 } else
21002452 if (source == doubleItem)
21012453 {
2102
- Composite csg = new GroupLeaf();
2454
+ Composite csg = new GroupLeaf("Fork");
21032455 csg.count = 5;
21042456 group(csg);
2105
- Composite child = new cGroup();
2457
+ Composite child = new cGroup("Branch A");
21062458 csg.addChild(child);
21072459 child.addChild(csg);
2108
- child = new cGroup();
2460
+ child = new cGroup("Branch B");
21092461 csg.addChild(child);
21102462 child.addChild(csg);
21112463 } else
21122464 if (source == tripleItem)
21132465 {
2114
- Composite csg = new GroupLeaf();
2466
+ Composite csg = new GroupLeaf("Trident");
21152467 csg.count = 4;
21162468 group(csg);
21172469 Composite child = new cGroup();
....@@ -2127,7 +2479,7 @@
21272479 if (source == computeAOItem)
21282480 {
21292481 Globals.drawMode = CameraPane.OCCLUSION;
2130
- Globals.theRenderer.repaint();
2482
+ cameraView.repaint();
21312483 } else
21322484 if (source == recompileItem)
21332485 {
....@@ -2175,15 +2527,31 @@
21752527 } else
21762528 if (source == undoButton)
21772529 {
2530
+ // Go to previous version
2531
+ //if (!Undo())
2532
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21782533 Undo();
2534
+ } else
2535
+ if (source == restoreButton)
2536
+ {
2537
+ // Restore current version
2538
+ Restore();
2539
+ } else
2540
+ if (source == replaceButton)
2541
+ {
2542
+ // Overwrite current version
2543
+ Replace();
21792544 } else
21802545 if (source == redoButton)
21812546 {
2547
+ // Go to next version
21822548 Redo();
21832549 } else
21842550 if (source == saveButton)
21852551 {
2186
- Save();
2552
+ // Save a new version
2553
+ if (!Save(true))
2554
+ java.awt.Toolkit.getDefaultToolkit().beep();
21872555 } else
21882556 if (source == oneStepButton)
21892557 {
....@@ -2192,17 +2560,14 @@
21922560 } else
21932561 if (source == screenfitButton)
21942562 {
2195
- //Reload(lastConverter, lastFilename, true);
21962563 ScreenFit();
21972564 } else
21982565 if (source == screenfitpointButton)
21992566 {
2200
- //Reload(lastConverter, lastFilename, true);
22012567 ScreenFitPoint();
22022568 } else
22032569 if (source == snapobjectButton)
22042570 {
2205
- //Reload(lastConverter, lastFilename, true);
22062571 SnapObject();
22072572 } else
22082573 // if (event.getSource() == recompileButton)
....@@ -2566,7 +2931,7 @@
25662931 {
25672932 StepAll();
25682933 } else
2569
- if (source == clearItem) // || event.getSource() == clearButton)
2934
+ if (source == deleteItem) // || event.getSource() == clearButton)
25702935 {
25712936 //int indices[] = jList.getSelectedIndices();
25722937 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2726,15 +3091,28 @@
27263091 } else
27273092 if (source == ungroupItem || source == ungroupButton)
27283093 {
2729
- //ungroup();
3094
+ boolean hasRoot = false;
3095
+
27303096 for (int i=0; i<group.selection.size(); i++)
27313097 {
2732
- Ungroup(group.selection.get(i));
3098
+ if (group.selection.get(i) == group)
3099
+ {
3100
+ hasRoot = true;
3101
+ break;
3102
+ }
27333103 }
27343104
2735
- ClearSelection(false);
2736
-
2737
- refreshContents();
3105
+ if (!hasRoot)
3106
+ {
3107
+ for (int i=0; i<group.selection.size(); i++)
3108
+ {
3109
+ Ungroup(group.selection.get(i));
3110
+ }
3111
+
3112
+ ClearSelection(false);
3113
+
3114
+ refreshContents();
3115
+ }
27383116 } else
27393117 if (source == genUVItem)
27403118 {
....@@ -3035,7 +3413,7 @@
30353413 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30363414 {
30373415 obj = (Object3D)e.nextElement();
3038
- obj.SetBumpTexture(null);
3416
+ obj.ResetBumpTexture();
30393417 }
30403418
30413419 refreshContents();
....@@ -3049,6 +3427,31 @@
30493427 obj.SetBumpTexture(obj.GetPigmentTexture());
30503428 }
30513429
3430
+ refreshContents();
3431
+ } else
3432
+ if (source == embedTexturesItem)
3433
+ {
3434
+ Object3D obj;
3435
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3436
+ {
3437
+ obj = (Object3D)e.nextElement();
3438
+ obj.EmbedTextures(true);
3439
+ }
3440
+
3441
+ refreshContents();
3442
+ } else
3443
+ if (source == deEmbedTexturesItem)
3444
+ {
3445
+ Object3D obj;
3446
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3447
+ {
3448
+ obj = (Object3D)e.nextElement();
3449
+ obj.EmbedTextures(false);
3450
+ }
3451
+
3452
+ CameraPane.texturepigment.clear();
3453
+ CameraPane.texturebump.clear();
3454
+
30523455 refreshContents();
30533456 } else
30543457 if (source == flashSelectionButton)
....@@ -3152,8 +3555,8 @@
31523555 // centralPanel.setVisible(true);
31533556 // XYZPanel.setVisible(true);
31543557 bigThree.ClearUI();
3558
+ bigThree.add(scenePanel);
31553559 bigThree.add(centralPanel);
3156
- bigThree.add(XYZPanel);
31573560 bigThree.FlushUI();
31583561
31593562 cameraView.requestFocusInWindow();
....@@ -3233,8 +3636,8 @@
32333636 // centralPanel.setVisible(true);
32343637 // XYZPanel.setVisible(false);
32353638 bigThree.ClearUI();
3236
- bigThree.add(scenePanel);
32373639 bigThree.add(centralPanel);
3640
+ bigThree.add(scenePanel);
32383641 bigThree.FlushUI();
32393642
32403643 cameraView.requestFocusInWindow();
....@@ -3326,6 +3729,12 @@
33263729 } else
33273730 if (source == editItem || source == editButton)
33283731 {
3732
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3733
+ {
3734
+ Object3D child = (Object3D)e.nextElement();
3735
+ child.pinned = true;
3736
+ }
3737
+
33293738 EditSelection(false);
33303739 } else
33313740 if (source == uneditButton)
....@@ -3335,6 +3744,7 @@
33353744 Object3D child = (Object3D)e.nextElement();
33363745 if(child.editWindow != null)
33373746 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3747
+ child.pinned = false;
33383748 child.CloseUI();
33393749 listUI.remove(child);
33403750
....@@ -3351,6 +3761,7 @@
33513761 //copy.ClearUI();
33523762 for (Object3D obj : listUI)
33533763 {
3764
+ obj.pinned = false;
33543765 obj.CloseUI();
33553766 }
33563767 listUI.clear();
....@@ -3360,7 +3771,7 @@
33603771 {
33613772 assert(copy == group);
33623773
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3774
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643775
33653776 for (Object3D obj : listUI)
33663777 {
....@@ -3409,6 +3820,9 @@
34093820 }
34103821
34113822 copy = group;
3823
+
3824
+ SetUndoStates();
3825
+
34123826 //Globals.theRenderer.object = group;
34133827 if(!useclient)
34143828 {
....@@ -3435,6 +3849,13 @@
34353849 currentLayout = sevenButton;
34363850 */
34373851 radio.layout.doClick();
3852
+
3853
+ ClearUnpinned();
3854
+ //Grafreed.Assert(group != null);
3855
+ //Grafreed.Assert(group.selection != null);
3856
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3857
+ if (group.selection == null || group.selection.size() == 1)
3858
+ EditSelection(false);
34383859 keepparent = group.parent;
34393860 // PARENT = NULL or not???
34403861 //group.parent = null; // ROOT
....@@ -4027,7 +4448,7 @@
40274448
40284449 try
40294450 {
4030
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4451
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
40314452 }
40324453 catch (Exception e)
40334454 {
....@@ -4502,12 +4923,14 @@
45024923 // }
45034924 // }
45044925
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45094926 void EditSelection(boolean newWindow)
45104927 {
4928
+ if (group.selection == null)
4929
+ {
4930
+ EditElement(group, newWindow); // ? new
4931
+ return;
4932
+ }
4933
+
45114934 // aConstraints.gridy = 0;
45124935 for (int i=0; i<group.selection.size(); i++)
45134936 {
....@@ -4518,12 +4941,7 @@
45184941 Object3D elem = (Object3D)group.selection.elementAt(i);
45194942 if(elem != group || !newWindow)
45204943 {
4521
- // if (!(elem instanceof Composite))
4522
- // newWindow = false;
4523
- listUI.add(elem);
4524
- elem.openEditWindow(this, newWindow); //, false);
4525
- System.out.println("edit : " + elem);
4526
- elem.editWindow.refreshContents(true); // ? new
4944
+ EditElement(elem, newWindow); // ? new
45274945 }
45284946 }
45294947 }
....@@ -4598,7 +5016,8 @@
45985016 //new Exception().printStackTrace();
45995017
46005018 freezemodel = true;
4601
-
5019
+ ClearUnpinned();
5020
+
46025021 /**/
46035022 //switch (event.id)
46045023 {
....@@ -4631,7 +5050,7 @@
46315050 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46325051 // a camera
46335052 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5053
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46355054 {
46365055 CameraPane.camerachangeframe = 0; // don't refuse it
46375056 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +5059,13 @@
46405059 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46415060 }
46425061
5062
+ if (tps != null && tps.length == 1)
5063
+ {
5064
+ EditSelection(false);
5065
+ }
5066
+
5067
+ SetPinStates(tps != null && tps.length > 0);
5068
+
46435069 refreshContents();
46445070 //return true;
46455071 }
....@@ -4649,10 +5075,18 @@
46495075 freezemodel = false;
46505076 }
46515077
5078
+ void SetPinStates(boolean enabled)
5079
+ {
5080
+ editButton.setEnabled(enabled);
5081
+ uneditButton.setEnabled(enabled);
5082
+ unselectButton.setEnabled(enabled);
5083
+ flashSelectionButton.setEnabled(enabled);
5084
+ }
5085
+
46525086 void refreshContents(boolean cp)
46535087 {
4654
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
5088
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5089
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46565090 {
46575091 objEditor.ClearInfo(); // .GetMaterial());
46585092
....@@ -4751,8 +5185,8 @@
47515185
47525186 if (cut)
47535187 {
4754
- if (Globals.SAVEONMAKE)
4755
- Save();
5188
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5189
+// Save();
47565190 //int indices[] = jList.getSelectedIndices();
47575191 //for (int i = indices.length - 1; i >= 0; i--)
47585192 //jList.remove(indices[i]);
....@@ -4855,6 +5289,10 @@
48555289
48565290 void paste(boolean expand)
48575291 {
5292
+ if (Globals.REPLACEONMAKE)
5293
+ Save();
5294
+ boolean keep = Globals.REPLACEONMAKE;
5295
+ Globals.REPLACEONMAKE = false;
48585296 // if (GrafreeD.clipboard == null)
48595297 // return;
48605298 boolean first = true;
....@@ -4914,6 +5352,7 @@
49145352 Grafreed.clipboard.get(0).parent = keepparent;
49155353 }
49165354
5355
+ Globals.REPLACEONMAKE = keep;
49175356 ResetModel();
49185357 refreshContents();
49195358 }
....@@ -5049,6 +5488,10 @@
50495488
50505489 void group(Object3D csg, boolean grab)
50515490 {
5491
+ if (Globals.REPLACEONMAKE)
5492
+ Save();
5493
+ boolean keep = Globals.REPLACEONMAKE;
5494
+ Globals.REPLACEONMAKE = false;
50525495 if (//false) // why??
50535496 !group.selection.isEmpty())
50545497 {
....@@ -5162,10 +5605,15 @@
51625605 //node.add(csg);
51635606 //makeSomething(node);
51645607 makeSomething(csg);
5608
+ Globals.REPLACEONMAKE = keep;
51655609 }
51665610
51675611 void Ungroup(Object3D g)
51685612 {
5613
+ if (Globals.REPLACEONMAKE)
5614
+ Save();
5615
+ boolean keep = Globals.REPLACEONMAKE;
5616
+ Globals.REPLACEONMAKE = false;
51695617 if (g instanceof HiddenObject)
51705618 {
51715619 HiddenObject h = (HiddenObject) g;
....@@ -5182,6 +5630,7 @@
51825630 objEditor.makeSomething(g.get(i), false);
51835631 }
51845632 }
5633
+ Globals.REPLACEONMAKE = keep;
51855634 }
51865635
51875636 void ungroup()
....@@ -5472,11 +5921,6 @@
54725921
54735922 cButton restoreCameraButton;
54745923
5475
- cButton minButton;
5476
- cButton maxButton;
5477
- cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54805924 cButton saveButton;
54815925 cButton oneStepButton;
54825926
....@@ -5486,6 +5930,22 @@
54865930 cButton switchButton;
54875931 cButton loopButton;
54885932 cButton textureButton;
5933
+
5934
+ cButton skybox1Button;
5935
+ cButton skybox2Button;
5936
+ cButton skybox3Button;
5937
+ cButton skybox4Button;
5938
+ cButton skybox5Button;
5939
+ cButton skybox6Button;
5940
+ cButton skybox7Button;
5941
+
5942
+ cButton skybox11Button;
5943
+ cButton skybox12Button;
5944
+ cButton skybox13Button;
5945
+ cButton skybox14Button;
5946
+ cButton skybox15Button;
5947
+ cButton skybox16Button;
5948
+ cButton skybox17Button;
54895949
54905950 cButton gridButton;
54915951 cButton boxButton;
....@@ -5550,7 +6010,7 @@
55506010 private MenuItem pasteLinkItem;
55516011 private MenuItem pasteCloneItem;
55526012 private MenuItem pasteExpandItem;
5553
- private MenuItem clearItem;
6013
+ private MenuItem deleteItem;
55546014 private MenuItem clearAllItem;
55556015 private MenuItem genUVItem;
55566016 private MenuItem genNormalsMESHItem;
....@@ -5634,6 +6094,8 @@
56346094 private MenuItem attachBumpItem;
56356095 private MenuItem detachBumpItem;
56366096 private MenuItem pigmentBumpItem;
6097
+ private MenuItem embedTexturesItem;
6098
+ private MenuItem deEmbedTexturesItem;
56376099
56386100 private MenuItem particleItem;
56396101 private MenuItem ragdollItem;