.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
87 | | - if (Globals.SAVEONMAKE) |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
88 | 102 | Save(); |
---|
89 | | - boolean keep = Globals.SAVEONMAKE; |
---|
90 | | - Globals.SAVEONMAKE = false; |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
91 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
92 | 106 | //Object3D obj; |
---|
93 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
98 | 112 | |
---|
99 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
100 | 114 | } |
---|
101 | | - Globals.SAVEONMAKE = keep; |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
102 | 116 | } |
---|
103 | 117 | |
---|
104 | 118 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
194 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
195 | 209 | // pasteExpandItem.addActionListener(this); |
---|
196 | 210 | menu.add("-"); |
---|
197 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
198 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
199 | 213 | |
---|
200 | 214 | if (Globals.ADVANCED) |
---|
201 | 215 | { |
---|
.. | .. |
---|
421 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
422 | 436 | if (Globals.ADVANCED) |
---|
423 | 437 | { |
---|
424 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
425 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
426 | 440 | } |
---|
427 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
514 | 528 | attachBumpItem.addActionListener(this); |
---|
515 | 529 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
516 | 530 | pigmentBumpItem.addActionListener(this); |
---|
| 531 | + //embedTexturesItem |
---|
517 | 532 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
518 | 533 | detachPigmentItem.addActionListener(this); |
---|
519 | 534 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
520 | 535 | detachBumpItem.addActionListener(this); |
---|
| 536 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 537 | + embedTexturesItem.addActionListener(this); |
---|
| 538 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 539 | + deEmbedTexturesItem.addActionListener(this); |
---|
521 | 540 | menu.add("-"); |
---|
522 | 541 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
523 | 542 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
544 | 563 | buildToolsMenu(menu); |
---|
545 | 564 | } |
---|
546 | 565 | |
---|
| 566 | + |
---|
547 | 567 | void SetupUI2(ObjEditor oe) |
---|
548 | 568 | { |
---|
549 | 569 | // June 2019 |
---|
.. | .. |
---|
615 | 635 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
616 | 636 | restoreCameraButton.addActionListener(this); |
---|
617 | 637 | |
---|
| 638 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + saveButton.setToolTipText("New version"); |
---|
| 640 | + saveButton.addActionListener(this); |
---|
| 641 | + |
---|
618 | 642 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
619 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 643 | + undoButton.setToolTipText("Previous version"); |
---|
620 | 644 | undoButton.addActionListener(this); |
---|
621 | 645 | undoButton.setEnabled(false); |
---|
622 | 646 | |
---|
| 647 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 648 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + restoreButton.setToolTipText("Restore current"); |
---|
| 650 | + restoreButton.addActionListener(this); |
---|
| 651 | + restoreButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + replaceButton.setToolTipText("Replace current"); |
---|
| 655 | + replaceButton.addActionListener(this); |
---|
| 656 | + replaceButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + copyOptionsPanel.add(updown); |
---|
| 659 | + |
---|
623 | 660 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 661 | + redoButton.setToolTipText("Next version"); |
---|
625 | 662 | redoButton.addActionListener(this); |
---|
626 | 663 | redoButton.setEnabled(false); |
---|
627 | 664 | |
---|
628 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | | - saveButton.setToolTipText("Save changes"); |
---|
630 | | - saveButton.addActionListener(this); |
---|
631 | | - |
---|
632 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 665 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
633 | 666 | liveCB.setToolTipText("Enable animation"); |
---|
634 | 667 | liveCB.addItemListener(this); |
---|
635 | 668 | |
---|
636 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 670 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
638 | 671 | oneStepButton.addActionListener(this); |
---|
639 | 672 | |
---|
640 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 673 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
641 | 674 | fastCB.setToolTipText("Fast mode"); |
---|
642 | 675 | fastCB.addItemListener(this); |
---|
643 | 676 | |
---|
.. | .. |
---|
655 | 688 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
656 | 689 | snapobjectButton.addActionListener(this); |
---|
657 | 690 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + fourButton.addActionListener(this); |
---|
| 694 | + fourButton.setToolTipText("Show control panel only"); |
---|
658 | 695 | } |
---|
659 | 696 | |
---|
660 | 697 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
661 | 698 | |
---|
662 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
663 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 699 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + twoButton.setToolTipText("Show 3D view only"); |
---|
664 | 701 | twoButton.addActionListener(this); |
---|
665 | 702 | this.fullscreenLayout = twoButton; |
---|
666 | 703 | |
---|
667 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - fourButton.addActionListener(this); |
---|
669 | | - fourButton.setToolTipText("Show left panel only"); |
---|
670 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - sixButton.setToolTipText("2-column layout left"); |
---|
672 | | - sixButton.addActionListener(this); |
---|
673 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
674 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 704 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
675 | 706 | threeButton.addActionListener(this); |
---|
676 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
677 | | - sevenButton.setToolTipText("3-column layout"); |
---|
678 | | - sevenButton.addActionListener(this); |
---|
| 707 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 709 | + sixButton.addActionListener(this); |
---|
| 710 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 712 | +// sevenButton.addActionListener(this); |
---|
679 | 713 | // |
---|
680 | 714 | |
---|
681 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
682 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 715 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 716 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
683 | 717 | rootButton.addActionListener(this); |
---|
684 | 718 | |
---|
685 | 719 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
820 | 854 | |
---|
821 | 855 | oe.treePanel.add(copyOptionsPanel); |
---|
822 | 856 | oe.treePanel.Return(); |
---|
| 857 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 858 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 859 | + sliderPane.preferredHeight = 1; |
---|
823 | 860 | |
---|
824 | 861 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
825 | 862 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
842 | 879 | dgr.addDragGestureListener(this); |
---|
843 | 880 | }catch(Exception e) {} |
---|
844 | 881 | */ |
---|
845 | | - radio.layout = sevenButton; |
---|
| 882 | + radio.layout = sixButton; // sevenButton; |
---|
846 | 883 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
847 | 884 | } |
---|
848 | 885 | |
---|
.. | .. |
---|
945 | 982 | toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
946 | 983 | toggleSwitchCB.addItemListener(this); |
---|
947 | 984 | |
---|
948 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
949 | | - autosaveCB.setToolTipText("On structure change"); |
---|
950 | | - autosaveCB.addItemListener(this); |
---|
| 985 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 986 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 987 | + autokeepCB.addItemListener(this); |
---|
951 | 988 | |
---|
952 | 989 | panel.Return(); |
---|
953 | 990 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
984 | 1021 | } |
---|
985 | 1022 | |
---|
986 | 1023 | radioButton.SetObject(obj); |
---|
987 | | - radioButton.layout = sevenButton; |
---|
| 1024 | + radioButton.layout = sixButton; // sevenButton; |
---|
988 | 1025 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
989 | 1026 | radioButton.addActionListener(this); |
---|
990 | 1027 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1024 | 1061 | |
---|
1025 | 1062 | cCheckBox oeilCB; |
---|
1026 | 1063 | cCheckBox shadowCB; |
---|
1027 | | - cCheckBox autosaveCB; |
---|
| 1064 | + cCheckBox autokeepCB; |
---|
1028 | 1065 | cCheckBox lookAtCB; |
---|
1029 | 1066 | |
---|
1030 | 1067 | // static int COLOR = 1; |
---|
.. | .. |
---|
1136 | 1173 | { |
---|
1137 | 1174 | Globals.FREEZEONMOVE ^= true; |
---|
1138 | 1175 | } |
---|
1139 | | - else if(e.getSource() == autosaveCB) |
---|
| 1176 | + else if(e.getSource() == autokeepCB) |
---|
1140 | 1177 | { |
---|
1141 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1178 | + Globals.REPLACEONMAKE ^= true; |
---|
1142 | 1179 | } |
---|
1143 | 1180 | else if(e.getSource() == lookAtCB) |
---|
1144 | 1181 | { |
---|
.. | .. |
---|
1663 | 1700 | listUI.remove(i); |
---|
1664 | 1701 | } |
---|
1665 | 1702 | } |
---|
| 1703 | + } |
---|
| 1704 | + |
---|
| 1705 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1706 | + { |
---|
| 1707 | + // if (!(elem instanceof Composite)) |
---|
| 1708 | + // newWindow = false; |
---|
| 1709 | + listUI.add(elem); |
---|
| 1710 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1711 | + System.out.println("edit : " + elem); |
---|
| 1712 | + elem.editWindow.refreshContents(true); // ? new |
---|
1666 | 1713 | } |
---|
1667 | 1714 | |
---|
1668 | 1715 | /** |
---|
.. | .. |
---|
2225 | 2272 | } else |
---|
2226 | 2273 | if (source == undoButton) |
---|
2227 | 2274 | { |
---|
2228 | | - if (!Undo()) |
---|
2229 | | - java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2275 | + // Go to previous version |
---|
| 2276 | + //if (!Undo()) |
---|
| 2277 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2278 | + Undo(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == restoreButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Restore current version |
---|
| 2283 | + Restore(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == replaceButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Overwrite current version |
---|
| 2288 | + Replace(); |
---|
2230 | 2289 | } else |
---|
2231 | 2290 | if (source == redoButton) |
---|
2232 | 2291 | { |
---|
| 2292 | + // Go to next version |
---|
2233 | 2293 | Redo(); |
---|
2234 | 2294 | } else |
---|
2235 | 2295 | if (source == saveButton) |
---|
2236 | 2296 | { |
---|
| 2297 | + // Save a new version |
---|
2237 | 2298 | if (!Save(true)) |
---|
2238 | 2299 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2239 | 2300 | } else |
---|
.. | .. |
---|
2615 | 2676 | { |
---|
2616 | 2677 | StepAll(); |
---|
2617 | 2678 | } else |
---|
2618 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2679 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2619 | 2680 | { |
---|
2620 | 2681 | //int indices[] = jList.getSelectedIndices(); |
---|
2621 | 2682 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3097 | 3158 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3098 | 3159 | { |
---|
3099 | 3160 | obj = (Object3D)e.nextElement(); |
---|
3100 | | - obj.SetBumpTexture(null); |
---|
| 3161 | + obj.ResetBumpTexture(); |
---|
3101 | 3162 | } |
---|
3102 | 3163 | |
---|
3103 | 3164 | refreshContents(); |
---|
.. | .. |
---|
3111 | 3172 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3112 | 3173 | } |
---|
3113 | 3174 | |
---|
| 3175 | + refreshContents(); |
---|
| 3176 | + } else |
---|
| 3177 | + if (source == embedTexturesItem) |
---|
| 3178 | + { |
---|
| 3179 | + Object3D obj; |
---|
| 3180 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3181 | + { |
---|
| 3182 | + obj = (Object3D)e.nextElement(); |
---|
| 3183 | + obj.EmbedTextures(true); |
---|
| 3184 | + } |
---|
| 3185 | + |
---|
| 3186 | + refreshContents(); |
---|
| 3187 | + } else |
---|
| 3188 | + if (source == deEmbedTexturesItem) |
---|
| 3189 | + { |
---|
| 3190 | + Object3D obj; |
---|
| 3191 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3192 | + { |
---|
| 3193 | + obj = (Object3D)e.nextElement(); |
---|
| 3194 | + obj.EmbedTextures(false); |
---|
| 3195 | + } |
---|
| 3196 | + |
---|
| 3197 | + CameraPane.texturepigment.clear(); |
---|
| 3198 | + CameraPane.texturebump.clear(); |
---|
| 3199 | + |
---|
3114 | 3200 | refreshContents(); |
---|
3115 | 3201 | } else |
---|
3116 | 3202 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3214 | 3300 | // centralPanel.setVisible(true); |
---|
3215 | 3301 | // XYZPanel.setVisible(true); |
---|
3216 | 3302 | bigThree.ClearUI(); |
---|
| 3303 | + bigThree.add(scenePanel); |
---|
3217 | 3304 | bigThree.add(centralPanel); |
---|
3218 | | - bigThree.add(XYZPanel); |
---|
3219 | 3305 | bigThree.FlushUI(); |
---|
3220 | 3306 | |
---|
3221 | 3307 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3295 | 3381 | // centralPanel.setVisible(true); |
---|
3296 | 3382 | // XYZPanel.setVisible(false); |
---|
3297 | 3383 | bigThree.ClearUI(); |
---|
3298 | | - bigThree.add(scenePanel); |
---|
3299 | 3384 | bigThree.add(centralPanel); |
---|
| 3385 | + bigThree.add(scenePanel); |
---|
3300 | 3386 | bigThree.FlushUI(); |
---|
3301 | 3387 | |
---|
3302 | 3388 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3479 | 3565 | } |
---|
3480 | 3566 | |
---|
3481 | 3567 | copy = group; |
---|
| 3568 | + |
---|
| 3569 | + SetUndoStates(); |
---|
| 3570 | + |
---|
3482 | 3571 | //Globals.theRenderer.object = group; |
---|
3483 | 3572 | if(!useclient) |
---|
3484 | 3573 | { |
---|
.. | .. |
---|
3507 | 3596 | radio.layout.doClick(); |
---|
3508 | 3597 | |
---|
3509 | 3598 | ClearUnpinned(); |
---|
3510 | | - SetPinStates(group.selection.size() > 0); |
---|
3511 | | - if (group.selection.size() == 1) |
---|
| 3599 | + //Grafreed.Assert(group != null); |
---|
| 3600 | + //Grafreed.Assert(group.selection != null); |
---|
| 3601 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3602 | + if (group.selection == null || group.selection.size() == 1) |
---|
3512 | 3603 | EditSelection(false); |
---|
3513 | 3604 | keepparent = group.parent; |
---|
3514 | 3605 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4102 | 4193 | |
---|
4103 | 4194 | try |
---|
4104 | 4195 | { |
---|
4105 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4196 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4106 | 4197 | } |
---|
4107 | 4198 | catch (Exception e) |
---|
4108 | 4199 | { |
---|
.. | .. |
---|
4579 | 4670 | |
---|
4580 | 4671 | void EditSelection(boolean newWindow) |
---|
4581 | 4672 | { |
---|
| 4673 | + if (group.selection == null) |
---|
| 4674 | + { |
---|
| 4675 | + EditElement(group, newWindow); // ? new |
---|
| 4676 | + return; |
---|
| 4677 | + } |
---|
| 4678 | + |
---|
4582 | 4679 | // aConstraints.gridy = 0; |
---|
4583 | 4680 | for (int i=0; i<group.selection.size(); i++) |
---|
4584 | 4681 | { |
---|
.. | .. |
---|
4589 | 4686 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4590 | 4687 | if(elem != group || !newWindow) |
---|
4591 | 4688 | { |
---|
4592 | | - // if (!(elem instanceof Composite)) |
---|
4593 | | - // newWindow = false; |
---|
4594 | | - listUI.add(elem); |
---|
4595 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4596 | | - System.out.println("edit : " + elem); |
---|
4597 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4689 | + EditElement(elem, newWindow); // ? new |
---|
4598 | 4690 | } |
---|
4599 | 4691 | } |
---|
4600 | 4692 | } |
---|
.. | .. |
---|
4738 | 4830 | |
---|
4739 | 4831 | void refreshContents(boolean cp) |
---|
4740 | 4832 | { |
---|
4741 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4833 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4742 | 4834 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4743 | 4835 | { |
---|
4744 | 4836 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
4942 | 5034 | |
---|
4943 | 5035 | void paste(boolean expand) |
---|
4944 | 5036 | { |
---|
4945 | | - if (Globals.SAVEONMAKE) |
---|
| 5037 | + if (Globals.REPLACEONMAKE) |
---|
4946 | 5038 | Save(); |
---|
4947 | | - boolean keep = Globals.SAVEONMAKE; |
---|
4948 | | - Globals.SAVEONMAKE = false; |
---|
| 5039 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5040 | + Globals.REPLACEONMAKE = false; |
---|
4949 | 5041 | // if (GrafreeD.clipboard == null) |
---|
4950 | 5042 | // return; |
---|
4951 | 5043 | boolean first = true; |
---|
.. | .. |
---|
5005 | 5097 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
5006 | 5098 | } |
---|
5007 | 5099 | |
---|
5008 | | - Globals.SAVEONMAKE = keep; |
---|
| 5100 | + Globals.REPLACEONMAKE = keep; |
---|
5009 | 5101 | ResetModel(); |
---|
5010 | 5102 | refreshContents(); |
---|
5011 | 5103 | } |
---|
.. | .. |
---|
5141 | 5233 | |
---|
5142 | 5234 | void group(Object3D csg, boolean grab) |
---|
5143 | 5235 | { |
---|
5144 | | - if (Globals.SAVEONMAKE) |
---|
| 5236 | + if (Globals.REPLACEONMAKE) |
---|
5145 | 5237 | Save(); |
---|
5146 | | - boolean keep = Globals.SAVEONMAKE; |
---|
5147 | | - Globals.SAVEONMAKE = false; |
---|
| 5238 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5239 | + Globals.REPLACEONMAKE = false; |
---|
5148 | 5240 | if (//false) // why?? |
---|
5149 | 5241 | !group.selection.isEmpty()) |
---|
5150 | 5242 | { |
---|
.. | .. |
---|
5258 | 5350 | //node.add(csg); |
---|
5259 | 5351 | //makeSomething(node); |
---|
5260 | 5352 | makeSomething(csg); |
---|
5261 | | - Globals.SAVEONMAKE = keep; |
---|
| 5353 | + Globals.REPLACEONMAKE = keep; |
---|
5262 | 5354 | } |
---|
5263 | 5355 | |
---|
5264 | 5356 | void Ungroup(Object3D g) |
---|
5265 | 5357 | { |
---|
5266 | | - if (Globals.SAVEONMAKE) |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
5267 | 5359 | Save(); |
---|
5268 | | - boolean keep = Globals.SAVEONMAKE; |
---|
5269 | | - Globals.SAVEONMAKE = false; |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
5270 | 5362 | if (g instanceof HiddenObject) |
---|
5271 | 5363 | { |
---|
5272 | 5364 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5283 | 5375 | objEditor.makeSomething(g.get(i), false); |
---|
5284 | 5376 | } |
---|
5285 | 5377 | } |
---|
5286 | | - Globals.SAVEONMAKE = keep; |
---|
| 5378 | + Globals.REPLACEONMAKE = keep; |
---|
5287 | 5379 | } |
---|
5288 | 5380 | |
---|
5289 | 5381 | void ungroup() |
---|
.. | .. |
---|
5647 | 5739 | private MenuItem pasteLinkItem; |
---|
5648 | 5740 | private MenuItem pasteCloneItem; |
---|
5649 | 5741 | private MenuItem pasteExpandItem; |
---|
5650 | | - private MenuItem clearItem; |
---|
| 5742 | + private MenuItem deleteItem; |
---|
5651 | 5743 | private MenuItem clearAllItem; |
---|
5652 | 5744 | private MenuItem genUVItem; |
---|
5653 | 5745 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5731 | 5823 | private MenuItem attachBumpItem; |
---|
5732 | 5824 | private MenuItem detachBumpItem; |
---|
5733 | 5825 | private MenuItem pigmentBumpItem; |
---|
| 5826 | + private MenuItem embedTexturesItem; |
---|
| 5827 | + private MenuItem deEmbedTexturesItem; |
---|
5734 | 5828 | |
---|
5735 | 5829 | private MenuItem particleItem; |
---|
5736 | 5830 | private MenuItem ragdollItem; |
---|