.. | .. |
---|
368 | 368 | refreshContents(); |
---|
369 | 369 | } |
---|
370 | 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 | | - } |
---|
380 | | - |
---|
381 | 371 | //ObjEditor objEditor; |
---|
382 | 372 | public void closeUI2() |
---|
383 | 373 | { |
---|
.. | .. |
---|
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) |
---|
.. | .. |
---|
493 | 483 | |
---|
494 | 484 | Object3D parent = obj.parent; |
---|
495 | 485 | obj.parent = null; |
---|
| 486 | + |
---|
496 | 487 | // Object3D support = obj.support; |
---|
497 | 488 | // obj.support = null; |
---|
498 | 489 | if (!supports) |
---|
499 | 490 | obj.SaveSupports(); |
---|
| 491 | + |
---|
500 | 492 | Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
| 493 | + |
---|
| 494 | + clone.ResetUUIDs(); |
---|
| 495 | + |
---|
501 | 496 | obj.parent = parent; |
---|
502 | 497 | // obj.support = support; |
---|
503 | 498 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
567 | 562 | pasteLinkItem.addActionListener(this); |
---|
568 | 563 | pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
569 | 564 | pasteCloneItem.addActionListener(this); |
---|
570 | | -// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
571 | | -// pasteExpandItem.addActionListener(this); |
---|
| 565 | +// CRASH |
---|
| 566 | + pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
| 567 | +// |
---|
| 568 | + pasteExpandItem.addActionListener(this); |
---|
572 | 569 | //menu.add("-"); |
---|
573 | 570 | oe.jTree.popup.addSeparator(); |
---|
574 | 571 | |
---|
.. | .. |
---|
765 | 762 | shadowYItem.addActionListener(this); |
---|
766 | 763 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
767 | 764 | shadowZItem.addActionListener(this); |
---|
| 765 | + |
---|
768 | 766 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
769 | 767 | attributeItem.addActionListener(this); |
---|
770 | | - |
---|
771 | 768 | if (Globals.ADVANCED) |
---|
772 | 769 | { |
---|
773 | 770 | menu.add("-"); |
---|
.. | .. |
---|
779 | 776 | pointflowItem.addActionListener(this); |
---|
780 | 777 | } |
---|
781 | 778 | 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("-"); |
---|
782 | 786 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
783 | 787 | resetTransformItem.addActionListener(this); |
---|
784 | 788 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
785 | 789 | resetCentroidItem.addActionListener(this); |
---|
786 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 790 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
787 | 791 | resetCentroidXZItem.addActionListener(this); |
---|
788 | 792 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
789 | 793 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
799 | 803 | genNormalsCADItem.addActionListener(this); |
---|
800 | 804 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
801 | 805 | genNormalsMESHItem.addActionListener(this); |
---|
802 | | - if (Globals.ADVANCED) |
---|
| 806 | + //if (Globals.ADVANCED) |
---|
803 | 807 | { |
---|
804 | 808 | genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
805 | 809 | genNormalsMINEItem.addActionListener(this); |
---|
.. | .. |
---|
835 | 839 | } |
---|
836 | 840 | |
---|
837 | 841 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 842 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 843 | + clearVersionsItem.addActionListener(this); |
---|
838 | 844 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
839 | 845 | clearMaterialsItem.addActionListener(this); |
---|
840 | 846 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
936 | 942 | cGridBag currenttab; |
---|
937 | 943 | //boolean added; // patch for jar |
---|
938 | 944 | |
---|
| 945 | + int totalcount = 0; |
---|
| 946 | + |
---|
939 | 947 | int tabcount = 0; |
---|
940 | 948 | int colcount = 0; |
---|
941 | 949 | int rowcount = 0; |
---|
.. | .. |
---|
958 | 966 | currenttab.setName(tabname); |
---|
959 | 967 | //added = false; |
---|
960 | 968 | resourcecontainer.add(currenttab); |
---|
961 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 969 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname); |
---|
962 | 970 | rowcount = 1; |
---|
963 | 971 | colcount = 0; |
---|
964 | 972 | texturecount = 0; |
---|
965 | 973 | } |
---|
966 | 974 | |
---|
967 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 975 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
968 | 976 | { |
---|
969 | 977 | //if (!added) |
---|
970 | 978 | { |
---|
.. | .. |
---|
973 | 981 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
974 | 982 | } |
---|
975 | 983 | |
---|
976 | | - 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++; |
---|
977 | 991 | |
---|
978 | 992 | if (++colcount >= columns) |
---|
979 | 993 | { |
---|
.. | .. |
---|
999 | 1013 | container.add(resourcecontainer); |
---|
1000 | 1014 | |
---|
1001 | 1015 | Grafreed.ParseResources("textures", this); |
---|
| 1016 | + |
---|
| 1017 | + // 935. System.out.println("Total = " + totalcount); |
---|
1002 | 1018 | } |
---|
1003 | 1019 | |
---|
1004 | 1020 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1067 | 1083 | // } |
---|
1068 | 1084 | // }); |
---|
1069 | 1085 | |
---|
| 1086 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1088 | + fullScreenButton.addActionListener(this); |
---|
| 1089 | + |
---|
1070 | 1090 | oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1071 | 1091 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1072 | 1092 | collapseButton.addActionListener(this); |
---|
1073 | 1093 | |
---|
1074 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1075 | | - maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1076 | | - 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); |
---|
1077 | 1097 | |
---|
1078 | 1098 | oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1079 | 1099 | twoButton.setToolTipText("Show 3D view only"); |
---|
.. | .. |
---|
1093 | 1113 | // sevenButton.setToolTipText("3-column layout"); |
---|
1094 | 1114 | // sevenButton.addActionListener(this); |
---|
1095 | 1115 | // |
---|
1096 | | - |
---|
1097 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1098 | | - fullButton.setToolTipText("Full-screen window"); |
---|
1099 | | - fullButton.addActionListener(this); |
---|
1100 | 1116 | |
---|
1101 | 1117 | oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1102 | 1118 | screenfitButton.setToolTipText("Screen fit"); |
---|
.. | .. |
---|
1184 | 1200 | //clearButton.addActionListener(this); |
---|
1185 | 1201 | |
---|
1186 | 1202 | cGridBag row1 = new cGridBag(); |
---|
| 1203 | + row1.preferredHeight = 8; |
---|
1187 | 1204 | |
---|
1188 | 1205 | // INSERT |
---|
1189 | 1206 | row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1210 | 1227 | torusButton.setToolTipText("Create torus"); |
---|
1211 | 1228 | torusButton.addActionListener(this); |
---|
1212 | 1229 | |
---|
1213 | | - if (Globals.ADVANCED) |
---|
| 1230 | + if (false) //Globals.ADVANCED) |
---|
1214 | 1231 | { |
---|
1215 | 1232 | oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1216 | 1233 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
.. | .. |
---|
1224 | 1241 | oe.toolboxPanel.add(row1); |
---|
1225 | 1242 | |
---|
1226 | 1243 | cGridBag row2 = new cGridBag(); |
---|
| 1244 | + row2.preferredHeight = 8; |
---|
1227 | 1245 | |
---|
1228 | 1246 | row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1229 | 1247 | groupButton.setToolTipText("Create group"); |
---|
.. | .. |
---|
1259 | 1277 | |
---|
1260 | 1278 | CreateTexturePanel(textures); |
---|
1261 | 1279 | |
---|
1262 | | - resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
| 1280 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1281 | + |
---|
| 1282 | + if (tabCount > 0) |
---|
| 1283 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
1263 | 1284 | |
---|
1264 | 1285 | oe.toolboxPanel.add(textures); |
---|
1265 | 1286 | |
---|
.. | .. |
---|
1323 | 1344 | |
---|
1324 | 1345 | oe.treePanel.add(versionManagerPanel); |
---|
1325 | 1346 | oe.treePanel.Return(); |
---|
| 1347 | + |
---|
1326 | 1348 | versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1327 | 1349 | versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
1328 | 1350 | versionSliderPane.preferredHeight = 3; |
---|
.. | .. |
---|
1382 | 1404 | // supportCB.setToolTipText("Enable rigging"); |
---|
1383 | 1405 | // supportCB.addItemListener(this); |
---|
1384 | 1406 | |
---|
1385 | | - panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1407 | + panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints); |
---|
1386 | 1408 | freezeCB.setToolTipText("Fast moving camera"); |
---|
1387 | 1409 | freezeCB.addItemListener(this); |
---|
1388 | 1410 | |
---|
.. | .. |
---|
1391 | 1413 | |
---|
1392 | 1414 | panel.Return(); |
---|
1393 | 1415 | |
---|
| 1416 | + if (Globals.ADVANCED) |
---|
| 1417 | + { |
---|
1394 | 1418 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
1395 | 1419 | crowdCB.setToolTipText("Used for crowds"); |
---|
1396 | 1420 | crowdCB.addItemListener(this); |
---|
| 1421 | + } |
---|
1397 | 1422 | |
---|
1398 | 1423 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
1399 | 1424 | smoothCB.setToolTipText("Snapping delay"); |
---|
.. | .. |
---|
1406 | 1431 | minshaderCB.setToolTipText("Minimal fast shader"); |
---|
1407 | 1432 | minshaderCB.addItemListener(this); |
---|
1408 | 1433 | |
---|
1409 | | -// constraints.gridy += 1; |
---|
1410 | 1434 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
1411 | 1435 | // speakerMocapCB.addItemListener(this); |
---|
1412 | 1436 | |
---|
1413 | | - panel.Return(); |
---|
1414 | | - |
---|
1415 | 1437 | if (false) |
---|
1416 | 1438 | { |
---|
1417 | 1439 | // handled in scripts |
---|
1418 | | - //constraints.gridy += 1; |
---|
1419 | 1440 | panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
1420 | 1441 | speakerCameraCB.addItemListener(this); |
---|
1421 | 1442 | |
---|
1422 | | - //constraints.gridy += 1; |
---|
1423 | 1443 | panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
1424 | 1444 | speakerFocusCB.addItemListener(this); |
---|
1425 | 1445 | |
---|
1426 | | - //constraints.gridy += 1; |
---|
1427 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
1428 | | - smoothfocusCB.addItemListener(this); |
---|
1429 | 1446 | panel.Return(); |
---|
1430 | 1447 | } |
---|
1431 | 1448 | |
---|
1432 | | -//constraints.gridx += 1; |
---|
| 1449 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1450 | + smoothfocusCB.addItemListener(this); |
---|
| 1451 | + |
---|
| 1452 | + panel.Return(); |
---|
| 1453 | + |
---|
1433 | 1454 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
1434 | 1455 | // debugCB.addItemListener(this); |
---|
1435 | 1456 | |
---|
.. | .. |
---|
1483 | 1504 | |
---|
1484 | 1505 | void EditObject(Object3D obj) |
---|
1485 | 1506 | { |
---|
1486 | | - assert(obj instanceof Composite); |
---|
| 1507 | + //assert(obj instanceof Composite); |
---|
1487 | 1508 | |
---|
1488 | 1509 | // if (obj.versionlist == null) |
---|
1489 | 1510 | // { |
---|
.. | .. |
---|
2068 | 2089 | Object3D obj = (Object3D)group.selection.elementAt(0); |
---|
2069 | 2090 | objEditor.ScreenFit(obj, false); |
---|
2070 | 2091 | |
---|
2071 | | - cameraView.pingthread.StepToTarget(true); |
---|
| 2092 | + cameraView.pingthread.StepToTarget(); //true); |
---|
2072 | 2093 | refreshContents(); |
---|
2073 | 2094 | } |
---|
2074 | 2095 | |
---|
.. | .. |
---|
2105 | 2126 | obj.parent.TransformToWorld(maxima); //, maxima); |
---|
2106 | 2127 | } |
---|
2107 | 2128 | |
---|
2108 | | - Object3D shadow = new Object3D("Shadow " + obj.name); |
---|
| 2129 | + Object3D shadow = new Object3D("Shadow" + obj.name); |
---|
2109 | 2130 | |
---|
2110 | 2131 | shadow.toParent = LA.newMatrix(); |
---|
2111 | 2132 | shadow.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
2119 | 2140 | switch(axis) |
---|
2120 | 2141 | { |
---|
2121 | 2142 | case 0 : |
---|
2122 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2123 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
2124 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2125 | | - 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; |
---|
2126 | 2147 | norm = cVector.X; |
---|
2127 | 2148 | break; |
---|
2128 | 2149 | case 1 : |
---|
2129 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2130 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2131 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2132 | | - 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; |
---|
2133 | 2154 | norm = cVector.Y; |
---|
2134 | 2155 | break; |
---|
2135 | 2156 | case 2 : |
---|
2136 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2137 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2138 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
2139 | | - 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; |
---|
2140 | 2161 | norm = cVector.Z; |
---|
2141 | 2162 | break; |
---|
2142 | 2163 | } |
---|
.. | .. |
---|
2705 | 2726 | if (!group.selection.isEmpty()) |
---|
2706 | 2727 | { |
---|
2707 | 2728 | Composite csg = new GroupLeaf(); |
---|
| 2729 | + group(csg); |
---|
2708 | 2730 | csg.count = 5; |
---|
2709 | 2731 | Composite child = new cGroup("Branch"); |
---|
2710 | 2732 | csg.addChild(child); |
---|
2711 | 2733 | child.addChild(csg); |
---|
2712 | | - group(csg); |
---|
2713 | 2734 | } |
---|
2714 | 2735 | } else |
---|
2715 | 2736 | if (source == doubleItem) |
---|
.. | .. |
---|
2717 | 2738 | if (!group.selection.isEmpty()) |
---|
2718 | 2739 | { |
---|
2719 | 2740 | Composite csg = new GroupLeaf("Fork"); |
---|
| 2741 | + group(csg); |
---|
2720 | 2742 | csg.count = 5; |
---|
2721 | 2743 | Composite child = new cGroup("Branch A"); |
---|
2722 | 2744 | csg.addChild(child); |
---|
.. | .. |
---|
2724 | 2746 | child = new cGroup("Branch B"); |
---|
2725 | 2747 | csg.addChild(child); |
---|
2726 | 2748 | child.addChild(csg); |
---|
2727 | | - group(csg); |
---|
2728 | 2749 | } |
---|
2729 | 2750 | } else |
---|
2730 | 2751 | if (source == tripleItem) |
---|
.. | .. |
---|
2790 | 2811 | { |
---|
2791 | 2812 | Maximize(); |
---|
2792 | 2813 | } else |
---|
2793 | | - if (source == fullButton) |
---|
| 2814 | + if (source == fullScreenButton) |
---|
2794 | 2815 | { |
---|
2795 | 2816 | ToggleFullScreen(); |
---|
2796 | 2817 | } else |
---|
.. | .. |
---|
2799 | 2820 | this.expandedLayout = radio.layout; |
---|
2800 | 2821 | CollapseToolbar(); |
---|
2801 | 2822 | } else |
---|
2802 | | - if (source == maximize3DButton) |
---|
2803 | | - { |
---|
2804 | | - this.expandedLayout = radio.layout; |
---|
2805 | | - radio.layout = twoButton; |
---|
2806 | | - Show3DView(); |
---|
2807 | | - CollapseToolbar(); |
---|
2808 | | - } else |
---|
| 2823 | +// if (source == maximize3DButton) |
---|
| 2824 | +// { |
---|
| 2825 | +// this.expandedLayout = radio.layout; |
---|
| 2826 | +// radio.layout = twoButton; |
---|
| 2827 | +// CollapseToolbar(); |
---|
| 2828 | +// Show3DView(); |
---|
| 2829 | +// } else |
---|
2809 | 2830 | if (source == previousVersionButton) |
---|
2810 | 2831 | { |
---|
2811 | 2832 | // Go to previous version |
---|
.. | .. |
---|
2833 | 2854 | if (source == saveVersionButton) |
---|
2834 | 2855 | { |
---|
2835 | 2856 | // Save a new version |
---|
2836 | | - if (!Save(true)) |
---|
| 2857 | + if (!DuplicateVersion()) //true)) |
---|
2837 | 2858 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2838 | 2859 | } else |
---|
2839 | 2860 | if (source == deleteVersionButton) |
---|
.. | .. |
---|
3458 | 3479 | { |
---|
3459 | 3480 | ClearMaterials(); |
---|
3460 | 3481 | } else |
---|
| 3482 | + if (source == clearVersionsItem) |
---|
| 3483 | + { |
---|
| 3484 | + ClearVersions(); |
---|
| 3485 | + } else |
---|
3461 | 3486 | if (source == liveleavesItem) |
---|
3462 | 3487 | { |
---|
3463 | 3488 | LiveLeaves(true); |
---|
.. | .. |
---|
3597 | 3622 | if (source == transformChildrenItem) |
---|
3598 | 3623 | { |
---|
3599 | 3624 | 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); |
---|
3600 | 3637 | } else |
---|
3601 | 3638 | if (source == resetTransformItem) |
---|
3602 | 3639 | { |
---|
.. | .. |
---|
3970 | 4007 | if (source == closeButton) |
---|
3971 | 4008 | { |
---|
3972 | 4009 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
3973 | | - Replace(); |
---|
| 4010 | + if (copy.versionlist != null) |
---|
| 4011 | + Replace(); |
---|
3974 | 4012 | |
---|
3975 | 4013 | cRadio ab; |
---|
3976 | 4014 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
.. | .. |
---|
4070 | 4108 | } else |
---|
4071 | 4109 | if(source instanceof cRadio) |
---|
4072 | 4110 | { |
---|
4073 | | - Replace(); |
---|
| 4111 | + if (copy.versionlist != null) |
---|
| 4112 | + Replace(); |
---|
4074 | 4113 | |
---|
4075 | 4114 | group.parent = keepparent; |
---|
4076 | 4115 | group.attributes = 0; |
---|
.. | .. |
---|
4123 | 4162 | */ |
---|
4124 | 4163 | radio.layout.doClick(); |
---|
4125 | 4164 | |
---|
4126 | | - assert(copy instanceof Composite); |
---|
| 4165 | + //assert(copy instanceof Composite); |
---|
4127 | 4166 | |
---|
4128 | 4167 | if (copy.versionlist == null) |
---|
4129 | 4168 | { |
---|
.. | .. |
---|
4134 | 4173 | // and check if any of these nodes are reachable below the root. |
---|
4135 | 4174 | Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
4136 | 4175 | |
---|
4137 | | - if (!copy.HasTags()) |
---|
| 4176 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
4138 | 4177 | { |
---|
4139 | | - copy.versionlist = new Object3D[100]; |
---|
| 4178 | + if (copy.versionlist == null) |
---|
| 4179 | + copy.versionlist = new Object3D[100]; |
---|
4140 | 4180 | |
---|
4141 | | - Save(true); |
---|
| 4181 | + //Save(true); |
---|
4142 | 4182 | } |
---|
| 4183 | + else |
---|
| 4184 | + copy.versionindex = -2; |
---|
4143 | 4185 | |
---|
4144 | 4186 | Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4145 | 4187 | } |
---|
.. | .. |
---|
4259 | 4301 | refreshContents(); |
---|
4260 | 4302 | } |
---|
4261 | 4303 | |
---|
| 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 | + |
---|
4262 | 4316 | void ResetTransform() |
---|
4263 | 4317 | { |
---|
4264 | 4318 | 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(); |
---|
4265 | 4344 | } |
---|
4266 | 4345 | |
---|
4267 | 4346 | void ResetTransform(int mask) |
---|
.. | .. |
---|
4274 | 4353 | if (obj.toParent == null) |
---|
4275 | 4354 | continue; |
---|
4276 | 4355 | |
---|
4277 | | - if (mask == -1) |
---|
4278 | | - { |
---|
4279 | | - if (obj instanceof Camera) // jan 2014 |
---|
4280 | | - { |
---|
4281 | | - LA.matIdentity(obj.toParent); |
---|
4282 | | - LA.matIdentity(obj.fromParent); |
---|
4283 | | - } |
---|
4284 | | - else |
---|
4285 | | - { |
---|
4286 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4287 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4288 | | - } |
---|
4289 | | - TouchTransform(obj); |
---|
4290 | | - continue; |
---|
4291 | | - } |
---|
4292 | | - if ((mask&2) != 0) // Scale/rotation |
---|
4293 | | - { |
---|
4294 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4295 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4296 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4297 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4298 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4299 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4300 | | - } |
---|
4301 | | - if ((mask&1) != 0) // Translation |
---|
4302 | | - { |
---|
4303 | | - if (obj.toParent != null) |
---|
4304 | | - { |
---|
4305 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4306 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4307 | | - } |
---|
4308 | | - } |
---|
| 4356 | + obj.ResetTransform(mask); |
---|
| 4357 | + |
---|
4309 | 4358 | if (obj.parent == null) |
---|
4310 | 4359 | { |
---|
4311 | 4360 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4814 | 4863 | { |
---|
4815 | 4864 | Object3D obj = group.selection.get(i); |
---|
4816 | 4865 | |
---|
| 4866 | + if (obj.toParent == null) |
---|
| 4867 | + { |
---|
| 4868 | + obj.toParent = LA.newMatrix(); |
---|
| 4869 | + obj.fromParent = LA.newMatrix(); |
---|
| 4870 | + } |
---|
| 4871 | + |
---|
4817 | 4872 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4818 | 4873 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4819 | 4874 | } |
---|
4820 | 4875 | |
---|
| 4876 | + Globals.lighttouched = true; |
---|
4821 | 4877 | refreshContents(); |
---|
4822 | 4878 | } |
---|
4823 | 4879 | |
---|
.. | .. |
---|
5105 | 5161 | refreshContents(); |
---|
5106 | 5162 | } |
---|
5107 | 5163 | |
---|
| 5164 | + void ClearVersions() |
---|
| 5165 | + { |
---|
| 5166 | + group.selection.ClearVersions(); |
---|
| 5167 | + refreshContents(); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
5108 | 5170 | void FlipV(boolean flip) |
---|
5109 | 5171 | { |
---|
5110 | 5172 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5343 | 5405 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5344 | 5406 | // a camera |
---|
5345 | 5407 | { |
---|
5346 | | - 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 |
---|
5347 | 5409 | { |
---|
5348 | 5410 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5349 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5411 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true); |
---|
5350 | 5412 | } |
---|
5351 | 5413 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
5352 | 5414 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
.. | .. |
---|
5390 | 5452 | } |
---|
5391 | 5453 | } |
---|
5392 | 5454 | |
---|
5393 | | - rootButton.setEnabled(allComposites); |
---|
| 5455 | + rootButton.setEnabled(true); // allComposites); |
---|
5394 | 5456 | } |
---|
5395 | 5457 | |
---|
5396 | 5458 | void refreshContents(boolean cp) |
---|
5397 | 5459 | { |
---|
5398 | | - if (Globals.ADVANCED) |
---|
| 5460 | + if (Globals.SHOWINFO) |
---|
5399 | 5461 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5400 | 5462 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5401 | 5463 | { |
---|
.. | .. |
---|
6346 | 6408 | private MenuItem clipMeshItem; |
---|
6347 | 6409 | private MenuItem smoothMeshItem; |
---|
6348 | 6410 | private MenuItem clearMaterialsItem; |
---|
| 6411 | + private MenuItem clearVersionsItem; |
---|
6349 | 6412 | |
---|
6350 | 6413 | private MenuItem liveleavesItem; |
---|
6351 | 6414 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6369 | 6432 | private MenuItem maxTexturesItem; |
---|
6370 | 6433 | private MenuItem panoTexturesItem; |
---|
6371 | 6434 | |
---|
| 6435 | + private MenuItem textureRatioRItem; |
---|
| 6436 | + private MenuItem textureRatioGItem; |
---|
| 6437 | + private MenuItem textureRatioBItem; |
---|
6372 | 6438 | private MenuItem resetCentroidItem; |
---|
6373 | 6439 | private MenuItem resetCentroidXZItem; |
---|
6374 | 6440 | private MenuItem resetTransformItem; |
---|