.. | .. |
---|
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 | { |
---|
.. | .. |
---|
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); |
---|
.. | .. |
---|
962 | 966 | currenttab.setName(tabname); |
---|
963 | 967 | //added = false; |
---|
964 | 968 | resourcecontainer.add(currenttab); |
---|
965 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 969 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname); |
---|
966 | 970 | rowcount = 1; |
---|
967 | 971 | colcount = 0; |
---|
968 | 972 | texturecount = 0; |
---|
.. | .. |
---|
977 | 981 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
978 | 982 | } |
---|
979 | 983 | |
---|
| 984 | + columns = 5; |
---|
| 985 | + |
---|
| 986 | + if (path[0].contains("D&R") || path[0].contains("Paint")) |
---|
| 987 | + columns = 4; |
---|
| 988 | + |
---|
980 | 989 | AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
981 | 990 | totalcount++; |
---|
982 | 991 | |
---|
.. | .. |
---|
1074 | 1083 | // } |
---|
1075 | 1084 | // }); |
---|
1076 | 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 | + |
---|
1077 | 1090 | oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1078 | 1091 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1079 | 1092 | collapseButton.addActionListener(this); |
---|
1080 | 1093 | |
---|
1081 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1082 | | - maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1083 | | - 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); |
---|
1084 | 1097 | |
---|
1085 | 1098 | oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1086 | 1099 | twoButton.setToolTipText("Show 3D view only"); |
---|
.. | .. |
---|
1100 | 1113 | // sevenButton.setToolTipText("3-column layout"); |
---|
1101 | 1114 | // sevenButton.addActionListener(this); |
---|
1102 | 1115 | // |
---|
1103 | | - |
---|
1104 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1105 | | - fullButton.setToolTipText("Full-screen window"); |
---|
1106 | | - fullButton.addActionListener(this); |
---|
1107 | 1116 | |
---|
1108 | 1117 | oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1109 | 1118 | screenfitButton.setToolTipText("Screen fit"); |
---|
.. | .. |
---|
1191 | 1200 | //clearButton.addActionListener(this); |
---|
1192 | 1201 | |
---|
1193 | 1202 | cGridBag row1 = new cGridBag(); |
---|
| 1203 | + row1.preferredHeight = 8; |
---|
1194 | 1204 | |
---|
1195 | 1205 | // INSERT |
---|
1196 | 1206 | row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1217 | 1227 | torusButton.setToolTipText("Create torus"); |
---|
1218 | 1228 | torusButton.addActionListener(this); |
---|
1219 | 1229 | |
---|
1220 | | - if (Globals.ADVANCED) |
---|
| 1230 | + if (false) //Globals.ADVANCED) |
---|
1221 | 1231 | { |
---|
1222 | 1232 | oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1223 | 1233 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
.. | .. |
---|
1231 | 1241 | oe.toolboxPanel.add(row1); |
---|
1232 | 1242 | |
---|
1233 | 1243 | cGridBag row2 = new cGridBag(); |
---|
| 1244 | + row2.preferredHeight = 8; |
---|
1234 | 1245 | |
---|
1235 | 1246 | row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1236 | 1247 | groupButton.setToolTipText("Create group"); |
---|
.. | .. |
---|
1333 | 1344 | |
---|
1334 | 1345 | oe.treePanel.add(versionManagerPanel); |
---|
1335 | 1346 | oe.treePanel.Return(); |
---|
| 1347 | + |
---|
1336 | 1348 | versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1337 | 1349 | versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
1338 | 1350 | versionSliderPane.preferredHeight = 3; |
---|
.. | .. |
---|
1392 | 1404 | // supportCB.setToolTipText("Enable rigging"); |
---|
1393 | 1405 | // supportCB.addItemListener(this); |
---|
1394 | 1406 | |
---|
1395 | | - panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1407 | + panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints); |
---|
1396 | 1408 | freezeCB.setToolTipText("Fast moving camera"); |
---|
1397 | 1409 | freezeCB.addItemListener(this); |
---|
1398 | 1410 | |
---|
.. | .. |
---|
1401 | 1413 | |
---|
1402 | 1414 | panel.Return(); |
---|
1403 | 1415 | |
---|
| 1416 | + if (Globals.ADVANCED) |
---|
| 1417 | + { |
---|
1404 | 1418 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
1405 | 1419 | crowdCB.setToolTipText("Used for crowds"); |
---|
1406 | 1420 | crowdCB.addItemListener(this); |
---|
| 1421 | + } |
---|
1407 | 1422 | |
---|
1408 | 1423 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
1409 | 1424 | smoothCB.setToolTipText("Snapping delay"); |
---|
.. | .. |
---|
1416 | 1431 | minshaderCB.setToolTipText("Minimal fast shader"); |
---|
1417 | 1432 | minshaderCB.addItemListener(this); |
---|
1418 | 1433 | |
---|
1419 | | -// constraints.gridy += 1; |
---|
1420 | 1434 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
1421 | 1435 | // speakerMocapCB.addItemListener(this); |
---|
1422 | 1436 | |
---|
1423 | | - panel.Return(); |
---|
1424 | | - |
---|
1425 | 1437 | if (false) |
---|
1426 | 1438 | { |
---|
1427 | 1439 | // handled in scripts |
---|
1428 | | - //constraints.gridy += 1; |
---|
1429 | 1440 | panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
1430 | 1441 | speakerCameraCB.addItemListener(this); |
---|
1431 | 1442 | |
---|
1432 | | - //constraints.gridy += 1; |
---|
1433 | 1443 | panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
1434 | 1444 | speakerFocusCB.addItemListener(this); |
---|
1435 | 1445 | |
---|
1436 | | - //constraints.gridy += 1; |
---|
1437 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
1438 | | - smoothfocusCB.addItemListener(this); |
---|
1439 | 1446 | panel.Return(); |
---|
1440 | 1447 | } |
---|
1441 | 1448 | |
---|
1442 | | -//constraints.gridx += 1; |
---|
| 1449 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1450 | + smoothfocusCB.addItemListener(this); |
---|
| 1451 | + |
---|
| 1452 | + panel.Return(); |
---|
| 1453 | + |
---|
1443 | 1454 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
1444 | 1455 | // debugCB.addItemListener(this); |
---|
1445 | 1456 | |
---|
.. | .. |
---|
1493 | 1504 | |
---|
1494 | 1505 | void EditObject(Object3D obj) |
---|
1495 | 1506 | { |
---|
1496 | | - assert(obj instanceof Composite); |
---|
| 1507 | + //assert(obj instanceof Composite); |
---|
1497 | 1508 | |
---|
1498 | 1509 | // if (obj.versionlist == null) |
---|
1499 | 1510 | // { |
---|
.. | .. |
---|
2078 | 2089 | Object3D obj = (Object3D)group.selection.elementAt(0); |
---|
2079 | 2090 | objEditor.ScreenFit(obj, false); |
---|
2080 | 2091 | |
---|
2081 | | - cameraView.pingthread.StepToTarget(true); |
---|
| 2092 | + cameraView.pingthread.StepToTarget(); //true); |
---|
2082 | 2093 | refreshContents(); |
---|
2083 | 2094 | } |
---|
2084 | 2095 | |
---|
.. | .. |
---|
2115 | 2126 | obj.parent.TransformToWorld(maxima); //, maxima); |
---|
2116 | 2127 | } |
---|
2117 | 2128 | |
---|
2118 | | - Object3D shadow = new Object3D("Shadow " + obj.name); |
---|
| 2129 | + Object3D shadow = new Object3D("Shadow" + obj.name); |
---|
2119 | 2130 | |
---|
2120 | 2131 | shadow.toParent = LA.newMatrix(); |
---|
2121 | 2132 | shadow.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
2715 | 2726 | if (!group.selection.isEmpty()) |
---|
2716 | 2727 | { |
---|
2717 | 2728 | Composite csg = new GroupLeaf(); |
---|
| 2729 | + group(csg); |
---|
2718 | 2730 | csg.count = 5; |
---|
2719 | 2731 | Composite child = new cGroup("Branch"); |
---|
2720 | 2732 | csg.addChild(child); |
---|
2721 | 2733 | child.addChild(csg); |
---|
2722 | | - group(csg); |
---|
2723 | 2734 | } |
---|
2724 | 2735 | } else |
---|
2725 | 2736 | if (source == doubleItem) |
---|
.. | .. |
---|
2727 | 2738 | if (!group.selection.isEmpty()) |
---|
2728 | 2739 | { |
---|
2729 | 2740 | Composite csg = new GroupLeaf("Fork"); |
---|
| 2741 | + group(csg); |
---|
2730 | 2742 | csg.count = 5; |
---|
2731 | 2743 | Composite child = new cGroup("Branch A"); |
---|
2732 | 2744 | csg.addChild(child); |
---|
.. | .. |
---|
2734 | 2746 | child = new cGroup("Branch B"); |
---|
2735 | 2747 | csg.addChild(child); |
---|
2736 | 2748 | child.addChild(csg); |
---|
2737 | | - group(csg); |
---|
2738 | 2749 | } |
---|
2739 | 2750 | } else |
---|
2740 | 2751 | if (source == tripleItem) |
---|
.. | .. |
---|
2800 | 2811 | { |
---|
2801 | 2812 | Maximize(); |
---|
2802 | 2813 | } else |
---|
2803 | | - if (source == fullButton) |
---|
| 2814 | + if (source == fullScreenButton) |
---|
2804 | 2815 | { |
---|
2805 | 2816 | ToggleFullScreen(); |
---|
2806 | 2817 | } else |
---|
.. | .. |
---|
2809 | 2820 | this.expandedLayout = radio.layout; |
---|
2810 | 2821 | CollapseToolbar(); |
---|
2811 | 2822 | } else |
---|
2812 | | - if (source == maximize3DButton) |
---|
2813 | | - { |
---|
2814 | | - this.expandedLayout = radio.layout; |
---|
2815 | | - radio.layout = twoButton; |
---|
2816 | | - Show3DView(); |
---|
2817 | | - CollapseToolbar(); |
---|
2818 | | - } else |
---|
| 2823 | +// if (source == maximize3DButton) |
---|
| 2824 | +// { |
---|
| 2825 | +// this.expandedLayout = radio.layout; |
---|
| 2826 | +// radio.layout = twoButton; |
---|
| 2827 | +// CollapseToolbar(); |
---|
| 2828 | +// Show3DView(); |
---|
| 2829 | +// } else |
---|
2819 | 2830 | if (source == previousVersionButton) |
---|
2820 | 2831 | { |
---|
2821 | 2832 | // Go to previous version |
---|
.. | .. |
---|
2843 | 2854 | if (source == saveVersionButton) |
---|
2844 | 2855 | { |
---|
2845 | 2856 | // Save a new version |
---|
2846 | | - if (!Save(true)) |
---|
| 2857 | + if (!DuplicateVersion()) //true)) |
---|
2847 | 2858 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2848 | 2859 | } else |
---|
2849 | 2860 | if (source == deleteVersionButton) |
---|
.. | .. |
---|
3612 | 3623 | { |
---|
3613 | 3624 | TransformChildren(); |
---|
3614 | 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); |
---|
| 3637 | + } else |
---|
3615 | 3638 | if (source == resetTransformItem) |
---|
3616 | 3639 | { |
---|
3617 | 3640 | ResetTransform(); |
---|
.. | .. |
---|
3984 | 4007 | if (source == closeButton) |
---|
3985 | 4008 | { |
---|
3986 | 4009 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
3987 | | - Replace(); |
---|
| 4010 | + if (copy.versionlist != null) |
---|
| 4011 | + Replace(); |
---|
3988 | 4012 | |
---|
3989 | 4013 | cRadio ab; |
---|
3990 | 4014 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
.. | .. |
---|
4084 | 4108 | } else |
---|
4085 | 4109 | if(source instanceof cRadio) |
---|
4086 | 4110 | { |
---|
4087 | | - Replace(); |
---|
| 4111 | + if (copy.versionlist != null) |
---|
| 4112 | + Replace(); |
---|
4088 | 4113 | |
---|
4089 | 4114 | group.parent = keepparent; |
---|
4090 | 4115 | group.attributes = 0; |
---|
.. | .. |
---|
4137 | 4162 | */ |
---|
4138 | 4163 | radio.layout.doClick(); |
---|
4139 | 4164 | |
---|
4140 | | - assert(copy instanceof Composite); |
---|
| 4165 | + //assert(copy instanceof Composite); |
---|
4141 | 4166 | |
---|
4142 | 4167 | if (copy.versionlist == null) |
---|
4143 | 4168 | { |
---|
.. | .. |
---|
4148 | 4173 | // and check if any of these nodes are reachable below the root. |
---|
4149 | 4174 | Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
4150 | 4175 | |
---|
4151 | | - if (copy.versionlist == null && !copy.HasTags()) |
---|
| 4176 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
4152 | 4177 | { |
---|
4153 | | - copy.versionlist = new Object3D[100]; |
---|
| 4178 | + if (copy.versionlist == null) |
---|
| 4179 | + copy.versionlist = new Object3D[100]; |
---|
4154 | 4180 | |
---|
4155 | 4181 | //Save(true); |
---|
4156 | 4182 | } |
---|
.. | .. |
---|
4275 | 4301 | refreshContents(); |
---|
4276 | 4302 | } |
---|
4277 | 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 | + |
---|
4278 | 4316 | void ResetTransform() |
---|
4279 | 4317 | { |
---|
4280 | 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(); |
---|
4281 | 4344 | } |
---|
4282 | 4345 | |
---|
4283 | 4346 | void ResetTransform(int mask) |
---|
.. | .. |
---|
4290 | 4353 | if (obj.toParent == null) |
---|
4291 | 4354 | continue; |
---|
4292 | 4355 | |
---|
4293 | | - if (mask == -1) |
---|
4294 | | - { |
---|
4295 | | - if (obj instanceof Camera) // jan 2014 |
---|
4296 | | - { |
---|
4297 | | - LA.matIdentity(obj.toParent); |
---|
4298 | | - LA.matIdentity(obj.fromParent); |
---|
4299 | | - } |
---|
4300 | | - else |
---|
4301 | | - { |
---|
4302 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4303 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4304 | | - } |
---|
4305 | | - TouchTransform(obj); |
---|
4306 | | - continue; |
---|
4307 | | - } |
---|
4308 | | - if ((mask&2) != 0) // Scale/rotation |
---|
4309 | | - { |
---|
4310 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4311 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4312 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4313 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4314 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4315 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4316 | | - } |
---|
4317 | | - if ((mask&1) != 0) // Translation |
---|
4318 | | - { |
---|
4319 | | - if (obj.toParent != null) |
---|
4320 | | - { |
---|
4321 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4322 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4323 | | - } |
---|
4324 | | - } |
---|
| 4356 | + obj.ResetTransform(mask); |
---|
| 4357 | + |
---|
4325 | 4358 | if (obj.parent == null) |
---|
4326 | 4359 | { |
---|
4327 | 4360 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4830 | 4863 | { |
---|
4831 | 4864 | Object3D obj = group.selection.get(i); |
---|
4832 | 4865 | |
---|
| 4866 | + if (obj.toParent == null) |
---|
| 4867 | + { |
---|
| 4868 | + obj.toParent = LA.newMatrix(); |
---|
| 4869 | + obj.fromParent = LA.newMatrix(); |
---|
| 4870 | + } |
---|
| 4871 | + |
---|
4833 | 4872 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4834 | 4873 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4835 | 4874 | } |
---|
4836 | 4875 | |
---|
| 4876 | + Globals.lighttouched = true; |
---|
4837 | 4877 | refreshContents(); |
---|
4838 | 4878 | } |
---|
4839 | 4879 | |
---|
.. | .. |
---|
5365 | 5405 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5366 | 5406 | // a camera |
---|
5367 | 5407 | { |
---|
5368 | | - 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 |
---|
5369 | 5409 | { |
---|
5370 | 5410 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5371 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5411 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true); |
---|
5372 | 5412 | } |
---|
5373 | 5413 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
5374 | 5414 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
.. | .. |
---|
5412 | 5452 | } |
---|
5413 | 5453 | } |
---|
5414 | 5454 | |
---|
5415 | | - rootButton.setEnabled(allComposites); |
---|
| 5455 | + rootButton.setEnabled(true); // allComposites); |
---|
5416 | 5456 | } |
---|
5417 | 5457 | |
---|
5418 | 5458 | void refreshContents(boolean cp) |
---|
5419 | 5459 | { |
---|
5420 | | - if (Globals.ADVANCED) |
---|
| 5460 | + if (Globals.SHOWINFO) |
---|
5421 | 5461 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5422 | 5462 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5423 | 5463 | { |
---|
.. | .. |
---|
6392 | 6432 | private MenuItem maxTexturesItem; |
---|
6393 | 6433 | private MenuItem panoTexturesItem; |
---|
6394 | 6434 | |
---|
| 6435 | + private MenuItem textureRatioRItem; |
---|
| 6436 | + private MenuItem textureRatioGItem; |
---|
| 6437 | + private MenuItem textureRatioBItem; |
---|
6395 | 6438 | private MenuItem resetCentroidItem; |
---|
6396 | 6439 | private MenuItem resetCentroidXZItem; |
---|
6397 | 6440 | private MenuItem resetTransformItem; |
---|