.. | .. |
---|
296 | 296 | client = inClient; |
---|
297 | 297 | copy = client; |
---|
298 | 298 | |
---|
299 | | - if (copy.versions == null) |
---|
| 299 | + if (copy.versionlist == null) |
---|
300 | 300 | { |
---|
301 | | - copy.versions = new byte[100][]; |
---|
| 301 | + copy.versionlist = new Object3D[100]; |
---|
302 | 302 | copy.versionindex = -1; |
---|
303 | 303 | } |
---|
304 | 304 | |
---|
.. | .. |
---|
315 | 315 | client = inClient; |
---|
316 | 316 | copy = client; |
---|
317 | 317 | |
---|
318 | | - if (copy.versions == null) |
---|
| 318 | + if (copy.versionlist == null) |
---|
319 | 319 | { |
---|
320 | | - copy.versions = new byte[100][]; |
---|
| 320 | + copy.versionlist = new Object3D[100]; |
---|
321 | 321 | copy.versionindex = -1; |
---|
322 | 322 | } |
---|
323 | 323 | |
---|
.. | .. |
---|
353 | 353 | copy = localCopy; |
---|
354 | 354 | copy.editWindow = this; |
---|
355 | 355 | |
---|
356 | | - if (copy.versions == null) |
---|
| 356 | + if (copy.versionlist == null) |
---|
357 | 357 | { |
---|
358 | 358 | // copy.versions = new byte[100][]; |
---|
359 | 359 | // copy.versionindex = -1; |
---|
.. | .. |
---|
467 | 467 | toolboxPanel = new cGridBag().setVertical(true); |
---|
468 | 468 | //toolboxPanel.setName("Toolbox"); |
---|
469 | 469 | |
---|
470 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 470 | + materialPanel = new cGridBag().setVertical(false); |
---|
471 | 471 | //materialPanel.setName("Material"); |
---|
472 | 472 | |
---|
473 | 473 | /*JTextPane*/ |
---|
.. | .. |
---|
850 | 850 | frame.validate(); |
---|
851 | 851 | } |
---|
852 | 852 | |
---|
853 | | - private byte[] CompressCopy() |
---|
| 853 | + private Object3D CompressCopy() |
---|
854 | 854 | { |
---|
855 | 855 | boolean temp = CameraPane.SWITCH; |
---|
856 | 856 | CameraPane.SWITCH = false; |
---|
.. | .. |
---|
858 | 858 | copy.ExtractBigData(versiontable); |
---|
859 | 859 | // if (copy == client) |
---|
860 | 860 | |
---|
861 | | - byte[] versions[] = copy.versions; |
---|
862 | | - copy.versions = null; |
---|
| 861 | + Object3D versions[] = copy.versionlist; |
---|
| 862 | + copy.versionlist = null; |
---|
863 | 863 | |
---|
864 | | - byte[] compress = Compress(copy); |
---|
| 864 | + //byte[] compress = Compress(copy); |
---|
| 865 | + Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
865 | 866 | |
---|
866 | | - copy.versions = versions; |
---|
| 867 | + copy.versionlist = versions; |
---|
867 | 868 | |
---|
868 | 869 | copy.RestoreBigData(versiontable); |
---|
869 | 870 | |
---|
.. | .. |
---|
993 | 994 | { |
---|
994 | 995 | SetupMaterial(materialPanel); |
---|
995 | 996 | } |
---|
| 997 | + |
---|
996 | 998 | //SetupName(); |
---|
997 | 999 | //SetupViews(); |
---|
998 | 1000 | } |
---|
.. | .. |
---|
1550 | 1552 | //tmp.setName("Edit"); |
---|
1551 | 1553 | objectPanel.add(materialPanel); |
---|
1552 | 1554 | objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
1553 | | - objectPanel.setToolTipTextAt(0, "Material panel"); |
---|
| 1555 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
1554 | 1556 | |
---|
1555 | 1557 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1556 | 1558 | // north.setName("Edit"); |
---|
.. | .. |
---|
1558 | 1560 | // objectPanel.add(north); |
---|
1559 | 1561 | objectPanel.add(editPanel); |
---|
1560 | 1562 | objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
1561 | | - objectPanel.setToolTipTextAt(1, "Edit panel"); |
---|
| 1563 | + objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
1562 | 1564 | |
---|
1563 | 1565 | //if (Globals.ADVANCED) |
---|
1564 | 1566 | objectPanel.add(infoPanel); |
---|
1565 | 1567 | objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
1566 | | - objectPanel.setToolTipTextAt(2, "Info panel"); |
---|
| 1568 | + objectPanel.setToolTipTextAt(2, "Information"); |
---|
1567 | 1569 | |
---|
1568 | 1570 | objectPanel.add(XYZPanel); |
---|
1569 | 1571 | objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
1570 | | - objectPanel.setToolTipTextAt(3, "XYZ/RGB panel"); |
---|
| 1572 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
1571 | 1573 | |
---|
1572 | 1574 | objectPanel.add(toolboxPanel); |
---|
1573 | 1575 | objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
1574 | | - objectPanel.setToolTipTextAt(4, "Objects/backgrounds panel"); |
---|
| 1576 | + objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1575 | 1577 | |
---|
1576 | 1578 | /* |
---|
1577 | 1579 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1733 | 1735 | ctrlPanel.removeAll(); |
---|
1734 | 1736 | } |
---|
1735 | 1737 | |
---|
1736 | | - void SetupMaterial(cGridBag panel) |
---|
| 1738 | + void SetupMaterial(cGridBag materialpanel) |
---|
1737 | 1739 | { |
---|
1738 | | - /* |
---|
| 1740 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1741 | + cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1742 | + label.addMouseListener(new MouseAdapter() |
---|
| 1743 | + { |
---|
| 1744 | + public void mouseClicked(MouseEvent e) |
---|
| 1745 | + { |
---|
| 1746 | + colorField.setFloat(0); |
---|
| 1747 | + saturationField.setFloat(1); |
---|
| 1748 | + materialtouched = true; |
---|
| 1749 | + applySelf(); |
---|
| 1750 | + } |
---|
| 1751 | + }); |
---|
| 1752 | + presetpanel.add(label); |
---|
| 1753 | + |
---|
| 1754 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF)); |
---|
| 1755 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
| 1756 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
| 1757 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
| 1758 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
| 1759 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
| 1760 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
| 1761 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
| 1762 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
| 1763 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
| 1764 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
| 1765 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
| 1766 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
| 1767 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
| 1768 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
| 1769 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
| 1770 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
| 1771 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF)); |
---|
| 1772 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF)); |
---|
| 1773 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF)); |
---|
| 1774 | + |
---|
| 1775 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 1776 | + |
---|
| 1777 | + presetpanel.preferredWidth = 1; |
---|
| 1778 | + |
---|
| 1779 | + materialpanel.add(panel); |
---|
| 1780 | + materialpanel.add(presetpanel); |
---|
| 1781 | + |
---|
| 1782 | + panel.preferredWidth = 8; |
---|
| 1783 | + |
---|
| 1784 | + /* |
---|
1739 | 1785 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1740 | 1786 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1741 | | - */ |
---|
| 1787 | + */ |
---|
1742 | 1788 | |
---|
1743 | 1789 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1744 | 1790 | |
---|
.. | .. |
---|
1775 | 1821 | |
---|
1776 | 1822 | cGridBag huepanel = new cGridBag(); |
---|
1777 | 1823 | cGridBag huelabel = new cGridBag(); |
---|
1778 | | - huelabel.add(GetLabel("icons/hue.png", false)); |
---|
| 1824 | + label = GetLabel("icons/hue.png", false); |
---|
| 1825 | + label.fit = true; |
---|
| 1826 | + huelabel.add(label); |
---|
1779 | 1827 | huelabel.preferredWidth = 20; |
---|
1780 | 1828 | huepanel.add(new cGridBag()); // Label |
---|
1781 | 1829 | huepanel.add(huelabel); // Field/slider |
---|
.. | .. |
---|
1796 | 1844 | cGridBag modulation = new cGridBag(); |
---|
1797 | 1845 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1798 | 1846 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1799 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1847 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1800 | 1848 | colorSection.add(modulation); |
---|
1801 | 1849 | |
---|
1802 | 1850 | cGridBag opacity = new cGridBag(); |
---|
.. | .. |
---|
2989 | 3037 | |
---|
2990 | 3038 | freezematerial = true; |
---|
2991 | 3039 | colorField.setFloat(mat.color); |
---|
2992 | | - modulationField.setFloat(mat.modulation); |
---|
| 3040 | + saturationField.setFloat(mat.modulation); |
---|
2993 | 3041 | metalnessField.setFloat(mat.metalness); |
---|
2994 | 3042 | diffuseField.setFloat(mat.diffuse); |
---|
2995 | 3043 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
3300 | 3348 | } else if (event.getSource() == liveCB) |
---|
3301 | 3349 | { |
---|
3302 | 3350 | copy.live ^= true; |
---|
| 3351 | + objEditor.refreshContents(true); // To show item colors |
---|
3303 | 3352 | return; |
---|
3304 | 3353 | } else if (event.getSource() == selectableCB) |
---|
3305 | 3354 | { |
---|
.. | .. |
---|
3309 | 3358 | { |
---|
3310 | 3359 | copy.hide ^= true; |
---|
3311 | 3360 | copy.Touch(); // display list issue |
---|
3312 | | - objEditor.refreshContents(); |
---|
| 3361 | + objEditor.refreshContents(true); // To show item colors |
---|
3313 | 3362 | return; |
---|
3314 | 3363 | } else if (event.getSource() == link2masterCB) |
---|
3315 | 3364 | { |
---|
.. | .. |
---|
3565 | 3614 | |
---|
3566 | 3615 | static public byte[] Compress(Object3D o) |
---|
3567 | 3616 | { |
---|
| 3617 | + // Slower to actually compress. |
---|
3568 | 3618 | try |
---|
3569 | 3619 | { |
---|
3570 | 3620 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
.. | .. |
---|
3666 | 3716 | { |
---|
3667 | 3717 | //Save(true); |
---|
3668 | 3718 | Replace(); |
---|
| 3719 | + SetUndoStates(); |
---|
3669 | 3720 | } |
---|
3670 | 3721 | |
---|
3671 | 3722 | private boolean Equal(byte[] compress, byte[] name) |
---|
.. | .. |
---|
3689 | 3740 | public boolean Save(boolean user) |
---|
3690 | 3741 | { |
---|
3691 | 3742 | System.err.println("Save"); |
---|
| 3743 | + Replace(); |
---|
3692 | 3744 | |
---|
3693 | 3745 | cRadio tab = GetCurrentTab(); |
---|
3694 | 3746 | |
---|
3695 | | - byte[] compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
| 3747 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
3696 | 3748 | |
---|
3697 | 3749 | boolean thesame = false; |
---|
3698 | 3750 | |
---|
3699 | | - // Quick heuristic using length. Works only when stream is compressed. |
---|
3700 | | - if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
3701 | | - { |
---|
3702 | | - thesame = true; |
---|
3703 | | - } |
---|
| 3751 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3752 | +// { |
---|
| 3753 | +// thesame = true; |
---|
| 3754 | +// } |
---|
3704 | 3755 | |
---|
3705 | 3756 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3706 | 3757 | if (!thesame) |
---|
.. | .. |
---|
3708 | 3759 | //tab.user[tab.versionindex] = user; |
---|
3709 | 3760 | //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
3710 | 3761 | |
---|
3711 | | - copy.versions[++copy.versionindex] = compress; |
---|
| 3762 | + copy.versionlist[++copy.versionindex] = compress; |
---|
3712 | 3763 | |
---|
3713 | 3764 | // if (increment) |
---|
3714 | 3765 | // tab.versionindex++; |
---|
.. | .. |
---|
3718 | 3769 | |
---|
3719 | 3770 | //assert(hashtable.isEmpty()); |
---|
3720 | 3771 | |
---|
3721 | | - for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
| 3772 | + for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3722 | 3773 | { |
---|
3723 | 3774 | //tab.user[i] = false; |
---|
3724 | | - copy.versions[i] = null; |
---|
| 3775 | + copy.versionlist[i] = null; |
---|
3725 | 3776 | } |
---|
3726 | 3777 | |
---|
3727 | 3778 | SetUndoStates(); |
---|
.. | .. |
---|
3747 | 3798 | |
---|
3748 | 3799 | return !thesame; |
---|
3749 | 3800 | } |
---|
| 3801 | + |
---|
| 3802 | + boolean flashIt = true; |
---|
| 3803 | + |
---|
| 3804 | + void RefreshSelection() |
---|
| 3805 | + { |
---|
| 3806 | + Object3D selection = new Object3D(); |
---|
| 3807 | + |
---|
| 3808 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 3809 | + { |
---|
| 3810 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 3811 | + |
---|
| 3812 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 3813 | + |
---|
| 3814 | + if (obj == null) |
---|
| 3815 | + { |
---|
| 3816 | + copy.selection.remove(i--); |
---|
| 3817 | + } |
---|
| 3818 | + else |
---|
| 3819 | + { |
---|
| 3820 | + selection.add(obj); |
---|
| 3821 | + copy.selection.setElementAt(obj, i); |
---|
| 3822 | + } |
---|
| 3823 | + } |
---|
| 3824 | + |
---|
| 3825 | + flashIt = false; |
---|
| 3826 | + GetTree().clearSelection(); |
---|
| 3827 | + for (int i = 0; i < selection.size(); i++) |
---|
| 3828 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 3829 | + flashIt = true; |
---|
| 3830 | + |
---|
| 3831 | + refreshContents(false); |
---|
| 3832 | + } |
---|
3750 | 3833 | |
---|
3751 | 3834 | void CopyChanged(Object3D obj) |
---|
3752 | 3835 | { |
---|
.. | .. |
---|
3771 | 3854 | |
---|
3772 | 3855 | CameraPane.SWITCH = temp; |
---|
3773 | 3856 | |
---|
| 3857 | + RefreshSelection(); |
---|
3774 | 3858 | //assert(hashtable.isEmpty()); |
---|
3775 | 3859 | |
---|
3776 | 3860 | copy.Touch(); |
---|
.. | .. |
---|
3805 | 3889 | { |
---|
3806 | 3890 | int count = 0; |
---|
3807 | 3891 | |
---|
3808 | | - for (int i = copy.versions.length; --i >= 0;) |
---|
| 3892 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
3809 | 3893 | { |
---|
3810 | | - if (copy.versions[i] != null) |
---|
| 3894 | + if (copy.versionlist[i] != null) |
---|
3811 | 3895 | count++; |
---|
3812 | 3896 | } |
---|
3813 | 3897 | |
---|
.. | .. |
---|
3822 | 3906 | replaceButton.setEnabled(copy.versionindex != -1); |
---|
3823 | 3907 | |
---|
3824 | 3908 | undoButton.setEnabled(copy.versionindex > 0); |
---|
3825 | | - redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 3909 | + redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
3826 | 3910 | |
---|
3827 | 3911 | muteSlider = true; |
---|
3828 | 3912 | versionSlider.setMaximum(VersionCount() - 1); |
---|
.. | .. |
---|
3860 | 3944 | |
---|
3861 | 3945 | copy.versionindex -= 1; |
---|
3862 | 3946 | |
---|
3863 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3947 | + CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
3864 | 3948 | |
---|
3865 | 3949 | return true; |
---|
3866 | 3950 | } |
---|
.. | .. |
---|
3871 | 3955 | |
---|
3872 | 3956 | cRadio tab = GetCurrentTab(); |
---|
3873 | 3957 | |
---|
3874 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3958 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3875 | 3959 | { |
---|
3876 | 3960 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3877 | 3961 | return false; |
---|
3878 | 3962 | } |
---|
3879 | 3963 | |
---|
3880 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3964 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3965 | + CopyChanged(copy.versionlist[copy.versionindex]); |
---|
3881 | 3966 | |
---|
3882 | 3967 | return true; |
---|
3883 | 3968 | } |
---|
.. | .. |
---|
3888 | 3973 | |
---|
3889 | 3974 | cRadio tab = GetCurrentTab(); |
---|
3890 | 3975 | |
---|
3891 | | - if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3976 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3892 | 3977 | { |
---|
3893 | 3978 | // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3894 | 3979 | return false; |
---|
3895 | 3980 | } |
---|
3896 | 3981 | |
---|
3897 | | - copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 3982 | + copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
3898 | 3983 | |
---|
3899 | 3984 | return true; |
---|
3900 | 3985 | } |
---|
.. | .. |
---|
3906 | 3991 | |
---|
3907 | 3992 | cRadio tab = GetCurrentTab(); |
---|
3908 | 3993 | |
---|
3909 | | - if (copy.versions[copy.versionindex + 1] == null) |
---|
| 3994 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3910 | 3995 | { |
---|
3911 | 3996 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3912 | 3997 | return; |
---|
.. | .. |
---|
3914 | 3999 | |
---|
3915 | 4000 | copy.versionindex += 1; |
---|
3916 | 4001 | |
---|
3917 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4002 | + CopyChanged(copy.versionlist[copy.versionindex]); |
---|
3918 | 4003 | |
---|
3919 | 4004 | //if (!tab.user[tab.versionindex]) |
---|
3920 | 4005 | // tab.graphs[tab.versionindex] = null; |
---|
.. | .. |
---|
4128 | 4213 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
4129 | 4214 | |
---|
4130 | 4215 | current.color = (float) colorField.getFloat(); |
---|
4131 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4216 | + current.modulation = (float) saturationField.getFloat(); |
---|
4132 | 4217 | current.metalness = (float) metalnessField.getFloat(); |
---|
4133 | 4218 | current.diffuse = (float) diffuseField.getFloat(); |
---|
4134 | 4219 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
4161 | 4246 | cMaterial mat = copy.material; |
---|
4162 | 4247 | |
---|
4163 | 4248 | colorField.SetToolTipValue((mat.color)); |
---|
4164 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4249 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
4165 | 4250 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
4166 | 4251 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
4167 | 4252 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
4225 | 4310 | |
---|
4226 | 4311 | int version = versionSlider.getInteger(); |
---|
4227 | 4312 | |
---|
4228 | | - if (copy.versions[version] != null) |
---|
| 4313 | + if (copy.versionlist[version] != null) |
---|
4229 | 4314 | { |
---|
4230 | | - CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4315 | + CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
4231 | 4316 | } |
---|
4232 | 4317 | |
---|
4233 | 4318 | return; |
---|
.. | .. |
---|
4267 | 4352 | { |
---|
4268 | 4353 | //System.out.println("stateChanged = " + this); |
---|
4269 | 4354 | materialtouched = true; |
---|
| 4355 | + |
---|
| 4356 | + if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4357 | + { |
---|
| 4358 | + saturationField.setFloat(1); |
---|
| 4359 | + } |
---|
| 4360 | + |
---|
4270 | 4361 | applySelf(); |
---|
4271 | 4362 | //System.out.println("this = " + this); |
---|
4272 | 4363 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4566 | 4657 | { |
---|
4567 | 4658 | if (GetTree() != null) |
---|
4568 | 4659 | { |
---|
| 4660 | + GetTree().revalidate(); |
---|
4569 | 4661 | GetTree().repaint(); |
---|
4570 | 4662 | } |
---|
4571 | 4663 | |
---|
.. | .. |
---|
4957 | 5049 | c.addChild(csg); |
---|
4958 | 5050 | } |
---|
4959 | 5051 | |
---|
4960 | | - copy.versions = readobj.versions; |
---|
| 5052 | + copy.versionlist = readobj.versionlist; |
---|
4961 | 5053 | copy.versionindex = readobj.versionindex; |
---|
4962 | 5054 | |
---|
4963 | | - if (copy.versions == null) |
---|
| 5055 | + if (copy.versionlist == null) |
---|
4964 | 5056 | { |
---|
4965 | | - copy.versions = new byte[100][]; |
---|
| 5057 | + copy.versionlist = new Object3D[100]; |
---|
4966 | 5058 | copy.versionindex = -1; |
---|
4967 | 5059 | } |
---|
4968 | 5060 | |
---|
.. | .. |
---|
5370 | 5462 | JLabel colorLabel; |
---|
5371 | 5463 | cNumberSlider colorField; |
---|
5372 | 5464 | JLabel modulationLabel; |
---|
5373 | | - cNumberSlider modulationField; |
---|
| 5465 | + cNumberSlider saturationField; |
---|
5374 | 5466 | JLabel metalnessLabel; |
---|
5375 | 5467 | cNumberSlider metalnessField; |
---|
5376 | 5468 | JLabel diffuseLabel; |
---|