Normand Briere
2019-08-04 0c85af6e46f48b7425d59fc776b193c06a4a1f52
ObjEditor.java
....@@ -41,11 +41,25 @@
4141 JFrame frame;
4242
4343 static ObjEditor theFrame;
44
+
45
+ public cGridBag GetSeparator()
46
+ {
47
+ cGridBag separator = new cGridBag();
48
+ separator.add(new JSeparator());
49
+ separator.preferredHeight = 5;
50
+ return separator;
51
+ }
4452
4553 cButton GetButton(String name, boolean border)
4654 {
4755 ImageIcon icon = GetIcon(name);
4856 return new cButton(icon, border);
57
+ }
58
+
59
+ cLabel GetLabel(String name, boolean border)
60
+ {
61
+ //ImageIcon icon = GetIcon(name);
62
+ return new cLabel(GetImage(name), border);
4963 }
5064
5165 cToggleButton GetToggleButton(String name, boolean border)
....@@ -66,20 +80,34 @@
6680 {
6781 BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
6882
69
- if (image.getWidth() > 48 && image.getHeight() > 48)
70
- {
71
- BufferedImage resized = new BufferedImage(48, 48, image.getType());
72
- Graphics2D g = resized.createGraphics();
73
- g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
- //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
- g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
76
- g.dispose();
77
-
78
- image = resized;
79
- }
83
+// if (image.getWidth() > 48 && image.getHeight() > 48)
84
+// {
85
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
86
+// Graphics2D g = resized.createGraphics();
87
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
88
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
89
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
90
+// g.dispose();
91
+//
92
+// image = resized;
93
+// }
8094
8195 javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
8296 return icon;
97
+ }
98
+ catch (Exception e)
99
+ {
100
+ return null;
101
+ }
102
+ }
103
+
104
+ BufferedImage GetImage(String name)
105
+ {
106
+ try
107
+ {
108
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
109
+
110
+ return image;
83111 }
84112 catch (Exception e)
85113 {
....@@ -268,9 +296,9 @@
268296 client = inClient;
269297 copy = client;
270298
271
- if (copy.versions == null)
299
+ if (copy.versionlist == null)
272300 {
273
- copy.versions = new byte[100][];
301
+ copy.versionlist = new Object3D[100];
274302 copy.versionindex = -1;
275303 }
276304
....@@ -287,9 +315,9 @@
287315 client = inClient;
288316 copy = client;
289317
290
- if (copy.versions == null)
318
+ if (copy.versionlist == null)
291319 {
292
- copy.versions = new byte[100][];
320
+ copy.versionlist = new Object3D[100];
293321 copy.versionindex = -1;
294322 }
295323
....@@ -325,7 +353,7 @@
325353 copy = localCopy;
326354 copy.editWindow = this;
327355
328
- if (copy.versions == null)
356
+ if (copy.versionlist == null)
329357 {
330358 // copy.versions = new byte[100][];
331359 // copy.versionindex = -1;
....@@ -439,7 +467,7 @@
439467 toolboxPanel = new cGridBag().setVertical(true);
440468 //toolboxPanel.setName("Toolbox");
441469
442
- materialPanel = new cGridBag().setVertical(true);
470
+ materialPanel = new cGridBag().setVertical(false);
443471 //materialPanel.setName("Material");
444472
445473 /*JTextPane*/
....@@ -822,7 +850,7 @@
822850 frame.validate();
823851 }
824852
825
- private byte[] CompressCopy()
853
+ private Object3D CompressCopy()
826854 {
827855 boolean temp = CameraPane.SWITCH;
828856 CameraPane.SWITCH = false;
....@@ -830,12 +858,13 @@
830858 copy.ExtractBigData(versiontable);
831859 // if (copy == client)
832860
833
- byte[] versions[] = copy.versions;
834
- copy.versions = null;
861
+ Object3D versions[] = copy.versionlist;
862
+ copy.versionlist = null;
835863
836
- byte[] compress = Compress(copy);
864
+ //byte[] compress = Compress(copy);
865
+ Object3D compress = (Object3D)Grafreed.clone(copy);
837866
838
- copy.versions = versions;
867
+ copy.versionlist = versions;
839868
840869 copy.RestoreBigData(versiontable);
841870
....@@ -965,6 +994,7 @@
965994 {
966995 SetupMaterial(materialPanel);
967996 }
997
+
968998 //SetupName();
969999 //SetupViews();
9701000 }
....@@ -1522,22 +1552,28 @@
15221552 //tmp.setName("Edit");
15231553 objectPanel.add(materialPanel);
15241554 objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1555
+ objectPanel.setToolTipTextAt(0, "Material");
1556
+
15251557 // JPanel north = new JPanel(new BorderLayout());
15261558 // north.setName("Edit");
15271559 // north.add(ctrlPanel, BorderLayout.NORTH);
15281560 // objectPanel.add(north);
15291561 objectPanel.add(editPanel);
15301562 objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1563
+ objectPanel.setToolTipTextAt(1, "Edit controls");
15311564
15321565 //if (Globals.ADVANCED)
15331566 objectPanel.add(infoPanel);
15341567 objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1568
+ objectPanel.setToolTipTextAt(2, "Information");
15351569
15361570 objectPanel.add(XYZPanel);
15371571 objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1572
+ objectPanel.setToolTipTextAt(3, "XYZ/RGB transform");
15381573
15391574 objectPanel.add(toolboxPanel);
15401575 objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
1576
+ objectPanel.setToolTipTextAt(4, "Objects & backgrounds");
15411577
15421578 /*
15431579 aConstraints.gridx = 0;
....@@ -1634,8 +1670,8 @@
16341670 /**/
16351671
16361672 bigThree = new cGridBag();
1637
- bigThree.addComponent(centralPanel);
16381673 bigThree.addComponent(scenePanel);
1674
+ bigThree.addComponent(centralPanel);
16391675 //bigThree.addComponent(XYZPanel);
16401676
16411677 // // SIDE EFFECT!!!
....@@ -1677,7 +1713,6 @@
16771713 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
16781714 frame.addWindowListener(new WindowAdapter()
16791715 {
1680
-
16811716 public void windowClosing(WindowEvent e)
16821717 {
16831718 Close();
....@@ -1700,12 +1735,56 @@
17001735 ctrlPanel.removeAll();
17011736 }
17021737
1703
- void SetupMaterial(cGridBag panel)
1738
+ void SetupMaterial(cGridBag materialpanel)
17041739 {
1705
- /*
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
+ /*
17061785 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
17071786 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- */
1787
+ */
17091788
17101789 cGridBag editBar = new cGridBag().setVertical(false);
17111790
....@@ -1739,27 +1818,50 @@
17391818 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17401819
17411820 cGridBag colorSection = new cGridBag().setVertical(true);
1821
+
1822
+ cGridBag huepanel = new cGridBag();
1823
+ cGridBag huelabel = new cGridBag();
1824
+ label = GetLabel("icons/hue.png", false);
1825
+ label.fit = true;
1826
+ huelabel.add(label);
1827
+ huelabel.preferredWidth = 20;
1828
+ huepanel.add(new cGridBag()); // Label
1829
+ huepanel.add(huelabel); // Field/slider
1830
+
1831
+ huepanel.preferredHeight = 7;
1832
+
1833
+ colorSection.add(huepanel);
17421834
17431835 cGridBag color = new cGridBag();
1744
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1745
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1746
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1836
+
1837
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1838
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1839
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1840
+
17471841 //colorField.preferredWidth = 200;
17481842 colorSection.add(color);
17491843
17501844 cGridBag modulation = new cGridBag();
17511845 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
17521846 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1847
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
17541848 colorSection.add(modulation);
17551849
1850
+ cGridBag opacity = new cGridBag();
1851
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1852
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1853
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
1854
+ colorSection.add(opacity);
1855
+
1856
+ colorSection.add(GetSeparator());
1857
+
17561858 cGridBag texture = new cGridBag();
17571859 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
17581860 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17591861 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
17601862 colorSection.add(texture);
17611863
1762
- panel.add(new JSeparator());
1864
+ panel.add(GetSeparator());
17631865
17641866 panel.add(colorSection);
17651867
....@@ -1815,7 +1917,7 @@
18151917 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
18161918 diffuseSection.add(shadowbias);
18171919
1818
- panel.add(new JSeparator());
1920
+ panel.add(GetSeparator());
18191921
18201922 panel.add(diffuseSection);
18211923
....@@ -1878,7 +1980,7 @@
18781980 specularSection.add(anisoV);
18791981
18801982
1881
- panel.add(new JSeparator());
1983
+ panel.add(GetSeparator());
18821984
18831985 panel.add(specularSection);
18841986
....@@ -1903,12 +2005,6 @@
19032005 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
19042006 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
19052007 colorSection.add(backlit);
1906
-
1907
- cGridBag opacity = new cGridBag();
1908
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1909
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1910
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1911
- colorSection.add(opacity);
19122008
19132009 //panel.add(new JSeparator());
19142010
....@@ -1954,7 +2050,7 @@
19542050 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
19552051 textureSection.add(opacityPower);
19562052
1957
- panel.add(new JSeparator());
2053
+ panel.add(GetSeparator());
19582054
19592055 panel.add(textureSection);
19602056
....@@ -2941,7 +3037,7 @@
29413037
29423038 freezematerial = true;
29433039 colorField.setFloat(mat.color);
2944
- modulationField.setFloat(mat.modulation);
3040
+ saturationField.setFloat(mat.modulation);
29453041 metalnessField.setFloat(mat.metalness);
29463042 diffuseField.setFloat(mat.diffuse);
29473043 specularField.setFloat(mat.specular);
....@@ -3252,6 +3348,7 @@
32523348 } else if (event.getSource() == liveCB)
32533349 {
32543350 copy.live ^= true;
3351
+ objEditor.refreshContents(true); // To show item colors
32553352 return;
32563353 } else if (event.getSource() == selectableCB)
32573354 {
....@@ -3261,7 +3358,7 @@
32613358 {
32623359 copy.hide ^= true;
32633360 copy.Touch(); // display list issue
3264
- objEditor.refreshContents();
3361
+ objEditor.refreshContents(true); // To show item colors
32653362 return;
32663363 } else if (event.getSource() == link2masterCB)
32673364 {
....@@ -3517,6 +3614,7 @@
35173614
35183615 static public byte[] Compress(Object3D o)
35193616 {
3617
+ // Slower to actually compress.
35203618 try
35213619 {
35223620 ByteArrayOutputStream baos = new ByteArrayOutputStream();
....@@ -3618,6 +3716,7 @@
36183716 {
36193717 //Save(true);
36203718 Replace();
3719
+ SetUndoStates();
36213720 }
36223721
36233722 private boolean Equal(byte[] compress, byte[] name)
....@@ -3641,18 +3740,18 @@
36413740 public boolean Save(boolean user)
36423741 {
36433742 System.err.println("Save");
3743
+ Replace();
36443744
36453745 cRadio tab = GetCurrentTab();
36463746
3647
- byte[] compress = CompressCopy();
3747
+ Object3D compress = CompressCopy(); // Saved version. No need for "Replace".
36483748
36493749 boolean thesame = false;
36503750
3651
- // Quick heuristic using length. Works only when stream is compressed.
3652
- if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3653
- {
3654
- thesame = true;
3655
- }
3751
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3752
+// {
3753
+// thesame = true;
3754
+// }
36563755
36573756 //EditorFrame.m_MainFrame.requestFocusInWindow();
36583757 if (!thesame)
....@@ -3660,7 +3759,7 @@
36603759 //tab.user[tab.versionindex] = user;
36613760 //boolean increment = true; // tab.graphs[tab.versionindex] == null;
36623761
3663
- copy.versions[++copy.versionindex] = compress;
3762
+ copy.versionlist[++copy.versionindex] = compress;
36643763
36653764 // if (increment)
36663765 // tab.versionindex++;
....@@ -3670,10 +3769,10 @@
36703769
36713770 //assert(hashtable.isEmpty());
36723771
3673
- for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3772
+ for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
36743773 {
36753774 //tab.user[i] = false;
3676
- copy.versions[i] = null;
3775
+ copy.versionlist[i] = null;
36773776 }
36783777
36793778 SetUndoStates();
....@@ -3699,6 +3798,38 @@
36993798
37003799 return !thesame;
37013800 }
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
+ }
37023833
37033834 void CopyChanged(Object3D obj)
37043835 {
....@@ -3711,6 +3842,9 @@
37113842
37123843 copy.clear();
37133844
3845
+ copy.skyboxname = obj.skyboxname;
3846
+ copy.skyboxext = obj.skyboxext;
3847
+
37143848 for (int i=0; i<obj.Size(); i++)
37153849 {
37163850 copy.add(obj.get(i));
....@@ -3720,6 +3854,7 @@
37203854
37213855 CameraPane.SWITCH = temp;
37223856
3857
+ RefreshSelection();
37233858 //assert(hashtable.isEmpty());
37243859
37253860 copy.Touch();
....@@ -3754,9 +3889,9 @@
37543889 {
37553890 int count = 0;
37563891
3757
- for (int i = copy.versions.length; --i >= 0;)
3892
+ for (int i = copy.versionlist.length; --i >= 0;)
37583893 {
3759
- if (copy.versions[i] != null)
3894
+ if (copy.versionlist[i] != null)
37603895 count++;
37613896 }
37623897
....@@ -3771,7 +3906,7 @@
37713906 replaceButton.setEnabled(copy.versionindex != -1);
37723907
37733908 undoButton.setEnabled(copy.versionindex > 0);
3774
- redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3909
+ redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
37753910
37763911 muteSlider = true;
37773912 versionSlider.setMaximum(VersionCount() - 1);
....@@ -3809,7 +3944,7 @@
38093944
38103945 copy.versionindex -= 1;
38113946
3812
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3947
+ CopyChanged((Object3D)copy.versionlist[copy.versionindex]);
38133948
38143949 return true;
38153950 }
....@@ -3820,13 +3955,14 @@
38203955
38213956 cRadio tab = GetCurrentTab();
38223957
3823
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3958
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38243959 {
38253960 java.awt.Toolkit.getDefaultToolkit().beep();
38263961 return false;
38273962 }
38283963
3829
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3964
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3965
+ CopyChanged(copy.versionlist[copy.versionindex]);
38303966
38313967 return true;
38323968 }
....@@ -3837,13 +3973,13 @@
38373973
38383974 cRadio tab = GetCurrentTab();
38393975
3840
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3976
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38413977 {
38423978 // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
38433979 return false;
38443980 }
38453981
3846
- copy.versions[copy.versionindex] = CompressCopy();
3982
+ copy.versionlist[copy.versionindex] = CompressCopy();
38473983
38483984 return true;
38493985 }
....@@ -3855,7 +3991,7 @@
38553991
38563992 cRadio tab = GetCurrentTab();
38573993
3858
- if (copy.versions[copy.versionindex + 1] == null)
3994
+ if (copy.versionlist[copy.versionindex + 1] == null)
38593995 {
38603996 java.awt.Toolkit.getDefaultToolkit().beep();
38613997 return;
....@@ -3863,7 +3999,7 @@
38633999
38644000 copy.versionindex += 1;
38654001
3866
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4002
+ CopyChanged(copy.versionlist[copy.versionindex]);
38674003
38684004 //if (!tab.user[tab.versionindex])
38694005 // tab.graphs[tab.versionindex] = null;
....@@ -4077,7 +4213,7 @@
40774213 //copy.material = new cMaterial(copy.GetMaterial());
40784214
40794215 current.color = (float) colorField.getFloat();
4080
- current.modulation = (float) modulationField.getFloat();
4216
+ current.modulation = (float) saturationField.getFloat();
40814217 current.metalness = (float) metalnessField.getFloat();
40824218 current.diffuse = (float) diffuseField.getFloat();
40834219 current.specular = (float) specularField.getFloat();
....@@ -4110,7 +4246,7 @@
41104246 cMaterial mat = copy.material;
41114247
41124248 colorField.SetToolTipValue((mat.color));
4113
- modulationField.SetToolTipValue((mat.modulation));
4249
+ saturationField.SetToolTipValue((mat.modulation));
41144250 metalnessField.SetToolTipValue((mat.metalness));
41154251 diffuseField.SetToolTipValue((mat.diffuse));
41164252 specularField.SetToolTipValue((mat.specular));
....@@ -4174,9 +4310,9 @@
41744310
41754311 int version = versionSlider.getInteger();
41764312
4177
- if (copy.versions[version] != null)
4313
+ if (copy.versionlist[version] != null)
41784314 {
4179
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4315
+ CopyChanged(copy.versionlist[copy.versionindex = version]);
41804316 }
41814317
41824318 return;
....@@ -4216,6 +4352,12 @@
42164352 {
42174353 //System.out.println("stateChanged = " + this);
42184354 materialtouched = true;
4355
+
4356
+ if (e.getSource() == colorField && saturationField.getFloat() == 0.001)
4357
+ {
4358
+ saturationField.setFloat(1);
4359
+ }
4360
+
42194361 applySelf();
42204362 //System.out.println("this = " + this);
42214363 //System.out.println("PARENT = " + parent);
....@@ -4515,6 +4657,7 @@
45154657 {
45164658 if (GetTree() != null)
45174659 {
4660
+ GetTree().revalidate();
45184661 GetTree().repaint();
45194662 }
45204663
....@@ -4853,6 +4996,8 @@
48534996 {
48544997 //readobj.deepCopySelf(copy);
48554998 copy.clear(); // june 2014
4999
+ copy.skyboxname = readobj.skyboxname;
5000
+ copy.skyboxext = readobj.skyboxext;
48565001 for (int i = 0; i < readobj.size(); i++)
48575002 {
48585003 Object3D child = readobj.get(i); // reserve(i);
....@@ -4904,12 +5049,12 @@
49045049 c.addChild(csg);
49055050 }
49065051
4907
- copy.versions = readobj.versions;
5052
+ copy.versionlist = readobj.versionlist;
49085053 copy.versionindex = readobj.versionindex;
49095054
4910
- if (copy.versions == null)
5055
+ if (copy.versionlist == null)
49115056 {
4912
- copy.versions = new byte[100][];
5057
+ copy.versionlist = new Object3D[100];
49135058 copy.versionindex = -1;
49145059 }
49155060
....@@ -5317,7 +5462,7 @@
53175462 JLabel colorLabel;
53185463 cNumberSlider colorField;
53195464 JLabel modulationLabel;
5320
- cNumberSlider modulationField;
5465
+ cNumberSlider saturationField;
53215466 JLabel metalnessLabel;
53225467 cNumberSlider metalnessField;
53235468 JLabel diffuseLabel;