.. | .. |
---|
29 | 29 | { |
---|
30 | 30 | cButton skyboxButton; |
---|
31 | 31 | 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)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | 34 | skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
46 | 46 | { |
---|
47 | 47 | cButton textureButton; |
---|
48 | 48 | 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)); |
---|
50 | 50 | textureButton.setToolTipText(c + count); |
---|
51 | 51 | textureButton.addActionListener(new ActionListener() |
---|
52 | 52 | { |
---|
.. | .. |
---|
347 | 347 | |
---|
348 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
349 | 349 | { |
---|
350 | | - JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
351 | 351 | |
---|
352 | 352 | AddSkyboxTab0(skyboxpane); |
---|
353 | 353 | AddSkyboxTab1(skyboxpane); |
---|
.. | .. |
---|
366 | 366 | } |
---|
367 | 367 | |
---|
368 | 368 | 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(); |
---|
379 | 369 | } |
---|
380 | 370 | |
---|
381 | 371 | //ObjEditor objEditor; |
---|
.. | .. |
---|
417 | 407 | |
---|
418 | 408 | assert(false); |
---|
419 | 409 | |
---|
420 | | - if (copy.versionlist == null) |
---|
421 | | - { |
---|
422 | | - copy.versionlist = new Object3D[100]; |
---|
423 | | - copy.versionindex = -1; |
---|
424 | | - |
---|
425 | | - //Save(true); |
---|
426 | | - } |
---|
| 410 | +// if (copy.versionlist == null) |
---|
| 411 | +// { |
---|
| 412 | +// copy.versionlist = new Object3D[100]; |
---|
| 413 | +// copy.versionindex = -1; |
---|
| 414 | +// |
---|
| 415 | +// //Save(true); |
---|
| 416 | +// } |
---|
427 | 417 | |
---|
428 | 418 | if(ui) |
---|
429 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
446 | 436 | |
---|
447 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
448 | 438 | |
---|
449 | | - if (copy.versionlist == null) |
---|
450 | | - { |
---|
451 | | - copy.versionlist = new Object3D[100]; |
---|
452 | | - copy.versionindex = -1; |
---|
453 | | - |
---|
454 | | - //Save(true); |
---|
455 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
456 | 446 | } |
---|
457 | 447 | |
---|
458 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
765 | 755 | shadowYItem.addActionListener(this); |
---|
766 | 756 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
767 | 757 | shadowZItem.addActionListener(this); |
---|
| 758 | + |
---|
768 | 759 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
769 | 760 | attributeItem.addActionListener(this); |
---|
770 | | - |
---|
771 | 761 | if (Globals.ADVANCED) |
---|
772 | 762 | { |
---|
773 | 763 | menu.add("-"); |
---|
.. | .. |
---|
779 | 769 | pointflowItem.addActionListener(this); |
---|
780 | 770 | } |
---|
781 | 771 | menu.add("-"); |
---|
| 772 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 773 | + textureRatioRItem.addActionListener(this); |
---|
| 774 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 775 | + textureRatioGItem.addActionListener(this); |
---|
| 776 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 777 | + textureRatioBItem.addActionListener(this); |
---|
| 778 | + menu.add("-"); |
---|
782 | 779 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
783 | 780 | resetTransformItem.addActionListener(this); |
---|
784 | 781 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
785 | 782 | resetCentroidItem.addActionListener(this); |
---|
786 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 783 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
787 | 784 | resetCentroidXZItem.addActionListener(this); |
---|
788 | 785 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
789 | 786 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
835 | 832 | } |
---|
836 | 833 | |
---|
837 | 834 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 835 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 836 | + clearVersionsItem.addActionListener(this); |
---|
838 | 837 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
839 | 838 | clearMaterialsItem.addActionListener(this); |
---|
840 | 839 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
857 | 856 | hideleavesItem.addActionListener(this); |
---|
858 | 857 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
859 | 858 | showleavesItem.addActionListener(this); |
---|
860 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 859 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
861 | 860 | markleavesItem.addActionListener(this); |
---|
862 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 861 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
863 | 862 | unmarkleavesItem.addActionListener(this); |
---|
864 | 863 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
865 | 864 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
936 | 935 | cGridBag currenttab; |
---|
937 | 936 | //boolean added; // patch for jar |
---|
938 | 937 | |
---|
| 938 | + int totalcount = 0; |
---|
| 939 | + |
---|
939 | 940 | int tabcount = 0; |
---|
940 | 941 | int colcount = 0; |
---|
941 | 942 | int rowcount = 0; |
---|
.. | .. |
---|
964 | 965 | texturecount = 0; |
---|
965 | 966 | } |
---|
966 | 967 | |
---|
967 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 968 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
968 | 969 | { |
---|
969 | 970 | //if (!added) |
---|
970 | 971 | { |
---|
.. | .. |
---|
973 | 974 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
974 | 975 | } |
---|
975 | 976 | |
---|
976 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 977 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 978 | + totalcount++; |
---|
977 | 979 | |
---|
978 | 980 | if (++colcount >= columns) |
---|
979 | 981 | { |
---|
.. | .. |
---|
999 | 1001 | container.add(resourcecontainer); |
---|
1000 | 1002 | |
---|
1001 | 1003 | Grafreed.ParseResources("textures", this); |
---|
| 1004 | + |
---|
| 1005 | + // 935. System.out.println("Total = " + totalcount); |
---|
1002 | 1006 | } |
---|
1003 | 1007 | |
---|
1004 | 1008 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1038 | 1042 | oe.radioPanel.add(dummyButton); |
---|
1039 | 1043 | oe.buttonGroup.add(dummyButton); |
---|
1040 | 1044 | */ |
---|
1041 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1045 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1042 | 1046 | |
---|
1043 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1047 | + versionManagerPanel.preferredHeight = 4; |
---|
1044 | 1048 | |
---|
1045 | 1049 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1046 | 1050 | |
---|
.. | .. |
---|
1067 | 1071 | // } |
---|
1068 | 1072 | // }); |
---|
1069 | 1073 | |
---|
1070 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1074 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1076 | + fullScreenButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1071 | 1079 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1072 | 1080 | collapseButton.addActionListener(this); |
---|
1073 | 1081 | |
---|
1074 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1075 | | - maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1076 | | - maximize3DButton.addActionListener(this); |
---|
| 1082 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1084 | +// maximize3DButton.addActionListener(this); |
---|
1077 | 1085 | |
---|
1078 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1086 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1079 | 1087 | twoButton.setToolTipText("Show 3D view only"); |
---|
1080 | 1088 | twoButton.addActionListener(this); |
---|
1081 | 1089 | this.fullscreenLayout = twoButton; |
---|
1082 | 1090 | |
---|
1083 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1091 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1084 | 1092 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1085 | 1093 | threeButton.addActionListener(this); |
---|
1086 | 1094 | if (Globals.ADVANCED) |
---|
1087 | 1095 | { |
---|
1088 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1096 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1097 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1090 | 1098 | sixButton.addActionListener(this); |
---|
1091 | 1099 | } |
---|
.. | .. |
---|
1094 | 1102 | // sevenButton.addActionListener(this); |
---|
1095 | 1103 | // |
---|
1096 | 1104 | |
---|
1097 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1098 | | - fullButton.setToolTipText("Full-screen window"); |
---|
1099 | | - fullButton.addActionListener(this); |
---|
1100 | | - |
---|
1101 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1105 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1102 | 1106 | screenfitButton.setToolTipText("Screen fit"); |
---|
1103 | 1107 | screenfitButton.addActionListener(this); |
---|
1104 | 1108 | |
---|
1105 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1106 | 1110 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1107 | 1111 | restoreCameraButton.addActionListener(this); |
---|
1108 | 1112 | |
---|
1109 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1110 | 1114 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1111 | 1115 | saveVersionButton.addActionListener(this); |
---|
1112 | 1116 | |
---|
1113 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1114 | 1118 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1115 | 1119 | deleteVersionButton.addActionListener(this); |
---|
1116 | 1120 | deleteVersionButton.setEnabled(false); |
---|
1117 | 1121 | |
---|
1118 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1122 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1119 | 1123 | previousVersionButton.setToolTipText("Previous version"); |
---|
1120 | 1124 | previousVersionButton.addActionListener(this); |
---|
1121 | 1125 | previousVersionButton.setEnabled(false); |
---|
1122 | 1126 | |
---|
1123 | 1127 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1124 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | 1129 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1126 | 1130 | restoreButton.addActionListener(this); |
---|
1127 | 1131 | restoreButton.setEnabled(false); |
---|
1128 | 1132 | |
---|
1129 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1133 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1134 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1131 | 1135 | replaceButton.addActionListener(this); |
---|
1132 | 1136 | replaceButton.setEnabled(false); |
---|
1133 | 1137 | |
---|
1134 | | - copyOptionsPanel.add(updown); |
---|
| 1138 | + versionManagerPanel.add(updown); |
---|
1135 | 1139 | |
---|
1136 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1137 | 1141 | nextVersionButton.setToolTipText("Next version"); |
---|
1138 | 1142 | nextVersionButton.addActionListener(this); |
---|
1139 | 1143 | nextVersionButton.setEnabled(false); |
---|
1140 | 1144 | |
---|
1141 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1145 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1142 | 1146 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1143 | 1147 | oneStepButton.addActionListener(this); |
---|
1144 | 1148 | |
---|
.. | .. |
---|
1161 | 1165 | |
---|
1162 | 1166 | if (Globals.ADVANCED) |
---|
1163 | 1167 | { |
---|
1164 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1165 | 1169 | snapobjectButton.addActionListener(this); |
---|
1166 | 1170 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1167 | 1171 | |
---|
1168 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1172 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1169 | 1173 | fourButton.addActionListener(this); |
---|
1170 | 1174 | fourButton.setToolTipText("Show control panel only"); |
---|
1171 | 1175 | } |
---|
.. | .. |
---|
1173 | 1177 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1174 | 1178 | |
---|
1175 | 1179 | |
---|
1176 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1177 | 1181 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1178 | 1182 | rootButton.addActionListener(this); |
---|
1179 | 1183 | |
---|
1180 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1181 | 1185 | closeButton.setToolTipText("Close tab"); |
---|
1182 | 1186 | closeButton.addActionListener(this); |
---|
1183 | 1187 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1186 | 1190 | cGridBag row1 = new cGridBag(); |
---|
1187 | 1191 | |
---|
1188 | 1192 | // INSERT |
---|
1189 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1193 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1190 | 1194 | gridButton.setToolTipText("Create ground"); |
---|
1191 | 1195 | gridButton.addActionListener(this); |
---|
1192 | 1196 | |
---|
1193 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1197 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1194 | 1198 | boxButton.setToolTipText("Create box"); |
---|
1195 | 1199 | boxButton.addActionListener(this); |
---|
1196 | 1200 | |
---|
1197 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1201 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1198 | 1202 | superButton.setToolTipText("Create superellipsoid"); |
---|
1199 | 1203 | superButton.addActionListener(this); |
---|
1200 | 1204 | |
---|
1201 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1205 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1202 | 1206 | sphereButton.setToolTipText("Create sphere"); |
---|
1203 | 1207 | sphereButton.addActionListener(this); |
---|
1204 | 1208 | |
---|
1205 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1209 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1206 | 1210 | coneButton.setToolTipText("Create cone"); |
---|
1207 | 1211 | coneButton.addActionListener(this); |
---|
1208 | 1212 | |
---|
1209 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1213 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1210 | 1214 | torusButton.setToolTipText("Create torus"); |
---|
1211 | 1215 | torusButton.addActionListener(this); |
---|
1212 | 1216 | |
---|
1213 | | - if (Globals.ADVANCED) |
---|
| 1217 | + if (false) //Globals.ADVANCED) |
---|
1214 | 1218 | { |
---|
1215 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1216 | 1220 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1217 | 1221 | kleinButton.addActionListener(this); |
---|
1218 | 1222 | } |
---|
1219 | 1223 | |
---|
1220 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1221 | 1225 | particlesButton.setToolTipText("Create particle system"); |
---|
1222 | 1226 | particlesButton.addActionListener(this); |
---|
1223 | 1227 | |
---|
.. | .. |
---|
1225 | 1229 | |
---|
1226 | 1230 | cGridBag row2 = new cGridBag(); |
---|
1227 | 1231 | |
---|
1228 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1229 | 1233 | groupButton.setToolTipText("Create group"); |
---|
1230 | 1234 | groupButton.addActionListener(this); |
---|
1231 | 1235 | |
---|
1232 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1233 | 1237 | compositeButton.setToolTipText("Create composite"); |
---|
1234 | 1238 | compositeButton.addActionListener(this); |
---|
1235 | 1239 | |
---|
1236 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1237 | 1241 | switchButton.setToolTipText("Create item switcher"); |
---|
1238 | 1242 | switchButton.addActionListener(this); |
---|
1239 | 1243 | |
---|
1240 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1241 | 1245 | loopButton.setToolTipText("Create loop"); |
---|
1242 | 1246 | loopButton.addActionListener(this); |
---|
1243 | 1247 | |
---|
1244 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1245 | 1249 | textureButton.setToolTipText("Create texture"); |
---|
1246 | 1250 | textureButton.addActionListener(this); |
---|
1247 | 1251 | |
---|
1248 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1249 | 1253 | overlayButton.setToolTipText("Create overlay"); |
---|
1250 | 1254 | overlayButton.addActionListener(this); |
---|
1251 | 1255 | |
---|
1252 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1256 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1253 | 1257 | lightButton.setToolTipText("Create light"); |
---|
1254 | 1258 | lightButton.addActionListener(this); |
---|
1255 | 1259 | |
---|
.. | .. |
---|
1259 | 1263 | |
---|
1260 | 1264 | CreateTexturePanel(textures); |
---|
1261 | 1265 | |
---|
| 1266 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1267 | + |
---|
| 1268 | + if (tabCount > 0) |
---|
| 1269 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1270 | + |
---|
1262 | 1271 | oe.toolboxPanel.add(textures); |
---|
1263 | 1272 | |
---|
1264 | 1273 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1266 | 1275 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1267 | 1276 | |
---|
1268 | 1277 | // EDIT panel |
---|
1269 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1278 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1270 | 1279 | editButton.setToolTipText("Pin selection controls"); |
---|
1271 | 1280 | editButton.addActionListener(this); |
---|
1272 | 1281 | |
---|
1273 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1282 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1274 | 1283 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1275 | 1284 | uneditButton.addActionListener(this); |
---|
1276 | 1285 | |
---|
.. | .. |
---|
1278 | 1287 | allParamsButton.setToolTipText("Show all controls"); |
---|
1279 | 1288 | allParamsButton.addActionListener(this); |
---|
1280 | 1289 | |
---|
1281 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1290 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1282 | 1291 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1283 | 1292 | clearPanelButton.addActionListener(this); |
---|
1284 | 1293 | |
---|
.. | .. |
---|
1286 | 1295 | //unselectButton.setToolTipText("Unselect"); |
---|
1287 | 1296 | //unselectButton.addActionListener(this); |
---|
1288 | 1297 | |
---|
1289 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1298 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1290 | 1299 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1291 | 1300 | flashSelectionButton.addActionListener(this); |
---|
1292 | 1301 | |
---|
.. | .. |
---|
1309 | 1318 | |
---|
1310 | 1319 | cGridBag jSPPanel = new cGridBag(); |
---|
1311 | 1320 | |
---|
| 1321 | + jSPPanel.preferredHeight = 20; |
---|
| 1322 | + |
---|
1312 | 1323 | JScrollPane jSP; |
---|
1313 | 1324 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1314 | 1325 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1317 | 1328 | oe.treePanel.add(jSPPanel); |
---|
1318 | 1329 | oe.treePanel.Return(); |
---|
1319 | 1330 | |
---|
1320 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1331 | + oe.treePanel.add(versionManagerPanel); |
---|
1321 | 1332 | oe.treePanel.Return(); |
---|
1322 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1323 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1324 | | - sliderPane.preferredHeight = 1; |
---|
| 1333 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1334 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1335 | + versionSliderPane.preferredHeight = 3; |
---|
1325 | 1336 | |
---|
1326 | 1337 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1327 | 1338 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1479 | 1490 | |
---|
1480 | 1491 | void EditObject(Object3D obj) |
---|
1481 | 1492 | { |
---|
1482 | | - assert(obj instanceof Composite); |
---|
| 1493 | + //assert(obj instanceof Composite); |
---|
1483 | 1494 | |
---|
1484 | 1495 | // if (obj.versionlist == null) |
---|
1485 | 1496 | // { |
---|
.. | .. |
---|
2115 | 2126 | switch(axis) |
---|
2116 | 2127 | { |
---|
2117 | 2128 | case 0 : |
---|
2118 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2119 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
2120 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2121 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2129 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2130 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2131 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2132 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
2122 | 2133 | norm = cVector.X; |
---|
2123 | 2134 | break; |
---|
2124 | 2135 | case 1 : |
---|
2125 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2126 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2127 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2128 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2136 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2137 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2138 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2139 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
2129 | 2140 | norm = cVector.Y; |
---|
2130 | 2141 | break; |
---|
2131 | 2142 | case 2 : |
---|
2132 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2133 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2134 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
2135 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2143 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2144 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2145 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2146 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
2136 | 2147 | norm = cVector.Z; |
---|
2137 | 2148 | break; |
---|
2138 | 2149 | } |
---|
.. | .. |
---|
2701 | 2712 | if (!group.selection.isEmpty()) |
---|
2702 | 2713 | { |
---|
2703 | 2714 | Composite csg = new GroupLeaf(); |
---|
| 2715 | + group(csg); |
---|
2704 | 2716 | csg.count = 5; |
---|
2705 | 2717 | Composite child = new cGroup("Branch"); |
---|
2706 | 2718 | csg.addChild(child); |
---|
2707 | 2719 | child.addChild(csg); |
---|
2708 | | - group(csg); |
---|
2709 | 2720 | } |
---|
2710 | 2721 | } else |
---|
2711 | 2722 | if (source == doubleItem) |
---|
.. | .. |
---|
2713 | 2724 | if (!group.selection.isEmpty()) |
---|
2714 | 2725 | { |
---|
2715 | 2726 | Composite csg = new GroupLeaf("Fork"); |
---|
| 2727 | + group(csg); |
---|
2716 | 2728 | csg.count = 5; |
---|
2717 | 2729 | Composite child = new cGroup("Branch A"); |
---|
2718 | 2730 | csg.addChild(child); |
---|
.. | .. |
---|
2720 | 2732 | child = new cGroup("Branch B"); |
---|
2721 | 2733 | csg.addChild(child); |
---|
2722 | 2734 | child.addChild(csg); |
---|
2723 | | - group(csg); |
---|
2724 | 2735 | } |
---|
2725 | 2736 | } else |
---|
2726 | 2737 | if (source == tripleItem) |
---|
.. | .. |
---|
2786 | 2797 | { |
---|
2787 | 2798 | Maximize(); |
---|
2788 | 2799 | } else |
---|
2789 | | - if (source == fullButton) |
---|
| 2800 | + if (source == fullScreenButton) |
---|
2790 | 2801 | { |
---|
2791 | 2802 | ToggleFullScreen(); |
---|
2792 | 2803 | } else |
---|
.. | .. |
---|
2795 | 2806 | this.expandedLayout = radio.layout; |
---|
2796 | 2807 | CollapseToolbar(); |
---|
2797 | 2808 | } else |
---|
2798 | | - if (source == maximize3DButton) |
---|
2799 | | - { |
---|
2800 | | - this.expandedLayout = radio.layout; |
---|
2801 | | - radio.layout = twoButton; |
---|
2802 | | - Show3DView(); |
---|
2803 | | - CollapseToolbar(); |
---|
2804 | | - } else |
---|
| 2809 | +// if (source == maximize3DButton) |
---|
| 2810 | +// { |
---|
| 2811 | +// this.expandedLayout = radio.layout; |
---|
| 2812 | +// radio.layout = twoButton; |
---|
| 2813 | +// CollapseToolbar(); |
---|
| 2814 | +// Show3DView(); |
---|
| 2815 | +// } else |
---|
2805 | 2816 | if (source == previousVersionButton) |
---|
2806 | 2817 | { |
---|
2807 | 2818 | // Go to previous version |
---|
.. | .. |
---|
3454 | 3465 | { |
---|
3455 | 3466 | ClearMaterials(); |
---|
3456 | 3467 | } else |
---|
| 3468 | + if (source == clearVersionsItem) |
---|
| 3469 | + { |
---|
| 3470 | + ClearVersions(); |
---|
| 3471 | + } else |
---|
3457 | 3472 | if (source == liveleavesItem) |
---|
3458 | 3473 | { |
---|
3459 | 3474 | LiveLeaves(true); |
---|
.. | .. |
---|
3593 | 3608 | if (source == transformChildrenItem) |
---|
3594 | 3609 | { |
---|
3595 | 3610 | TransformChildren(); |
---|
| 3611 | + } else |
---|
| 3612 | + if (source == textureRatioRItem) |
---|
| 3613 | + { |
---|
| 3614 | + TextureRatio(0); |
---|
| 3615 | + } else |
---|
| 3616 | + if (source == textureRatioGItem) |
---|
| 3617 | + { |
---|
| 3618 | + TextureRatio(1); |
---|
| 3619 | + } else |
---|
| 3620 | + if (source == textureRatioBItem) |
---|
| 3621 | + { |
---|
| 3622 | + TextureRatio(2); |
---|
3596 | 3623 | } else |
---|
3597 | 3624 | if (source == resetTransformItem) |
---|
3598 | 3625 | { |
---|
.. | .. |
---|
3966 | 3993 | if (source == closeButton) |
---|
3967 | 3994 | { |
---|
3968 | 3995 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3996 | + if (copy.versionlist != null) |
---|
| 3997 | + Replace(); |
---|
| 3998 | + |
---|
3969 | 3999 | cRadio ab; |
---|
3970 | 4000 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3971 | 4001 | { |
---|
.. | .. |
---|
4064 | 4094 | } else |
---|
4065 | 4095 | if(source instanceof cRadio) |
---|
4066 | 4096 | { |
---|
| 4097 | + if (copy.versionlist != null) |
---|
| 4098 | + Replace(); |
---|
| 4099 | + |
---|
4067 | 4100 | group.parent = keepparent; |
---|
4068 | 4101 | group.attributes = 0; |
---|
4069 | 4102 | //group.editWindow = null; |
---|
.. | .. |
---|
4115 | 4148 | */ |
---|
4116 | 4149 | radio.layout.doClick(); |
---|
4117 | 4150 | |
---|
4118 | | - assert(copy instanceof Composite); |
---|
| 4151 | + //assert(copy instanceof Composite); |
---|
4119 | 4152 | |
---|
4120 | 4153 | if (copy.versionlist == null) |
---|
4121 | 4154 | { |
---|
4122 | | - copy.versionlist = new Object3D[100]; |
---|
4123 | 4155 | copy.versionindex = -1; |
---|
4124 | 4156 | |
---|
4125 | 4157 | // Cannot work with loops |
---|
4126 | | - // To fix this issue, first mark all nodes above the root, |
---|
| 4158 | + // To fix this issue, we first mark all nodes above the root, |
---|
4127 | 4159 | // and check if any of these nodes are reachable below the root. |
---|
4128 | | - //Save(true); |
---|
| 4160 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4161 | + |
---|
| 4162 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4163 | + { |
---|
| 4164 | + if (copy.versionlist == null) |
---|
| 4165 | + copy.versionlist = new Object3D[100]; |
---|
| 4166 | + |
---|
| 4167 | + //Save(true); |
---|
| 4168 | + } |
---|
| 4169 | + else |
---|
| 4170 | + copy.versionindex = -2; |
---|
| 4171 | + |
---|
| 4172 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4129 | 4173 | } |
---|
4130 | 4174 | |
---|
4131 | 4175 | SetVersionStates(); |
---|
.. | .. |
---|
4243 | 4287 | refreshContents(); |
---|
4244 | 4288 | } |
---|
4245 | 4289 | |
---|
| 4290 | + void TextureRatio(int axis) |
---|
| 4291 | + { |
---|
| 4292 | + Object3D obj; |
---|
| 4293 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4294 | + { |
---|
| 4295 | + obj = (Object3D)e.nextElement(); |
---|
| 4296 | + obj.TextureRatio(axis); |
---|
| 4297 | + } |
---|
| 4298 | + |
---|
| 4299 | + refreshContents(); |
---|
| 4300 | + } |
---|
| 4301 | + |
---|
4246 | 4302 | void ResetTransform() |
---|
4247 | 4303 | { |
---|
4248 | 4304 | ResetTransform(-1); |
---|
.. | .. |
---|
4258 | 4314 | if (obj.toParent == null) |
---|
4259 | 4315 | continue; |
---|
4260 | 4316 | |
---|
4261 | | - if (mask == -1) |
---|
4262 | | - { |
---|
4263 | | - if (obj instanceof Camera) // jan 2014 |
---|
4264 | | - { |
---|
4265 | | - LA.matIdentity(obj.toParent); |
---|
4266 | | - LA.matIdentity(obj.fromParent); |
---|
4267 | | - } |
---|
4268 | | - else |
---|
4269 | | - { |
---|
4270 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4271 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4272 | | - } |
---|
4273 | | - TouchTransform(obj); |
---|
4274 | | - continue; |
---|
4275 | | - } |
---|
4276 | | - if ((mask&2) != 0) // Scale |
---|
4277 | | - { |
---|
4278 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4279 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4280 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4281 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4282 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4283 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4284 | | - } |
---|
4285 | | - if ((mask&4) != 0) // Rotation |
---|
4286 | | - { |
---|
4287 | | - // ? |
---|
4288 | | - } |
---|
4289 | | - if ((mask&1) != 0) // Translation |
---|
4290 | | - { |
---|
4291 | | - if (obj.toParent != null) |
---|
4292 | | - { |
---|
4293 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4294 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4295 | | - } |
---|
4296 | | - } |
---|
| 4317 | + obj.ResetTransform(mask); |
---|
| 4318 | + |
---|
4297 | 4319 | if (obj.parent == null) |
---|
4298 | 4320 | { |
---|
4299 | 4321 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4802 | 4824 | { |
---|
4803 | 4825 | Object3D obj = group.selection.get(i); |
---|
4804 | 4826 | |
---|
| 4827 | + if (obj.toParent == null) |
---|
| 4828 | + { |
---|
| 4829 | + obj.toParent = LA.newMatrix(); |
---|
| 4830 | + obj.fromParent = LA.newMatrix(); |
---|
| 4831 | + } |
---|
| 4832 | + |
---|
4805 | 4833 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4806 | 4834 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4807 | 4835 | } |
---|
.. | .. |
---|
5093 | 5121 | refreshContents(); |
---|
5094 | 5122 | } |
---|
5095 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
5096 | 5130 | void FlipV(boolean flip) |
---|
5097 | 5131 | { |
---|
5098 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5331 | 5365 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5332 | 5366 | // a camera |
---|
5333 | 5367 | { |
---|
5334 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5368 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5335 | 5369 | { |
---|
5336 | 5370 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5337 | 5371 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
5378 | 5412 | } |
---|
5379 | 5413 | } |
---|
5380 | 5414 | |
---|
5381 | | - rootButton.setEnabled(allComposites); |
---|
| 5415 | + rootButton.setEnabled(true); // allComposites); |
---|
5382 | 5416 | } |
---|
5383 | 5417 | |
---|
5384 | 5418 | void refreshContents(boolean cp) |
---|
5385 | 5419 | { |
---|
| 5420 | + if (Globals.SHOWINFO) |
---|
5386 | 5421 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5387 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5388 | 5423 | { |
---|
.. | .. |
---|
6333 | 6368 | private MenuItem clipMeshItem; |
---|
6334 | 6369 | private MenuItem smoothMeshItem; |
---|
6335 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
6336 | 6372 | |
---|
6337 | 6373 | private MenuItem liveleavesItem; |
---|
6338 | 6374 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6356 | 6392 | private MenuItem maxTexturesItem; |
---|
6357 | 6393 | private MenuItem panoTexturesItem; |
---|
6358 | 6394 | |
---|
| 6395 | + private MenuItem textureRatioRItem; |
---|
| 6396 | + private MenuItem textureRatioGItem; |
---|
| 6397 | + private MenuItem textureRatioBItem; |
---|
6359 | 6398 | private MenuItem resetCentroidItem; |
---|
6360 | 6399 | private MenuItem resetCentroidXZItem; |
---|
6361 | 6400 | private MenuItem resetTransformItem; |
---|