Normand Briere
2019-08-18 480ad70047e54b2b92f974e6c2ac5a6c0bdc5a5c
ObjEditor.java
....@@ -43,6 +43,50 @@
4343
4444 static ObjEditor theFrame;
4545
46
+ public void AllocProjectedVertices(Object3D object)
47
+ {
48
+ assert (object.projectedVertices != null);
49
+
50
+ if (object.projectedVertices.length <= 2)
51
+ {
52
+ // Side effect...
53
+ Object3D.cVector2[] keep = object.projectedVertices;
54
+ object.projectedVertices = new Object3D.cVector2[3];
55
+ for (int i = 0; i < 3; i++)
56
+ {
57
+ if (i < keep.length)
58
+ {
59
+ object.projectedVertices[i] = keep[i];
60
+ } else
61
+ {
62
+ object.projectedVertices[i] = new Object3D.cVector2();
63
+ }
64
+ /*
65
+ if(keep.length == 0)
66
+ object.projectedVertices[0] = new Object3D.cVector2();
67
+ else
68
+ object.projectedVertices[0] = keep[0];
69
+ object.projectedVertices[1] = new Object3D.cVector2();
70
+ */
71
+ }
72
+ }
73
+ }
74
+
75
+ public Composite CreateCameras()
76
+ {
77
+ Composite cams = new cTemplate();
78
+ cams.name = "Cameras";
79
+ copy.insertElementAt(cams, 0);
80
+
81
+ cams.addChild(new Camera());
82
+ cams.addChild(new Camera(1));
83
+ cams.addChild(new Camera(2));
84
+ cams.addChild(new Camera(3));
85
+ cams.addChild(new Camera(4));
86
+
87
+ return cams;
88
+ }
89
+
4690 public cGridBag GetSeparator()
4791 {
4892 cGridBag separator = new cGridBag();
....@@ -54,7 +98,10 @@
5498 cButton GetButton(String name, boolean border)
5599 {
56100 ImageIcon icon = GetIcon(name);
57
- return new cButton(icon, border);
101
+ if (icon != null || name.contains("/"))
102
+ return new cButton(icon, border);
103
+ else
104
+ return new cButton(name, border);
58105 }
59106
60107 cLabel GetLabel(String name, boolean border)
....@@ -75,11 +122,19 @@
75122 return new cCheckBox(icon, border);
76123 }
77124
78
- ImageIcon GetIcon(String name)
125
+ static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>();
126
+
127
+ static ImageIcon GetIcon(String name)
79128 {
129
+ javax.swing.ImageIcon iconCache = icons.get(name);
130
+ if (iconCache != null)
131
+ {
132
+ return iconCache;
133
+ }
134
+
80135 try
81136 {
82
- BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
137
+ BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
83138
84139 // if (image.getWidth() > 48 && image.getHeight() > 48)
85140 // {
....@@ -94,10 +149,14 @@
94149 // }
95150
96151 javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
152
+
153
+ icons.put(name, icon);
154
+
97155 return icon;
98156 }
99157 catch (Exception e)
100158 {
159
+ //icons.put(name, null);
101160 return null;
102161 }
103162 }
....@@ -297,11 +356,13 @@
297356 client = inClient;
298357 copy = client;
299358
300
- if (copy.versionlist == null)
301
- {
302
- copy.versionlist = new Object3D[100];
303
- copy.versionindex = -1;
304
- }
359
+// if (copy.versionlist == null)
360
+// {
361
+// copy.versionlist = new Object3D[100];
362
+// copy.versionindex = -1;
363
+//
364
+// callee.Save(true);
365
+// }
305366
306367 // "this" is not called: SetupUI2(objEditor);
307368 }
....@@ -320,6 +381,8 @@
320381 {
321382 copy.versionlist = new Object3D[100];
322383 copy.versionindex = -1;
384
+
385
+// Save(true);
323386 }
324387
325388 SetupUI2(callee.GetEditor());
....@@ -343,7 +406,8 @@
343406 //parent = p;
344407
345408 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
346
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
409
+ if (Globals.DEBUG)
410
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
347411 //gd.setFullScreenWindow(this);
348412 //setResizable(false);
349413 //if (!isDisplayable())
....@@ -354,11 +418,13 @@
354418 copy = localCopy;
355419 copy.editWindow = this;
356420
357
- if (copy.versionlist == null)
358
- {
359
-// copy.versions = new byte[100][];
421
+// if (copy.versionlist == null)
422
+// {
423
+// copy.versionlist = new Object3D[100];
360424 // copy.versionindex = -1;
361
- }
425
+//
426
+// Save(true);
427
+// }
362428
363429 SetupMenu();
364430
....@@ -378,6 +444,9 @@
378444
379445 static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
380446
447
+ // This is to refresh the UI of the material panel.
448
+ boolean patchMaterial;
449
+
381450 void SetupMenu()
382451 {
383452 frame.setMenuBar(menuBar = new MenuBar());
....@@ -427,6 +496,8 @@
427496
428497 ChangeListener changeListener = new ChangeListener()
429498 {
499
+ //String name;
500
+
430501 public void stateChanged(ChangeEvent changeEvent)
431502 {
432503 // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
....@@ -445,7 +516,37 @@
445516 // EditSelection(false);
446517 // }
447518
448
- refreshContents(false); // To refresh Info tab
519
+// if (objectPanel.getSelectedIndex() == 4)
520
+// {
521
+// name = copy.skyboxname;
522
+//
523
+// if (name == null)
524
+// {
525
+// name = "";
526
+// }
527
+//
528
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
529
+// copy.skyboxext = "jpg";
530
+// }
531
+// else
532
+// {
533
+// if (name != null)
534
+// {
535
+// if (name.equals(""))
536
+// {
537
+// copy.skyboxname = null;
538
+// copy.skyboxext = null;
539
+// }
540
+// else
541
+// {
542
+// copy.skyboxname = name;
543
+// }
544
+// }
545
+// }
546
+ cameraView.transformMode = objectPanel.getSelectedIndex() == 4;
547
+
548
+// refreshContents(false); // To refresh Info tab
549
+ cameraView.repaint();
449550 }
450551 };
451552 objectPanel.addChangeListener(changeListener);
....@@ -871,18 +972,29 @@
871972 boolean temp = CameraPane.SWITCH;
872973 CameraPane.SWITCH = false;
873974
874
- object.ExtractBigData(versiontable);
975
+ if (Grafreed.grafreed.universe.versiontable == null)
976
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
977
+
978
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
875979 // if (copy == client)
876980
877981 Object3D versions[] = object.versionlist;
982
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
878983 object.versionlist = null;
984
+ object.versiontable = null;
985
+
986
+ Object3D parent = object.parent;
987
+ object.parent = null;
879988
880989 //byte[] compress = Compress(copy);
881990 Object3D compress = (Object3D)Grafreed.clone(object);
882991
883
- object.versionlist = versions;
992
+ object.parent = parent;
884993
885
- object.RestoreBigData(versiontable);
994
+ object.versionlist = versions;
995
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
996
+
997
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
886998
887999 CameraPane.SWITCH = temp;
8881000
....@@ -1221,7 +1333,7 @@
12211333
12221334 //if (copy.pinned)
12231335 {
1224
- pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1336
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
12251337 pinButton.setSelected(copy.pinned);
12261338 cGridBag t = new cGridBag();
12271339 t.preferredWidth = 2;
....@@ -1244,14 +1356,14 @@
12441356
12451357 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
12461358 liveCB.setToolTipText("Animate object");
1359
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1360
+ markCB.setToolTipText("Set target transform");
12471361 selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
12481362 selectableCB.setToolTipText("Make object selectable");
12491363 // Return();
12501364
12511365 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
12521366 hideCB.setToolTipText("Hide object");
1253
- markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1254
- markCB.setToolTipText("As animation target transform");
12551367
12561368 ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
12571369
....@@ -1453,22 +1565,9 @@
14531565
14541566 if (cam == null || !(copy.get(0) instanceof cGroup))
14551567 {
1456
- System.out.println("CREATE CAMERAS");
1457
- cams = new cTemplate();
1458
- cams.name = "Cameras";
1459
- copy.insertElementAt(cams, 0);
1460
- //cams.parent = copy;
1461
-
1462
- cam = new Camera(); // LA.newVector(3, 2, 1));
1463
- cams.addChild(cam);
1464
- cam = new Camera(1);
1465
- cams.addChild(cam);
1466
- cam = new Camera(2);
1467
- cams.addChild(cam);
1468
- cam = new Camera(3);
1469
- cams.addChild(cam);
1470
- cam = new Camera(4); // Light
1471
- cams.addChild(cam);
1568
+ if (Globals.DEBUG)
1569
+ System.out.println("CREATE CAMERAS");
1570
+ cams = CreateCameras();
14721571 } else
14731572 {
14741573 cams = (cGroup) copy.get(0);
....@@ -1534,6 +1633,45 @@
15341633 //frontView.object = copy;
15351634 //sideView.object = copy;
15361635
1636
+ transformPanel = new cGridBag().setVertical(true);
1637
+
1638
+ cGridBag resetTransformPanel = new cGridBag();
1639
+
1640
+ resetTransformPanel.preferredHeight = 2;
1641
+
1642
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1643
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1644
+ resetTransform.addMouseListener(new MouseAdapter()
1645
+ {
1646
+ public void mouseClicked(MouseEvent e)
1647
+ {
1648
+ ResetTransform();
1649
+ }
1650
+ });
1651
+ resetTransformPanel.add(resetTransform);
1652
+
1653
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1654
+ resetTransform.setToolTipText("Reset Translation only");
1655
+ resetTransform.addMouseListener(new MouseAdapter()
1656
+ {
1657
+ public void mouseClicked(MouseEvent e)
1658
+ {
1659
+ ResetTransform(1);
1660
+ }
1661
+ });
1662
+ resetTransformPanel.add(resetTransform);
1663
+
1664
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1665
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1666
+ resetTransform.addMouseListener(new MouseAdapter()
1667
+ {
1668
+ public void mouseClicked(MouseEvent e)
1669
+ {
1670
+ ResetTransform(2);
1671
+ }
1672
+ });
1673
+ resetTransformPanel.add(resetTransform);
1674
+
15371675 XYZPanel = new cGridBag().setVertical(true);
15381676 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
15391677
....@@ -1543,6 +1681,9 @@
15431681 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
15441682 //XYZPanel.setName("XYZ");
15451683
1684
+ transformPanel.add(resetTransformPanel);
1685
+ transformPanel.add(XYZPanel);
1686
+
15461687 /*
15471688 gridPanel = new JPanel(); //new BorderLayout());
15481689 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1550,12 +1691,12 @@
15501691 gridPanel.add(cameraView);
15511692 gridPanel.add(XYZPanel);
15521693 */
1553
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1554
- gridPanel.setContinuousLayout(true);
1555
- gridPanel.setOneTouchExpandable(true);
1556
- gridPanel.setDividerLocation(1.0);
1557
- gridPanel.setDividerSize(9);
1558
- gridPanel.setResizeWeight(0.85);
1694
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1695
+// gridPanel.setContinuousLayout(true);
1696
+// gridPanel.setOneTouchExpandable(true);
1697
+// gridPanel.setDividerLocation(1.0);
1698
+// gridPanel.setDividerSize(9);
1699
+// gridPanel.setResizeWeight(0.85);
15591700
15601701 // aConstraints.weighty = 0;
15611702 //System.out.println("THIS = " + this);
....@@ -1578,30 +1719,34 @@
15781719
15791720 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
15801721 //tmp.setName("Edit");
1581
- objectPanel.add(materialPanel);
1582
- objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1583
- objectPanel.setToolTipTextAt(0, "Material");
1584
-
1722
+ objectPanel.add(skyboxPanel);
1723
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1724
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1725
+
15851726 objectPanel.add(toolboxPanel);
15861727 objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
15871728 objectPanel.setToolTipTextAt(1, "Objects & textures");
15881729
1589
- objectPanel.add(skyboxPanel);
1590
- objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1591
- objectPanel.setToolTipTextAt(2, "Backgrounds");
1592
-
1730
+ objectPanel.add(materialPanel);
1731
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1732
+ objectPanel.setToolTipTextAt(2, "Material");
1733
+
15931734 // JPanel north = new JPanel(new BorderLayout());
15941735 // north.setName("Edit");
15951736 // north.add(ctrlPanel, BorderLayout.NORTH);
15961737 // objectPanel.add(north);
15971738 objectPanel.add(editPanel);
1598
- objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1739
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
15991740 objectPanel.setToolTipTextAt(3, "Edit controls");
16001741
1601
- objectPanel.add(XYZPanel);
1742
+ objectPanel.add(transformPanel);
16021743 objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1603
- objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
1744
+ objectPanel.setToolTipTextAt(4, "TRS transform");
16041745
1746
+ patchMaterial = true;
1747
+ cameraView.patchMaterial = this;
1748
+ objectPanel.setSelectedIndex(2);
1749
+
16051750 /*
16061751 aConstraints.gridx = 0;
16071752 aConstraints.gridwidth = 1;
....@@ -1621,7 +1766,7 @@
16211766 scrollpane.addMouseWheelListener(this); // Default not fast enough
16221767
16231768 /*JTabbedPane*/ scenePanel = new cGridBag();
1624
- scenePanel.preferredWidth = 5;
1769
+ scenePanel.preferredWidth = 6;
16251770
16261771 JTabbedPane tabbedPane = new JTabbedPane();
16271772 tabbedPane.add(scrollpane);
....@@ -1632,17 +1777,52 @@
16321777
16331778 AddOptions(optionsPanel); //, aConstraints);
16341779
1635
- tabbedPane.add(optionsPanel);
1636
-
16371780 tabbedPane.add(FSPane = new cFileSystemPane(this));
16381781
1782
+ tabbedPane.add(optionsPanel);
1783
+
16391784 scenePanel.add(tabbedPane);
16401785
1641
- //if (Globals.ADVANCED)
1642
- tabbedPane.add(infoPanel);
1643
- tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1644
- tabbedPane.setToolTipTextAt(3, "Information");
1786
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1787
+ creditsPanel.setName("Credits");
16451788
1789
+ cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1790
+ creditsPanel.add(ogaLabel);
1791
+
1792
+ cButton opengameartButton;
1793
+ creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1794
+ opengameartButton.setToolTipText("https://opengameart.org");
1795
+
1796
+ opengameartButton.addMouseListener(new MouseAdapter()
1797
+ {
1798
+ public void mouseClicked(MouseEvent e)
1799
+ {
1800
+ try
1801
+ {
1802
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1803
+ } catch (Exception e1)
1804
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1805
+ {
1806
+ e1.printStackTrace();
1807
+ }
1808
+ }
1809
+ });
1810
+
1811
+ for (int i=10; --i>=0;)
1812
+ {
1813
+ creditsPanel.add(new cGridBag());
1814
+ }
1815
+
1816
+ tabbedPane.add(creditsPanel);
1817
+ tabbedPane.setToolTipTextAt(3, "Credits");
1818
+
1819
+ if (Globals.ADVANCED)
1820
+ {
1821
+ tabbedPane.add(infoPanel);
1822
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1823
+ tabbedPane.setToolTipTextAt(4, "Information");
1824
+ }
1825
+
16461826 /*
16471827 cTree jTree = new cTree(null);
16481828 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1663,13 +1843,13 @@
16631843 jtp.add(tree);
16641844 */
16651845
1666
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1667
- bigPanel.setContinuousLayout(true);
1668
- bigPanel.setOneTouchExpandable(true);
1669
- bigPanel.setDividerLocation(0.8);
1670
- bigPanel.setDividerSize(15);
1671
- bigPanel.setResizeWeight(0.15);
1672
- bigPanel.setName("Scene");
1846
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1847
+// bigPanel.setContinuousLayout(true);
1848
+// bigPanel.setOneTouchExpandable(true);
1849
+// bigPanel.setDividerLocation(0.8);
1850
+// bigPanel.setDividerSize(15);
1851
+// bigPanel.setResizeWeight(0.15);
1852
+// bigPanel.setName("Scene");
16731853
16741854 //bigPanel.setLayout(new BorderLayout());
16751855 //bigPanel.setSize(new Dimension(10,10));
....@@ -1739,7 +1919,7 @@
17391919
17401920 frame.getContentPane().setLayout(new BorderLayout());
17411921 /**/
1742
- JTabbedPane worldPane = new JTabbedPane();
1922
+ //JTabbedPane worldPane = new JTabbedPane();
17431923 //worldPane.add(bigPanel);
17441924 //worldPane.add(worldPanel);
17451925 /**/
....@@ -1753,7 +1933,7 @@
17531933
17541934 cameraView.requestFocusInWindow();
17551935
1756
- gridPanel.setDividerLocation(1.0);
1936
+// gridPanel.setDividerLocation(1.0);
17571937
17581938 frame.validate();
17591939
....@@ -1788,7 +1968,7 @@
17881968 {
17891969 cGridBag presetpanel = new cGridBag().setVertical(true);
17901970
1791
- cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1971
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
17921972 skin.setToolTipText("Skin");
17931973 skin.addMouseListener(new MouseAdapter()
17941974 {
....@@ -1799,7 +1979,15 @@
17991979
18001980 // Skin
18011981 colorField.setFloat(material.color);
1802
- saturationField.setFloat(material.modulation);
1982
+ float saturation = material.modulation;
1983
+
1984
+ if (!cameraView.Skinshader)
1985
+ {
1986
+ saturation /= 1.5;
1987
+ }
1988
+
1989
+ saturationField.setFloat(saturation);
1990
+
18031991 subsurfaceField.setFloat(material.subsurface);
18041992 selfshadowField.setFloat(material.diffuseness);
18051993 diffusenessField.setFloat(material.factor);
....@@ -1818,7 +2006,7 @@
18182006 });
18192007 presetpanel.add(skin);
18202008
1821
- cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
2009
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
18222010 lambert.setToolTipText("Diffuse");
18232011 lambert.addMouseListener(new MouseAdapter()
18242012 {
....@@ -1836,7 +2024,7 @@
18362024 });
18372025 presetpanel.add(lambert);
18382026
1839
- cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
2027
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
18402028 diffuse2.setToolTipText("Diffuse2");
18412029 diffuse2.addMouseListener(new MouseAdapter()
18422030 {
....@@ -1854,7 +2042,7 @@
18542042 });
18552043 presetpanel.add(diffuse2);
18562044
1857
- cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
2045
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
18582046 diffusemoon.setToolTipText("Moon");
18592047 diffusemoon.addMouseListener(new MouseAdapter()
18602048 {
....@@ -1872,7 +2060,7 @@
18722060 });
18732061 presetpanel.add(diffusemoon);
18742062
1875
- cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
2063
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
18762064 diffusemoon2.setToolTipText("Moon2");
18772065 diffusemoon2.addMouseListener(new MouseAdapter()
18782066 {
....@@ -1890,7 +2078,7 @@
18902078 });
18912079 presetpanel.add(diffusemoon2);
18922080
1893
- cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
2081
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
18942082 diffusemoon3.setToolTipText("Moon3");
18952083 diffusemoon3.addMouseListener(new MouseAdapter()
18962084 {
....@@ -1908,7 +2096,7 @@
19082096 });
19092097 presetpanel.add(diffusemoon3);
19102098
1911
- cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
2099
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
19122100 diffusesheen.setToolTipText("Sheen");
19132101 diffusesheen.addMouseListener(new MouseAdapter()
19142102 {
....@@ -1925,7 +2113,7 @@
19252113 });
19262114 presetpanel.add(diffusesheen);
19272115
1928
- cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2116
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
19292117 rough.setToolTipText("Rough metal");
19302118 rough.addMouseListener(new MouseAdapter()
19312119 {
....@@ -1943,7 +2131,7 @@
19432131 });
19442132 presetpanel.add(rough);
19452133
1946
- cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2134
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
19472135 rough2.setToolTipText("Medium metal");
19482136 rough2.addMouseListener(new MouseAdapter()
19492137 {
....@@ -1961,7 +2149,7 @@
19612149 });
19622150 presetpanel.add(rough2);
19632151
1964
- cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2152
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
19652153 shini0.setToolTipText("Shiny");
19662154 shini0.addMouseListener(new MouseAdapter()
19672155 {
....@@ -1979,7 +2167,7 @@
19792167 });
19802168 presetpanel.add(shini0);
19812169
1982
- cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2170
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
19832171 shini1.setToolTipText("Shiny2");
19842172 shini1.addMouseListener(new MouseAdapter()
19852173 {
....@@ -1997,7 +2185,7 @@
19972185 });
19982186 presetpanel.add(shini1);
19992187
2000
- cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2188
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
20012189 shini2.setToolTipText("Shiny3");
20022190 shini2.addMouseListener(new MouseAdapter()
20032191 {
....@@ -2015,7 +2203,7 @@
20152203 });
20162204 presetpanel.add(shini2);
20172205
2018
- cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2206
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
20192207 aniso.setToolTipText("AnisoU");
20202208 aniso.addMouseListener(new MouseAdapter()
20212209 {
....@@ -2033,7 +2221,7 @@
20332221 });
20342222 presetpanel.add(aniso);
20352223
2036
- cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2224
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
20372225 aniso2.setToolTipText("AnisoV");
20382226 aniso2.addMouseListener(new MouseAdapter()
20392227 {
....@@ -2051,7 +2239,7 @@
20512239 });
20522240 presetpanel.add(aniso2);
20532241
2054
- cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2242
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
20552243 aniso3.setToolTipText("AnisoUV");
20562244 aniso3.addMouseListener(new MouseAdapter()
20572245 {
....@@ -2069,7 +2257,7 @@
20692257 });
20702258 presetpanel.add(aniso3);
20712259
2072
- cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2260
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
20732261 velvet0.setToolTipText("Velvet");
20742262 velvet0.addMouseListener(new MouseAdapter()
20752263 {
....@@ -2091,7 +2279,7 @@
20912279 });
20922280 presetpanel.add(velvet0);
20932281
2094
- cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2282
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
20952283 bump0.setToolTipText("Bump texture");
20962284 bump0.addMouseListener(new MouseAdapter()
20972285 {
....@@ -2110,7 +2298,22 @@
21102298 });
21112299 presetpanel.add(bump0);
21122300
2113
- cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2301
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
2302
+ borderShader.setToolTipText("Border fade");
2303
+ borderShader.addMouseListener(new MouseAdapter()
2304
+ {
2305
+ public void mouseClicked(MouseEvent e)
2306
+ {
2307
+ borderfadeField.setFloat(0.5);
2308
+ opacityField.setFloat(0.75);
2309
+
2310
+ materialtouched = true;
2311
+ applySelf();
2312
+ }
2313
+ });
2314
+ presetpanel.add(borderShader);
2315
+
2316
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
21142317 halo.setToolTipText("Halo");
21152318 halo.addMouseListener(new MouseAdapter()
21162319 {
....@@ -2127,7 +2330,7 @@
21272330 });
21282331 presetpanel.add(halo);
21292332
2130
- cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2333
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
21312334 candle.setToolTipText("Candle");
21322335 candle.addMouseListener(new MouseAdapter()
21332336 {
....@@ -2149,7 +2352,7 @@
21492352 });
21502353 presetpanel.add(candle);
21512354
2152
- cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2355
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
21532356 shadowShader.setToolTipText("Shadow");
21542357 shadowShader.addMouseListener(new MouseAdapter()
21552358 {
....@@ -2184,19 +2387,19 @@
21842387
21852388 cGridBag editBar = new cGridBag().setVertical(false);
21862389
2187
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2390
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
21882391 createMaterialButton.setToolTipText("Create material");
21892392
21902393 /*
21912394 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
21922395 */
21932396
2194
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2397
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
21952398 clearMaterialButton.setToolTipText("Clear material");
21962399
21972400 if (Globals.ADVANCED)
21982401 {
2199
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2402
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
22002403 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
22012404 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
22022405 }
....@@ -2217,9 +2420,20 @@
22172420
22182421 cGridBag huepanel = new cGridBag();
22192422 cGridBag huelabel = new cGridBag();
2220
- skin = GetLabel("icons/hue.png", false);
2221
- skin.fit = true;
2222
- huelabel.add(skin);
2423
+ cLabel hue = GetLabel("icons/hue.png", false);
2424
+ hue.fit = true;
2425
+
2426
+ hue.addMouseListener(new MouseAdapter()
2427
+ {
2428
+ public void mousePressed(MouseEvent e)
2429
+ {
2430
+ int x = e.getX();
2431
+
2432
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2433
+ }
2434
+ });
2435
+
2436
+ huelabel.add(hue);
22232437 huelabel.preferredWidth = 20;
22242438 huepanel.add(new cGridBag()); // Label
22252439 huepanel.add(huelabel); // Field/slider
....@@ -3495,32 +3709,8 @@
34953709
34963710 if (multiplyToggle != null)
34973711 multiplyToggle.setSelected(mat.multiply);
3498
-
3499
- assert (object.projectedVertices != null);
3500
-
3501
- if (object.projectedVertices.length <= 2)
3502
- {
3503
- // Side effect...
3504
- Object3D.cVector2[] keep = object.projectedVertices;
3505
- object.projectedVertices = new Object3D.cVector2[3];
3506
- for (int i = 0; i < 3; i++)
3507
- {
3508
- if (i < keep.length)
3509
- {
3510
- object.projectedVertices[i] = keep[i];
3511
- } else
3512
- {
3513
- object.projectedVertices[i] = new Object3D.cVector2();
3514
- }
3515
- /*
3516
- if(keep.length == 0)
3517
- object.projectedVertices[0] = new Object3D.cVector2();
3518
- else
3519
- object.projectedVertices[0] = keep[0];
3520
- object.projectedVertices[1] = new Object3D.cVector2();
3521
- */
3522
- }
3523
- }
3712
+
3713
+ AllocProjectedVertices(object);
35243714
35253715 SetMaterial(mat, object.projectedVertices);
35263716 }
....@@ -3830,7 +4020,7 @@
38304020 //System.out.println("ObjEditor " + event);
38314021 applySelf0(true);
38324022 //parent.applySelf();
3833
- objEditor.refreshContents();
4023
+ // conflicts with requestFocus objEditor.refreshContents();
38344024 } else if (source == resetButton)
38354025 {
38364026 CameraPane.fullreset = true;
....@@ -4010,11 +4200,18 @@
40104200
40114201 void New()
40124202 {
4013
- while (copy.Size() > 1)
4203
+ while (copy.Size() > 0)
40144204 {
4015
- copy.remove(1);
4205
+ copy.remove(0);
40164206 }
40174207
4208
+ copy.selection.clear();
4209
+
4210
+ if (copy == Grafreed.grafreed.universe)
4211
+ {
4212
+ CreateCameras();
4213
+ cameraView.SetCamera(GetCamera(copy, 0));
4214
+ }
40184215 ResetModel();
40194216 objEditor.refreshContents();
40204217 }
....@@ -4123,7 +4320,7 @@
41234320 {
41244321 //Save(true);
41254322 Replace();
4126
- SetUndoStates();
4323
+ SetVersionStates();
41274324 }
41284325
41294326 private boolean Equal(byte[] compress, byte[] name)
....@@ -4142,8 +4339,6 @@
41424339 return true;
41434340 }
41444341
4145
- java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
4146
-
41474342 void DeleteVersion()
41484343 {
41494344 for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
....@@ -4151,9 +4346,13 @@
41514346 copy.versionlist[i] = copy.versionlist[i+1];
41524347 }
41534348
4154
- CopyChanged();
4349
+ if (copy.versionlist[copy.versionindex] == null)
4350
+ copy.versionindex -= 1;
41554351
4156
- SetUndoStates();
4352
+ if (copy.versionindex != -1)
4353
+ CopyChanged();
4354
+
4355
+ SetVersionStates();
41574356 }
41584357
41594358 public boolean Save(boolean user)
....@@ -4161,7 +4360,7 @@
41614360 System.err.println("Save");
41624361 Replace();
41634362
4164
- cRadio tab = GetCurrentTab();
4363
+ //cRadio tab = GetCurrentTab();
41654364
41664365 Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
41674366
....@@ -4199,7 +4398,7 @@
41994398 // copy.versionlist[i] = null;
42004399 // }
42014400
4202
- SetUndoStates();
4401
+ SetVersionStates();
42034402
42044403 // test save
42054404 if (false)
....@@ -4259,12 +4458,12 @@
42594458 {
42604459 Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
42614460
4262
- SetUndoStates();
4461
+ SetVersionStates();
42634462
42644463 boolean temp = CameraPane.SWITCH;
42654464 CameraPane.SWITCH = false;
42664465
4267
- copy.ExtractBigData(versiontable);
4466
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
42684467
42694468 copy.clear();
42704469
....@@ -4276,7 +4475,7 @@
42764475 copy.add(obj.get(i));
42774476 }
42784477
4279
- copy.RestoreBigData(versiontable);
4478
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
42804479
42814480 CameraPane.SWITCH = temp;
42824481
....@@ -4326,23 +4525,45 @@
43264525 return count;
43274526 }
43284527
4329
- void SetUndoStates()
4528
+ public cGridBag versionSliderPane;
4529
+
4530
+ void SetVersionStates()
43304531 {
4331
- cRadio tab = GetCurrentTab();
4532
+ //if (true)
4533
+ // return;
4534
+
4535
+ //cRadio tab = GetCurrentTab();
43324536
4333
- restoreButton.setEnabled(true); // copy.versionindex != -1);
4334
- replaceButton.setEnabled(true); // copy.versionindex != -1);
4335
-
4336
- previousVersionButton.setEnabled(copy.versionindex > 0);
4337
- nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4338
-
4339
- deleteVersionButton.setEnabled(//copy.versionindex > 0 &&
4340
- copy.versionlist[copy.versionindex + 1] != null);
4341
-
4342
- muteSlider = true;
4343
- versionSlider.setMaximum(VersionCount() - 1);
4344
- versionSlider.setInteger(copy.versionindex);
4345
- muteSlider = false;
4537
+ if (copy.versionlist == null)
4538
+ {
4539
+ saveVersionButton.setEnabled(false);
4540
+ restoreButton.setEnabled(false);
4541
+ replaceButton.setEnabled(false);
4542
+ previousVersionButton.setEnabled(false);
4543
+ nextVersionButton.setEnabled(false);
4544
+ deleteVersionButton.setEnabled(false);
4545
+ versionSliderPane.setVisible(false);
4546
+ }
4547
+ else
4548
+ {
4549
+ restoreButton.setEnabled(copy.versionindex != -1);
4550
+ replaceButton.setEnabled(copy.versionindex != -1);
4551
+
4552
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4553
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4554
+
4555
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4556
+ //copy.versionlist[copy.versionindex + 1] != null);
4557
+
4558
+ muteSlider = true;
4559
+ versionSlider.setMinimum(0);
4560
+ versionSlider.setMaximum(VersionCount() - 1);
4561
+ versionSlider.setInteger(copy.versionindex);
4562
+ versionSlider.setEnabled(copy.versionindex != -1);
4563
+ muteSlider = false;
4564
+
4565
+ versionSliderPane.setVisible(true);
4566
+ }
43464567 }
43474568
43484569 public boolean PreviousVersion()
....@@ -4352,7 +4573,7 @@
43524573
43534574 System.err.println("Undo");
43544575
4355
- cRadio tab = GetCurrentTab();
4576
+ //cRadio tab = GetCurrentTab();
43564577
43574578 if (copy.versionindex == 0)
43584579 {
....@@ -4384,7 +4605,7 @@
43844605 {
43854606 System.err.println("Restore");
43864607
4387
- cRadio tab = GetCurrentTab();
4608
+ //cRadio tab = GetCurrentTab();
43884609
43894610 if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
43904611 {
....@@ -4400,9 +4621,9 @@
44004621
44014622 public boolean Replace()
44024623 {
4403
- System.err.println("Replace");
4624
+ //System.err.println("Replace");
44044625
4405
- cRadio tab = GetCurrentTab();
4626
+ //cRadio tab = GetCurrentTab();
44064627
44074628 if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
44084629 {
....@@ -4420,7 +4641,7 @@
44204641 // Option?
44214642 Replace();
44224643
4423
- cRadio tab = GetCurrentTab();
4644
+ //cRadio tab = GetCurrentTab();
44244645
44254646 if (copy.versionlist[copy.versionindex + 1] == null)
44264647 {
....@@ -4627,6 +4848,12 @@
46274848 // else
46284849 // applySelf(true);
46294850 // }
4851
+
4852
+ boolean Equal(double a, double b)
4853
+ {
4854
+ return Math.abs(a - b) < 0.001;
4855
+ }
4856
+
46304857 void applySelf0(boolean name)
46314858 {
46324859 if (name)
....@@ -4676,29 +4903,52 @@
46764903 {
46774904 cMaterial mat = copy.material;
46784905
4679
- colorField.SetToolTipValue((mat.color));
4680
- saturationField.SetToolTipValue((mat.modulation));
4681
- metalnessField.SetToolTipValue((mat.metalness));
4682
- diffuseField.SetToolTipValue((mat.diffuse));
4683
- specularField.SetToolTipValue((mat.specular));
4684
- shininessField.SetToolTipValue((mat.shininess));
4685
- shiftField.SetToolTipValue((mat.shift));
4686
- ambientField.SetToolTipValue((mat.ambient));
4687
- lightareaField.SetToolTipValue((mat.lightarea));
4688
- diffusenessField.SetToolTipValue((mat.factor));
4689
- velvetField.SetToolTipValue((mat.velvet));
4690
- sheenField.SetToolTipValue((mat.sheen));
4691
- subsurfaceField.SetToolTipValue((mat.subsurface));
4692
- backlitField.SetToolTipValue((mat.bump));
4693
- anisoField.SetToolTipValue((mat.aniso));
4694
- anisoVField.SetToolTipValue((mat.anisoV));
4695
- cameraField.SetToolTipValue((mat.cameralight));
4696
- selfshadowField.SetToolTipValue((mat.diffuseness));
4697
- shadowField.SetToolTipValue((mat.shadow));
4698
- textureField.SetToolTipValue((mat.texture));
4699
- opacityField.SetToolTipValue((mat.opacity));
4700
- fakedepthField.SetToolTipValue((mat.fakedepth));
4701
- shadowbiasField.SetToolTipValue((mat.shadowbias));
4906
+ if (!Equal(colorField.getFloat(), mat.color))
4907
+ colorField.SetToolTipValue((mat.color));
4908
+ if (!Equal(saturationField.getFloat(), mat.modulation))
4909
+ saturationField.SetToolTipValue((mat.modulation));
4910
+ if (!Equal(metalnessField.getFloat(), mat.metalness))
4911
+ metalnessField.SetToolTipValue((mat.metalness));
4912
+ if (!Equal(diffuseField.getFloat(), mat.diffuse))
4913
+ diffuseField.SetToolTipValue((mat.diffuse));
4914
+ if (!Equal(specularField.getFloat(), mat.specular))
4915
+ specularField.SetToolTipValue((mat.specular));
4916
+ if (!Equal(shininessField.getFloat(), mat.shininess))
4917
+ shininessField.SetToolTipValue((mat.shininess));
4918
+ if (!Equal(shiftField.getFloat(), mat.shift))
4919
+ shiftField.SetToolTipValue((mat.shift));
4920
+ if (!Equal(ambientField.getFloat(), mat.ambient))
4921
+ ambientField.SetToolTipValue((mat.ambient));
4922
+ if (!Equal(lightareaField.getFloat(), mat.lightarea))
4923
+ lightareaField.SetToolTipValue((mat.lightarea));
4924
+ if (!Equal(diffusenessField.getFloat(), mat.factor))
4925
+ diffusenessField.SetToolTipValue((mat.factor));
4926
+ if (!Equal(velvetField.getFloat(), mat.velvet))
4927
+ velvetField.SetToolTipValue((mat.velvet));
4928
+ if (!Equal(sheenField.getFloat(), mat.sheen))
4929
+ sheenField.SetToolTipValue((mat.sheen));
4930
+ if (!Equal(subsurfaceField.getFloat(), mat.subsurface))
4931
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4932
+ if (!Equal(backlitField.getFloat(), mat.bump))
4933
+ backlitField.SetToolTipValue((mat.bump));
4934
+ if (!Equal(anisoField.getFloat(), mat.aniso))
4935
+ anisoField.SetToolTipValue((mat.aniso));
4936
+ if (!Equal(anisoVField.getFloat(), mat.anisoV))
4937
+ anisoVField.SetToolTipValue((mat.anisoV));
4938
+ if (!Equal(cameraField.getFloat(), mat.cameralight))
4939
+ cameraField.SetToolTipValue((mat.cameralight));
4940
+ if (!Equal(selfshadowField.getFloat(), mat.diffuseness))
4941
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4942
+ if (!Equal(shadowField.getFloat(), mat.shadow))
4943
+ shadowField.SetToolTipValue((mat.shadow));
4944
+ if (!Equal(textureField.getFloat(), mat.texture))
4945
+ textureField.SetToolTipValue((mat.texture));
4946
+ if (!Equal(opacityField.getFloat(), mat.opacity))
4947
+ opacityField.SetToolTipValue((mat.opacity));
4948
+ if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
4949
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4950
+ if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
4951
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
47024952 }
47034953
47044954 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
....@@ -4733,15 +4983,17 @@
47334983
47344984 public void stateChanged(ChangeEvent e)
47354985 {
4736
- // assert(false);
4986
+ // assert(false);
47374987 if (e.getSource() == versionSlider)
47384988 {
47394989 if (muteSlider)
47404990 return;
47414991
4992
+ Replace();
4993
+
47424994 int version = versionSlider.getInteger();
47434995
4744
- if (copy.versionlist[version] != null)
4996
+ if (version != -1 && copy.versionlist[version] != null)
47454997 {
47464998 copy.versionindex = version;
47474999 CopyChanged();
....@@ -5100,7 +5352,9 @@
51005352 }
51015353
51025354 if (previousVersionButton != null && copy.versionlist != null)
5103
- SetUndoStates();
5355
+ SetVersionStates();
5356
+
5357
+ cameraView.requestFocusInWindow();
51045358 }
51055359
51065360 static TweenManager tweenManager = new TweenManager();
....@@ -5132,7 +5386,7 @@
51325386 // group = (Composite) group.get(0);
51335387 // }
51345388
5135
- System.out.println("makeSomething of " + thing);
5389
+ //System.out.println("makeSomething of " + thing);
51365390
51375391 /*
51385392 if (deselect && jList != null)
....@@ -5486,11 +5740,15 @@
54865740
54875741 copy.versionlist = readobj.versionlist;
54885742 copy.versionindex = readobj.versionindex;
5743
+ copy.versiontable = readobj.versiontable;
54895744
54905745 if (copy.versionlist == null)
54915746 {
5747
+ // Backward compatibility
54925748 copy.versionlist = new Object3D[100];
54935749 copy.versionindex = -1;
5750
+
5751
+ //Save(true);
54945752 }
54955753
54965754 //? SetUndoStates();
....@@ -5582,6 +5840,8 @@
55825840
55835841 void save()
55845842 {
5843
+ Replace();
5844
+
55855845 if (lastname == null)
55865846 {
55875847 return;
....@@ -5836,6 +6096,7 @@
58366096 boolean materialFlushed;
58376097 Object3D latestObject;
58386098
6099
+ cGridBag transformPanel;
58396100 cGridBag XYZPanel;
58406101
58416102 JSplitPane gridPanel;