Normand Briere
2019-09-08 4a303a7b3635adfee8f46ac76af4e1b7b4a7029b
ObjEditor.java
....@@ -24,6 +24,7 @@
2424 matrix.Matrix;
2525
2626 import grafeme.ui.*;
27
+import org.xj3d.ui.swt.widgets.ImageLoader;
2728
2829 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2930 ActionListener, ChangeListener,
....@@ -34,6 +35,7 @@
3435 iSendInfo
3536 //KeyListener
3637 {
38
+ public cToggleButton pinButton;
3739 boolean timeline;
3840 boolean wasFullScreen;
3941
....@@ -41,11 +43,72 @@
4143 JFrame frame;
4244
4345 static ObjEditor theFrame;
46
+
47
+ public void AllocProjectedVertices(Object3D object)
48
+ {
49
+ assert (object.projectedVertices != null);
50
+
51
+ if (object.projectedVertices.length <= 2)
52
+ {
53
+ // Side effect...
54
+ Object3D.cVector2[] keep = object.projectedVertices;
55
+ object.projectedVertices = new Object3D.cVector2[3];
56
+ for (int i = 0; i < 3; i++)
57
+ {
58
+ if (i < keep.length)
59
+ {
60
+ object.projectedVertices[i] = keep[i];
61
+ } else
62
+ {
63
+ object.projectedVertices[i] = new Object3D.cVector2();
64
+ }
65
+ /*
66
+ if(keep.length == 0)
67
+ object.projectedVertices[0] = new Object3D.cVector2();
68
+ else
69
+ object.projectedVertices[0] = keep[0];
70
+ object.projectedVertices[1] = new Object3D.cVector2();
71
+ */
72
+ }
73
+ }
74
+ }
75
+
76
+ public Composite CreateCameras()
77
+ {
78
+ Composite cams = new cTemplate();
79
+ cams.name = "Cameras";
80
+ copy.insertElementAt(cams, 0);
81
+
82
+ cams.addChild(new Camera());
83
+ cams.addChild(new Camera(1));
84
+ cams.addChild(new Camera(2));
85
+ cams.addChild(new Camera(3));
86
+ cams.addChild(new Camera(4));
87
+
88
+ return cams;
89
+ }
90
+
91
+ public cGridBag GetSeparator()
92
+ {
93
+ cGridBag separator = new cGridBag();
94
+ separator.add(new JSeparator());
95
+ separator.preferredHeight = 5;
96
+ return separator;
97
+ }
4498
4599 cButton GetButton(String name, boolean border)
46100 {
47101 ImageIcon icon = GetIcon(name);
48
- return new cButton(icon, border);
102
+ if (icon != null || name.contains("/"))
103
+ return new cButton(icon, border);
104
+ else
105
+ return new cButton(name, border);
106
+ }
107
+
108
+ cLabel GetLabel(String name, boolean border)
109
+ {
110
+ //ImageIcon icon = GetIcon(name);
111
+ return new cLabel(GetImage(name), border);
49112 }
50113
51114 cToggleButton GetToggleButton(String name, boolean border)
....@@ -60,26 +123,67 @@
60123 return new cCheckBox(icon, border);
61124 }
62125
63
- ImageIcon GetIcon(String name)
126
+ static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>();
127
+
128
+ static ImageIcon GetIcon(String name)
129
+ {
130
+ javax.swing.ImageIcon iconCache = icons.get(name);
131
+ if (iconCache != null)
132
+ {
133
+ return iconCache;
134
+ }
135
+
136
+ try
137
+ {
138
+ BufferedImage image;
139
+
140
+ if (!Grafreed.isWindows && name.endsWith("jpg"))
141
+ {
142
+ try
143
+ {
144
+ // Much faster!
145
+ image = JpegLoader.load(name);
146
+ }
147
+ catch (Exception e)
148
+ {
149
+ image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
150
+ }
151
+ }
152
+ else
153
+ image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
154
+
155
+// if (image.getWidth() > 48 && image.getHeight() > 48)
156
+// {
157
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
158
+// Graphics2D g = resized.createGraphics();
159
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
160
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
161
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
162
+// g.dispose();
163
+//
164
+// image = resized;
165
+// }
166
+
167
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
168
+
169
+ icons.put(name, icon);
170
+
171
+ return icon;
172
+ }
173
+ catch (Exception e)
174
+ {
175
+ //icons.put(name, null);
176
+ return null;
177
+ }
178
+ }
179
+
180
+ BufferedImage GetImage(String name)
64181 {
65182 try
66183 {
67184 BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
68185
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
- }
80
-
81
- javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
82
- return icon;
186
+ return image;
83187 }
84188 catch (Exception e)
85189 {
....@@ -222,6 +326,8 @@
222326 objEditor.ctrlPanel.remove(setupPanel2);
223327 objEditor.ctrlPanel.remove(objectCommandsPanel);
224328 objEditor.ctrlPanel.remove(pushPanel);
329
+ if (versionPanel != null)
330
+ objEditor.ctrlPanel.remove(versionPanel);
225331 //objEditor.ctrlPanel.remove(fillPanel);
226332
227333 //Remove(normalpushField);
....@@ -268,11 +374,13 @@
268374 client = inClient;
269375 copy = client;
270376
271
- if (copy.versions == null)
272
- {
273
- copy.versions = new byte[100][];
274
- copy.versionindex = -1;
275
- }
377
+// if (copy.versionlist == null)
378
+// {
379
+// copy.versionlist = new Object3D[100];
380
+// copy.versionindex = -1;
381
+//
382
+// callee.Save(true);
383
+// }
276384
277385 // "this" is not called: SetupUI2(objEditor);
278386 }
....@@ -287,12 +395,6 @@
287395 client = inClient;
288396 copy = client;
289397
290
- if (copy.versions == null)
291
- {
292
- copy.versions = new byte[100][];
293
- copy.versionindex = -1;
294
- }
295
-
296398 SetupUI2(callee.GetEditor());
297399 }
298400
....@@ -314,7 +416,8 @@
314416 //parent = p;
315417
316418 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
317
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
419
+ if (Globals.DEBUG)
420
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
318421 //gd.setFullScreenWindow(this);
319422 //setResizable(false);
320423 //if (!isDisplayable())
....@@ -325,11 +428,13 @@
325428 copy = localCopy;
326429 copy.editWindow = this;
327430
328
- if (copy.versions == null)
329
- {
330
-// copy.versions = new byte[100][];
431
+// if (copy.versionlist == null)
432
+// {
433
+// copy.versionlist = new Object3D[100];
331434 // copy.versionindex = -1;
332
- }
435
+//
436
+// Save(true);
437
+// }
333438
334439 SetupMenu();
335440
....@@ -349,6 +454,9 @@
349454
350455 static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
351456
457
+ // This is to refresh the UI of the material panel.
458
+ boolean patchMaterial;
459
+
352460 void SetupMenu()
353461 {
354462 frame.setMenuBar(menuBar = new MenuBar());
....@@ -362,8 +470,11 @@
362470 importOBJItem.addActionListener(this);
363471 import3DSItem = menu.add(new MenuItem("3DS file..."));
364472 import3DSItem.addActionListener(this);
473
+ if (Globals.ADVANCED)
474
+ {
365475 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
366476 importVRMLX3DItem.addActionListener(this);
477
+ }
367478 menu.add("-");
368479 importGFDItem = menu.add(new MenuItem("Grafreed file..."));
369480 importGFDItem.addActionListener(this);
....@@ -394,10 +505,12 @@
394505 //povItem.addActionListener(this);
395506 closeItem.addActionListener(this);
396507
397
- objectPanel = new JTabbedPane();
508
+ objectTabbedPane = new JTabbedPane();
398509
399510 ChangeListener changeListener = new ChangeListener()
400511 {
512
+ //String name;
513
+
401514 public void stateChanged(ChangeEvent changeEvent)
402515 {
403516 // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
....@@ -416,10 +529,40 @@
416529 // EditSelection(false);
417530 // }
418531
419
- refreshContents(false); // To refresh Info tab
532
+// if (objectPanel.getSelectedIndex() == 4)
533
+// {
534
+// name = copy.skyboxname;
535
+//
536
+// if (name == null)
537
+// {
538
+// name = "";
539
+// }
540
+//
541
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
542
+// copy.skyboxext = "jpg";
543
+// }
544
+// else
545
+// {
546
+// if (name != null)
547
+// {
548
+// if (name.equals(""))
549
+// {
550
+// copy.skyboxname = null;
551
+// copy.skyboxext = null;
552
+// }
553
+// else
554
+// {
555
+// copy.skyboxname = name;
556
+// }
557
+// }
558
+// }
559
+ cameraView.transformMode = objectTabbedPane.getSelectedIndex() == 5;
560
+
561
+// refreshContents(false); // To refresh Info tab
562
+ cameraView.repaint();
420563 }
421564 };
422
- objectPanel.addChangeListener(changeListener);
565
+ objectTabbedPane.addChangeListener(changeListener);
423566
424567 toolbarPanel = new JPanel();
425568 toolbarPanel.setName("Toolbar");
....@@ -439,7 +582,9 @@
439582 toolboxPanel = new cGridBag().setVertical(true);
440583 //toolboxPanel.setName("Toolbox");
441584
442
- materialPanel = new cGridBag().setVertical(true);
585
+ skyboxPanel = new cGridBag().setVertical(true);
586
+
587
+ materialPanel = new cGridBag().setVertical(false);
443588 //materialPanel.setName("Material");
444589
445590 /*JTextPane*/
....@@ -460,7 +605,7 @@
460605 //infoPanel.setLayout(new BorderLayout());
461606 //infoPanel.add(createTextPane());
462607
463
- mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, treePanel, objectPanel);
608
+ mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, treePanel, objectTabbedPane);
464609 mainPanel.setName("Main");
465610 mainPanel.setContinuousLayout(true);
466611 mainPanel.setOneTouchExpandable(true);
....@@ -723,6 +868,7 @@
723868 boolean maximized;
724869
725870 cButton fullscreenLayout;
871
+ cButton expandedLayout;
726872
727873 void Minimize()
728874 {
....@@ -761,11 +907,23 @@
761907
762908 cButton minButton;
763909 cButton maxButton;
764
- cButton fullButton;
910
+ cButton fullScreenButton;
911
+ cButton collapseButton;
912
+ cButton maximize3DButton;
765913
914
+ public void Show3DView()
915
+ {
916
+ // bug
917
+ //gridPanel.setDividerLocation(1.0);
918
+ //bigPanel.setDividerLocation(0.0);
919
+ bigThree.ClearUI();
920
+ bigThree.add(centralPanel);
921
+ bigThree.FlushUI();
922
+ }
923
+
766924 void ToggleFullScreen()
767925 {
768
-GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
926
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
769927
770928 cameraView.ToggleFullScreen();
771929
....@@ -786,7 +944,7 @@
786944 // X frame.getContentPane().remove(/*"Center",*/bigThree);
787945 // X framePanel.add(bigThree);
788946 // X frame.getContentPane().add(/*"Center",*/framePanel);
789
- framePanel.setDividerLocation(46);
947
+// framePanel.setDividerLocation(46); // icons are 24x24
790948
791949 //frame.setVisible(true);
792950 radio.layout = keepButton;
....@@ -797,6 +955,10 @@
797955 } else
798956 {
799957 keepButton = radio.layout;
958
+
959
+ radio.layout = twoButton;
960
+ Show3DView();
961
+
800962 //keeprect = frame.getBounds();
801963 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
802964 // frame.getToolkit().getScreenSize().height);
....@@ -813,31 +975,58 @@
813975 // X frame.getContentPane().remove(/*"Center",*/framePanel);
814976 // X framePanel.remove(bigThree);
815977 // X frame.getContentPane().add(/*"Center",*/bigThree);
816
- framePanel.setDividerLocation(0);
978
+// framePanel.setDividerLocation(0);
817979
818
- radio.layout = fullscreenLayout;
819
- radio.layout.doClick();
980
+// radio.layout = fullscreenLayout;
981
+// radio.layout.doClick();
820982 //frame.setVisible(true);
983
+ CollapseToolbar();
821984 }
822985 frame.validate();
986
+
987
+ cameraView.requestFocusInWindow();
823988 }
824989
825
- private byte[] CompressCopy()
990
+ void CollapseToolbar()
991
+ {
992
+ framePanel.setDividerLocation(0);
993
+ //frame.validate();
994
+
995
+ cameraView.requestFocusInWindow();
996
+ }
997
+
998
+ private Object3D Duplicate(Object3D object)
826999 {
8271000 boolean temp = CameraPane.SWITCH;
8281001 CameraPane.SWITCH = false;
8291002
830
- copy.ExtractBigData(versiontable);
1003
+ if (Grafreed.grafreed.universe.versiontable == null)
1004
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
1005
+
1006
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
8311007 // if (copy == client)
8321008
833
- byte[] versions[] = copy.versions;
834
- copy.versions = null;
1009
+ assert(!object.HasBigData());
8351010
836
- byte[] compress = Compress(copy);
1011
+ Object3D versions[] = object.versionlist;
1012
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
1013
+ object.versionlist = null;
1014
+ object.versiontable = null;
8371015
838
- copy.versions = versions;
1016
+ Object3D parent = object.parent;
1017
+ object.parent = null;
8391018
840
- copy.RestoreBigData(versiontable);
1019
+ //byte[] compress = Compress(copy);
1020
+ Object3D compress = (Object3D)Grafreed.clone(object);
1021
+
1022
+ assert(!compress.HasBigData());
1023
+
1024
+ object.parent = parent;
1025
+
1026
+ object.versionlist = versions;
1027
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
1028
+
1029
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
8411030
8421031 CameraPane.SWITCH = temp;
8431032
....@@ -965,6 +1154,7 @@
9651154 {
9661155 SetupMaterial(materialPanel);
9671156 }
1157
+
9681158 //SetupName();
9691159 //SetupViews();
9701160 }
....@@ -1004,6 +1194,7 @@
10041194 cGridBag setupPanel2;
10051195 cGridBag objectCommandsPanel;
10061196 cGridBag pushPanel;
1197
+ cGridBag versionPanel;
10071198 cGridBag fillPanel;
10081199
10091200 JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
....@@ -1166,6 +1357,11 @@
11661357 obj = o;
11671358 }
11681359 }
1360
+
1361
+ String GetSupportText()
1362
+ {
1363
+ return "Support";
1364
+ }
11691365
11701366 void SetupUI2(ObjEditor oe)
11711367 {
....@@ -1173,6 +1369,18 @@
11731369
11741370 namePanel = new cGridBag();
11751371
1372
+ //if (copy.pinned)
1373
+ {
1374
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
1375
+ pinButton.setSelected(copy.pinned);
1376
+ cGridBag t = new cGridBag();
1377
+ t.preferredWidth = 2;
1378
+ t.add(pinButton);
1379
+ namePanel.add(t);
1380
+
1381
+ pinButton.addItemListener(this);
1382
+ }
1383
+
11761384 nameField = AddText(namePanel, copy.GetName());
11771385 namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11781386 oe.ctrlPanel.add(namePanel);
....@@ -1186,14 +1394,14 @@
11861394
11871395 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
11881396 liveCB.setToolTipText("Animate object");
1397
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1398
+ markCB.setToolTipText("Set target transform");
11891399 selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
11901400 selectableCB.setToolTipText("Make object selectable");
11911401 // Return();
11921402
11931403 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11941404 hideCB.setToolTipText("Hide object");
1195
- markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1196
- markCB.setToolTipText("As animation target transform");
11971405
11981406 ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
11991407
....@@ -1205,7 +1413,7 @@
12051413 randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
12061414 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
12071415
1208
- link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1416
+ link2masterCB = AddCheckBox(setupPanel2, GetSupportText(), copy.link2master);
12091417 link2masterCB.setToolTipText("Attach to support");
12101418
12111419 if (Globals.ADVANCED)
....@@ -1238,9 +1446,14 @@
12381446 oe.ctrlPanel.add(objectCommandsPanel);
12391447 oe.ctrlPanel.Return();
12401448
1241
- pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1449
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH * 100, 1.1); // To have the buttons
12421450 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1243
- //Return();
1451
+ if (false && copy.versionlist != null && copy.versionindex != -1)
1452
+ {
1453
+ oe.ctrlPanel.Return();
1454
+ versionPanel = AddSlider(oe.ctrlPanel, "Version", 0, copy.VersionCount() - 1, copy.versionindex);
1455
+ versionField = (cNumberSlider)versionPanel.getComponent(1);
1456
+ }
12441457
12451458 oe.ctrlPanel.Return();
12461459
....@@ -1377,6 +1590,8 @@
13771590
13781591 return null;
13791592 }
1593
+
1594
+ int objectTabCount;
13801595
13811596 void SetupViews()
13821597 {
....@@ -1395,22 +1610,9 @@
13951610
13961611 if (cam == null || !(copy.get(0) instanceof cGroup))
13971612 {
1398
- System.out.println("CREATE CAMERAS");
1399
- cams = new cTemplate();
1400
- cams.name = "Cameras";
1401
- copy.insertElementAt(cams, 0);
1402
- //cams.parent = copy;
1403
-
1404
- cam = new Camera(); // LA.newVector(3, 2, 1));
1405
- cams.addChild(cam);
1406
- cam = new Camera(1);
1407
- cams.addChild(cam);
1408
- cam = new Camera(2);
1409
- cams.addChild(cam);
1410
- cam = new Camera(3);
1411
- cams.addChild(cam);
1412
- cam = new Camera(4); // Light
1413
- cams.addChild(cam);
1613
+ if (Globals.DEBUG)
1614
+ System.out.println("CREATE CAMERAS");
1615
+ cams = CreateCameras();
14141616 } else
14151617 {
14161618 cams = (cGroup) copy.get(0);
....@@ -1476,6 +1678,45 @@
14761678 //frontView.object = copy;
14771679 //sideView.object = copy;
14781680
1681
+ transformPanel = new cGridBag().setVertical(true);
1682
+
1683
+ cGridBag resetTransformPanel = new cGridBag();
1684
+
1685
+ resetTransformPanel.preferredHeight = 2;
1686
+
1687
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1688
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1689
+ resetTransform.addMouseListener(new MouseAdapter()
1690
+ {
1691
+ public void mouseClicked(MouseEvent e)
1692
+ {
1693
+ ResetTransform();
1694
+ }
1695
+ });
1696
+ resetTransformPanel.add(resetTransform);
1697
+
1698
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1699
+ resetTransform.setToolTipText("Reset Translation only");
1700
+ resetTransform.addMouseListener(new MouseAdapter()
1701
+ {
1702
+ public void mouseClicked(MouseEvent e)
1703
+ {
1704
+ ResetTransform(1);
1705
+ }
1706
+ });
1707
+ resetTransformPanel.add(resetTransform);
1708
+
1709
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1710
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1711
+ resetTransform.addMouseListener(new MouseAdapter()
1712
+ {
1713
+ public void mouseClicked(MouseEvent e)
1714
+ {
1715
+ ResetTransform(2);
1716
+ }
1717
+ });
1718
+ resetTransformPanel.add(resetTransform);
1719
+
14791720 XYZPanel = new cGridBag().setVertical(true);
14801721 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
14811722
....@@ -1485,6 +1726,15 @@
14851726 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
14861727 //XYZPanel.setName("XYZ");
14871728
1729
+ transformPanel.add(resetTransformPanel);
1730
+
1731
+ cGridBag scalePanel = AddSlider(transformPanel, "Scale", 1, 10, 1);
1732
+ scalePanel.preferredHeight = 2;
1733
+ scaleSlider = (cNumberSlider)scalePanel.getComponent(1);
1734
+ transformPanel.add(scalePanel);
1735
+
1736
+ transformPanel.add(XYZPanel);
1737
+
14881738 /*
14891739 gridPanel = new JPanel(); //new BorderLayout());
14901740 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1492,12 +1742,12 @@
14921742 gridPanel.add(cameraView);
14931743 gridPanel.add(XYZPanel);
14941744 */
1495
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1496
- gridPanel.setContinuousLayout(true);
1497
- gridPanel.setOneTouchExpandable(true);
1498
- gridPanel.setDividerLocation(1.0);
1499
- gridPanel.setDividerSize(9);
1500
- gridPanel.setResizeWeight(0.85);
1745
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1746
+// gridPanel.setContinuousLayout(true);
1747
+// gridPanel.setOneTouchExpandable(true);
1748
+// gridPanel.setDividerLocation(1.0);
1749
+// gridPanel.setDividerSize(9);
1750
+// gridPanel.setResizeWeight(0.85);
15011751
15021752 // aConstraints.weighty = 0;
15031753 //System.out.println("THIS = " + this);
....@@ -1520,25 +1770,43 @@
15201770
15211771 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
15221772 //tmp.setName("Edit");
1523
- objectPanel.add(materialPanel);
1524
- objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1773
+
1774
+ objectTabCount = 0;
1775
+
1776
+ objectTabbedPane.add(skyboxPanel);
1777
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/skybox.jpg"));
1778
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Backgrounds");
1779
+
1780
+ objectTabbedPane.add(toolboxPanel);
1781
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/primitives.png"));
1782
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Objects & textures");
1783
+
1784
+ objectTabbedPane.add(materialPanel);
1785
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/material.png"));
1786
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Material");
1787
+
1788
+ figurePanel = new cGridBag();
1789
+ figurePanel.add(new cButton("FIGURES amd POSES coming soon!"));
1790
+ objectTabbedPane.add(figurePanel);
1791
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/figure.png"));
1792
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Figures and poses");
1793
+
15251794 // JPanel north = new JPanel(new BorderLayout());
15261795 // north.setName("Edit");
15271796 // north.add(ctrlPanel, BorderLayout.NORTH);
15281797 // objectPanel.add(north);
1529
- objectPanel.add(editPanel);
1530
- objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1798
+ objectTabbedPane.add(editPanel);
1799
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/writewhite.png"));
1800
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Edit controls");
15311801
1532
- //if (Globals.ADVANCED)
1533
- objectPanel.add(infoPanel);
1534
- objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1802
+ objectTabbedPane.add(transformPanel);
1803
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/XYZ.png"));
1804
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "TRS transform");
15351805
1536
- objectPanel.add(XYZPanel);
1537
- objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1538
-
1539
- objectPanel.add(toolboxPanel);
1540
- objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
1541
-
1806
+ patchMaterial = true;
1807
+ cameraView.patchMaterial = this;
1808
+ objectTabbedPane.setSelectedIndex(2);
1809
+
15421810 /*
15431811 aConstraints.gridx = 0;
15441812 aConstraints.gridwidth = 1;
....@@ -1558,7 +1826,7 @@
15581826 scrollpane.addMouseWheelListener(this); // Default not fast enough
15591827
15601828 /*JTabbedPane*/ scenePanel = new cGridBag();
1561
- scenePanel.preferredWidth = 5;
1829
+ scenePanel.preferredWidth = 6;
15621830
15631831 JTabbedPane tabbedPane = new JTabbedPane();
15641832 tabbedPane.add(scrollpane);
....@@ -1569,11 +1837,108 @@
15691837
15701838 AddOptions(optionsPanel); //, aConstraints);
15711839
1572
- tabbedPane.add(optionsPanel);
1573
-
15741840 tabbedPane.add(FSPane = new cFileSystemPane(this));
15751841
1842
+ tabbedPane.add(optionsPanel);
1843
+
15761844 scenePanel.add(tabbedPane);
1845
+
1846
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1847
+ creditsPanel.setName("Credits");
1848
+
1849
+ cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1850
+ creditsPanel.add(ogaLabel);
1851
+
1852
+ cButton creditButton;
1853
+ creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1854
+ creditButton.setToolTipText("https://opengameart.org");
1855
+
1856
+ creditButton.addMouseListener(new MouseAdapter()
1857
+ {
1858
+ public void mouseClicked(MouseEvent e)
1859
+ {
1860
+ try
1861
+ {
1862
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1863
+ } catch (Exception e1)
1864
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1865
+ {
1866
+ e1.printStackTrace();
1867
+ }
1868
+ }
1869
+ });
1870
+
1871
+ ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF);
1872
+ creditsPanel.add(ogaLabel);
1873
+
1874
+ creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF));
1875
+ creditButton.setToolTipText("https://3delicious.net");
1876
+
1877
+ creditButton.addMouseListener(new MouseAdapter()
1878
+ {
1879
+ public void mouseClicked(MouseEvent e)
1880
+ {
1881
+ try
1882
+ {
1883
+ Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net"));
1884
+ } catch (Exception e1)
1885
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1886
+ {
1887
+ e1.printStackTrace();
1888
+ }
1889
+ }
1890
+ });
1891
+
1892
+ creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF));
1893
+ creditButton.setToolTipText("https://archive3d.net");
1894
+
1895
+ creditButton.addMouseListener(new MouseAdapter()
1896
+ {
1897
+ public void mouseClicked(MouseEvent e)
1898
+ {
1899
+ try
1900
+ {
1901
+ Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net"));
1902
+ } catch (Exception e1)
1903
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1904
+ {
1905
+ e1.printStackTrace();
1906
+ }
1907
+ }
1908
+ });
1909
+
1910
+ creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF));
1911
+ creditButton.setToolTipText("https://turbosquid.com");
1912
+
1913
+ creditButton.addMouseListener(new MouseAdapter()
1914
+ {
1915
+ public void mouseClicked(MouseEvent e)
1916
+ {
1917
+ try
1918
+ {
1919
+ Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free"));
1920
+ } catch (Exception e1)
1921
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1922
+ {
1923
+ e1.printStackTrace();
1924
+ }
1925
+ }
1926
+ });
1927
+
1928
+ for (int i=6; --i>=0;)
1929
+ {
1930
+ creditsPanel.add(new cGridBag());
1931
+ }
1932
+
1933
+ tabbedPane.add(creditsPanel);
1934
+ tabbedPane.setToolTipTextAt(3, "Credits");
1935
+
1936
+ if (Globals.SHOWINFO)
1937
+ {
1938
+ objectTabbedPane.add(infoPanel);
1939
+ objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/info.png"));
1940
+ objectTabbedPane.setToolTipTextAt(objectTabCount++, "Information");
1941
+ }
15771942
15781943 /*
15791944 cTree jTree = new cTree(null);
....@@ -1595,13 +1960,13 @@
15951960 jtp.add(tree);
15961961 */
15971962
1598
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1599
- bigPanel.setContinuousLayout(true);
1600
- bigPanel.setOneTouchExpandable(true);
1601
- bigPanel.setDividerLocation(0.8);
1602
- bigPanel.setDividerSize(15);
1603
- bigPanel.setResizeWeight(0.15);
1604
- bigPanel.setName("Scene");
1963
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1964
+// bigPanel.setContinuousLayout(true);
1965
+// bigPanel.setOneTouchExpandable(true);
1966
+// bigPanel.setDividerLocation(0.8);
1967
+// bigPanel.setDividerSize(15);
1968
+// bigPanel.setResizeWeight(0.15);
1969
+// bigPanel.setName("Scene");
16051970
16061971 //bigPanel.setLayout(new BorderLayout());
16071972 //bigPanel.setSize(new Dimension(10,10));
....@@ -1634,8 +1999,8 @@
16341999 /**/
16352000
16362001 bigThree = new cGridBag();
1637
- bigThree.addComponent(centralPanel);
16382002 bigThree.addComponent(scenePanel);
2003
+ bigThree.addComponent(centralPanel);
16392004 //bigThree.addComponent(XYZPanel);
16402005
16412006 // // SIDE EFFECT!!!
....@@ -1645,6 +2010,28 @@
16452010 // aConstraints.gridheight = 1;
16462011
16472012 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
2013
+
2014
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
2015
+ new java.beans.PropertyChangeListener()
2016
+ {
2017
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
2018
+ {
2019
+ if ((Integer)pce.getOldValue() == 1)
2020
+ {
2021
+ if (CameraPane.FULLSCREEN)
2022
+ {
2023
+ ToggleFullScreen();
2024
+ }
2025
+
2026
+// if (radio.layout != expandedLayout)
2027
+// {
2028
+// radio.layout = expandedLayout;
2029
+// radio.layout.doClick();
2030
+// }
2031
+ }
2032
+ }
2033
+ });
2034
+
16482035 framePanel.setContinuousLayout(false);
16492036 framePanel.setOneTouchExpandable(false);
16502037 //.setDividerLocation(0.8);
....@@ -1654,7 +2041,7 @@
16542041
16552042 frame.getContentPane().setLayout(new BorderLayout());
16562043 /**/
1657
- JTabbedPane worldPane = new JTabbedPane();
2044
+ //JTabbedPane worldPane = new JTabbedPane();
16582045 //worldPane.add(bigPanel);
16592046 //worldPane.add(worldPanel);
16602047 /**/
....@@ -1664,11 +2051,11 @@
16642051
16652052 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
16662053
1667
- frame.setSize(1280, 860);
2054
+ frame.setSize(1280, 900);
16682055
16692056 cameraView.requestFocusInWindow();
16702057
1671
- gridPanel.setDividerLocation(1.0);
2058
+// gridPanel.setDividerLocation(1.0);
16722059
16732060 frame.validate();
16742061
....@@ -1677,7 +2064,6 @@
16772064 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
16782065 frame.addWindowListener(new WindowAdapter()
16792066 {
1680
-
16812067 public void windowClosing(WindowEvent e)
16822068 {
16832069 Close();
....@@ -1700,28 +2086,484 @@
17002086 ctrlPanel.removeAll();
17012087 }
17022088
1703
- void SetupMaterial(cGridBag panel)
2089
+ void SetupMaterial(cGridBag materialpanel)
17042090 {
1705
- /*
2091
+ cGridBag presetpanel = new cGridBag().setVertical(true);
2092
+
2093
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
2094
+ skin.setToolTipText("Skin");
2095
+ skin.addMouseListener(new MouseAdapter()
2096
+ {
2097
+ public void mouseClicked(MouseEvent e)
2098
+ {
2099
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
2100
+ cMaterial material = object.material;
2101
+
2102
+ // Skin
2103
+ colorField.setFloat(material.color);
2104
+ float saturation = material.modulation;
2105
+
2106
+ if (!cameraView.Skinshader)
2107
+ {
2108
+ saturation /= 1.5;
2109
+ }
2110
+
2111
+ saturationField.setFloat(saturation);
2112
+
2113
+ subsurfaceField.setFloat(material.subsurface);
2114
+ selfshadowField.setFloat(material.diffuseness);
2115
+ diffusenessField.setFloat(material.factor);
2116
+ shininessField.setFloat(material.shininess);
2117
+ shadowbiasField.setFloat(material.shadowbias);
2118
+ diffuseField.setFloat(material.diffuse);
2119
+ specularField.setFloat(material.specular);
2120
+
2121
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2122
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2123
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2124
+
2125
+ materialtouched = true;
2126
+ applySelf();
2127
+ }
2128
+ });
2129
+ presetpanel.add(skin);
2130
+
2131
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
2132
+ lambert.setToolTipText("Diffuse");
2133
+ lambert.addMouseListener(new MouseAdapter()
2134
+ {
2135
+ public void mouseClicked(MouseEvent e)
2136
+ {
2137
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
2138
+ cMaterial material = object.material;
2139
+
2140
+ diffusenessField.setFloat(material.factor);
2141
+ selfshadowField.setFloat(material.diffuseness);
2142
+
2143
+ materialtouched = true;
2144
+ applySelf();
2145
+ }
2146
+ });
2147
+ presetpanel.add(lambert);
2148
+
2149
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
2150
+ diffuse2.setToolTipText("Diffuse2");
2151
+ diffuse2.addMouseListener(new MouseAdapter()
2152
+ {
2153
+ public void mouseClicked(MouseEvent e)
2154
+ {
2155
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
2156
+ cMaterial material = object.material;
2157
+
2158
+ diffusenessField.setFloat(material.factor);
2159
+ selfshadowField.setFloat(material.diffuseness);
2160
+
2161
+ materialtouched = true;
2162
+ applySelf();
2163
+ }
2164
+ });
2165
+ presetpanel.add(diffuse2);
2166
+
2167
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
2168
+ diffusemoon.setToolTipText("Moon");
2169
+ diffusemoon.addMouseListener(new MouseAdapter()
2170
+ {
2171
+ public void mouseClicked(MouseEvent e)
2172
+ {
2173
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
2174
+ cMaterial material = object.material;
2175
+
2176
+ diffusenessField.setFloat(material.factor);
2177
+ selfshadowField.setFloat(material.diffuseness);
2178
+
2179
+ materialtouched = true;
2180
+ applySelf();
2181
+ }
2182
+ });
2183
+ presetpanel.add(diffusemoon);
2184
+
2185
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
2186
+ diffusemoon2.setToolTipText("Moon2");
2187
+ diffusemoon2.addMouseListener(new MouseAdapter()
2188
+ {
2189
+ public void mouseClicked(MouseEvent e)
2190
+ {
2191
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
2192
+ cMaterial material = object.material;
2193
+
2194
+ diffusenessField.setFloat(material.factor);
2195
+ selfshadowField.setFloat(material.diffuseness);
2196
+
2197
+ materialtouched = true;
2198
+ applySelf();
2199
+ }
2200
+ });
2201
+ presetpanel.add(diffusemoon2);
2202
+
2203
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
2204
+ diffusemoon3.setToolTipText("Moon3");
2205
+ diffusemoon3.addMouseListener(new MouseAdapter()
2206
+ {
2207
+ public void mouseClicked(MouseEvent e)
2208
+ {
2209
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
2210
+ cMaterial material = object.material;
2211
+
2212
+ diffusenessField.setFloat(material.factor);
2213
+ selfshadowField.setFloat(material.diffuseness);
2214
+
2215
+ materialtouched = true;
2216
+ applySelf();
2217
+ }
2218
+ });
2219
+ presetpanel.add(diffusemoon3);
2220
+
2221
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
2222
+ diffusesheen.setToolTipText("Sheen");
2223
+ diffusesheen.addMouseListener(new MouseAdapter()
2224
+ {
2225
+ public void mouseClicked(MouseEvent e)
2226
+ {
2227
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
2228
+ cMaterial material = object.material;
2229
+
2230
+ sheenField.setFloat(material.sheen);
2231
+
2232
+ materialtouched = true;
2233
+ applySelf();
2234
+ }
2235
+ });
2236
+ presetpanel.add(diffusesheen);
2237
+
2238
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
2239
+ rough.setToolTipText("Rough metal");
2240
+ rough.addMouseListener(new MouseAdapter()
2241
+ {
2242
+ public void mouseClicked(MouseEvent e)
2243
+ {
2244
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
2245
+ cMaterial material = object.material;
2246
+
2247
+ shininessField.setFloat(material.shininess);
2248
+ velvetField.setFloat(material.velvet);
2249
+
2250
+ materialtouched = true;
2251
+ applySelf();
2252
+ }
2253
+ });
2254
+ presetpanel.add(rough);
2255
+
2256
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
2257
+ rough2.setToolTipText("Medium metal");
2258
+ rough2.addMouseListener(new MouseAdapter()
2259
+ {
2260
+ public void mouseClicked(MouseEvent e)
2261
+ {
2262
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
2263
+ cMaterial material = object.material;
2264
+
2265
+ shininessField.setFloat(material.shininess);
2266
+ lightareaField.setFloat(material.lightarea);
2267
+
2268
+ materialtouched = true;
2269
+ applySelf();
2270
+ }
2271
+ });
2272
+ presetpanel.add(rough2);
2273
+
2274
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
2275
+ shini0.setToolTipText("Shiny");
2276
+ shini0.addMouseListener(new MouseAdapter()
2277
+ {
2278
+ public void mouseClicked(MouseEvent e)
2279
+ {
2280
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
2281
+ cMaterial material = object.material;
2282
+
2283
+ shininessField.setFloat(material.shininess);
2284
+ lightareaField.setFloat(material.lightarea);
2285
+
2286
+ materialtouched = true;
2287
+ applySelf();
2288
+ }
2289
+ });
2290
+ presetpanel.add(shini0);
2291
+
2292
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
2293
+ shini1.setToolTipText("Shiny2");
2294
+ shini1.addMouseListener(new MouseAdapter()
2295
+ {
2296
+ public void mouseClicked(MouseEvent e)
2297
+ {
2298
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
2299
+ cMaterial material = object.material;
2300
+
2301
+ shininessField.setFloat(material.shininess);
2302
+ lightareaField.setFloat(material.lightarea);
2303
+
2304
+ materialtouched = true;
2305
+ applySelf();
2306
+ }
2307
+ });
2308
+ presetpanel.add(shini1);
2309
+
2310
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
2311
+ shini2.setToolTipText("Shiny3");
2312
+ shini2.addMouseListener(new MouseAdapter()
2313
+ {
2314
+ public void mouseClicked(MouseEvent e)
2315
+ {
2316
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2317
+ cMaterial material = object.material;
2318
+
2319
+ shininessField.setFloat(material.shininess);
2320
+ lightareaField.setFloat(material.lightarea);
2321
+
2322
+ materialtouched = true;
2323
+ applySelf();
2324
+ }
2325
+ });
2326
+ presetpanel.add(shini2);
2327
+
2328
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
2329
+ aniso.setToolTipText("AnisoU");
2330
+ aniso.addMouseListener(new MouseAdapter()
2331
+ {
2332
+ public void mouseClicked(MouseEvent e)
2333
+ {
2334
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2335
+ cMaterial material = object.material;
2336
+
2337
+ anisoField.setFloat(material.aniso);
2338
+ anisoVField.setFloat(material.anisoV);
2339
+
2340
+ materialtouched = true;
2341
+ applySelf();
2342
+ }
2343
+ });
2344
+ presetpanel.add(aniso);
2345
+
2346
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
2347
+ aniso2.setToolTipText("AnisoV");
2348
+ aniso2.addMouseListener(new MouseAdapter()
2349
+ {
2350
+ public void mouseClicked(MouseEvent e)
2351
+ {
2352
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2353
+ cMaterial material = object.material;
2354
+
2355
+ anisoField.setFloat(material.aniso);
2356
+ anisoVField.setFloat(material.anisoV);
2357
+
2358
+ materialtouched = true;
2359
+ applySelf();
2360
+ }
2361
+ });
2362
+ presetpanel.add(aniso2);
2363
+
2364
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
2365
+ aniso3.setToolTipText("AnisoUV");
2366
+ aniso3.addMouseListener(new MouseAdapter()
2367
+ {
2368
+ public void mouseClicked(MouseEvent e)
2369
+ {
2370
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2371
+ cMaterial material = object.material;
2372
+
2373
+ anisoField.setFloat(material.aniso);
2374
+ anisoVField.setFloat(material.anisoV);
2375
+
2376
+ materialtouched = true;
2377
+ applySelf();
2378
+ }
2379
+ });
2380
+ presetpanel.add(aniso3);
2381
+
2382
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
2383
+ velvet0.setToolTipText("Velvet");
2384
+ velvet0.addMouseListener(new MouseAdapter()
2385
+ {
2386
+ public void mouseClicked(MouseEvent e)
2387
+ {
2388
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2389
+ cMaterial material = object.material;
2390
+
2391
+ diffusenessField.setFloat(material.factor);
2392
+ selfshadowField.setFloat(material.diffuseness);
2393
+ sheenField.setFloat(material.sheen);
2394
+ shininessField.setFloat(material.shininess);
2395
+ velvetField.setFloat(material.velvet);
2396
+ shiftField.setFloat(material.shift);
2397
+
2398
+ materialtouched = true;
2399
+ applySelf();
2400
+ }
2401
+ });
2402
+ presetpanel.add(velvet0);
2403
+
2404
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
2405
+ bump0.setToolTipText("Bump texture");
2406
+ bump0.addMouseListener(new MouseAdapter()
2407
+ {
2408
+ public void mouseClicked(MouseEvent e)
2409
+ {
2410
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2411
+ cMaterial material = object.material;
2412
+
2413
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2414
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2415
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2416
+
2417
+ materialtouched = true;
2418
+ applySelf();
2419
+ }
2420
+ });
2421
+ presetpanel.add(bump0);
2422
+
2423
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
2424
+ borderShader.setToolTipText("Border fade");
2425
+ borderShader.addMouseListener(new MouseAdapter()
2426
+ {
2427
+ public void mouseClicked(MouseEvent e)
2428
+ {
2429
+ borderfadeField.setFloat(0.4);
2430
+ opacityField.setFloat(0.75);
2431
+
2432
+ materialtouched = true;
2433
+ applySelf();
2434
+ }
2435
+ });
2436
+ presetpanel.add(borderShader);
2437
+
2438
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
2439
+ halo.setToolTipText("Halo");
2440
+ halo.addMouseListener(new MouseAdapter()
2441
+ {
2442
+ public void mouseClicked(MouseEvent e)
2443
+ {
2444
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2445
+ cMaterial material = object.material;
2446
+
2447
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2448
+
2449
+ materialtouched = true;
2450
+ applySelf();
2451
+ }
2452
+ });
2453
+ presetpanel.add(halo);
2454
+
2455
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
2456
+ candle.setToolTipText("Candle");
2457
+ candle.addMouseListener(new MouseAdapter()
2458
+ {
2459
+ public void mouseClicked(MouseEvent e)
2460
+ {
2461
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2462
+ cMaterial material = object.material;
2463
+
2464
+ subsurfaceField.setFloat(material.subsurface);
2465
+ shadowbiasField.setFloat(material.shadowbias);
2466
+ ambientField.setFloat(material.ambient);
2467
+ specularField.setFloat(material.specular);
2468
+ lightareaField.setFloat(material.lightarea);
2469
+ shininessField.setFloat(material.shininess);
2470
+
2471
+ materialtouched = true;
2472
+ applySelf();
2473
+ }
2474
+ });
2475
+ presetpanel.add(candle);
2476
+
2477
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
2478
+ shadowShader.setToolTipText("Shadow");
2479
+ shadowShader.addMouseListener(new MouseAdapter()
2480
+ {
2481
+ public void mouseClicked(MouseEvent e)
2482
+ {
2483
+ diffuseField.setFloat(0.001);
2484
+ ambientField.setFloat(0.001);
2485
+ cameraField.setFloat(0.001);
2486
+ specularField.setFloat(0.001);
2487
+ fakedepthField.setFloat(0.001);
2488
+ opacityField.setFloat(0.4);
2489
+
2490
+ materialtouched = true;
2491
+ applySelf();
2492
+ }
2493
+ });
2494
+ presetpanel.add(shadowShader);
2495
+
2496
+ cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF);
2497
+ para0.setToolTipText("No parallax");
2498
+ para0.addMouseListener(new MouseAdapter()
2499
+ {
2500
+ public void mouseClicked(MouseEvent e)
2501
+ {
2502
+ parallaxField.setFloat(0.125);
2503
+
2504
+ materialtouched = true;
2505
+ applySelf();
2506
+ }
2507
+ });
2508
+ presetpanel.add(para0);
2509
+
2510
+ cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF);
2511
+ para1.setToolTipText("With parallax");
2512
+ para1.addMouseListener(new MouseAdapter()
2513
+ {
2514
+ public void mouseClicked(MouseEvent e)
2515
+ {
2516
+ parallaxField.setFloat(0.13);
2517
+
2518
+ materialtouched = true;
2519
+ applySelf();
2520
+ }
2521
+ });
2522
+ presetpanel.add(para1);
2523
+
2524
+ cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF);
2525
+ para2.setToolTipText("Reset parallax");
2526
+ para2.addMouseListener(new MouseAdapter()
2527
+ {
2528
+ public void mouseClicked(MouseEvent e)
2529
+ {
2530
+ parallaxField.setFloat(0.14);
2531
+
2532
+ materialtouched = true;
2533
+ applySelf();
2534
+ }
2535
+ });
2536
+ presetpanel.add(para2);
2537
+
2538
+ cGridBag panel = new cGridBag().setVertical(true);
2539
+
2540
+ presetpanel.preferredWidth = 1;
2541
+
2542
+ materialpanel.add(presetpanel);
2543
+ materialpanel.add(panel);
2544
+
2545
+ panel.preferredWidth = 8;
2546
+
2547
+ /*
17062548 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
17072549 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1708
- */
2550
+ */
17092551
17102552 cGridBag editBar = new cGridBag().setVertical(false);
17112553
1712
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2554
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
17132555 createMaterialButton.setToolTipText("Create material");
17142556
17152557 /*
17162558 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
17172559 */
17182560
1719
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2561
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
17202562 clearMaterialButton.setToolTipText("Clear material");
17212563
17222564 if (Globals.ADVANCED)
17232565 {
1724
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2566
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
17252567 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
17262568 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
17272569 }
....@@ -1739,27 +2581,61 @@
17392581 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17402582
17412583 cGridBag colorSection = new cGridBag().setVertical(true);
2584
+
2585
+ cGridBag huepanel = new cGridBag();
2586
+ cGridBag huelabel = new cGridBag();
2587
+ cLabel hue = GetLabel("icons/hue.png", false);
2588
+ hue.fit = true;
2589
+
2590
+ hue.addMouseListener(new MouseAdapter()
2591
+ {
2592
+ public void mousePressed(MouseEvent e)
2593
+ {
2594
+ int x = e.getX();
2595
+
2596
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2597
+ }
2598
+ });
2599
+
2600
+ huelabel.add(hue);
2601
+ huelabel.preferredWidth = 20;
2602
+ huepanel.add(new cGridBag()); // Label
2603
+ huepanel.add(huelabel); // Field/slider
2604
+
2605
+ huepanel.preferredHeight = 7;
2606
+
2607
+ colorSection.add(huepanel);
17422608
17432609 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);
2610
+
2611
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2612
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2613
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2614
+
17472615 //colorField.preferredWidth = 200;
17482616 colorSection.add(color);
17492617
17502618 cGridBag modulation = new cGridBag();
17512619 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
17522620 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1753
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2621
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
17542622 colorSection.add(modulation);
17552623
2624
+ cGridBag opacity = new cGridBag();
2625
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2626
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2627
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2628
+ colorSection.add(opacity);
2629
+
2630
+ colorSection.add(GetSeparator());
2631
+
17562632 cGridBag texture = new cGridBag();
17572633 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
17582634 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17592635 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
17602636 colorSection.add(texture);
17612637
1762
- panel.add(new JSeparator());
2638
+ panel.add(GetSeparator());
17632639
17642640 panel.add(colorSection);
17652641
....@@ -1815,7 +2691,7 @@
18152691 shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
18162692 diffuseSection.add(shadowbias);
18172693
1818
- panel.add(new JSeparator());
2694
+ panel.add(GetSeparator());
18192695
18202696 panel.add(diffuseSection);
18212697
....@@ -1878,7 +2754,7 @@
18782754 specularSection.add(anisoV);
18792755
18802756
1881
- panel.add(new JSeparator());
2757
+ panel.add(GetSeparator());
18822758
18832759 panel.add(specularSection);
18842760
....@@ -1904,12 +2780,12 @@
19042780 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
19052781 colorSection.add(backlit);
19062782
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);
1912
-
2783
+ cGridBag parallax = new cGridBag();
2784
+ parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints);
2785
+ parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2786
+ parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.25, -0.125)); // , aConstraints);
2787
+ colorSection.add(parallax);
2788
+
19132789 //panel.add(new JSeparator());
19142790
19152791 //panel.add(globalSection);
....@@ -1954,7 +2830,7 @@
19542830 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
19552831 textureSection.add(opacityPower);
19562832
1957
- panel.add(new JSeparator());
2833
+ panel.add(GetSeparator());
19582834
19592835 panel.add(textureSection);
19602836
....@@ -2941,7 +3817,7 @@
29413817
29423818 freezematerial = true;
29433819 colorField.setFloat(mat.color);
2944
- modulationField.setFloat(mat.modulation);
3820
+ saturationField.setFloat(mat.modulation);
29453821 metalnessField.setFloat(mat.metalness);
29463822 diffuseField.setFloat(mat.diffuse);
29473823 specularField.setFloat(mat.specular);
....@@ -2961,6 +3837,7 @@
29613837 shadowField.setFloat(mat.shadow);
29623838 textureField.setFloat(mat.texture);
29633839 opacityField.setFloat(mat.opacity);
3840
+ parallaxField.setFloat(mat.parallax + 0.125f);
29643841 fakedepthField.setFloat(mat.fakedepth);
29653842 shadowbiasField.setFloat(mat.shadowbias);
29663843 bumpField.setInteger(1); // dec 2013
....@@ -3003,32 +3880,8 @@
30033880
30043881 if (multiplyToggle != null)
30053882 multiplyToggle.setSelected(mat.multiply);
3006
-
3007
- assert (object.projectedVertices != null);
3008
-
3009
- if (object.projectedVertices.length <= 2)
3010
- {
3011
- // Side effect...
3012
- Object3D.cVector2[] keep = object.projectedVertices;
3013
- object.projectedVertices = new Object3D.cVector2[3];
3014
- for (int i = 0; i < 3; i++)
3015
- {
3016
- if (i < keep.length)
3017
- {
3018
- object.projectedVertices[i] = keep[i];
3019
- } else
3020
- {
3021
- object.projectedVertices[i] = new Object3D.cVector2();
3022
- }
3023
- /*
3024
- if(keep.length == 0)
3025
- object.projectedVertices[0] = new Object3D.cVector2();
3026
- else
3027
- object.projectedVertices[0] = keep[0];
3028
- object.projectedVertices[1] = new Object3D.cVector2();
3029
- */
3030
- }
3031
- }
3883
+
3884
+ AllocProjectedVertices(object);
30323885
30333886 SetMaterial(mat, object.projectedVertices);
30343887 }
....@@ -3148,6 +4001,17 @@
31484001 public void itemStateChanged(ItemEvent event)
31494002 {
31504003 // System.out.println("Propagate = " + propagate);
4004
+ if (event.getSource() == pinButton)
4005
+ {
4006
+ copy.pinned ^= true;
4007
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
4008
+ {
4009
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
4010
+ copy.CloseUI();
4011
+ //copy.editWindow.refreshContents();
4012
+ }
4013
+ }
4014
+ else
31514015 if (event.getSource() == propagateToggle)
31524016 {
31534017 propagate ^= true;
....@@ -3252,6 +4116,7 @@
32524116 } else if (event.getSource() == liveCB)
32534117 {
32544118 copy.live ^= true;
4119
+ objEditor.refreshContents(true); // To show item colors
32554120 return;
32564121 } else if (event.getSource() == selectableCB)
32574122 {
....@@ -3261,16 +4126,31 @@
32614126 {
32624127 copy.hide ^= true;
32634128 copy.Touch(); // display list issue
3264
- objEditor.refreshContents();
4129
+ objEditor.refreshContents(true); // To show item colors
32654130 return;
32664131 } else if (event.getSource() == link2masterCB)
32674132 {
32684133 copy.link2master ^= true;
4134
+ objEditor.refreshContents();
32694135 return;
32704136 }
32714137 if (event.getSource() == randomCB)
32724138 {
32734139 copy.random ^= true;
4140
+ if (this instanceof RandomEditor)
4141
+ {
4142
+ cGridBag itemPanel = ((RandomEditor)this).itemPanel;
4143
+ itemPanel.getComponent(0).setEnabled(!copy.random);
4144
+
4145
+ // Tooltip?
4146
+ if (copy.random)
4147
+ {
4148
+ }
4149
+ else
4150
+ {
4151
+ }
4152
+ }
4153
+
32744154 objEditor.refreshContents();
32754155 return;
32764156 }
....@@ -3326,7 +4206,7 @@
33264206 //System.out.println("ObjEditor " + event);
33274207 applySelf0(true);
33284208 //parent.applySelf();
3329
- objEditor.refreshContents();
4209
+ // conflicts with requestFocus objEditor.refreshContents();
33304210 } else if (source == resetButton)
33314211 {
33324212 CameraPane.fullreset = true;
....@@ -3506,17 +4386,37 @@
35064386
35074387 void New()
35084388 {
3509
- while (copy.Size() > 1)
4389
+ copy.skyboxname = "cubemaps/penguins-skyboxes/yonder";
4390
+ copy.skyboxext = "jpg";
4391
+
4392
+ copy.versionlist = null;
4393
+ copy.versionindex = -1;
4394
+
4395
+ while (copy.Size() > 0)
35104396 {
3511
- copy.remove(1);
4397
+ copy.remove(0);
4398
+ }
4399
+
4400
+ copy.selection.clear();
4401
+
4402
+ if (copy == Grafreed.grafreed.universe)
4403
+ {
4404
+ CreateCameras();
4405
+ cameraView.SetCamera(GetCamera(copy, 0));
4406
+ cameraView.SetLight(GetCamera(copy, 4));
35124407 }
35134408
35144409 ResetModel();
4410
+
4411
+ DuplicateVersion();
4412
+
4413
+ this.SetVersionStates();
35154414 objEditor.refreshContents();
35164415 }
35174416
35184417 static public byte[] Compress(Object3D o)
35194418 {
4419
+ // Slower to actually compress.
35204420 try
35214421 {
35224422 ByteArrayOutputStream baos = new ByteArrayOutputStream();
....@@ -3618,6 +4518,7 @@
36184518 {
36194519 //Save(true);
36204520 Replace();
4521
+ SetVersionStates();
36214522 }
36224523
36234524 private boolean Equal(byte[] compress, byte[] name)
....@@ -3636,31 +4537,56 @@
36364537 return true;
36374538 }
36384539
3639
- java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
4540
+ void DeleteVersion()
4541
+ {
4542
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4543
+ {
4544
+ copy.versionlist[i] = copy.versionlist[i+1];
4545
+ }
4546
+
4547
+ if (copy.versionlist[copy.versionindex] == null)
4548
+ copy.versionindex -= 1;
4549
+
4550
+ if (copy.versionindex != -1)
4551
+ CopyChanged(copy);
4552
+
4553
+ SetVersionStates();
4554
+
4555
+ SetCameras();
4556
+ }
36404557
3641
- public boolean Save(boolean user)
4558
+ public boolean DuplicateVersion() // boolean user)
36424559 {
36434560 System.err.println("Save");
4561
+ //Replace();
36444562
3645
- cRadio tab = GetCurrentTab();
4563
+ if (copy.versionlist == null)
4564
+ {
4565
+ copy.versionlist = new Object3D[100];
4566
+ copy.versionindex = -1;
4567
+ }
36464568
3647
- byte[] compress = CompressCopy();
4569
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
36484570
36494571 boolean thesame = false;
36504572
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
- }
4573
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4574
+// {
4575
+// thesame = true;
4576
+// }
36564577
36574578 //EditorFrame.m_MainFrame.requestFocusInWindow();
36584579 if (!thesame)
36594580 {
4581
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4582
+ {
4583
+ copy.versionlist[i] = copy.versionlist[i-1];
4584
+ }
4585
+
36604586 //tab.user[tab.versionindex] = user;
36614587 //boolean increment = true; // tab.graphs[tab.versionindex] == null;
36624588
3663
- copy.versions[++copy.versionindex] = compress;
4589
+ copy.versionlist[++copy.versionindex] = compress;
36644590
36654591 // if (increment)
36664592 // tab.versionindex++;
....@@ -3670,13 +4596,13 @@
36704596
36714597 //assert(hashtable.isEmpty());
36724598
3673
- for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3674
- {
3675
- //tab.user[i] = false;
3676
- copy.versions[i] = null;
3677
- }
4599
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4600
+// {
4601
+// //tab.user[i] = false;
4602
+// copy.versionlist[i] = null;
4603
+// }
36784604
3679
- SetUndoStates();
4605
+ SetVersionStates();
36804606
36814607 // test save
36824608 if (false)
....@@ -3699,39 +4625,82 @@
36994625
37004626 return !thesame;
37014627 }
3702
-
3703
- void CopyChanged(Object3D obj)
4628
+
4629
+ boolean flashIt = true;
4630
+
4631
+ void RefreshSelection()
37044632 {
3705
- SetUndoStates();
4633
+ Object3D selection = new Object3D();
4634
+
4635
+ if (objEditor.copy.selection == null)
4636
+ {
4637
+ objEditor.copy.selection = new Object3D();
4638
+ }
4639
+
4640
+ for (int i = 0; i < objEditor.copy.selection.size(); i++)
4641
+ {
4642
+ Object3D elem = objEditor.copy.selection.elementAt(i);
4643
+
4644
+ Object3D obj = objEditor.copy.GetObject(elem.GetUUID());
4645
+
4646
+ if (obj == null)
4647
+ {
4648
+ objEditor.copy.selection.remove(i--);
4649
+ }
4650
+ else
4651
+ {
4652
+ selection.add(obj);
4653
+ objEditor.copy.selection.setElementAt(obj, i);
4654
+ }
4655
+ }
4656
+
4657
+ flashIt = false;
4658
+ GetTree().clearSelection();
4659
+ for (int i = 0; i < selection.size(); i++)
4660
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4661
+ flashIt = true;
4662
+
4663
+ //refreshContents(false);
4664
+ }
4665
+
4666
+ void CopyChanged(Object3D changed)
4667
+ {
4668
+ Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]);
4669
+
4670
+ assert(!obj.HasBigData());
37064671
37074672 boolean temp = CameraPane.SWITCH;
37084673 CameraPane.SWITCH = false;
37094674
3710
- copy.ExtractBigData(versiontable);
4675
+ changed.ExtractBigData(Grafreed.grafreed.universe.versiontable);
37114676
3712
- copy.clear();
3713
-
4677
+ changed.clear();
4678
+
4679
+ obj.deepCopyNode(changed);
4680
+
37144681 for (int i=0; i<obj.Size(); i++)
37154682 {
3716
- copy.add(obj.get(i));
4683
+ changed.add(obj.get(i));
37174684 }
37184685
3719
- copy.RestoreBigData(versiontable);
4686
+ changed.RestoreBigData(Grafreed.grafreed.universe.versiontable);
37204687
37214688 CameraPane.SWITCH = temp;
37224689
4690
+ if (objEditor == this)
4691
+ RefreshSelection();
37234692 //assert(hashtable.isEmpty());
37244693
3725
- copy.Touch();
4694
+ objEditor.copy.Touch();
37264695
37274696 ResetModel();
3728
- copy.HardTouch(); // recompile?
4697
+ objEditor.copy.HardTouch(); // recompile?
37294698
37304699 cRadio ab;
3731
- for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4700
+ for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();)
37324701 {
37334702 ab = (cRadio)e.nextElement();
3734
- Object3D test = copy.GetObject(ab.object.GetUUID());
4703
+ Object3D test = objEditor.copy.GetObject(ab.object.GetUUID());
37354704 //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
37364705 if (test != null)
37374706 {
....@@ -3740,53 +4709,72 @@
37404709 }
37414710 }
37424711
3743
- refreshContents();
4712
+ objEditor.refreshContents(true);
37444713 }
37454714
3746
- cButton undoButton;
4715
+ cButton previousVersionButton;
37474716 cButton restoreButton;
37484717 cButton replaceButton;
3749
- cButton redoButton;
4718
+ cButton nextVersionButton;
4719
+ cButton saveVersionButton;
4720
+ cButton deleteVersionButton;
37504721
37514722 boolean muteSlider;
37524723
37534724 int VersionCount()
37544725 {
3755
- int count = 0;
3756
-
3757
- for (int i = copy.versions.length; --i >= 0;)
3758
- {
3759
- if (copy.versions[i] != null)
3760
- count++;
3761
- }
3762
-
3763
- return count;
4726
+ return copy.VersionCount();
37644727 }
37654728
3766
- void SetUndoStates()
4729
+ public cGridBag versionSliderPane;
4730
+
4731
+ void SetVersionStates()
37674732 {
3768
- cRadio tab = GetCurrentTab();
4733
+ //if (true)
4734
+ // return;
4735
+
4736
+ //cRadio tab = GetCurrentTab();
37694737
3770
- restoreButton.setEnabled(copy.versionindex != -1);
3771
- replaceButton.setEnabled(copy.versionindex != -1);
3772
-
3773
- undoButton.setEnabled(copy.versionindex > 0);
3774
- redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3775
-
3776
- muteSlider = true;
3777
- versionSlider.setMaximum(VersionCount() - 1);
3778
- versionSlider.setInteger(copy.versionindex);
3779
- muteSlider = false;
4738
+ if (copy.versionindex == -2)
4739
+ {
4740
+ saveVersionButton.setEnabled(false);
4741
+ restoreButton.setEnabled(false);
4742
+ replaceButton.setEnabled(false);
4743
+ previousVersionButton.setEnabled(false);
4744
+ nextVersionButton.setEnabled(false);
4745
+ deleteVersionButton.setEnabled(false);
4746
+ versionSliderPane.setVisible(false);
4747
+ }
4748
+ else
4749
+ {
4750
+ restoreButton.setEnabled(copy.versionindex != -1);
4751
+ replaceButton.setEnabled(copy.versionindex != -1);
4752
+
4753
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4754
+ nextVersionButton.setEnabled(copy.versionlist != null && copy.versionlist[copy.versionindex + 1] != null);
4755
+
4756
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4757
+ //copy.versionlist[copy.versionindex + 1] != null);
4758
+
4759
+ muteSlider = true;
4760
+ versionSlider.setMinimum(0);
4761
+ versionSlider.setMaximum(VersionCount() - 1);
4762
+ versionSlider.setInteger(copy.versionindex);
4763
+ versionSlider.setEnabled(copy.versionindex != -1);
4764
+ muteSlider = false;
4765
+
4766
+ versionSliderPane.setVisible(true);
4767
+ }
37804768 }
37814769
3782
- public boolean Undo()
4770
+ public boolean PreviousVersion()
37834771 {
37844772 // Option?
37854773 Replace();
37864774
3787
- System.err.println("Undo");
4775
+ //System.err.println("Previous");
37884776
3789
- cRadio tab = GetCurrentTab();
4777
+ //cRadio tab = GetCurrentTab();
37904778
37914779 if (copy.versionindex == 0)
37924780 {
....@@ -3809,7 +4797,11 @@
38094797
38104798 copy.versionindex -= 1;
38114799
3812
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4800
+ CopyChanged(copy);
4801
+
4802
+ SetVersionStates();
4803
+
4804
+ SetCameras();
38134805
38144806 return true;
38154807 }
....@@ -3818,44 +4810,49 @@
38184810 {
38194811 System.err.println("Restore");
38204812
3821
- cRadio tab = GetCurrentTab();
4813
+ //cRadio tab = GetCurrentTab();
38224814
3823
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
4815
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38244816 {
38254817 java.awt.Toolkit.getDefaultToolkit().beep();
38264818 return false;
38274819 }
38284820
3829
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4821
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4822
+ CopyChanged(copy);
4823
+
4824
+ SetVersionStates();
4825
+
4826
+ SetCameras();
38304827
38314828 return true;
38324829 }
38334830
38344831 public boolean Replace()
38354832 {
3836
- System.err.println("Replace");
4833
+ //System.err.println("Replace");
38374834
3838
- cRadio tab = GetCurrentTab();
4835
+ //cRadio tab = GetCurrentTab();
38394836
3840
- if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
4837
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
38414838 {
38424839 // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
38434840 return false;
38444841 }
38454842
3846
- copy.versions[copy.versionindex] = CompressCopy();
4843
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
38474844
38484845 return true;
38494846 }
38504847
3851
- public void Redo()
4848
+ public void NextVersion()
38524849 {
38534850 // Option?
38544851 Replace();
38554852
3856
- cRadio tab = GetCurrentTab();
4853
+ //cRadio tab = GetCurrentTab();
38574854
3858
- if (copy.versions[copy.versionindex + 1] == null)
4855
+ if (copy.versionlist[copy.versionindex + 1] == null)
38594856 {
38604857 java.awt.Toolkit.getDefaultToolkit().beep();
38614858 return;
....@@ -3863,12 +4860,28 @@
38634860
38644861 copy.versionindex += 1;
38654862
3866
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4863
+ CopyChanged(copy);
38674864
38684865 //if (!tab.user[tab.versionindex])
38694866 // tab.graphs[tab.versionindex] = null;
4867
+
4868
+ SetVersionStates();
4869
+
4870
+ SetCameras();
38704871 }
38714872
4873
+ void SetCameras()
4874
+ {
4875
+ if (copy == Grafreed.grafreed.universe)
4876
+ {
4877
+ Camera neweye = (Camera)copy.GetObject(cameraView.cameras[cameraView.cameracount^1].GetUUID());
4878
+ Camera newlight = (Camera)copy.GetObject(cameraView.LightCamera().GetUUID());
4879
+
4880
+ cameraView.SetCamera(neweye);
4881
+ cameraView.SetLight(newlight);
4882
+ }
4883
+ }
4884
+
38724885 void ImportGFD()
38734886 {
38744887 FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
....@@ -4060,6 +5073,12 @@
40605073 // else
40615074 // applySelf(true);
40625075 // }
5076
+
5077
+ boolean Equal(double a, double b)
5078
+ {
5079
+ return Math.abs(a - b) < 0.001;
5080
+ }
5081
+
40635082 void applySelf0(boolean name)
40645083 {
40655084 if (name)
....@@ -4077,7 +5096,7 @@
40775096 //copy.material = new cMaterial(copy.GetMaterial());
40785097
40795098 current.color = (float) colorField.getFloat();
4080
- current.modulation = (float) modulationField.getFloat();
5099
+ current.modulation = (float) saturationField.getFloat();
40815100 current.metalness = (float) metalnessField.getFloat();
40825101 current.diffuse = (float) diffuseField.getFloat();
40835102 current.specular = (float) specularField.getFloat();
....@@ -4097,6 +5116,7 @@
40975116 current.shadow = (float) shadowField.getFloat();
40985117 current.texture = (float) textureField.getFloat();
40995118 current.opacity = (float) opacityField.getFloat();
5119
+ current.parallax = (float) parallaxField.getFloat() - 0.125f;
41005120 current.fakedepth = (float) fakedepthField.getFloat();
41015121 current.shadowbias = (float) shadowbiasField.getFloat();
41025122
....@@ -4109,29 +5129,54 @@
41095129 {
41105130 cMaterial mat = copy.material;
41115131
4112
- colorField.SetToolTipValue((mat.color));
4113
- modulationField.SetToolTipValue((mat.modulation));
4114
- metalnessField.SetToolTipValue((mat.metalness));
4115
- diffuseField.SetToolTipValue((mat.diffuse));
4116
- specularField.SetToolTipValue((mat.specular));
4117
- shininessField.SetToolTipValue((mat.shininess));
4118
- shiftField.SetToolTipValue((mat.shift));
4119
- ambientField.SetToolTipValue((mat.ambient));
4120
- lightareaField.SetToolTipValue((mat.lightarea));
4121
- diffusenessField.SetToolTipValue((mat.factor));
4122
- velvetField.SetToolTipValue((mat.velvet));
4123
- sheenField.SetToolTipValue((mat.sheen));
4124
- subsurfaceField.SetToolTipValue((mat.subsurface));
4125
- backlitField.SetToolTipValue((mat.bump));
4126
- anisoField.SetToolTipValue((mat.aniso));
4127
- anisoVField.SetToolTipValue((mat.anisoV));
4128
- cameraField.SetToolTipValue((mat.cameralight));
4129
- selfshadowField.SetToolTipValue((mat.diffuseness));
4130
- shadowField.SetToolTipValue((mat.shadow));
4131
- textureField.SetToolTipValue((mat.texture));
4132
- opacityField.SetToolTipValue((mat.opacity));
4133
- fakedepthField.SetToolTipValue((mat.fakedepth));
4134
- shadowbiasField.SetToolTipValue((mat.shadowbias));
5132
+ if (!Equal(colorField.getFloat(), mat.color))
5133
+ colorField.SetToolTipValue((mat.color));
5134
+ if (!Equal(saturationField.getFloat(), mat.modulation))
5135
+ saturationField.SetToolTipValue((mat.modulation));
5136
+ if (!Equal(metalnessField.getFloat(), mat.metalness))
5137
+ metalnessField.SetToolTipValue((mat.metalness));
5138
+ if (!Equal(diffuseField.getFloat(), mat.diffuse))
5139
+ diffuseField.SetToolTipValue((mat.diffuse));
5140
+ if (!Equal(specularField.getFloat(), mat.specular))
5141
+ specularField.SetToolTipValue((mat.specular));
5142
+ if (!Equal(shininessField.getFloat(), mat.shininess))
5143
+ shininessField.SetToolTipValue((mat.shininess));
5144
+ if (!Equal(shiftField.getFloat(), mat.shift))
5145
+ shiftField.SetToolTipValue((mat.shift));
5146
+ if (!Equal(ambientField.getFloat(), mat.ambient))
5147
+ ambientField.SetToolTipValue((mat.ambient));
5148
+ if (!Equal(lightareaField.getFloat(), mat.lightarea))
5149
+ lightareaField.SetToolTipValue((mat.lightarea));
5150
+ if (!Equal(diffusenessField.getFloat(), mat.factor))
5151
+ diffusenessField.SetToolTipValue((mat.factor));
5152
+ if (!Equal(velvetField.getFloat(), mat.velvet))
5153
+ velvetField.SetToolTipValue((mat.velvet));
5154
+ if (!Equal(sheenField.getFloat(), mat.sheen))
5155
+ sheenField.SetToolTipValue((mat.sheen));
5156
+ if (!Equal(subsurfaceField.getFloat(), mat.subsurface))
5157
+ subsurfaceField.SetToolTipValue((mat.subsurface));
5158
+ if (!Equal(backlitField.getFloat(), mat.bump))
5159
+ backlitField.SetToolTipValue((mat.bump));
5160
+ if (!Equal(anisoField.getFloat(), mat.aniso))
5161
+ anisoField.SetToolTipValue((mat.aniso));
5162
+ if (!Equal(anisoVField.getFloat(), mat.anisoV))
5163
+ anisoVField.SetToolTipValue((mat.anisoV));
5164
+ if (!Equal(cameraField.getFloat(), mat.cameralight))
5165
+ cameraField.SetToolTipValue((mat.cameralight));
5166
+ if (!Equal(selfshadowField.getFloat(), mat.diffuseness))
5167
+ selfshadowField.SetToolTipValue((mat.diffuseness));
5168
+ if (!Equal(shadowField.getFloat(), mat.shadow))
5169
+ shadowField.SetToolTipValue((mat.shadow));
5170
+ if (!Equal(textureField.getFloat(), mat.texture))
5171
+ textureField.SetToolTipValue((mat.texture));
5172
+ if (!Equal(opacityField.getFloat(), mat.opacity))
5173
+ opacityField.SetToolTipValue((mat.opacity));
5174
+ //if (!Equal(parallaxField.getFloat(), mat.parallax))
5175
+ parallaxField.SetToolTipValue((mat.parallax));
5176
+ if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
5177
+ fakedepthField.SetToolTipValue((mat.fakedepth));
5178
+ if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
5179
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
41355180 }
41365181
41375182 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
....@@ -4163,22 +5208,57 @@
41635208 }
41645209
41655210 cNumberSlider versionSlider;
5211
+ cNumberSlider versionField;
41665212
5213
+ cNumberSlider scaleSlider;
5214
+
5215
+ void ScaleSelection(int scale)
5216
+ {
5217
+ }
5218
+
41675219 public void stateChanged(ChangeEvent e)
41685220 {
4169
- // assert(false);
5221
+ // assert(false);
5222
+ // Main version slider
41705223 if (e.getSource() == versionSlider)
41715224 {
41725225 if (muteSlider)
41735226 return;
41745227
5228
+ Replace();
5229
+
41755230 int version = versionSlider.getInteger();
41765231
4177
- if (copy.versions[version] != null)
5232
+ if (version != -1 && copy.versionlist[version] != null)
41785233 {
4179
- CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
5234
+ copy.versionindex = version;
5235
+ CopyChanged(copy);
5236
+ SetVersionStates();
5237
+ SetCameras();
41805238 }
41815239
5240
+ return;
5241
+ }
5242
+
5243
+ // Version slider of edited object
5244
+ if (e.getSource() == versionField)
5245
+ {
5246
+ int version = versionField.getInteger();
5247
+
5248
+ if (version != -1 && copy.versionindex != version && copy.versionlist[version] != null)
5249
+ {
5250
+ copy.versionindex = version;
5251
+ CopyChanged(copy);
5252
+ }
5253
+
5254
+ return;
5255
+ }
5256
+
5257
+ if (e.getSource() == scaleSlider)
5258
+ {
5259
+ int scale = scaleSlider.getInteger();
5260
+
5261
+ ScaleSelection(scale);
41825262 return;
41835263 }
41845264
....@@ -4216,6 +5296,12 @@
42165296 {
42175297 //System.out.println("stateChanged = " + this);
42185298 materialtouched = true;
5299
+
5300
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
5301
+ {
5302
+ saturationField.setFloat(1);
5303
+ }
5304
+
42195305 applySelf();
42205306 //System.out.println("this = " + this);
42215307 //System.out.println("PARENT = " + parent);
....@@ -4265,7 +5351,7 @@
42655351 }
42665352
42675353 if (normalpushField != null)
4268
- copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
5354
+ copy.NORMALPUSH = (float)normalpushField.getFloat() / 100;
42695355 }
42705356
42715357 void SnapObject()
....@@ -4515,6 +5601,7 @@
45155601 {
45165602 if (GetTree() != null)
45175603 {
5604
+ GetTree().revalidate();
45185605 GetTree().repaint();
45195606 }
45205607
....@@ -4523,6 +5610,11 @@
45235610 ctrlPanel.validate(); // ? new
45245611 ctrlPanel.repaint();
45255612 }
5613
+
5614
+ if (previousVersionButton != null && copy.versionlist != null)
5615
+ SetVersionStates();
5616
+
5617
+ cameraView.requestFocusInWindow();
45265618 }
45275619
45285620 static TweenManager tweenManager = new TweenManager();
....@@ -4554,7 +5646,7 @@
45545646 // group = (Composite) group.get(0);
45555647 // }
45565648
4557
- System.out.println("makeSomething of " + thing);
5649
+ //System.out.println("makeSomething of " + thing);
45585650
45595651 /*
45605652 if (deselect && jList != null)
....@@ -4633,7 +5725,7 @@
46335725 void ResetModel()
46345726 {
46355727 //assert(copy instanceof Composite);
4636
- Object3D /*Composite*/ group = (Object3D /*Composite*/) copy;
5728
+ Object3D /*Composite*/ group = (Object3D /*Composite*/) objEditor.copy;
46375729
46385730 // necessary? group.selection = new Object3D(); // java.util.Vector();
46395731
....@@ -4644,14 +5736,14 @@
46445736 //group.refreshEditWindow();
46455737 //refreshContents();
46465738
4647
- if (copy.selection == null)
5739
+ if (objEditor.copy.selection == null)
46485740 {
4649
- copy.selection = new Object3D();
5741
+ objEditor.copy.selection = new Object3D();
46505742 }
46515743
4652
- for (int j = 0; j < copy.selection.size(); j++)
5744
+ for (int j = 0; j < objEditor.copy.selection.size(); j++)
46535745 {
4654
- Object3D item = copy.selection.get(j);
5746
+ Object3D item = objEditor.copy.selection.get(j);
46555747
46565748 if (item instanceof cGroup && ((cGroup) item).transientlink)
46575749 {
....@@ -4660,15 +5752,15 @@
46605752
46615753 if (item.count <= 1) // ??? == 0)
46625754 {
4663
- copy.selection.remove(item);
5755
+ objEditor.copy.selection.remove(item);
46645756 }
46655757 }
46665758
46675759 boolean first = true;
46685760
4669
- for (int i = copy.selection.size(); --i >= 0;)
5761
+ for (int i = objEditor.copy.selection.size(); --i >= 0;)
46705762 {
4671
- Object3D item = copy.selection.get(i);
5763
+ Object3D item = objEditor.copy.selection.get(i);
46725764
46735765 if (item instanceof cGroup && ((cGroup) item).transientlink)
46745766 {
....@@ -4853,6 +5945,8 @@
48535945 {
48545946 //readobj.deepCopySelf(copy);
48555947 copy.clear(); // june 2014
5948
+ copy.skyboxname = readobj.skyboxname;
5949
+ copy.skyboxext = readobj.skyboxext;
48565950 for (int i = 0; i < readobj.size(); i++)
48575951 {
48585952 Object3D child = readobj.get(i); // reserve(i);
....@@ -4904,16 +5998,22 @@
49045998 c.addChild(csg);
49055999 }
49066000
4907
- copy.versions = readobj.versions;
6001
+ copy.versionlist = readobj.versionlist;
49086002 copy.versionindex = readobj.versionindex;
6003
+ copy.versiontable = readobj.versiontable;
49096004
4910
- if (copy.versions == null)
6005
+ if (copy.versionlist == null)
49116006 {
4912
- copy.versions = new byte[100][];
6007
+ // Backward compatibility
6008
+ copy.versionlist = new Object3D[100];
49136009 copy.versionindex = -1;
6010
+
6011
+ //Save(true);
49146012 }
49156013
49166014 //? SetUndoStates();
6015
+
6016
+ cameraView.RevertCamera();
49176017
49186018 ResetModel();
49196019 copy.HardTouch(); // recompile?
....@@ -4925,7 +6025,7 @@
49256025 {
49266026 if (Grafreed.standAlone)
49276027 {
4928
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
6028
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
49296029 browser.show();
49306030 String filename = browser.getFile();
49316031 if (filename != null && filename.length() > 0)
....@@ -5002,6 +6102,8 @@
50026102
50036103 void save()
50046104 {
6105
+ Replace();
6106
+
50056107 if (lastname == null)
50066108 {
50076109 return;
....@@ -5244,17 +6346,20 @@
52446346 ButtonGroup buttonGroup;
52456347
52466348 cGridBag toolboxPanel;
6349
+ cGridBag skyboxPanel;
52476350 cGridBag materialPanel;
52486351 cGridBag ctrlPanel;
6352
+ cGridBag figurePanel;
52496353
52506354 JScrollPane infoPanel;
52516355
52526356 cGridBag optionsPanel;
52536357
5254
- JTabbedPane objectPanel;
6358
+ JTabbedPane objectTabbedPane;
52556359 boolean materialFlushed;
52566360 Object3D latestObject;
52576361
6362
+ cGridBag transformPanel;
52586363 cGridBag XYZPanel;
52596364
52606365 JSplitPane gridPanel;
....@@ -5317,7 +6422,7 @@
53176422 JLabel colorLabel;
53186423 cNumberSlider colorField;
53196424 JLabel modulationLabel;
5320
- cNumberSlider modulationField;
6425
+ cNumberSlider saturationField;
53216426 JLabel metalnessLabel;
53226427 cNumberSlider metalnessField;
53236428 JLabel diffuseLabel;
....@@ -5348,6 +6453,7 @@
53486453 cNumberSlider anisoField;
53496454 JLabel anisoVLabel;
53506455 cNumberSlider anisoVField;
6456
+
53516457 JLabel cameraLabel;
53526458 cNumberSlider cameraField;
53536459 JLabel selfshadowLabel;
....@@ -5358,10 +6464,13 @@
53586464 cNumberSlider textureField;
53596465 JLabel opacityLabel;
53606466 cNumberSlider opacityField;
6467
+ JLabel parallaxLabel;
6468
+ cNumberSlider parallaxField;
53616469 JLabel fakedepthLabel;
53626470 cNumberSlider fakedepthField;
53636471 JLabel shadowbiasLabel;
53646472 cNumberSlider shadowbiasField;
6473
+
53656474 JLabel bumpLabel;
53666475 cNumberSlider bumpField;
53676476 JLabel noiseLabel;