Normand Briere
2019-09-20 cbe4e90105d07d7d3fecabffaa01342403aa2ae3
GroupEditor.java
....@@ -29,7 +29,7 @@
2929 {
3030 cButton skyboxButton;
3131 final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
- row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF));
3333 //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
3434 skyboxButton.setToolTipText(s.equals("") ? "No background" : s);
3535 skyboxButton.addActionListener(new ActionListener()
....@@ -46,7 +46,7 @@
4646 {
4747 cButton textureButton;
4848 final String path = "textures/" + f + "/" + c + "/"; // + t;
49
- row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF));
5050 textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
....@@ -347,7 +347,7 @@
347347
348348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
349349 {
350
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351351
352352 AddSkyboxTab0(skyboxpane);
353353 AddSkyboxTab1(skyboxpane);
....@@ -366,16 +366,6 @@
366366 }
367367
368368 refreshContents();
369
- }
370
-
371
- public void Show3DView()
372
- {
373
- // bug
374
- //gridPanel.setDividerLocation(1.0);
375
- //bigPanel.setDividerLocation(0.0);
376
- bigThree.ClearUI();
377
- bigThree.add(centralPanel);
378
- bigThree.FlushUI();
379369 }
380370
381371 //ObjEditor objEditor;
....@@ -415,13 +405,15 @@
415405 this.copy = this.group = group;
416406 //selectees = this.group.selectees;
417407
418
- if (copy.versionlist == null)
419
- {
420
- copy.versionlist = new Object3D[100];
421
- copy.versionindex = -1;
422
-
423
- Save(true);
424
- }
408
+ assert(false);
409
+
410
+// if (copy.versionlist == null)
411
+// {
412
+// copy.versionlist = new Object3D[100];
413
+// copy.versionindex = -1;
414
+//
415
+// //Save(true);
416
+// }
425417
426418 if(ui)
427419 SetupUI(objEditor);
....@@ -444,13 +436,13 @@
444436
445437 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
446438
447
- if (copy.versionlist == null)
448
- {
449
- copy.versionlist = new Object3D[100];
450
- copy.versionindex = -1;
451
-
452
- Save(true);
453
- }
439
+// if (copy.versionlist == null)
440
+// {
441
+// copy.versionlist = new Object3D[100];
442
+// copy.versionindex = -1;
443
+//
444
+// //Save(true);
445
+// }
454446 }
455447
456448 void CloneSelection(boolean supports)
....@@ -491,11 +483,16 @@
491483
492484 Object3D parent = obj.parent;
493485 obj.parent = null;
486
+
494487 // Object3D support = obj.support;
495488 // obj.support = null;
496489 if (!supports)
497490 obj.SaveSupports();
491
+
498492 Object3D clone = (Object3D)Grafreed.clone(obj);
493
+
494
+ clone.ResetUUIDs();
495
+
499496 obj.parent = parent;
500497 // obj.support = support;
501498 // clone.support = support; // aout 2013
....@@ -565,13 +562,12 @@
565562 pasteLinkItem.addActionListener(this);
566563 pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone"));
567564 pasteCloneItem.addActionListener(this);
568
-// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
569
-// pasteExpandItem.addActionListener(this);
565
+// CRASH
566
+ pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand"));
567
+//
568
+ pasteExpandItem.addActionListener(this);
570569 //menu.add("-");
571570 oe.jTree.popup.addSeparator();
572
-
573
- deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
574
- deleteItem.addActionListener(this);
575571
576572 if (Globals.ADVANCED)
577573 {
....@@ -706,15 +702,17 @@
706702 setMasterItem.addActionListener(this);
707703 }
708704
709
- oe.menuBar.add(menu = new Menu("Group"));
710
-// grabItem = menu.add(new MenuItem("Grab"));
711
-// grabItem.addActionListener(this);
705
+ oe.menuBar.add(menu = new Menu("Order"));
706
+
712707 backItem = menu.add(new MenuItem("Back"));
713708 backItem.addActionListener(this);
714709 frontItem = menu.add(new MenuItem("Front"));
715710 frontItem.addActionListener(this);
716711 // compositeItem = menu.add(new MenuItem("Composite"));
717712 // compositeItem.addActionListener(this);
713
+
714
+ grabItem = oe.jTree.popup.add(new JMenuItem("Group"));
715
+ grabItem.addActionListener(this);
718716
719717 if (Globals.ADVANCED)
720718 {
....@@ -723,6 +721,11 @@
723721 }
724722 ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup"));
725723 ungroupItem.addActionListener(this);
724
+
725
+ oe.jTree.popup.addSeparator();
726
+
727
+ deleteItem = oe.jTree.popup.add(new JMenuItem("Delete"));
728
+ deleteItem.addActionListener(this);
726729
727730 // menu.add("-");
728731 //
....@@ -759,9 +762,9 @@
759762 shadowYItem.addActionListener(this);
760763 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
761764 shadowZItem.addActionListener(this);
765
+
762766 attributeItem = menu.add(new MenuItem("Attribute"));
763767 attributeItem.addActionListener(this);
764
-
765768 if (Globals.ADVANCED)
766769 {
767770 menu.add("-");
....@@ -773,11 +776,18 @@
773776 pointflowItem.addActionListener(this);
774777 }
775778 menu.add("-");
779
+ textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red"));
780
+ textureRatioRItem.addActionListener(this);
781
+ textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green"));
782
+ textureRatioGItem.addActionListener(this);
783
+ textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue"));
784
+ textureRatioBItem.addActionListener(this);
785
+ menu.add("-");
776786 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
777787 resetTransformItem.addActionListener(this);
778788 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
779789 resetCentroidItem.addActionListener(this);
780
- resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
790
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ"));
781791 resetCentroidXZItem.addActionListener(this);
782792 transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
783793 transformGeometryItem.addActionListener(this);
....@@ -793,7 +803,7 @@
793803 genNormalsCADItem.addActionListener(this);
794804 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
795805 genNormalsMESHItem.addActionListener(this);
796
- if (Globals.ADVANCED)
806
+ //if (Globals.ADVANCED)
797807 {
798808 genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
799809 genNormalsMINEItem.addActionListener(this);
....@@ -829,6 +839,8 @@
829839 }
830840
831841 oe.menuBar.add(menu = new Menu("Attributes"));
842
+ clearVersionsItem = menu.add(new MenuItem("Clear Versions"));
843
+ clearVersionsItem.addActionListener(this);
832844 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
833845 clearMaterialsItem.addActionListener(this);
834846 resetAllItem = menu.add(new MenuItem("Reset All"));
....@@ -851,9 +863,9 @@
851863 hideleavesItem.addActionListener(this);
852864 showleavesItem = menu.add(new MenuItem("Show Leaves"));
853865 showleavesItem.addActionListener(this);
854
- markleavesItem = menu.add(new MenuItem("Mark Leaves"));
866
+ markleavesItem = menu.add(new MenuItem("Anim Leaves"));
855867 markleavesItem.addActionListener(this);
856
- unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
868
+ unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves"));
857869 unmarkleavesItem.addActionListener(this);
858870 rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
859871 rewindleavesItem.addActionListener(this);
....@@ -928,8 +940,10 @@
928940
929941 JTabbedPane resourcecontainer;
930942 cGridBag currenttab;
931
- boolean added; // patch for jar
943
+ //boolean added; // patch for jar
932944
945
+ int totalcount = 0;
946
+
933947 int tabcount = 0;
934948 int colcount = 0;
935949 int rowcount = 0;
....@@ -940,33 +954,40 @@
940954
941955 public void ResourceCallBack(String[] path)
942956 {
943
- for (int i = 0; i < path.length; i++)
944
- System.out.print(path[i] + "/");
945
- System.out.println();
957
+// for (int i = 0; i < path.length; i++)
958
+// System.out.print(path[i] + "/");
959
+// System.out.println();
946960
947961 if (//rowcount == 0 ||
948
- path.length == 1)
962
+ path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store"))
949963 {
950964 currenttab = new cGridBag();
951
- added = false;
952965 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
953966 currenttab.setName(tabname);
967
+ //added = false;
968
+ resourcecontainer.add(currenttab);
969
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname);
954970 rowcount = 1;
955971 colcount = 0;
956972 texturecount = 0;
957973 }
958974
959
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
975
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
960976 {
961
- if (!added)
977
+ //if (!added)
962978 {
963
- added = true;
964
- resourcecontainer.add(currenttab);
979
+ //added = true;
965980 String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
966
- resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
981
+ currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
967982 }
968983
969
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
984
+ columns = 5;
985
+
986
+ if (path[0].contains("D&R") || path[0].contains("Paint"))
987
+ columns = 4;
988
+
989
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
990
+ totalcount++;
970991
971992 if (++colcount >= columns)
972993 {
....@@ -992,6 +1013,8 @@
9921013 container.add(resourcecontainer);
9931014
9941015 Grafreed.ParseResources("textures", this);
1016
+
1017
+ // 935. System.out.println("Total = " + totalcount);
9951018 }
9961019
9971020 void SetupUI2(ObjEditor oe)
....@@ -1031,9 +1054,9 @@
10311054 oe.radioPanel.add(dummyButton);
10321055 oe.buttonGroup.add(dummyButton);
10331056 */
1034
- cGridBag copyOptionsPanel = new cGridBag();
1057
+ cGridBag versionManagerPanel = new cGridBag();
10351058
1036
- copyOptionsPanel.preferredHeight = 2;
1059
+ versionManagerPanel.preferredHeight = 4;
10371060
10381061 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10391062
....@@ -1060,25 +1083,29 @@
10601083 // }
10611084 // });
10621085
1063
- oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1086
+ oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1087
+ fullScreenButton.setToolTipText("Full-screen window");
1088
+ fullScreenButton.addActionListener(this);
1089
+
1090
+ oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10641091 collapseButton.setToolTipText("Collapse toolbar");
10651092 collapseButton.addActionListener(this);
10661093
1067
- oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
- maximize3DButton.setToolTipText("Maximize 3D view");
1069
- maximize3DButton.addActionListener(this);
1094
+// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1095
+// maximize3DButton.setToolTipText("Maximize 3D view");
1096
+// maximize3DButton.addActionListener(this);
10701097
1071
- oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1098
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10721099 twoButton.setToolTipText("Show 3D view only");
10731100 twoButton.addActionListener(this);
10741101 this.fullscreenLayout = twoButton;
10751102
1076
- oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1103
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10771104 threeButton.setToolTipText("Show controls and 3D view");
10781105 threeButton.addActionListener(this);
10791106 if (Globals.ADVANCED)
10801107 {
1081
- oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1108
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10821109 sixButton.setToolTipText("Show 3D view and controls");
10831110 sixButton.addActionListener(this);
10841111 }
....@@ -1087,50 +1114,47 @@
10871114 // sevenButton.addActionListener(this);
10881115 //
10891116
1090
- oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1091
- fullButton.setToolTipText("Full-screen window");
1092
- fullButton.addActionListener(this);
1093
-
1094
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1117
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10951118 screenfitButton.setToolTipText("Screen fit");
10961119 screenfitButton.addActionListener(this);
10971120
1098
- oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
10991122 restoreCameraButton.setToolTipText("Restore viewpoint");
11001123 restoreCameraButton.addActionListener(this);
11011124
1102
- copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11031126 saveVersionButton.setToolTipText("Duplicate current version");
11041127 saveVersionButton.addActionListener(this);
11051128
1106
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11071130 deleteVersionButton.setToolTipText("Delete current version");
11081131 deleteVersionButton.addActionListener(this);
1132
+ deleteVersionButton.setEnabled(false);
11091133
1110
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1134
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11111135 previousVersionButton.setToolTipText("Previous version");
11121136 previousVersionButton.addActionListener(this);
11131137 previousVersionButton.setEnabled(false);
11141138
11151139 cGridBag updown = new cGridBag().setVertical(true);
1116
- updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
+ updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11171141 restoreButton.setToolTipText("Undo (restore current version)");
11181142 restoreButton.addActionListener(this);
1119
- //restoreButton.setEnabled(false);
1143
+ restoreButton.setEnabled(false);
11201144
1121
- updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1145
+ updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11221146 replaceButton.setToolTipText("Save (replace current version)");
11231147 replaceButton.addActionListener(this);
1124
- //replaceButton.setEnabled(false);
1148
+ replaceButton.setEnabled(false);
11251149
1126
- copyOptionsPanel.add(updown);
1150
+ versionManagerPanel.add(updown);
11271151
1128
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1152
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11291153 nextVersionButton.setToolTipText("Next version");
11301154 nextVersionButton.addActionListener(this);
11311155 nextVersionButton.setEnabled(false);
11321156
1133
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1157
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11341158 oneStepButton.setToolTipText("Animate one step forward");
11351159 oneStepButton.addActionListener(this);
11361160
....@@ -1153,11 +1177,11 @@
11531177
11541178 if (Globals.ADVANCED)
11551179 {
1156
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1180
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11571181 snapobjectButton.addActionListener(this);
11581182 snapobjectButton.setToolTipText("Snap Object");
11591183
1160
- oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1184
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11611185 fourButton.addActionListener(this);
11621186 fourButton.setToolTipText("Show control panel only");
11631187 }
....@@ -1165,83 +1189,85 @@
11651189 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
11661190
11671191
1168
- oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1192
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11691193 rootButton.setToolTipText("Open selection in new tab");
11701194 rootButton.addActionListener(this);
11711195
1172
- oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1196
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11731197 closeButton.setToolTipText("Close tab");
11741198 closeButton.addActionListener(this);
11751199 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
11761200 //clearButton.addActionListener(this);
11771201
11781202 cGridBag row1 = new cGridBag();
1203
+ row1.preferredHeight = 8;
11791204
11801205 // INSERT
1181
- row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1206
+ row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11821207 gridButton.setToolTipText("Create ground");
11831208 gridButton.addActionListener(this);
11841209
1185
- row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1210
+ row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
11861211 boxButton.setToolTipText("Create box");
11871212 boxButton.addActionListener(this);
11881213
1189
- row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1190
- sphereButton.setToolTipText("Create sphere");
1191
- sphereButton.addActionListener(this);
1192
-
1193
- row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1194
- coneButton.setToolTipText("Create cone");
1195
- coneButton.addActionListener(this);
1196
-
1197
- row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1198
- torusButton.setToolTipText("Create torus");
1199
- torusButton.addActionListener(this);
1200
-
1201
- row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1214
+ row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12021215 superButton.setToolTipText("Create superellipsoid");
12031216 superButton.addActionListener(this);
12041217
1205
- if (Globals.ADVANCED)
1218
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1219
+ sphereButton.setToolTipText("Create sphere");
1220
+ sphereButton.addActionListener(this);
1221
+
1222
+ row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1223
+ coneButton.setToolTipText("Create cone");
1224
+ coneButton.addActionListener(this);
1225
+
1226
+ row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
1227
+ torusButton.setToolTipText("Create torus");
1228
+ torusButton.addActionListener(this);
1229
+
1230
+ if (false) //Globals.ADVANCED)
12061231 {
1207
- oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1232
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12081233 kleinButton.setToolTipText("Create Klein bottle");
12091234 kleinButton.addActionListener(this);
12101235 }
12111236
1212
- row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1237
+ row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12131238 particlesButton.setToolTipText("Create particle system");
12141239 particlesButton.addActionListener(this);
12151240
12161241 oe.toolboxPanel.add(row1);
12171242
12181243 cGridBag row2 = new cGridBag();
1244
+ row2.preferredHeight = 8;
12191245
1220
- row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1246
+ row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12211247 groupButton.setToolTipText("Create group");
12221248 groupButton.addActionListener(this);
12231249
1224
- row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1250
+ row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12251251 compositeButton.setToolTipText("Create composite");
12261252 compositeButton.addActionListener(this);
12271253
1228
- row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1254
+ row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12291255 switchButton.setToolTipText("Create item switcher");
12301256 switchButton.addActionListener(this);
12311257
1232
- row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1258
+ row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12331259 loopButton.setToolTipText("Create loop");
12341260 loopButton.addActionListener(this);
12351261
1236
- row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1262
+ row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12371263 textureButton.setToolTipText("Create texture");
12381264 textureButton.addActionListener(this);
12391265
1240
- row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1266
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12411267 overlayButton.setToolTipText("Create overlay");
12421268 overlayButton.addActionListener(this);
12431269
1244
- row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1270
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12451271 lightButton.setToolTipText("Create light");
12461272 lightButton.addActionListener(this);
12471273
....@@ -1251,6 +1277,11 @@
12511277
12521278 CreateTexturePanel(textures);
12531279
1280
+ int tabCount = resourcecontainer.getTabCount();
1281
+
1282
+ if (tabCount > 0)
1283
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
1284
+
12541285 oe.toolboxPanel.add(textures);
12551286
12561287 textures.preferredHeight = 100;
....@@ -1258,11 +1289,11 @@
12581289 CreateSkyboxPanel(oe.skyboxPanel);
12591290
12601291 // EDIT panel
1261
- editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1292
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12621293 editButton.setToolTipText("Pin selection controls");
12631294 editButton.addActionListener(this);
12641295
1265
- editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1296
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12661297 uneditButton.setToolTipText("Unpin and remove selection controls");
12671298 uneditButton.addActionListener(this);
12681299
....@@ -1270,7 +1301,7 @@
12701301 allParamsButton.setToolTipText("Show all controls");
12711302 allParamsButton.addActionListener(this);
12721303
1273
- editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1304
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12741305 clearPanelButton.setToolTipText("Clear all controls");
12751306 clearPanelButton.addActionListener(this);
12761307
....@@ -1278,7 +1309,7 @@
12781309 //unselectButton.setToolTipText("Unselect");
12791310 //unselectButton.addActionListener(this);
12801311
1281
- editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1312
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);
12821313 flashSelectionButton.setToolTipText("Highlight selection");
12831314 flashSelectionButton.addActionListener(this);
12841315
....@@ -1301,6 +1332,8 @@
13011332
13021333 cGridBag jSPPanel = new cGridBag();
13031334
1335
+ jSPPanel.preferredHeight = 20;
1336
+
13041337 JScrollPane jSP;
13051338 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13061339 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1309,11 +1342,12 @@
13091342 oe.treePanel.add(jSPPanel);
13101343 oe.treePanel.Return();
13111344
1312
- oe.treePanel.add(copyOptionsPanel);
1345
+ oe.treePanel.add(versionManagerPanel);
13131346 oe.treePanel.Return();
1314
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1315
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1316
- sliderPane.preferredHeight = 1;
1347
+
1348
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1349
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1350
+ versionSliderPane.preferredHeight = 3;
13171351
13181352 // mainPanel.setDividerLocation(0.1); //1.0);
13191353 mainPanel.setResizeWeight(0.4);
....@@ -1370,7 +1404,7 @@
13701404 // supportCB.setToolTipText("Enable rigging");
13711405 // supportCB.addItemListener(this);
13721406
1373
- panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1407
+ panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints);
13741408 freezeCB.setToolTipText("Fast moving camera");
13751409 freezeCB.addItemListener(this);
13761410
....@@ -1379,9 +1413,12 @@
13791413
13801414 panel.Return();
13811415
1416
+ if (Globals.ADVANCED)
1417
+ {
13821418 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
13831419 crowdCB.setToolTipText("Used for crowds");
13841420 crowdCB.addItemListener(this);
1421
+ }
13851422
13861423 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
13871424 smoothCB.setToolTipText("Snapping delay");
....@@ -1394,30 +1431,26 @@
13941431 minshaderCB.setToolTipText("Minimal fast shader");
13951432 minshaderCB.addItemListener(this);
13961433
1397
-// constraints.gridy += 1;
13981434 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
13991435 // speakerMocapCB.addItemListener(this);
14001436
1401
- panel.Return();
1402
-
14031437 if (false)
14041438 {
14051439 // handled in scripts
1406
- //constraints.gridy += 1;
14071440 panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
14081441 speakerCameraCB.addItemListener(this);
14091442
1410
- //constraints.gridy += 1;
14111443 panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
14121444 speakerFocusCB.addItemListener(this);
14131445
1414
- //constraints.gridy += 1;
1415
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1416
- smoothfocusCB.addItemListener(this);
14171446 panel.Return();
14181447 }
14191448
1420
-//constraints.gridx += 1;
1449
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1450
+ smoothfocusCB.addItemListener(this);
1451
+
1452
+ panel.Return();
1453
+
14211454 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
14221455 // debugCB.addItemListener(this);
14231456
....@@ -1471,7 +1504,7 @@
14711504
14721505 void EditObject(Object3D obj)
14731506 {
1474
- assert(obj instanceof Composite);
1507
+ //assert(obj instanceof Composite);
14751508
14761509 // if (obj.versionlist == null)
14771510 // {
....@@ -1503,6 +1536,7 @@
15031536
15041537 oe.SetupViews();
15051538
1539
+ if (Globals.DEBUG)
15061540 System.out.println("SetupViews");
15071541 DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
15081542 oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ??
....@@ -2055,7 +2089,7 @@
20552089 Object3D obj = (Object3D)group.selection.elementAt(0);
20562090 objEditor.ScreenFit(obj, false);
20572091
2058
- cameraView.pingthread.StepToTarget(true);
2092
+ cameraView.pingthread.StepToTarget(); //true);
20592093 refreshContents();
20602094 }
20612095
....@@ -2092,7 +2126,7 @@
20922126 obj.parent.TransformToWorld(maxima); //, maxima);
20932127 }
20942128
2095
- Object3D shadow = new Object3D("Shadow " + obj.name);
2129
+ Object3D shadow = new Object3D("Shadow" + obj.name);
20962130
20972131 shadow.toParent = LA.newMatrix();
20982132 shadow.fromParent = LA.newMatrix();
....@@ -2106,24 +2140,24 @@
21062140 switch(axis)
21072141 {
21082142 case 0 :
2109
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2110
- vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z;
2111
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2112
- vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z;
2143
+ vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z;
2144
+ vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z;
2145
+ vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z;
2146
+ vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z;
21132147 norm = cVector.X;
21142148 break;
21152149 case 1 :
2116
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2117
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2118
- vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z;
2119
- vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z;
2150
+ vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z;
2151
+ vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z;
2152
+ vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z;
2153
+ vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z;
21202154 norm = cVector.Y;
21212155 break;
21222156 case 2 :
2123
- vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z;
2124
- vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z;
2125
- vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z;
2126
- vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z;
2157
+ vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f;
2158
+ vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f;
2159
+ vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f;
2160
+ vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f;
21272161 norm = cVector.Z;
21282162 break;
21292163 }
....@@ -2164,7 +2198,11 @@
21642198 shadow.material = new cMaterial(obj.material);
21652199 shadow.material.diffuse = 0.0001f;
21662200 shadow.material.specular = 0.0001f;
2167
- //shadow.projectedVertices[1].x = 300;
2201
+ shadow.material.opacity = 0.75f;
2202
+
2203
+ AllocProjectedVertices(shadow);
2204
+
2205
+ shadow.projectedVertices[1].x = 300;
21682206
21692207 makeSomething(shadow);
21702208 }
....@@ -2688,11 +2726,11 @@
26882726 if (!group.selection.isEmpty())
26892727 {
26902728 Composite csg = new GroupLeaf();
2729
+ group(csg);
26912730 csg.count = 5;
26922731 Composite child = new cGroup("Branch");
26932732 csg.addChild(child);
26942733 child.addChild(csg);
2695
- group(csg);
26962734 }
26972735 } else
26982736 if (source == doubleItem)
....@@ -2700,6 +2738,7 @@
27002738 if (!group.selection.isEmpty())
27012739 {
27022740 Composite csg = new GroupLeaf("Fork");
2741
+ group(csg);
27032742 csg.count = 5;
27042743 Composite child = new cGroup("Branch A");
27052744 csg.addChild(child);
....@@ -2707,7 +2746,6 @@
27072746 child = new cGroup("Branch B");
27082747 csg.addChild(child);
27092748 child.addChild(csg);
2710
- group(csg);
27112749 }
27122750 } else
27132751 if (source == tripleItem)
....@@ -2773,7 +2811,7 @@
27732811 {
27742812 Maximize();
27752813 } else
2776
- if (source == fullButton)
2814
+ if (source == fullScreenButton)
27772815 {
27782816 ToggleFullScreen();
27792817 } else
....@@ -2782,13 +2820,13 @@
27822820 this.expandedLayout = radio.layout;
27832821 CollapseToolbar();
27842822 } else
2785
- if (source == maximize3DButton)
2786
- {
2787
- this.expandedLayout = radio.layout;
2788
- radio.layout = twoButton;
2789
- Show3DView();
2790
- CollapseToolbar();
2791
- } else
2823
+// if (source == maximize3DButton)
2824
+// {
2825
+// this.expandedLayout = radio.layout;
2826
+// radio.layout = twoButton;
2827
+// CollapseToolbar();
2828
+// Show3DView();
2829
+// } else
27922830 if (source == previousVersionButton)
27932831 {
27942832 // Go to previous version
....@@ -2816,7 +2854,7 @@
28162854 if (source == saveVersionButton)
28172855 {
28182856 // Save a new version
2819
- if (!Save(true))
2857
+ if (!DuplicateVersion()) //true))
28202858 java.awt.Toolkit.getDefaultToolkit().beep();
28212859 } else
28222860 if (source == deleteVersionButton)
....@@ -3441,6 +3479,10 @@
34413479 {
34423480 ClearMaterials();
34433481 } else
3482
+ if (source == clearVersionsItem)
3483
+ {
3484
+ ClearVersions();
3485
+ } else
34443486 if (source == liveleavesItem)
34453487 {
34463488 LiveLeaves(true);
....@@ -3580,6 +3622,18 @@
35803622 if (source == transformChildrenItem)
35813623 {
35823624 TransformChildren();
3625
+ } else
3626
+ if (source == textureRatioRItem)
3627
+ {
3628
+ TextureRatio(0);
3629
+ } else
3630
+ if (source == textureRatioGItem)
3631
+ {
3632
+ TextureRatio(1);
3633
+ } else
3634
+ if (source == textureRatioBItem)
3635
+ {
3636
+ TextureRatio(2);
35833637 } else
35843638 if (source == resetTransformItem)
35853639 {
....@@ -3953,6 +4007,9 @@
39534007 if (source == closeButton)
39544008 {
39554009 //System.out.println("CLOSE: " + buttonGroup.getSelection());
4010
+ if (copy.versionlist != null)
4011
+ Replace();
4012
+
39564013 cRadio ab;
39574014 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39584015 {
....@@ -4051,6 +4108,9 @@
40514108 } else
40524109 if(source instanceof cRadio)
40534110 {
4111
+ if (copy.versionlist != null)
4112
+ Replace();
4113
+
40544114 group.parent = keepparent;
40554115 group.attributes = 0;
40564116 //group.editWindow = null;
....@@ -4102,14 +4162,28 @@
41024162 */
41034163 radio.layout.doClick();
41044164
4105
- assert(copy instanceof Composite);
4165
+ //assert(copy instanceof Composite);
41064166
41074167 if (copy.versionlist == null)
41084168 {
4109
- copy.versionlist = new Object3D[100];
41104169 copy.versionindex = -1;
41114170
4112
- Save(true);
4171
+ // Cannot work with loops
4172
+ // To fix this issue, we first mark all nodes above the root,
4173
+ // and check if any of these nodes are reachable below the root.
4174
+ Grafreed.grafreed.universe.TagObjects(copy, true);
4175
+
4176
+ if (copy instanceof Composite && !copy.HasTags())
4177
+ {
4178
+ if (copy.versionlist == null)
4179
+ copy.versionlist = new Object3D[100];
4180
+
4181
+ //Save(true);
4182
+ }
4183
+ else
4184
+ copy.versionindex = -2;
4185
+
4186
+ Grafreed.grafreed.universe.TagObjects(copy, false);
41134187 }
41144188
41154189 SetVersionStates();
....@@ -4227,9 +4301,46 @@
42274301 refreshContents();
42284302 }
42294303
4304
+ void TextureRatio(int axis)
4305
+ {
4306
+ Object3D obj;
4307
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4308
+ {
4309
+ obj = (Object3D)e.nextElement();
4310
+ obj.TextureRatio(axis);
4311
+ }
4312
+
4313
+ refreshContents();
4314
+ }
4315
+
42304316 void ResetTransform()
42314317 {
42324318 ResetTransform(-1);
4319
+ }
4320
+
4321
+ void ScaleSelection(int scale)
4322
+ {
4323
+ Object3D obj;
4324
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4325
+ {
4326
+ obj = (Object3D)e.nextElement();
4327
+
4328
+ if (obj.toParent == null)
4329
+ continue;
4330
+
4331
+ obj.Scale(scale);
4332
+
4333
+ if (obj.parent == null)
4334
+ {
4335
+ System.out.println("NULL PARENT!");
4336
+ // new Exception().printStackTrace();
4337
+ }
4338
+ else
4339
+ TouchTransform(obj);
4340
+ //obj.parent.Touch();
4341
+ }
4342
+
4343
+ refreshContents();
42334344 }
42344345
42354346 void ResetTransform(int mask)
....@@ -4242,42 +4353,8 @@
42424353 if (obj.toParent == null)
42434354 continue;
42444355
4245
- if (mask == -1)
4246
- {
4247
- if (obj instanceof Camera) // jan 2014
4248
- {
4249
- LA.matIdentity(obj.toParent);
4250
- LA.matIdentity(obj.fromParent);
4251
- }
4252
- else
4253
- {
4254
- obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent);
4255
- obj.fromParent = null; // LA.matIdentity(obj.fromParent);
4256
- }
4257
- TouchTransform(obj);
4258
- continue;
4259
- }
4260
- if ((mask&2) != 0) // Scale
4261
- {
4262
- obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
4263
- obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
4264
- obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0;
4265
- obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
4266
- obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
4267
- obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4268
- }
4269
- if ((mask&4) != 0) // Rotation
4270
- {
4271
- // ?
4272
- }
4273
- if ((mask&1) != 0) // Translation
4274
- {
4275
- if (obj.toParent != null)
4276
- {
4277
- obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0;
4278
- obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0;
4279
- }
4280
- }
4356
+ obj.ResetTransform(mask);
4357
+
42814358 if (obj.parent == null)
42824359 {
42834360 System.out.println("NULL PARENT!");
....@@ -4786,10 +4863,17 @@
47864863 {
47874864 Object3D obj = group.selection.get(i);
47884865
4866
+ if (obj.toParent == null)
4867
+ {
4868
+ obj.toParent = LA.newMatrix();
4869
+ obj.fromParent = LA.newMatrix();
4870
+ }
4871
+
47894872 LA.matTranslate(obj.toParent, i * scale, 0, 0);
47904873 LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
47914874 }
47924875
4876
+ Globals.lighttouched = true;
47934877 refreshContents();
47944878 }
47954879
....@@ -5077,6 +5161,12 @@
50775161 refreshContents();
50785162 }
50795163
5164
+ void ClearVersions()
5165
+ {
5166
+ group.selection.ClearVersions();
5167
+ refreshContents();
5168
+ }
5169
+
50805170 void FlipV(boolean flip)
50815171 {
50825172 group.selection.FlipV(flip);
....@@ -5315,10 +5405,10 @@
53155405 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
53165406 // a camera
53175407 {
5318
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5408
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace
53195409 {
53205410 CameraPane.camerachangeframe = 0; // don't refuse it
5321
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5411
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true);
53225412 }
53235413 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
53245414 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
....@@ -5354,18 +5444,20 @@
53545444 if (group.selection != null)
53555445 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
53565446 {
5357
- if (!(e.nextElement() instanceof Composite))
5447
+ Object next = e.nextElement();
5448
+ if (!(next instanceof Composite)) // || (next instanceof GroupLeaf))
53585449 {
53595450 allComposites = false;
53605451 break;
53615452 }
53625453 }
53635454
5364
- rootButton.setEnabled(allComposites);
5455
+ rootButton.setEnabled(true); // allComposites);
53655456 }
53665457
53675458 void refreshContents(boolean cp)
53685459 {
5460
+ if (Globals.SHOWINFO)
53695461 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53705462 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53715463 {
....@@ -6316,6 +6408,7 @@
63166408 private MenuItem clipMeshItem;
63176409 private MenuItem smoothMeshItem;
63186410 private MenuItem clearMaterialsItem;
6411
+ private MenuItem clearVersionsItem;
63196412
63206413 private MenuItem liveleavesItem;
63216414 private MenuItem unliveleavesItem;
....@@ -6339,13 +6432,16 @@
63396432 private MenuItem maxTexturesItem;
63406433 private MenuItem panoTexturesItem;
63416434
6435
+ private MenuItem textureRatioRItem;
6436
+ private MenuItem textureRatioGItem;
6437
+ private MenuItem textureRatioBItem;
63426438 private MenuItem resetCentroidItem;
63436439 private MenuItem resetCentroidXZItem;
63446440 private MenuItem resetTransformItem;
63456441 private MenuItem transformGeometryItem;
63466442 private MenuItem transformChildrenItem;
63476443 private MenuItem hideItem;
6348
- private MenuItem grabItem;
6444
+ private JMenuItem grabItem;
63496445 private MenuItem backItem;
63506446 private MenuItem frontItem;
63516447 private MenuItem cameraItem;