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 {
....@@ -80,18 +314,20 @@
80314 this.copy = this.group = copy;
81315 //selectees = this.group.selectees;
82316
83
- if (copy.versions == null)
84
- {
85
- copy.versions = new byte[100][];
86
- copy.versionindex = -1;
87
- }
88
-
89317 SetupMenu2(this); //objEditor);
90318 SetupUI2(objEditor);
91319 objEditor.SetupUI(true);
92320 SetupViews(objEditor);
93321
94322 ((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
+ }
95331 }
96332
97333 void CloneSelection(boolean supports)
....@@ -206,8 +442,8 @@
206442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
207443 // pasteExpandItem.addActionListener(this);
208444 menu.add("-");
209
- clearItem = menu.add(new MenuItem("Clear"));
210
- clearItem.addActionListener(this);
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
211447
212448 if (Globals.ADVANCED)
213449 {
....@@ -433,7 +669,7 @@
433669 genNormalsMESHItem.addActionListener(this);
434670 if (Globals.ADVANCED)
435671 {
436
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437673 genNormalsMINEItem.addActionListener(this);
438674 }
439675 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -526,10 +762,15 @@
526762 attachBumpItem.addActionListener(this);
527763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
528764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
529766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
530767 detachPigmentItem.addActionListener(this);
531768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
532769 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);
533774 menu.add("-");
534775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
535776 sortbysizeItem.addActionListener(this);
....@@ -601,7 +842,7 @@
601842 */
602843 cGridBag copyOptionsPanel = new cGridBag();
603844
604
- copyOptionsPanel.preferredHeight = 1;
845
+ copyOptionsPanel.preferredHeight = 2;
605846
606847 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
607848
....@@ -681,31 +922,32 @@
681922 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682923 snapobjectButton.addActionListener(this);
683924 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");
684929 }
685930
686931 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
687932
688
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
- 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");
690935 twoButton.addActionListener(this);
691936 this.fullscreenLayout = twoButton;
692937
693
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
- fourButton.addActionListener(this);
695
- fourButton.setToolTipText("Show left panel only");
696
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
- sixButton.setToolTipText("2-column layout left");
698
- sixButton.addActionListener(this);
699
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- 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");
701940 threeButton.addActionListener(this);
702
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
- sevenButton.setToolTipText("3-column layout");
704
- 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);
705947 //
706948
707
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
- 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");
709951 rootButton.addActionListener(this);
710952
711953 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -714,28 +956,30 @@
714956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
715957 //clearButton.addActionListener(this);
716958
959
+ cGridBag row1 = new cGridBag();
960
+
717961 // INSERT
718
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
962
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719963 gridButton.setToolTipText("Create grid");
720964 gridButton.addActionListener(this);
721965
722
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723967 boxButton.setToolTipText("Create box");
724968 boxButton.addActionListener(this);
725969
726
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
970
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727971 sphereButton.setToolTipText("Create sphere");
728972 sphereButton.addActionListener(this);
729973
730
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
974
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731975 coneButton.setToolTipText("Create cone");
732976 coneButton.addActionListener(this);
733977
734
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
978
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735979 torusButton.setToolTipText("Create torus");
736980 torusButton.addActionListener(this);
737981
738
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
982
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739983 superButton.setToolTipText("Create superellipsoid");
740984 superButton.addActionListener(this);
741985
....@@ -746,51 +990,56 @@
746990 kleinButton.addActionListener(this);
747991 }
748992
749
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
993
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750994 particlesButton.setToolTipText("Create particle system");
751995 particlesButton.addActionListener(this);
752996
753
- oe.toolboxPanel.Return();
997
+ oe.toolboxPanel.add(row1);
754998
755
- 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);
7561002 groupButton.setToolTipText("Create group");
7571003 groupButton.addActionListener(this);
7581004
759
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1005
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7601006 compositeButton.setToolTipText("Create composite");
7611007 compositeButton.addActionListener(this);
7621008
763
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1009
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7641010 switchButton.setToolTipText("Create item switcher");
7651011 switchButton.addActionListener(this);
7661012
767
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7681014 loopButton.setToolTipText("Create loop");
7691015 loopButton.addActionListener(this);
7701016
771
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1017
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7721018 textureButton.setToolTipText("Create texture");
7731019 textureButton.addActionListener(this);
7741020
775
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
7761022 overlayButton.setToolTipText("Create overlay");
7771023 overlayButton.addActionListener(this);
7781024
779
- 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);
7801026 lightButton.setToolTipText("Create light");
7811027 lightButton.addActionListener(this);
7821028
783
- for (int i=6; --i>=0;)
784
- {
785
- oe.toolboxPanel.Return();
786
- oe.toolboxPanel.add(new cGridBag());
787
- oe.toolboxPanel.add(new cGridBag());
788
- oe.toolboxPanel.add(new cGridBag());
789
- oe.toolboxPanel.add(new cGridBag());
790
- oe.toolboxPanel.add(new cGridBag());
791
- oe.toolboxPanel.add(new cGridBag());
792
- oe.toolboxPanel.add(new cGridBag());
793
- }
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);
7941043
7951044 // EDIT panel
7961045 editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -850,8 +1099,8 @@
8501099 versionSlider = (cNumberSlider)sliderPane.getComponent(1);
8511100 sliderPane.preferredHeight = 1;
8521101
853
-// mainPanel.setDividerLocation(0.5); //1.0);
854
-// mainPanel.setResizeWeight(0.5);
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
8551104
8561105 //jList.addListSelectionListener(this);
8571106 oe.jTree.addTreeSelectionListener(this);
....@@ -859,7 +1108,7 @@
8591108 //jTree.setEditable(true);
8601109 oe.jTree.setDragEnabled(true);
8611110 //jTree.setPreferredSize(new Dimension(10,10));
862
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
8631112
8641113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
8651114
....@@ -871,7 +1120,7 @@
8711120 dgr.addDragGestureListener(this);
8721121 }catch(Exception e) {}
8731122 */
874
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
8751124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8761125 }
8771126
....@@ -1013,7 +1262,7 @@
10131262 }
10141263
10151264 radioButton.SetObject(obj);
1016
- radioButton.layout = sevenButton;
1265
+ radioButton.layout = sixButton; // sevenButton;
10171266 radioButton.SetCamera(cameraView.renderCamera, false);
10181267 radioButton.addActionListener(this);
10191268 radioPanel.add(radioButton);
....@@ -1693,6 +1942,16 @@
16931942 }
16941943 }
16951944 }
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
+ }
16961955
16971956 /**
16981957 * applyExample
....@@ -2121,6 +2380,23 @@
21212380 {
21222381 makeSomething(new Light());
21232382 } 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
21242400 if (source == csgItem)
21252401 {
21262402 group(new CSG());
....@@ -2206,7 +2482,7 @@
22062482 if (source == computeAOItem)
22072483 {
22082484 Globals.drawMode = CameraPane.OCCLUSION;
2209
- Globals.theRenderer.repaint();
2485
+ cameraView.repaint();
22102486 } else
22112487 if (source == recompileItem)
22122488 {
....@@ -2658,7 +2934,7 @@
26582934 {
26592935 StepAll();
26602936 } else
2661
- if (source == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
26622938 {
26632939 //int indices[] = jList.getSelectedIndices();
26642940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3140,7 +3416,7 @@
31403416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
31413417 {
31423418 obj = (Object3D)e.nextElement();
3143
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
31443420 }
31453421
31463422 refreshContents();
....@@ -3154,6 +3430,31 @@
31543430 obj.SetBumpTexture(obj.GetPigmentTexture());
31553431 }
31563432
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
+
31573458 refreshContents();
31583459 } else
31593460 if (source == flashSelectionButton)
....@@ -3257,8 +3558,8 @@
32573558 // centralPanel.setVisible(true);
32583559 // XYZPanel.setVisible(true);
32593560 bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
32603562 bigThree.add(centralPanel);
3261
- bigThree.add(XYZPanel);
32623563 bigThree.FlushUI();
32633564
32643565 cameraView.requestFocusInWindow();
....@@ -3338,8 +3639,8 @@
33383639 // centralPanel.setVisible(true);
33393640 // XYZPanel.setVisible(false);
33403641 bigThree.ClearUI();
3341
- bigThree.add(scenePanel);
33423642 bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
33433644 bigThree.FlushUI();
33443645
33453646 cameraView.requestFocusInWindow();
....@@ -3553,10 +3854,10 @@
35533854 radio.layout.doClick();
35543855
35553856 ClearUnpinned();
3556
- Grafreed.Assert(group != null);
3557
- Grafreed.Assert(group.selection != null);
3558
- SetPinStates(group.selection.size() > 0);
3559
- if (group.selection.size() == 1)
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)
35603861 EditSelection(false);
35613862 keepparent = group.parent;
35623863 // PARENT = NULL or not???
....@@ -4150,7 +4451,7 @@
41504451
41514452 try
41524453 {
4153
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4454
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
41544455 }
41554456 catch (Exception e)
41564457 {
....@@ -4627,6 +4928,12 @@
46274928
46284929 void EditSelection(boolean newWindow)
46294930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
46304937 // aConstraints.gridy = 0;
46314938 for (int i=0; i<group.selection.size(); i++)
46324939 {
....@@ -4637,12 +4944,7 @@
46374944 Object3D elem = (Object3D)group.selection.elementAt(i);
46384945 if(elem != group || !newWindow)
46394946 {
4640
- // if (!(elem instanceof Composite))
4641
- // newWindow = false;
4642
- listUI.add(elem);
4643
- elem.openEditWindow(this, newWindow); //, false);
4644
- System.out.println("edit : " + elem);
4645
- elem.editWindow.refreshContents(true); // ? new
4947
+ EditElement(elem, newWindow); // ? new
46464948 }
46474949 }
46484950 }
....@@ -4786,7 +5088,7 @@
47865088
47875089 void refreshContents(boolean cp)
47885090 {
4789
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
5091
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
47905092 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47915093 {
47925094 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5632,6 +5934,22 @@
56325934 cButton loopButton;
56335935 cButton textureButton;
56345936
5937
+ cButton skybox1Button;
5938
+ cButton skybox2Button;
5939
+ cButton skybox3Button;
5940
+ cButton skybox4Button;
5941
+ cButton skybox5Button;
5942
+ cButton skybox6Button;
5943
+ cButton skybox7Button;
5944
+
5945
+ cButton skybox11Button;
5946
+ cButton skybox12Button;
5947
+ cButton skybox13Button;
5948
+ cButton skybox14Button;
5949
+ cButton skybox15Button;
5950
+ cButton skybox16Button;
5951
+ cButton skybox17Button;
5952
+
56355953 cButton gridButton;
56365954 cButton boxButton;
56375955 cButton sphereButton;
....@@ -5695,7 +6013,7 @@
56956013 private MenuItem pasteLinkItem;
56966014 private MenuItem pasteCloneItem;
56976015 private MenuItem pasteExpandItem;
5698
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
56996017 private MenuItem clearAllItem;
57006018 private MenuItem genUVItem;
57016019 private MenuItem genNormalsMESHItem;
....@@ -5779,6 +6097,8 @@
57796097 private MenuItem attachBumpItem;
57806098 private MenuItem detachBumpItem;
57816099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
57826102
57836103 private MenuItem particleItem;
57846104 private MenuItem ragdollItem;