Normand Briere
2019-08-22 0c7b833be7d86598a6813cd1c6db0ca9e1b17966
GroupEditor.java
....@@ -347,7 +347,7 @@
347347
348348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
349349 {
350
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351351
352352 AddSkyboxTab0(skyboxpane);
353353 AddSkyboxTab1(skyboxpane);
....@@ -417,13 +417,13 @@
417417
418418 assert(false);
419419
420
- if (copy.versionlist == null)
421
- {
422
- copy.versionlist = new Object3D[100];
423
- copy.versionindex = -1;
424
-
425
- //Save(true);
426
- }
420
+// if (copy.versionlist == null)
421
+// {
422
+// copy.versionlist = new Object3D[100];
423
+// copy.versionindex = -1;
424
+//
425
+// //Save(true);
426
+// }
427427
428428 if(ui)
429429 SetupUI(objEditor);
....@@ -446,13 +446,13 @@
446446
447447 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
448448
449
- if (copy.versionlist == null)
450
- {
451
- copy.versionlist = new Object3D[100];
452
- copy.versionindex = -1;
453
-
454
- //Save(true);
455
- }
449
+// if (copy.versionlist == null)
450
+// {
451
+// copy.versionlist = new Object3D[100];
452
+// copy.versionindex = -1;
453
+//
454
+// //Save(true);
455
+// }
456456 }
457457
458458 void CloneSelection(boolean supports)
....@@ -835,6 +835,8 @@
835835 }
836836
837837 oe.menuBar.add(menu = new Menu("Attributes"));
838
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
839
+ clearVersionsItem.addActionListener(this);
838840 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
839841 clearMaterialsItem.addActionListener(this);
840842 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -936,6 +938,8 @@
936938 cGridBag currenttab;
937939 //boolean added; // patch for jar
938940
941
+ int totalcount = 0;
942
+
939943 int tabcount = 0;
940944 int colcount = 0;
941945 int rowcount = 0;
....@@ -964,7 +968,7 @@
964968 texturecount = 0;
965969 }
966970
967
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
971
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
968972 {
969973 //if (!added)
970974 {
....@@ -973,7 +977,8 @@
973977 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
974978 }
975979
976
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
980
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
981
+ totalcount++;
977982
978983 if (++colcount >= columns)
979984 {
....@@ -999,6 +1004,8 @@
9991004 container.add(resourcecontainer);
10001005
10011006 Grafreed.ParseResources("textures", this);
1007
+
1008
+ // 935. System.out.println("Total = " + totalcount);
10021009 }
10031010
10041011 void SetupUI2(ObjEditor oe)
....@@ -1259,7 +1266,10 @@
12591266
12601267 CreateTexturePanel(textures);
12611268
1262
- resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1269
+ int tabCount = resourcecontainer.getTabCount();
1270
+
1271
+ if (tabCount > 0)
1272
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
12631273
12641274 oe.toolboxPanel.add(textures);
12651275
....@@ -3458,6 +3468,10 @@
34583468 {
34593469 ClearMaterials();
34603470 } else
3471
+ if (source == clearVersionsItem)
3472
+ {
3473
+ ClearVersions();
3474
+ } else
34613475 if (source == liveleavesItem)
34623476 {
34633477 LiveLeaves(true);
....@@ -4134,12 +4148,14 @@
41344148 // and check if any of these nodes are reachable below the root.
41354149 Grafreed.grafreed.universe.TagObjects(copy, true);
41364150
4137
- if (!copy.HasTags())
4151
+ if (copy.versionlist == null && !copy.HasTags())
41384152 {
41394153 copy.versionlist = new Object3D[100];
41404154
4141
- Save(true);
4155
+ //Save(true);
41424156 }
4157
+ else
4158
+ copy.versionindex = -2;
41434159
41444160 Grafreed.grafreed.universe.TagObjects(copy, false);
41454161 }
....@@ -5102,6 +5118,12 @@
51025118 void ClearMaterials()
51035119 {
51045120 group.selection.ClearMaterials();
5121
+ refreshContents();
5122
+ }
5123
+
5124
+ void ClearVersions()
5125
+ {
5126
+ group.selection.ClearVersions();
51055127 refreshContents();
51065128 }
51075129
....@@ -6346,6 +6368,7 @@
63466368 private MenuItem clipMeshItem;
63476369 private MenuItem smoothMeshItem;
63486370 private MenuItem clearMaterialsItem;
6371
+ private MenuItem clearVersionsItem;
63496372
63506373 private MenuItem liveleavesItem;
63516374 private MenuItem unliveleavesItem;