Normand Briere
2019-07-30 475f8cbdbd96fdbf8f5b216ffebb31a51f25c2f9
GroupEditor.java
....@@ -23,6 +23,240 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("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
+
26260 //ObjEditor objEditor;
27261 public void closeUI2()
28262 {
....@@ -60,6 +294,12 @@
60294 this.copy = this.group = group;
61295 //selectees = this.group.selectees;
62296
297
+ if (copy.versions == null)
298
+ {
299
+ copy.versions = new byte[100][];
300
+ copy.versionindex = -1;
301
+ }
302
+
63303 if(ui)
64304 SetupUI(objEditor);
65305 }
....@@ -80,10 +320,22 @@
80320 SetupViews(objEditor);
81321
82322 ((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
+ }
83331 }
84332
85333 void CloneSelection(boolean supports)
86334 {
335
+ if (Globals.REPLACEONMAKE)
336
+ Save();
337
+ boolean keep = Globals.REPLACEONMAKE;
338
+ Globals.REPLACEONMAKE = false;
87339 // Object3D keep = GrafreeD.clipboard;
88340 //Object3D obj;
89341 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +346,7 @@
94346
95347 makeSomething(clone, i==group.selection.size()-1);
96348 }
349
+ Globals.REPLACEONMAKE = keep;
97350 }
98351
99352 void CloneClipboard(boolean supports)
....@@ -189,8 +442,8 @@
189442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190443 // pasteExpandItem.addActionListener(this);
191444 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
194447
195448 if (Globals.ADVANCED)
196449 {
....@@ -220,7 +473,7 @@
220473 // toggleSwitchItem.addItemListener(this);
221474 // toggleSwitchItem.setState(CameraPane.SWITCH);
222475
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
476
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224477 toggleHandleItem.addItemListener(this);
225478 toggleHandleItem.setState(CameraPane.HANDLES);
226479
....@@ -380,13 +633,14 @@
380633 shadowYItem.addActionListener(this);
381634 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382635 shadowZItem.addActionListener(this);
636
+ attributeItem = menu.add(new MenuItem("Attribute"));
637
+ attributeItem.addActionListener(this);
638
+
383639 if (Globals.ADVANCED)
384640 {
385641 menu.add("-");
386642 linkerItem = menu.add(new MenuItem("Linker"));
387643 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390644 templateItem = menu.add(new MenuItem("Template"));
391645 templateItem.addActionListener(this);
392646 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -415,7 +669,7 @@
415669 genNormalsMESHItem.addActionListener(this);
416670 if (Globals.ADVANCED)
417671 {
418
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
419673 genNormalsMINEItem.addActionListener(this);
420674 }
421675 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -508,10 +762,15 @@
508762 attachBumpItem.addActionListener(this);
509763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
510764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
511766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
512767 detachPigmentItem.addActionListener(this);
513768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
514769 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);
515774 menu.add("-");
516775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
517776 sortbysizeItem.addActionListener(this);
....@@ -538,6 +797,7 @@
538797 buildToolsMenu(menu);
539798 }
540799
800
+
541801 void SetupUI2(ObjEditor oe)
542802 {
543803 // June 2019
....@@ -590,48 +850,66 @@
590850 //minButton.setToolTipText("Minimize window");
591851 //minButton.addActionListener(this);
592852
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
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
+ }
596859
597860 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598861 fullButton.setToolTipText("Full-screen window");
599862 fullButton.addActionListener(this);
600863
864
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
865
+ screenfitButton.setToolTipText("Screen fit");
866
+ screenfitButton.addActionListener(this);
867
+
601868 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602869 restoreCameraButton.setToolTipText("Restore viewpoint");
603870 restoreCameraButton.addActionListener(this);
604871
872
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
+ saveButton.setToolTipText("New version");
874
+ saveButton.addActionListener(this);
875
+
605876 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
877
+ undoButton.setToolTipText("Previous version");
607878 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);
608893
609894 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
- redoButton.setToolTipText("Redo changes");
895
+ redoButton.setToolTipText("Next version");
611896 redoButton.addActionListener(this);
897
+ redoButton.setEnabled(false);
612898
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);
899
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618900 liveCB.setToolTipText("Enable animation");
619901 liveCB.addItemListener(this);
620902
621
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
903
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622904 oneStepButton.setToolTipText("Animate one step forward");
623905 oneStepButton.addActionListener(this);
624906
625
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
907
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626908 fastCB.setToolTipText("Fast mode");
627909 fastCB.addItemListener(this);
628910
629911 //oe.toolboxPanel.Return();
630912
631
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
- screenfitButton.setToolTipText("Screen fit");
633
- screenfitButton.addActionListener(this);
634
-
635913 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636914 // trackCB.setToolTipText("Enable tracking");
637915 // trackCB.addItemListener(this);
....@@ -644,31 +922,32 @@
644922 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645923 snapobjectButton.addActionListener(this);
646924 snapobjectButton.setToolTipText("Snap Object");
925
+
926
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ fourButton.addActionListener(this);
928
+ fourButton.setToolTipText("Show control panel only");
647929 }
648930
649931 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
650932
651
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- twoButton.setToolTipText("Show center view only");
933
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
+ twoButton.setToolTipText("Show 3D view only");
653935 twoButton.addActionListener(this);
654936 this.fullscreenLayout = twoButton;
655937
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");
938
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ threeButton.setToolTipText("Show controls and 3D view");
664940 threeButton.addActionListener(this);
665
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
- sevenButton.setToolTipText("3-column layout");
667
- 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);
668947 //
669948
670
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- rootButton.setToolTipText("Edit selection in new tab");
949
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ rootButton.setToolTipText("Open selection in new tab");
672951 rootButton.addActionListener(this);
673952
674953 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -677,28 +956,30 @@
677956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
678957 //clearButton.addActionListener(this);
679958
959
+ cGridBag row1 = new cGridBag();
960
+
680961 // INSERT
681
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
962
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682963 gridButton.setToolTipText("Create grid");
683964 gridButton.addActionListener(this);
684965
685
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686967 boxButton.setToolTipText("Create box");
687968 boxButton.addActionListener(this);
688969
689
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
970
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690971 sphereButton.setToolTipText("Create sphere");
691972 sphereButton.addActionListener(this);
692973
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
974
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694975 coneButton.setToolTipText("Create cone");
695976 coneButton.addActionListener(this);
696977
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
978
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698979 torusButton.setToolTipText("Create torus");
699980 torusButton.addActionListener(this);
700981
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
982
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702983 superButton.setToolTipText("Create superellipsoid");
703984 superButton.addActionListener(this);
704985
....@@ -709,51 +990,68 @@
709990 kleinButton.addActionListener(this);
710991 }
711992
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
993
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713994 particlesButton.setToolTipText("Create particle system");
714995 particlesButton.addActionListener(this);
715996
716
- oe.toolboxPanel.Return();
997
+ oe.toolboxPanel.add(row1);
717998
718
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
999
+ cGridBag row2 = new cGridBag();
1000
+
1001
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7191002 groupButton.setToolTipText("Create group");
7201003 groupButton.addActionListener(this);
7211004
722
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1005
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7231006 compositeButton.setToolTipText("Create composite");
7241007 compositeButton.addActionListener(this);
7251008
726
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
- switchButton.setToolTipText("Create switch");
1009
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1010
+ switchButton.setToolTipText("Create item switcher");
7281011 switchButton.addActionListener(this);
7291012
730
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7311014 loopButton.setToolTipText("Create loop");
7321015 loopButton.addActionListener(this);
7331016
734
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1017
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7351018 textureButton.setToolTipText("Create texture");
7361019 textureButton.addActionListener(this);
7371020
738
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7391022 overlayButton.setToolTipText("Create overlay");
7401023 overlayButton.addActionListener(this);
7411024
742
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7431026 lightButton.setToolTipText("Create light");
7441027 lightButton.addActionListener(this);
7451028
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
+
7461044 // EDIT panel
747
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
- editButton.setToolTipText("Edit selection");
1045
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ editButton.setToolTipText("Pin selection controls");
7491047 editButton.addActionListener(this);
7501048
751
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
- uneditButton.setToolTipText("Unedit selection");
1049
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ uneditButton.setToolTipText("Remove selection controls");
7531051 uneditButton.addActionListener(this);
7541052
7551053 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
- allParamsButton.setToolTipText("Edit all params");
1054
+ allParamsButton.setToolTipText("Show all controle");
7571055 allParamsButton.addActionListener(this);
7581056
7591057 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -770,6 +1068,7 @@
7701068
7711069 editCommandsPanel.preferredHeight = 1;
7721070
1071
+ SetPinStates(false);
7731072 // oe.treePanel.add(commandsPanel);
7741073 // oe.treePanel.Return();
7751074
....@@ -796,9 +1095,12 @@
7961095
7971096 oe.treePanel.add(copyOptionsPanel);
7981097 oe.treePanel.Return();
1098
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
+ sliderPane.preferredHeight = 1;
7991101
800
-// mainPanel.setDividerLocation(0.5); //1.0);
801
-// mainPanel.setResizeWeight(0.5);
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
8021104
8031105 //jList.addListSelectionListener(this);
8041106 oe.jTree.addTreeSelectionListener(this);
....@@ -806,7 +1108,7 @@
8061108 //jTree.setEditable(true);
8071109 oe.jTree.setDragEnabled(true);
8081110 //jTree.setPreferredSize(new Dimension(10,10));
809
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
8101112
8111113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8121114
....@@ -818,7 +1120,7 @@
8181120 dgr.addDragGestureListener(this);
8191121 }catch(Exception e) {}
8201122 */
821
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
8221124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8231125 }
8241126
....@@ -843,14 +1145,18 @@
8431145 boxCB.addItemListener(this);
8441146
8451147 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1148
+ zoomBoxCB.setToolTipText("Display only for wheel");
8471149 zoomBoxCB.addItemListener(this);
8481150
8491151 if (true) // Globals.ADVANCED)
8501152 {
851
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
- supportCB.setToolTipText("Enable rigging");
853
- supportCB.addItemListener(this);
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);
8541160
8551161 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8561162 // localCB.addItemListener(this);
....@@ -905,7 +1211,7 @@
9051211 oeilCB.addItemListener(this);
9061212
9071213 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
- shadowCB.setToolTipText("Compute shadows when live");
1214
+ shadowCB.setToolTipText("When live compute shadows");
9091215 shadowCB.addItemListener(this);
9101216
9111217 panel.Return();
....@@ -914,12 +1220,12 @@
9141220 toggleTextureCB.addItemListener(this);
9151221
9161222 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
- toggleSwitchCB.setToolTipText("Use switch");
1223
+ toggleSwitchCB.setToolTipText("Choose a single item");
9181224 toggleSwitchCB.addItemListener(this);
9191225
920
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
- autosaveCB.setToolTipText("Auto-save on structure change");
922
- autosaveCB.addItemListener(this);
1226
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1227
+ autokeepCB.setToolTipText("On structure change");
1228
+ autokeepCB.addItemListener(this);
9231229
9241230 panel.Return();
9251231 if (Globals.ADVANCED)
....@@ -948,7 +1254,7 @@
9481254 {
9491255 cRadio radioButton = new cRadio(obj.name);
9501256
951
- // Patch to avoid bug with transparency.
1257
+ // June 2019. Patch to avoid bug with transparency.
9521258 radioButton.hadMaterial = obj.material != null;
9531259 if (!radioButton.hadMaterial)
9541260 {
....@@ -956,7 +1262,7 @@
9561262 }
9571263
9581264 radioButton.SetObject(obj);
959
- radioButton.layout = sevenButton;
1265
+ radioButton.layout = sixButton; // sevenButton;
9601266 radioButton.SetCamera(cameraView.renderCamera, false);
9611267 radioButton.addActionListener(this);
9621268 radioPanel.add(radioButton);
....@@ -985,6 +1291,7 @@
9851291 cCheckBox slowCB;
9861292 cCheckBox boxCB;
9871293 cCheckBox zoomBoxCB;
1294
+ cCheckBox freezeCB;
9881295 //cToggleButton trackCB;
9891296 cCheckBox trackCB;
9901297 cCheckBox smoothfocusCB;
....@@ -995,7 +1302,7 @@
9951302
9961303 cCheckBox oeilCB;
9971304 cCheckBox shadowCB;
998
- cCheckBox autosaveCB;
1305
+ cCheckBox autokeepCB;
9991306 cCheckBox lookAtCB;
10001307
10011308 // static int COLOR = 1;
....@@ -1103,9 +1410,13 @@
11031410 {
11041411 Globals.COMPUTESHADOWWHENLIVE ^= true;
11051412 }
1106
- else if(e.getSource() == autosaveCB)
1413
+ else if(e.getSource() == freezeCB)
11071414 {
1108
- Globals.SAVEONMAKE ^= true;
1415
+ Globals.FREEZEONMOVE ^= true;
1416
+ }
1417
+ else if(e.getSource() == autokeepCB)
1418
+ {
1419
+ Globals.REPLACEONMAKE ^= true;
11091420 }
11101421 else if(e.getSource() == lookAtCB)
11111422 {
....@@ -1187,8 +1498,6 @@
11871498 }
11881499 }
11891500
1190
- String string = (String) object;
1191
-
11921501 System.out.println("Transfer = " + object + "; drop : " + target);
11931502 // if( object instanceof java.io.File[])
11941503 // {
....@@ -1196,6 +1505,8 @@
11961505 // objEditor.DropFile((java.io.File[]) object, true);
11971506 // return;
11981507 // }
1508
+
1509
+ String string = object.toString();
11991510
12001511 // File path for Mac and Windows
12011512 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1445,6 +1756,9 @@
14451756 animationItem.addItemListener(this);
14461757 animationItem.setState(Globals.ANIMATION);
14471758
1759
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1760
+ archiveItem.addActionListener(this);
1761
+
14481762 menu.add("-");
14491763 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14501764 parseverticesItem.addActionListener(this);
....@@ -1457,6 +1771,8 @@
14571771 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14581772 reduce34MorphItem.addActionListener(this);
14591773 menu.add("-");
1774
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1775
+ memoryItem.addActionListener(this);
14601776 menu.add(computeAOItem = new MenuItem("Compute AO"));
14611777 computeAOItem.addActionListener(this);
14621778
....@@ -1465,8 +1781,6 @@
14651781 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14661782 mirrorItem.addActionListener(this);
14671783 menu.add("-");
1468
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1469
- memoryItem.addActionListener(this);
14701784 menu.add(analyzeItem = new MenuItem("Analyze"));
14711785 analyzeItem.addActionListener(this);
14721786 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1614,6 +1928,30 @@
16141928
16151929 makeSomething(shadow);
16161930 }
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
+ }
16171955
16181956 /**
16191957 * applyExample
....@@ -2042,6 +2380,23 @@
20422380 {
20432381 makeSomething(new Light());
20442382 } else
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
20452400 if (source == csgItem)
20462401 {
20472402 group(new CSG());
....@@ -2093,25 +2448,25 @@
20932448 Composite csg = new GroupLeaf();
20942449 csg.count = 5;
20952450 group(csg);
2096
- Composite child = new cGroup();
2451
+ Composite child = new cGroup("Branch");
20972452 csg.addChild(child);
20982453 child.addChild(csg);
20992454 } else
21002455 if (source == doubleItem)
21012456 {
2102
- Composite csg = new GroupLeaf();
2457
+ Composite csg = new GroupLeaf("Fork");
21032458 csg.count = 5;
21042459 group(csg);
2105
- Composite child = new cGroup();
2460
+ Composite child = new cGroup("Branch A");
21062461 csg.addChild(child);
21072462 child.addChild(csg);
2108
- child = new cGroup();
2463
+ child = new cGroup("Branch B");
21092464 csg.addChild(child);
21102465 child.addChild(csg);
21112466 } else
21122467 if (source == tripleItem)
21132468 {
2114
- Composite csg = new GroupLeaf();
2469
+ Composite csg = new GroupLeaf("Trident");
21152470 csg.count = 4;
21162471 group(csg);
21172472 Composite child = new cGroup();
....@@ -2127,7 +2482,7 @@
21272482 if (source == computeAOItem)
21282483 {
21292484 Globals.drawMode = CameraPane.OCCLUSION;
2130
- Globals.theRenderer.repaint();
2485
+ cameraView.repaint();
21312486 } else
21322487 if (source == recompileItem)
21332488 {
....@@ -2175,15 +2530,31 @@
21752530 } else
21762531 if (source == undoButton)
21772532 {
2533
+ // Go to previous version
2534
+ //if (!Undo())
2535
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21782536 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();
21792547 } else
21802548 if (source == redoButton)
21812549 {
2550
+ // Go to next version
21822551 Redo();
21832552 } else
21842553 if (source == saveButton)
21852554 {
2186
- Save();
2555
+ // Save a new version
2556
+ if (!Save(true))
2557
+ java.awt.Toolkit.getDefaultToolkit().beep();
21872558 } else
21882559 if (source == oneStepButton)
21892560 {
....@@ -2192,17 +2563,14 @@
21922563 } else
21932564 if (source == screenfitButton)
21942565 {
2195
- //Reload(lastConverter, lastFilename, true);
21962566 ScreenFit();
21972567 } else
21982568 if (source == screenfitpointButton)
21992569 {
2200
- //Reload(lastConverter, lastFilename, true);
22012570 ScreenFitPoint();
22022571 } else
22032572 if (source == snapobjectButton)
22042573 {
2205
- //Reload(lastConverter, lastFilename, true);
22062574 SnapObject();
22072575 } else
22082576 // if (event.getSource() == recompileButton)
....@@ -2566,7 +2934,7 @@
25662934 {
25672935 StepAll();
25682936 } else
2569
- if (source == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
25702938 {
25712939 //int indices[] = jList.getSelectedIndices();
25722940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2726,15 +3094,28 @@
27263094 } else
27273095 if (source == ungroupItem || source == ungroupButton)
27283096 {
2729
- //ungroup();
3097
+ boolean hasRoot = false;
3098
+
27303099 for (int i=0; i<group.selection.size(); i++)
27313100 {
2732
- Ungroup(group.selection.get(i));
3101
+ if (group.selection.get(i) == group)
3102
+ {
3103
+ hasRoot = true;
3104
+ break;
3105
+ }
27333106 }
27343107
2735
- ClearSelection(false);
2736
-
2737
- 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
+ }
27383119 } else
27393120 if (source == genUVItem)
27403121 {
....@@ -3035,7 +3416,7 @@
30353416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30363417 {
30373418 obj = (Object3D)e.nextElement();
3038
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
30393420 }
30403421
30413422 refreshContents();
....@@ -3049,6 +3430,31 @@
30493430 obj.SetBumpTexture(obj.GetPigmentTexture());
30503431 }
30513432
3433
+ refreshContents();
3434
+ } else
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
+
30523458 refreshContents();
30533459 } else
30543460 if (source == flashSelectionButton)
....@@ -3152,8 +3558,8 @@
31523558 // centralPanel.setVisible(true);
31533559 // XYZPanel.setVisible(true);
31543560 bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
31553562 bigThree.add(centralPanel);
3156
- bigThree.add(XYZPanel);
31573563 bigThree.FlushUI();
31583564
31593565 cameraView.requestFocusInWindow();
....@@ -3233,8 +3639,8 @@
32333639 // centralPanel.setVisible(true);
32343640 // XYZPanel.setVisible(false);
32353641 bigThree.ClearUI();
3236
- bigThree.add(scenePanel);
32373642 bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
32383644 bigThree.FlushUI();
32393645
32403646 cameraView.requestFocusInWindow();
....@@ -3326,6 +3732,12 @@
33263732 } else
33273733 if (source == editItem || source == editButton)
33283734 {
3735
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3736
+ {
3737
+ Object3D child = (Object3D)e.nextElement();
3738
+ child.pinned = true;
3739
+ }
3740
+
33293741 EditSelection(false);
33303742 } else
33313743 if (source == uneditButton)
....@@ -3335,6 +3747,7 @@
33353747 Object3D child = (Object3D)e.nextElement();
33363748 if(child.editWindow != null)
33373749 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3750
+ child.pinned = false;
33383751 child.CloseUI();
33393752 listUI.remove(child);
33403753
....@@ -3351,6 +3764,7 @@
33513764 //copy.ClearUI();
33523765 for (Object3D obj : listUI)
33533766 {
3767
+ obj.pinned = false;
33543768 obj.CloseUI();
33553769 }
33563770 listUI.clear();
....@@ -3360,7 +3774,7 @@
33603774 {
33613775 assert(copy == group);
33623776
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3777
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643778
33653779 for (Object3D obj : listUI)
33663780 {
....@@ -3409,6 +3823,9 @@
34093823 }
34103824
34113825 copy = group;
3826
+
3827
+ SetUndoStates();
3828
+
34123829 //Globals.theRenderer.object = group;
34133830 if(!useclient)
34143831 {
....@@ -3435,6 +3852,13 @@
34353852 currentLayout = sevenButton;
34363853 */
34373854 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);
34383862 keepparent = group.parent;
34393863 // PARENT = NULL or not???
34403864 //group.parent = null; // ROOT
....@@ -4027,7 +4451,7 @@
40274451
40284452 try
40294453 {
4030
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4454
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
40314455 }
40324456 catch (Exception e)
40334457 {
....@@ -4502,12 +4926,14 @@
45024926 // }
45034927 // }
45044928
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45094929 void EditSelection(boolean newWindow)
45104930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
45114937 // aConstraints.gridy = 0;
45124938 for (int i=0; i<group.selection.size(); i++)
45134939 {
....@@ -4518,12 +4944,7 @@
45184944 Object3D elem = (Object3D)group.selection.elementAt(i);
45194945 if(elem != group || !newWindow)
45204946 {
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
4947
+ EditElement(elem, newWindow); // ? new
45274948 }
45284949 }
45294950 }
....@@ -4598,7 +5019,8 @@
45985019 //new Exception().printStackTrace();
45995020
46005021 freezemodel = true;
4601
-
5022
+ ClearUnpinned();
5023
+
46025024 /**/
46035025 //switch (event.id)
46045026 {
....@@ -4631,7 +5053,7 @@
46315053 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46325054 // a camera
46335055 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5056
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46355057 {
46365058 CameraPane.camerachangeframe = 0; // don't refuse it
46375059 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +5062,13 @@
46405062 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46415063 }
46425064
5065
+ if (tps != null && tps.length == 1)
5066
+ {
5067
+ EditSelection(false);
5068
+ }
5069
+
5070
+ SetPinStates(tps != null && tps.length > 0);
5071
+
46435072 refreshContents();
46445073 //return true;
46455074 }
....@@ -4649,10 +5078,18 @@
46495078 freezemodel = false;
46505079 }
46515080
5081
+ void SetPinStates(boolean enabled)
5082
+ {
5083
+ editButton.setEnabled(enabled);
5084
+ uneditButton.setEnabled(enabled);
5085
+ unselectButton.setEnabled(enabled);
5086
+ flashSelectionButton.setEnabled(enabled);
5087
+ }
5088
+
46525089 void refreshContents(boolean cp)
46535090 {
4654
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
5091
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5092
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46565093 {
46575094 objEditor.ClearInfo(); // .GetMaterial());
46585095
....@@ -4751,8 +5188,8 @@
47515188
47525189 if (cut)
47535190 {
4754
- if (Globals.SAVEONMAKE)
4755
- Save();
5191
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5192
+// Save();
47565193 //int indices[] = jList.getSelectedIndices();
47575194 //for (int i = indices.length - 1; i >= 0; i--)
47585195 //jList.remove(indices[i]);
....@@ -4855,6 +5292,10 @@
48555292
48565293 void paste(boolean expand)
48575294 {
5295
+ if (Globals.REPLACEONMAKE)
5296
+ Save();
5297
+ boolean keep = Globals.REPLACEONMAKE;
5298
+ Globals.REPLACEONMAKE = false;
48585299 // if (GrafreeD.clipboard == null)
48595300 // return;
48605301 boolean first = true;
....@@ -4914,6 +5355,7 @@
49145355 Grafreed.clipboard.get(0).parent = keepparent;
49155356 }
49165357
5358
+ Globals.REPLACEONMAKE = keep;
49175359 ResetModel();
49185360 refreshContents();
49195361 }
....@@ -5049,6 +5491,10 @@
50495491
50505492 void group(Object3D csg, boolean grab)
50515493 {
5494
+ if (Globals.REPLACEONMAKE)
5495
+ Save();
5496
+ boolean keep = Globals.REPLACEONMAKE;
5497
+ Globals.REPLACEONMAKE = false;
50525498 if (//false) // why??
50535499 !group.selection.isEmpty())
50545500 {
....@@ -5162,10 +5608,15 @@
51625608 //node.add(csg);
51635609 //makeSomething(node);
51645610 makeSomething(csg);
5611
+ Globals.REPLACEONMAKE = keep;
51655612 }
51665613
51675614 void Ungroup(Object3D g)
51685615 {
5616
+ if (Globals.REPLACEONMAKE)
5617
+ Save();
5618
+ boolean keep = Globals.REPLACEONMAKE;
5619
+ Globals.REPLACEONMAKE = false;
51695620 if (g instanceof HiddenObject)
51705621 {
51715622 HiddenObject h = (HiddenObject) g;
....@@ -5182,6 +5633,7 @@
51825633 objEditor.makeSomething(g.get(i), false);
51835634 }
51845635 }
5636
+ Globals.REPLACEONMAKE = keep;
51855637 }
51865638
51875639 void ungroup()
....@@ -5472,11 +5924,6 @@
54725924
54735925 cButton restoreCameraButton;
54745926
5475
- cButton minButton;
5476
- cButton maxButton;
5477
- cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54805927 cButton saveButton;
54815928 cButton oneStepButton;
54825929
....@@ -5486,6 +5933,22 @@
54865933 cButton switchButton;
54875934 cButton loopButton;
54885935 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;
54895952
54905953 cButton gridButton;
54915954 cButton boxButton;
....@@ -5550,7 +6013,7 @@
55506013 private MenuItem pasteLinkItem;
55516014 private MenuItem pasteCloneItem;
55526015 private MenuItem pasteExpandItem;
5553
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
55546017 private MenuItem clearAllItem;
55556018 private MenuItem genUVItem;
55566019 private MenuItem genNormalsMESHItem;
....@@ -5634,6 +6097,8 @@
56346097 private MenuItem attachBumpItem;
56356098 private MenuItem detachBumpItem;
56366099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
56376102
56386103 private MenuItem particleItem;
56396104 private MenuItem ragdollItem;