.. | .. |
---|
43 | 43 | |
---|
44 | 44 | static ObjEditor theFrame; |
---|
45 | 45 | |
---|
| 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 | + |
---|
46 | 90 | public cGridBag GetSeparator() |
---|
47 | 91 | { |
---|
48 | 92 | cGridBag separator = new cGridBag(); |
---|
.. | .. |
---|
54 | 98 | cButton GetButton(String name, boolean border) |
---|
55 | 99 | { |
---|
56 | 100 | 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); |
---|
58 | 105 | } |
---|
59 | 106 | |
---|
60 | 107 | cLabel GetLabel(String name, boolean border) |
---|
.. | .. |
---|
75 | 122 | return new cCheckBox(icon, border); |
---|
76 | 123 | } |
---|
77 | 124 | |
---|
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) |
---|
79 | 128 | { |
---|
| 129 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 130 | + if (iconCache != null) |
---|
| 131 | + { |
---|
| 132 | + return iconCache; |
---|
| 133 | + } |
---|
| 134 | + |
---|
80 | 135 | try |
---|
81 | 136 | { |
---|
82 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 137 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
83 | 138 | |
---|
84 | 139 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
85 | 140 | // { |
---|
.. | .. |
---|
94 | 149 | // } |
---|
95 | 150 | |
---|
96 | 151 | javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 152 | + |
---|
| 153 | + icons.put(name, icon); |
---|
| 154 | + |
---|
97 | 155 | return icon; |
---|
98 | 156 | } |
---|
99 | 157 | catch (Exception e) |
---|
100 | 158 | { |
---|
| 159 | + //icons.put(name, null); |
---|
101 | 160 | return null; |
---|
102 | 161 | } |
---|
103 | 162 | } |
---|
.. | .. |
---|
297 | 356 | client = inClient; |
---|
298 | 357 | copy = client; |
---|
299 | 358 | |
---|
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 | +// } |
---|
305 | 366 | |
---|
306 | 367 | // "this" is not called: SetupUI2(objEditor); |
---|
307 | 368 | } |
---|
.. | .. |
---|
320 | 381 | { |
---|
321 | 382 | copy.versionlist = new Object3D[100]; |
---|
322 | 383 | copy.versionindex = -1; |
---|
| 384 | + |
---|
| 385 | +// Save(true); |
---|
323 | 386 | } |
---|
324 | 387 | |
---|
325 | 388 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
343 | 406 | //parent = p; |
---|
344 | 407 | |
---|
345 | 408 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
346 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 409 | + if (Globals.DEBUG) |
---|
| 410 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
347 | 411 | //gd.setFullScreenWindow(this); |
---|
348 | 412 | //setResizable(false); |
---|
349 | 413 | //if (!isDisplayable()) |
---|
.. | .. |
---|
354 | 418 | copy = localCopy; |
---|
355 | 419 | copy.editWindow = this; |
---|
356 | 420 | |
---|
357 | | - if (copy.versionlist == null) |
---|
358 | | - { |
---|
359 | | -// copy.versions = new byte[100][]; |
---|
| 421 | +// if (copy.versionlist == null) |
---|
| 422 | +// { |
---|
| 423 | +// copy.versionlist = new Object3D[100]; |
---|
360 | 424 | // copy.versionindex = -1; |
---|
361 | | - } |
---|
| 425 | +// |
---|
| 426 | +// Save(true); |
---|
| 427 | +// } |
---|
362 | 428 | |
---|
363 | 429 | SetupMenu(); |
---|
364 | 430 | |
---|
.. | .. |
---|
378 | 444 | |
---|
379 | 445 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
380 | 446 | |
---|
| 447 | + // This is to refresh the UI of the material panel. |
---|
| 448 | + boolean patchMaterial; |
---|
| 449 | + |
---|
381 | 450 | void SetupMenu() |
---|
382 | 451 | { |
---|
383 | 452 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
427 | 496 | |
---|
428 | 497 | ChangeListener changeListener = new ChangeListener() |
---|
429 | 498 | { |
---|
| 499 | + //String name; |
---|
| 500 | + |
---|
430 | 501 | public void stateChanged(ChangeEvent changeEvent) |
---|
431 | 502 | { |
---|
432 | 503 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
445 | 516 | // EditSelection(false); |
---|
446 | 517 | // } |
---|
447 | 518 | |
---|
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(); |
---|
449 | 550 | } |
---|
450 | 551 | }; |
---|
451 | 552 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
754 | 855 | boolean maximized; |
---|
755 | 856 | |
---|
756 | 857 | cButton fullscreenLayout; |
---|
| 858 | + cButton expandedLayout; |
---|
757 | 859 | |
---|
758 | 860 | void Minimize() |
---|
759 | 861 | { |
---|
.. | .. |
---|
793 | 895 | cButton minButton; |
---|
794 | 896 | cButton maxButton; |
---|
795 | 897 | cButton fullButton; |
---|
| 898 | + cButton collapseButton; |
---|
| 899 | + cButton maximize3DButton; |
---|
796 | 900 | |
---|
797 | 901 | void ToggleFullScreen() |
---|
798 | 902 | { |
---|
799 | | -GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 903 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
800 | 904 | |
---|
801 | 905 | cameraView.ToggleFullScreen(); |
---|
802 | 906 | |
---|
.. | .. |
---|
817 | 921 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
818 | 922 | // X framePanel.add(bigThree); |
---|
819 | 923 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
820 | | - framePanel.setDividerLocation(46); |
---|
| 924 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
821 | 925 | |
---|
822 | 926 | //frame.setVisible(true); |
---|
823 | | - radio.layout = keepButton; |
---|
| 927 | +// radio.layout = keepButton; |
---|
824 | 928 | //theFrame = null; |
---|
825 | 929 | keepButton = null; |
---|
826 | | - radio.layout.doClick(); |
---|
| 930 | +// radio.layout.doClick(); |
---|
827 | 931 | |
---|
828 | 932 | } else |
---|
829 | 933 | { |
---|
.. | .. |
---|
844 | 948 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
845 | 949 | // X framePanel.remove(bigThree); |
---|
846 | 950 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
847 | | - framePanel.setDividerLocation(0); |
---|
| 951 | +// framePanel.setDividerLocation(0); |
---|
848 | 952 | |
---|
849 | | - radio.layout = fullscreenLayout; |
---|
850 | | - radio.layout.doClick(); |
---|
| 953 | +// radio.layout = fullscreenLayout; |
---|
| 954 | +// radio.layout.doClick(); |
---|
851 | 955 | //frame.setVisible(true); |
---|
852 | 956 | } |
---|
853 | 957 | frame.validate(); |
---|
.. | .. |
---|
855 | 959 | cameraView.requestFocusInWindow(); |
---|
856 | 960 | } |
---|
857 | 961 | |
---|
858 | | - private Object3D CompressCopy() |
---|
| 962 | + void CollapseToolbar() |
---|
| 963 | + { |
---|
| 964 | + framePanel.setDividerLocation(0); |
---|
| 965 | + //frame.validate(); |
---|
| 966 | + |
---|
| 967 | + cameraView.requestFocusInWindow(); |
---|
| 968 | + } |
---|
| 969 | + |
---|
| 970 | + private Object3D Duplicate(Object3D object) |
---|
859 | 971 | { |
---|
860 | 972 | boolean temp = CameraPane.SWITCH; |
---|
861 | 973 | CameraPane.SWITCH = false; |
---|
862 | 974 | |
---|
863 | | - copy.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); |
---|
864 | 979 | // if (copy == client) |
---|
865 | 980 | |
---|
866 | | - Object3D versions[] = copy.versionlist; |
---|
867 | | - copy.versionlist = null; |
---|
| 981 | + Object3D versions[] = object.versionlist; |
---|
| 982 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 983 | + object.versionlist = null; |
---|
| 984 | + object.versiontable = null; |
---|
| 985 | + |
---|
| 986 | + Object3D parent = object.parent; |
---|
| 987 | + object.parent = null; |
---|
868 | 988 | |
---|
869 | 989 | //byte[] compress = Compress(copy); |
---|
870 | | - Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 990 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
871 | 991 | |
---|
872 | | - copy.versionlist = versions; |
---|
| 992 | + object.parent = parent; |
---|
873 | 993 | |
---|
874 | | - copy.RestoreBigData(versiontable); |
---|
| 994 | + object.versionlist = versions; |
---|
| 995 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 996 | + |
---|
| 997 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
875 | 998 | |
---|
876 | 999 | CameraPane.SWITCH = temp; |
---|
877 | 1000 | |
---|
.. | .. |
---|
1210 | 1333 | |
---|
1211 | 1334 | //if (copy.pinned) |
---|
1212 | 1335 | { |
---|
1213 | | - pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1336 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
1214 | 1337 | pinButton.setSelected(copy.pinned); |
---|
1215 | 1338 | cGridBag t = new cGridBag(); |
---|
1216 | 1339 | t.preferredWidth = 2; |
---|
.. | .. |
---|
1233 | 1356 | |
---|
1234 | 1357 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1235 | 1358 | liveCB.setToolTipText("Animate object"); |
---|
| 1359 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1360 | + markCB.setToolTipText("Set target transform"); |
---|
1236 | 1361 | selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1237 | 1362 | selectableCB.setToolTipText("Make object selectable"); |
---|
1238 | 1363 | // Return(); |
---|
1239 | 1364 | |
---|
1240 | 1365 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1241 | 1366 | hideCB.setToolTipText("Hide object"); |
---|
1242 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1243 | | - markCB.setToolTipText("As animation target transform"); |
---|
1244 | 1367 | |
---|
1245 | 1368 | ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1246 | 1369 | |
---|
.. | .. |
---|
1442 | 1565 | |
---|
1443 | 1566 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1444 | 1567 | { |
---|
1445 | | - System.out.println("CREATE CAMERAS"); |
---|
1446 | | - cams = new cTemplate(); |
---|
1447 | | - cams.name = "Cameras"; |
---|
1448 | | - copy.insertElementAt(cams, 0); |
---|
1449 | | - //cams.parent = copy; |
---|
1450 | | - |
---|
1451 | | - cam = new Camera(); // LA.newVector(3, 2, 1)); |
---|
1452 | | - cams.addChild(cam); |
---|
1453 | | - cam = new Camera(1); |
---|
1454 | | - cams.addChild(cam); |
---|
1455 | | - cam = new Camera(2); |
---|
1456 | | - cams.addChild(cam); |
---|
1457 | | - cam = new Camera(3); |
---|
1458 | | - cams.addChild(cam); |
---|
1459 | | - cam = new Camera(4); // Light |
---|
1460 | | - cams.addChild(cam); |
---|
| 1568 | + if (Globals.DEBUG) |
---|
| 1569 | + System.out.println("CREATE CAMERAS"); |
---|
| 1570 | + cams = CreateCameras(); |
---|
1461 | 1571 | } else |
---|
1462 | 1572 | { |
---|
1463 | 1573 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1523 | 1633 | //frontView.object = copy; |
---|
1524 | 1634 | //sideView.object = copy; |
---|
1525 | 1635 | |
---|
| 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 | + |
---|
1526 | 1675 | XYZPanel = new cGridBag().setVertical(true); |
---|
1527 | 1676 | //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1528 | 1677 | |
---|
.. | .. |
---|
1532 | 1681 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1533 | 1682 | //XYZPanel.setName("XYZ"); |
---|
1534 | 1683 | |
---|
| 1684 | + transformPanel.add(resetTransformPanel); |
---|
| 1685 | + transformPanel.add(XYZPanel); |
---|
| 1686 | + |
---|
1535 | 1687 | /* |
---|
1536 | 1688 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1537 | 1689 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1539 | 1691 | gridPanel.add(cameraView); |
---|
1540 | 1692 | gridPanel.add(XYZPanel); |
---|
1541 | 1693 | */ |
---|
1542 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1543 | | - gridPanel.setContinuousLayout(true); |
---|
1544 | | - gridPanel.setOneTouchExpandable(true); |
---|
1545 | | - gridPanel.setDividerLocation(1.0); |
---|
1546 | | - gridPanel.setDividerSize(9); |
---|
1547 | | - 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); |
---|
1548 | 1700 | |
---|
1549 | 1701 | // aConstraints.weighty = 0; |
---|
1550 | 1702 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1567 | 1719 | |
---|
1568 | 1720 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1569 | 1721 | //tmp.setName("Edit"); |
---|
1570 | | - objectPanel.add(materialPanel); |
---|
1571 | | - objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1572 | | - objectPanel.setToolTipTextAt(0, "Material"); |
---|
1573 | | - |
---|
| 1722 | + objectPanel.add(skyboxPanel); |
---|
| 1723 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1724 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1725 | + |
---|
1574 | 1726 | objectPanel.add(toolboxPanel); |
---|
1575 | 1727 | objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
1576 | 1728 | objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1577 | 1729 | |
---|
1578 | | - objectPanel.add(skyboxPanel); |
---|
1579 | | - objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
1580 | | - objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
1581 | | - |
---|
| 1730 | + objectPanel.add(materialPanel); |
---|
| 1731 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1732 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
| 1733 | + |
---|
1582 | 1734 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1583 | 1735 | // north.setName("Edit"); |
---|
1584 | 1736 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1585 | 1737 | // objectPanel.add(north); |
---|
1586 | 1738 | objectPanel.add(editPanel); |
---|
1587 | | - objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1739 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
1588 | 1740 | objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1589 | 1741 | |
---|
1590 | | - objectPanel.add(XYZPanel); |
---|
| 1742 | + objectPanel.add(transformPanel); |
---|
1591 | 1743 | objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
1592 | | - objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1744 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
1593 | 1745 | |
---|
| 1746 | + patchMaterial = true; |
---|
| 1747 | + cameraView.patchMaterial = this; |
---|
| 1748 | + objectPanel.setSelectedIndex(2); |
---|
| 1749 | + |
---|
1594 | 1750 | /* |
---|
1595 | 1751 | aConstraints.gridx = 0; |
---|
1596 | 1752 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1610 | 1766 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1611 | 1767 | |
---|
1612 | 1768 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1613 | | - scenePanel.preferredWidth = 5; |
---|
| 1769 | + scenePanel.preferredWidth = 6; |
---|
1614 | 1770 | |
---|
1615 | 1771 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1616 | 1772 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1621 | 1777 | |
---|
1622 | 1778 | AddOptions(optionsPanel); //, aConstraints); |
---|
1623 | 1779 | |
---|
1624 | | - tabbedPane.add(optionsPanel); |
---|
1625 | | - |
---|
1626 | 1780 | tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1627 | 1781 | |
---|
| 1782 | + tabbedPane.add(optionsPanel); |
---|
| 1783 | + |
---|
1628 | 1784 | scenePanel.add(tabbedPane); |
---|
1629 | 1785 | |
---|
1630 | | - //if (Globals.ADVANCED) |
---|
1631 | | - tabbedPane.add(infoPanel); |
---|
1632 | | - tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
1633 | | - tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1786 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1787 | + creditsPanel.setName("Credits"); |
---|
1634 | 1788 | |
---|
| 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 | + |
---|
1635 | 1826 | /* |
---|
1636 | 1827 | cTree jTree = new cTree(null); |
---|
1637 | 1828 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1652 | 1843 | jtp.add(tree); |
---|
1653 | 1844 | */ |
---|
1654 | 1845 | |
---|
1655 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1656 | | - bigPanel.setContinuousLayout(true); |
---|
1657 | | - bigPanel.setOneTouchExpandable(true); |
---|
1658 | | - bigPanel.setDividerLocation(0.8); |
---|
1659 | | - bigPanel.setDividerSize(15); |
---|
1660 | | - bigPanel.setResizeWeight(0.15); |
---|
1661 | | - 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"); |
---|
1662 | 1853 | |
---|
1663 | 1854 | //bigPanel.setLayout(new BorderLayout()); |
---|
1664 | 1855 | //bigPanel.setSize(new Dimension(10,10)); |
---|
.. | .. |
---|
1702 | 1893 | // aConstraints.gridheight = 1; |
---|
1703 | 1894 | |
---|
1704 | 1895 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
| 1896 | + |
---|
| 1897 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1898 | + new java.beans.PropertyChangeListener() |
---|
| 1899 | + { |
---|
| 1900 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1901 | + { |
---|
| 1902 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1903 | + { |
---|
| 1904 | + if (radio.layout != expandedLayout) |
---|
| 1905 | + { |
---|
| 1906 | + radio.layout = expandedLayout; |
---|
| 1907 | + radio.layout.doClick(); |
---|
| 1908 | + } |
---|
| 1909 | + } |
---|
| 1910 | + } |
---|
| 1911 | + }); |
---|
| 1912 | + |
---|
1705 | 1913 | framePanel.setContinuousLayout(false); |
---|
1706 | 1914 | framePanel.setOneTouchExpandable(false); |
---|
1707 | 1915 | //.setDividerLocation(0.8); |
---|
.. | .. |
---|
1711 | 1919 | |
---|
1712 | 1920 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1713 | 1921 | /**/ |
---|
1714 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1922 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1715 | 1923 | //worldPane.add(bigPanel); |
---|
1716 | 1924 | //worldPane.add(worldPanel); |
---|
1717 | 1925 | /**/ |
---|
.. | .. |
---|
1725 | 1933 | |
---|
1726 | 1934 | cameraView.requestFocusInWindow(); |
---|
1727 | 1935 | |
---|
1728 | | - gridPanel.setDividerLocation(1.0); |
---|
| 1936 | +// gridPanel.setDividerLocation(1.0); |
---|
1729 | 1937 | |
---|
1730 | 1938 | frame.validate(); |
---|
1731 | 1939 | |
---|
.. | .. |
---|
1760 | 1968 | { |
---|
1761 | 1969 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1762 | 1970 | |
---|
1763 | | - cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1971 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
1764 | 1972 | skin.setToolTipText("Skin"); |
---|
1765 | 1973 | skin.addMouseListener(new MouseAdapter() |
---|
1766 | 1974 | { |
---|
.. | .. |
---|
1771 | 1979 | |
---|
1772 | 1980 | // Skin |
---|
1773 | 1981 | colorField.setFloat(material.color); |
---|
1774 | | - 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 | + |
---|
1775 | 1991 | subsurfaceField.setFloat(material.subsurface); |
---|
1776 | 1992 | selfshadowField.setFloat(material.diffuseness); |
---|
1777 | 1993 | diffusenessField.setFloat(material.factor); |
---|
.. | .. |
---|
1790 | 2006 | }); |
---|
1791 | 2007 | presetpanel.add(skin); |
---|
1792 | 2008 | |
---|
1793 | | - cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 2009 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
1794 | 2010 | lambert.setToolTipText("Diffuse"); |
---|
1795 | 2011 | lambert.addMouseListener(new MouseAdapter() |
---|
1796 | 2012 | { |
---|
.. | .. |
---|
1808 | 2024 | }); |
---|
1809 | 2025 | presetpanel.add(lambert); |
---|
1810 | 2026 | |
---|
1811 | | - cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 2027 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
1812 | 2028 | diffuse2.setToolTipText("Diffuse2"); |
---|
1813 | 2029 | diffuse2.addMouseListener(new MouseAdapter() |
---|
1814 | 2030 | { |
---|
.. | .. |
---|
1826 | 2042 | }); |
---|
1827 | 2043 | presetpanel.add(diffuse2); |
---|
1828 | 2044 | |
---|
1829 | | - cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2045 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
1830 | 2046 | diffusemoon.setToolTipText("Moon"); |
---|
1831 | 2047 | diffusemoon.addMouseListener(new MouseAdapter() |
---|
1832 | 2048 | { |
---|
.. | .. |
---|
1844 | 2060 | }); |
---|
1845 | 2061 | presetpanel.add(diffusemoon); |
---|
1846 | 2062 | |
---|
1847 | | - cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2063 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
1848 | 2064 | diffusemoon2.setToolTipText("Moon2"); |
---|
1849 | 2065 | diffusemoon2.addMouseListener(new MouseAdapter() |
---|
1850 | 2066 | { |
---|
.. | .. |
---|
1862 | 2078 | }); |
---|
1863 | 2079 | presetpanel.add(diffusemoon2); |
---|
1864 | 2080 | |
---|
1865 | | - cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2081 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
1866 | 2082 | diffusemoon3.setToolTipText("Moon3"); |
---|
1867 | 2083 | diffusemoon3.addMouseListener(new MouseAdapter() |
---|
1868 | 2084 | { |
---|
.. | .. |
---|
1880 | 2096 | }); |
---|
1881 | 2097 | presetpanel.add(diffusemoon3); |
---|
1882 | 2098 | |
---|
1883 | | - cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2099 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
1884 | 2100 | diffusesheen.setToolTipText("Sheen"); |
---|
1885 | 2101 | diffusesheen.addMouseListener(new MouseAdapter() |
---|
1886 | 2102 | { |
---|
.. | .. |
---|
1897 | 2113 | }); |
---|
1898 | 2114 | presetpanel.add(diffusesheen); |
---|
1899 | 2115 | |
---|
1900 | | - cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2116 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
1901 | 2117 | rough.setToolTipText("Rough metal"); |
---|
1902 | 2118 | rough.addMouseListener(new MouseAdapter() |
---|
1903 | 2119 | { |
---|
.. | .. |
---|
1915 | 2131 | }); |
---|
1916 | 2132 | presetpanel.add(rough); |
---|
1917 | 2133 | |
---|
1918 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2134 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
1919 | 2135 | rough2.setToolTipText("Medium metal"); |
---|
1920 | 2136 | rough2.addMouseListener(new MouseAdapter() |
---|
1921 | 2137 | { |
---|
.. | .. |
---|
1933 | 2149 | }); |
---|
1934 | 2150 | presetpanel.add(rough2); |
---|
1935 | 2151 | |
---|
1936 | | - cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2152 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
1937 | 2153 | shini0.setToolTipText("Shiny"); |
---|
1938 | 2154 | shini0.addMouseListener(new MouseAdapter() |
---|
1939 | 2155 | { |
---|
.. | .. |
---|
1951 | 2167 | }); |
---|
1952 | 2168 | presetpanel.add(shini0); |
---|
1953 | 2169 | |
---|
1954 | | - cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2170 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
1955 | 2171 | shini1.setToolTipText("Shiny2"); |
---|
1956 | 2172 | shini1.addMouseListener(new MouseAdapter() |
---|
1957 | 2173 | { |
---|
.. | .. |
---|
1969 | 2185 | }); |
---|
1970 | 2186 | presetpanel.add(shini1); |
---|
1971 | 2187 | |
---|
1972 | | - cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2188 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
1973 | 2189 | shini2.setToolTipText("Shiny3"); |
---|
1974 | 2190 | shini2.addMouseListener(new MouseAdapter() |
---|
1975 | 2191 | { |
---|
.. | .. |
---|
1987 | 2203 | }); |
---|
1988 | 2204 | presetpanel.add(shini2); |
---|
1989 | 2205 | |
---|
1990 | | - cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2206 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
1991 | 2207 | aniso.setToolTipText("AnisoU"); |
---|
1992 | 2208 | aniso.addMouseListener(new MouseAdapter() |
---|
1993 | 2209 | { |
---|
.. | .. |
---|
2005 | 2221 | }); |
---|
2006 | 2222 | presetpanel.add(aniso); |
---|
2007 | 2223 | |
---|
2008 | | - cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2224 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
2009 | 2225 | aniso2.setToolTipText("AnisoV"); |
---|
2010 | 2226 | aniso2.addMouseListener(new MouseAdapter() |
---|
2011 | 2227 | { |
---|
.. | .. |
---|
2023 | 2239 | }); |
---|
2024 | 2240 | presetpanel.add(aniso2); |
---|
2025 | 2241 | |
---|
2026 | | - cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2242 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
2027 | 2243 | aniso3.setToolTipText("AnisoUV"); |
---|
2028 | 2244 | aniso3.addMouseListener(new MouseAdapter() |
---|
2029 | 2245 | { |
---|
.. | .. |
---|
2041 | 2257 | }); |
---|
2042 | 2258 | presetpanel.add(aniso3); |
---|
2043 | 2259 | |
---|
2044 | | - cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2260 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
2045 | 2261 | velvet0.setToolTipText("Velvet"); |
---|
2046 | 2262 | velvet0.addMouseListener(new MouseAdapter() |
---|
2047 | 2263 | { |
---|
.. | .. |
---|
2063 | 2279 | }); |
---|
2064 | 2280 | presetpanel.add(velvet0); |
---|
2065 | 2281 | |
---|
2066 | | - cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2282 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
2067 | 2283 | bump0.setToolTipText("Bump texture"); |
---|
2068 | 2284 | bump0.addMouseListener(new MouseAdapter() |
---|
2069 | 2285 | { |
---|
.. | .. |
---|
2082 | 2298 | }); |
---|
2083 | 2299 | presetpanel.add(bump0); |
---|
2084 | 2300 | |
---|
2085 | | - 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); |
---|
2086 | 2317 | halo.setToolTipText("Halo"); |
---|
2087 | 2318 | halo.addMouseListener(new MouseAdapter() |
---|
2088 | 2319 | { |
---|
.. | .. |
---|
2099 | 2330 | }); |
---|
2100 | 2331 | presetpanel.add(halo); |
---|
2101 | 2332 | |
---|
2102 | | - cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2333 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
2103 | 2334 | candle.setToolTipText("Candle"); |
---|
2104 | 2335 | candle.addMouseListener(new MouseAdapter() |
---|
2105 | 2336 | { |
---|
.. | .. |
---|
2121 | 2352 | }); |
---|
2122 | 2353 | presetpanel.add(candle); |
---|
2123 | 2354 | |
---|
| 2355 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
| 2356 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2357 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2358 | + { |
---|
| 2359 | + public void mouseClicked(MouseEvent e) |
---|
| 2360 | + { |
---|
| 2361 | + diffuseField.setFloat(0.001); |
---|
| 2362 | + ambientField.setFloat(0.001); |
---|
| 2363 | + cameraField.setFloat(0.001); |
---|
| 2364 | + specularField.setFloat(0.001); |
---|
| 2365 | + fakedepthField.setFloat(0.001); |
---|
| 2366 | + opacityField.setFloat(0.6); |
---|
| 2367 | + |
---|
| 2368 | + materialtouched = true; |
---|
| 2369 | + applySelf(); |
---|
| 2370 | + } |
---|
| 2371 | + }); |
---|
| 2372 | + presetpanel.add(shadowShader); |
---|
| 2373 | + |
---|
2124 | 2374 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2125 | 2375 | |
---|
2126 | 2376 | presetpanel.preferredWidth = 1; |
---|
.. | .. |
---|
2137 | 2387 | |
---|
2138 | 2388 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
2139 | 2389 | |
---|
2140 | | - editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2390 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2141 | 2391 | createMaterialButton.setToolTipText("Create material"); |
---|
2142 | 2392 | |
---|
2143 | 2393 | /* |
---|
2144 | 2394 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
2145 | 2395 | */ |
---|
2146 | 2396 | |
---|
2147 | | - editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2397 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2148 | 2398 | clearMaterialButton.setToolTipText("Clear material"); |
---|
2149 | 2399 | |
---|
2150 | 2400 | if (Globals.ADVANCED) |
---|
2151 | 2401 | { |
---|
2152 | | - editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2402 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2153 | 2403 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
2154 | 2404 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
2155 | 2405 | } |
---|
.. | .. |
---|
2170 | 2420 | |
---|
2171 | 2421 | cGridBag huepanel = new cGridBag(); |
---|
2172 | 2422 | cGridBag huelabel = new cGridBag(); |
---|
2173 | | - skin = GetLabel("icons/hue.png", false); |
---|
2174 | | - skin.fit = true; |
---|
2175 | | - 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); |
---|
2176 | 2437 | huelabel.preferredWidth = 20; |
---|
2177 | 2438 | huepanel.add(new cGridBag()); // Label |
---|
2178 | 2439 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
3448 | 3709 | |
---|
3449 | 3710 | if (multiplyToggle != null) |
---|
3450 | 3711 | multiplyToggle.setSelected(mat.multiply); |
---|
3451 | | - |
---|
3452 | | - assert (object.projectedVertices != null); |
---|
3453 | | - |
---|
3454 | | - if (object.projectedVertices.length <= 2) |
---|
3455 | | - { |
---|
3456 | | - // Side effect... |
---|
3457 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
3458 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
3459 | | - for (int i = 0; i < 3; i++) |
---|
3460 | | - { |
---|
3461 | | - if (i < keep.length) |
---|
3462 | | - { |
---|
3463 | | - object.projectedVertices[i] = keep[i]; |
---|
3464 | | - } else |
---|
3465 | | - { |
---|
3466 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
3467 | | - } |
---|
3468 | | - /* |
---|
3469 | | - if(keep.length == 0) |
---|
3470 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
3471 | | - else |
---|
3472 | | - object.projectedVertices[0] = keep[0]; |
---|
3473 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
3474 | | - */ |
---|
3475 | | - } |
---|
3476 | | - } |
---|
| 3712 | + |
---|
| 3713 | + AllocProjectedVertices(object); |
---|
3477 | 3714 | |
---|
3478 | 3715 | SetMaterial(mat, object.projectedVertices); |
---|
3479 | 3716 | } |
---|
.. | .. |
---|
3783 | 4020 | //System.out.println("ObjEditor " + event); |
---|
3784 | 4021 | applySelf0(true); |
---|
3785 | 4022 | //parent.applySelf(); |
---|
3786 | | - objEditor.refreshContents(); |
---|
| 4023 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3787 | 4024 | } else if (source == resetButton) |
---|
3788 | 4025 | { |
---|
3789 | 4026 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3963 | 4200 | |
---|
3964 | 4201 | void New() |
---|
3965 | 4202 | { |
---|
3966 | | - while (copy.Size() > 1) |
---|
| 4203 | + while (copy.Size() > 0) |
---|
3967 | 4204 | { |
---|
3968 | | - copy.remove(1); |
---|
| 4205 | + copy.remove(0); |
---|
3969 | 4206 | } |
---|
3970 | 4207 | |
---|
| 4208 | + copy.selection.clear(); |
---|
| 4209 | + |
---|
| 4210 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4211 | + { |
---|
| 4212 | + CreateCameras(); |
---|
| 4213 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4214 | + } |
---|
3971 | 4215 | ResetModel(); |
---|
3972 | 4216 | objEditor.refreshContents(); |
---|
3973 | 4217 | } |
---|
.. | .. |
---|
4076 | 4320 | { |
---|
4077 | 4321 | //Save(true); |
---|
4078 | 4322 | Replace(); |
---|
4079 | | - SetUndoStates(); |
---|
| 4323 | + SetVersionStates(); |
---|
4080 | 4324 | } |
---|
4081 | 4325 | |
---|
4082 | 4326 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
4095 | 4339 | return true; |
---|
4096 | 4340 | } |
---|
4097 | 4341 | |
---|
4098 | | - java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
4099 | | - |
---|
4100 | 4342 | void DeleteVersion() |
---|
4101 | 4343 | { |
---|
4102 | 4344 | for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
.. | .. |
---|
4104 | 4346 | copy.versionlist[i] = copy.versionlist[i+1]; |
---|
4105 | 4347 | } |
---|
4106 | 4348 | |
---|
4107 | | - CopyChanged(); |
---|
| 4349 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4350 | + copy.versionindex -= 1; |
---|
4108 | 4351 | |
---|
4109 | | - SetUndoStates(); |
---|
| 4352 | + if (copy.versionindex != -1) |
---|
| 4353 | + CopyChanged(); |
---|
| 4354 | + |
---|
| 4355 | + SetVersionStates(); |
---|
4110 | 4356 | } |
---|
4111 | 4357 | |
---|
4112 | 4358 | public boolean Save(boolean user) |
---|
4113 | 4359 | { |
---|
4114 | 4360 | System.err.println("Save"); |
---|
4115 | | - //Replace(); |
---|
| 4361 | + Replace(); |
---|
4116 | 4362 | |
---|
4117 | | - cRadio tab = GetCurrentTab(); |
---|
| 4363 | + //cRadio tab = GetCurrentTab(); |
---|
4118 | 4364 | |
---|
4119 | | - Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
| 4365 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4120 | 4366 | |
---|
4121 | 4367 | boolean thesame = false; |
---|
4122 | 4368 | |
---|
.. | .. |
---|
4152 | 4398 | // copy.versionlist[i] = null; |
---|
4153 | 4399 | // } |
---|
4154 | 4400 | |
---|
4155 | | - SetUndoStates(); |
---|
| 4401 | + SetVersionStates(); |
---|
4156 | 4402 | |
---|
4157 | 4403 | // test save |
---|
4158 | 4404 | if (false) |
---|
.. | .. |
---|
4210 | 4456 | |
---|
4211 | 4457 | void CopyChanged() |
---|
4212 | 4458 | { |
---|
4213 | | - Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4459 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4214 | 4460 | |
---|
4215 | | - SetUndoStates(); |
---|
| 4461 | + SetVersionStates(); |
---|
4216 | 4462 | |
---|
4217 | 4463 | boolean temp = CameraPane.SWITCH; |
---|
4218 | 4464 | CameraPane.SWITCH = false; |
---|
4219 | 4465 | |
---|
4220 | | - copy.ExtractBigData(versiontable); |
---|
| 4466 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4221 | 4467 | |
---|
4222 | 4468 | copy.clear(); |
---|
4223 | 4469 | |
---|
.. | .. |
---|
4229 | 4475 | copy.add(obj.get(i)); |
---|
4230 | 4476 | } |
---|
4231 | 4477 | |
---|
4232 | | - copy.RestoreBigData(versiontable); |
---|
| 4478 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4233 | 4479 | |
---|
4234 | 4480 | CameraPane.SWITCH = temp; |
---|
4235 | 4481 | |
---|
.. | .. |
---|
4279 | 4525 | return count; |
---|
4280 | 4526 | } |
---|
4281 | 4527 | |
---|
4282 | | - void SetUndoStates() |
---|
| 4528 | + public cGridBag versionSliderPane; |
---|
| 4529 | + |
---|
| 4530 | + void SetVersionStates() |
---|
4283 | 4531 | { |
---|
4284 | | - cRadio tab = GetCurrentTab(); |
---|
| 4532 | + //if (true) |
---|
| 4533 | + // return; |
---|
| 4534 | + |
---|
| 4535 | + //cRadio tab = GetCurrentTab(); |
---|
4285 | 4536 | |
---|
4286 | | - restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
4287 | | - replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
4288 | | - |
---|
4289 | | - previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
4290 | | - nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
4291 | | - |
---|
4292 | | - deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
4293 | | - copy.versionlist[copy.versionindex + 1] != null); |
---|
4294 | | - |
---|
4295 | | - muteSlider = true; |
---|
4296 | | - versionSlider.setMaximum(VersionCount() - 1); |
---|
4297 | | - versionSlider.setInteger(copy.versionindex); |
---|
4298 | | - 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 | + } |
---|
4299 | 4567 | } |
---|
4300 | 4568 | |
---|
4301 | 4569 | public boolean PreviousVersion() |
---|
.. | .. |
---|
4305 | 4573 | |
---|
4306 | 4574 | System.err.println("Undo"); |
---|
4307 | 4575 | |
---|
4308 | | - cRadio tab = GetCurrentTab(); |
---|
| 4576 | + //cRadio tab = GetCurrentTab(); |
---|
4309 | 4577 | |
---|
4310 | 4578 | if (copy.versionindex == 0) |
---|
4311 | 4579 | { |
---|
.. | .. |
---|
4337 | 4605 | { |
---|
4338 | 4606 | System.err.println("Restore"); |
---|
4339 | 4607 | |
---|
4340 | | - cRadio tab = GetCurrentTab(); |
---|
| 4608 | + //cRadio tab = GetCurrentTab(); |
---|
4341 | 4609 | |
---|
4342 | 4610 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4343 | 4611 | { |
---|
.. | .. |
---|
4353 | 4621 | |
---|
4354 | 4622 | public boolean Replace() |
---|
4355 | 4623 | { |
---|
4356 | | - System.err.println("Replace"); |
---|
| 4624 | + //System.err.println("Replace"); |
---|
4357 | 4625 | |
---|
4358 | | - cRadio tab = GetCurrentTab(); |
---|
| 4626 | + //cRadio tab = GetCurrentTab(); |
---|
4359 | 4627 | |
---|
4360 | 4628 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4361 | 4629 | { |
---|
.. | .. |
---|
4363 | 4631 | return false; |
---|
4364 | 4632 | } |
---|
4365 | 4633 | |
---|
4366 | | - copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4634 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
4367 | 4635 | |
---|
4368 | 4636 | return true; |
---|
4369 | 4637 | } |
---|
.. | .. |
---|
4373 | 4641 | // Option? |
---|
4374 | 4642 | Replace(); |
---|
4375 | 4643 | |
---|
4376 | | - cRadio tab = GetCurrentTab(); |
---|
| 4644 | + //cRadio tab = GetCurrentTab(); |
---|
4377 | 4645 | |
---|
4378 | 4646 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
4379 | 4647 | { |
---|
.. | .. |
---|
4580 | 4848 | // else |
---|
4581 | 4849 | // applySelf(true); |
---|
4582 | 4850 | // } |
---|
| 4851 | + |
---|
| 4852 | + boolean Equal(double a, double b) |
---|
| 4853 | + { |
---|
| 4854 | + return Math.abs(a - b) < 0.001; |
---|
| 4855 | + } |
---|
| 4856 | + |
---|
4583 | 4857 | void applySelf0(boolean name) |
---|
4584 | 4858 | { |
---|
4585 | 4859 | if (name) |
---|
.. | .. |
---|
4629 | 4903 | { |
---|
4630 | 4904 | cMaterial mat = copy.material; |
---|
4631 | 4905 | |
---|
4632 | | - colorField.SetToolTipValue((mat.color)); |
---|
4633 | | - saturationField.SetToolTipValue((mat.modulation)); |
---|
4634 | | - metalnessField.SetToolTipValue((mat.metalness)); |
---|
4635 | | - diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4636 | | - specularField.SetToolTipValue((mat.specular)); |
---|
4637 | | - shininessField.SetToolTipValue((mat.shininess)); |
---|
4638 | | - shiftField.SetToolTipValue((mat.shift)); |
---|
4639 | | - ambientField.SetToolTipValue((mat.ambient)); |
---|
4640 | | - lightareaField.SetToolTipValue((mat.lightarea)); |
---|
4641 | | - diffusenessField.SetToolTipValue((mat.factor)); |
---|
4642 | | - velvetField.SetToolTipValue((mat.velvet)); |
---|
4643 | | - sheenField.SetToolTipValue((mat.sheen)); |
---|
4644 | | - subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
4645 | | - backlitField.SetToolTipValue((mat.bump)); |
---|
4646 | | - anisoField.SetToolTipValue((mat.aniso)); |
---|
4647 | | - anisoVField.SetToolTipValue((mat.anisoV)); |
---|
4648 | | - cameraField.SetToolTipValue((mat.cameralight)); |
---|
4649 | | - selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
4650 | | - shadowField.SetToolTipValue((mat.shadow)); |
---|
4651 | | - textureField.SetToolTipValue((mat.texture)); |
---|
4652 | | - opacityField.SetToolTipValue((mat.opacity)); |
---|
4653 | | - fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4654 | | - 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)); |
---|
4655 | 4952 | } |
---|
4656 | 4953 | |
---|
4657 | 4954 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
4686 | 4983 | |
---|
4687 | 4984 | public void stateChanged(ChangeEvent e) |
---|
4688 | 4985 | { |
---|
4689 | | - // assert(false); |
---|
| 4986 | + // assert(false); |
---|
4690 | 4987 | if (e.getSource() == versionSlider) |
---|
4691 | 4988 | { |
---|
4692 | 4989 | if (muteSlider) |
---|
4693 | 4990 | return; |
---|
4694 | 4991 | |
---|
| 4992 | + Replace(); |
---|
| 4993 | + |
---|
4695 | 4994 | int version = versionSlider.getInteger(); |
---|
4696 | 4995 | |
---|
4697 | | - if (copy.versionlist[version] != null) |
---|
| 4996 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4698 | 4997 | { |
---|
4699 | 4998 | copy.versionindex = version; |
---|
4700 | 4999 | CopyChanged(); |
---|
.. | .. |
---|
4738 | 5037 | //System.out.println("stateChanged = " + this); |
---|
4739 | 5038 | materialtouched = true; |
---|
4740 | 5039 | |
---|
4741 | | - if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 5040 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
4742 | 5041 | { |
---|
4743 | 5042 | saturationField.setFloat(1); |
---|
4744 | 5043 | } |
---|
.. | .. |
---|
5053 | 5352 | } |
---|
5054 | 5353 | |
---|
5055 | 5354 | if (previousVersionButton != null && copy.versionlist != null) |
---|
5056 | | - SetUndoStates(); |
---|
| 5355 | + SetVersionStates(); |
---|
| 5356 | + |
---|
| 5357 | + cameraView.requestFocusInWindow(); |
---|
5057 | 5358 | } |
---|
5058 | 5359 | |
---|
5059 | 5360 | static TweenManager tweenManager = new TweenManager(); |
---|
.. | .. |
---|
5085 | 5386 | // group = (Composite) group.get(0); |
---|
5086 | 5387 | // } |
---|
5087 | 5388 | |
---|
5088 | | - System.out.println("makeSomething of " + thing); |
---|
| 5389 | + //System.out.println("makeSomething of " + thing); |
---|
5089 | 5390 | |
---|
5090 | 5391 | /* |
---|
5091 | 5392 | if (deselect && jList != null) |
---|
.. | .. |
---|
5439 | 5740 | |
---|
5440 | 5741 | copy.versionlist = readobj.versionlist; |
---|
5441 | 5742 | copy.versionindex = readobj.versionindex; |
---|
| 5743 | + copy.versiontable = readobj.versiontable; |
---|
5442 | 5744 | |
---|
5443 | 5745 | if (copy.versionlist == null) |
---|
5444 | 5746 | { |
---|
| 5747 | + // Backward compatibility |
---|
5445 | 5748 | copy.versionlist = new Object3D[100]; |
---|
5446 | 5749 | copy.versionindex = -1; |
---|
| 5750 | + |
---|
| 5751 | + //Save(true); |
---|
5447 | 5752 | } |
---|
5448 | 5753 | |
---|
5449 | 5754 | //? SetUndoStates(); |
---|
.. | .. |
---|
5535 | 5840 | |
---|
5536 | 5841 | void save() |
---|
5537 | 5842 | { |
---|
| 5843 | + Replace(); |
---|
| 5844 | + |
---|
5538 | 5845 | if (lastname == null) |
---|
5539 | 5846 | { |
---|
5540 | 5847 | return; |
---|
.. | .. |
---|
5789 | 6096 | boolean materialFlushed; |
---|
5790 | 6097 | Object3D latestObject; |
---|
5791 | 6098 | |
---|
| 6099 | + cGridBag transformPanel; |
---|
5792 | 6100 | cGridBag XYZPanel; |
---|
5793 | 6101 | |
---|
5794 | 6102 | JSplitPane gridPanel; |
---|
.. | .. |
---|
5882 | 6190 | cNumberSlider anisoField; |
---|
5883 | 6191 | JLabel anisoVLabel; |
---|
5884 | 6192 | cNumberSlider anisoVField; |
---|
| 6193 | + |
---|
5885 | 6194 | JLabel cameraLabel; |
---|
5886 | 6195 | cNumberSlider cameraField; |
---|
5887 | 6196 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5896 | 6205 | cNumberSlider fakedepthField; |
---|
5897 | 6206 | JLabel shadowbiasLabel; |
---|
5898 | 6207 | cNumberSlider shadowbiasField; |
---|
| 6208 | + |
---|
5899 | 6209 | JLabel bumpLabel; |
---|
5900 | 6210 | cNumberSlider bumpField; |
---|
5901 | 6211 | JLabel noiseLabel; |
---|