.. | .. |
---|
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 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
189 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 209 | // pasteExpandItem.addActionListener(this); |
---|
191 | 210 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
194 | 213 | |
---|
195 | 214 | if (Globals.ADVANCED) |
---|
196 | 215 | { |
---|
.. | .. |
---|
220 | 239 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 240 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 241 | |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 243 | toggleHandleItem.addItemListener(this); |
---|
225 | 244 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 245 | |
---|
.. | .. |
---|
380 | 399 | shadowYItem.addActionListener(this); |
---|
381 | 400 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 401 | shadowZItem.addActionListener(this); |
---|
| 402 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 403 | + attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
383 | 405 | if (Globals.ADVANCED) |
---|
384 | 406 | { |
---|
385 | 407 | menu.add("-"); |
---|
386 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 409 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 411 | templateItem.addActionListener(this); |
---|
392 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 436 | if (Globals.ADVANCED) |
---|
417 | 437 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 440 | } |
---|
421 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
508 | 528 | attachBumpItem.addActionListener(this); |
---|
509 | 529 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
510 | 530 | pigmentBumpItem.addActionListener(this); |
---|
| 531 | + //embedTexturesItem |
---|
511 | 532 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
512 | 533 | detachPigmentItem.addActionListener(this); |
---|
513 | 534 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
514 | 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); |
---|
515 | 540 | menu.add("-"); |
---|
516 | 541 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
517 | 542 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
538 | 563 | buildToolsMenu(menu); |
---|
539 | 564 | } |
---|
540 | 565 | |
---|
| 566 | + |
---|
541 | 567 | void SetupUI2(ObjEditor oe) |
---|
542 | 568 | { |
---|
543 | 569 | // June 2019 |
---|
.. | .. |
---|
582 | 608 | */ |
---|
583 | 609 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 610 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 611 | + copyOptionsPanel.preferredHeight = 1; |
---|
586 | 612 | |
---|
587 | 613 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 614 | |
---|
.. | .. |
---|
590 | 616 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 617 | //minButton.addActionListener(this); |
---|
592 | 618 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 619 | + if (Globals.ADVANCED) |
---|
| 620 | + { |
---|
| 621 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + maxButton.setToolTipText("Maximize window"); |
---|
| 623 | + maxButton.addActionListener(this); |
---|
| 624 | + } |
---|
596 | 625 | |
---|
597 | 626 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 627 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 628 | fullButton.addActionListener(this); |
---|
600 | 629 | |
---|
| 630 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 631 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 632 | + screenfitButton.addActionListener(this); |
---|
| 633 | + |
---|
601 | 634 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 635 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 636 | restoreCameraButton.addActionListener(this); |
---|
604 | 637 | |
---|
| 638 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + saveButton.setToolTipText("New version"); |
---|
| 640 | + saveButton.addActionListener(this); |
---|
| 641 | + |
---|
605 | 642 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 643 | + undoButton.setToolTipText("Previous version"); |
---|
607 | 644 | undoButton.addActionListener(this); |
---|
| 645 | + undoButton.setEnabled(false); |
---|
| 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); |
---|
608 | 659 | |
---|
609 | 660 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
610 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 661 | + redoButton.setToolTipText("Next version"); |
---|
611 | 662 | redoButton.addActionListener(this); |
---|
| 663 | + redoButton.setEnabled(false); |
---|
612 | 664 | |
---|
613 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
614 | | - saveButton.setToolTipText("Save changes"); |
---|
615 | | - saveButton.addActionListener(this); |
---|
616 | | - |
---|
617 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 665 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
618 | 666 | liveCB.setToolTipText("Enable animation"); |
---|
619 | 667 | liveCB.addItemListener(this); |
---|
620 | 668 | |
---|
621 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
622 | 670 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
623 | 671 | oneStepButton.addActionListener(this); |
---|
624 | 672 | |
---|
625 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 673 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
626 | 674 | fastCB.setToolTipText("Fast mode"); |
---|
627 | 675 | fastCB.addItemListener(this); |
---|
628 | 676 | |
---|
629 | 677 | //oe.toolboxPanel.Return(); |
---|
630 | 678 | |
---|
631 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
632 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
633 | | - screenfitButton.addActionListener(this); |
---|
634 | | - |
---|
635 | 679 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
636 | 680 | // trackCB.setToolTipText("Enable tracking"); |
---|
637 | 681 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
644 | 688 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
645 | 689 | snapobjectButton.addActionListener(this); |
---|
646 | 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"); |
---|
647 | 695 | } |
---|
648 | 696 | |
---|
649 | 697 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
650 | 698 | |
---|
651 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
652 | | - 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"); |
---|
653 | 701 | twoButton.addActionListener(this); |
---|
654 | 702 | this.fullscreenLayout = twoButton; |
---|
655 | 703 | |
---|
656 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | | - fourButton.addActionListener(this); |
---|
658 | | - fourButton.setToolTipText("Show left panel only"); |
---|
659 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
660 | | - sixButton.setToolTipText("2-column layout left"); |
---|
661 | | - sixButton.addActionListener(this); |
---|
662 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
663 | | - 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"); |
---|
664 | 706 | threeButton.addActionListener(this); |
---|
665 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
666 | | - sevenButton.setToolTipText("3-column layout"); |
---|
667 | | - 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); |
---|
668 | 713 | // |
---|
669 | 714 | |
---|
670 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - 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"); |
---|
672 | 717 | rootButton.addActionListener(this); |
---|
673 | 718 | |
---|
674 | 719 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
724 | 769 | compositeButton.addActionListener(this); |
---|
725 | 770 | |
---|
726 | 771 | oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
727 | | - switchButton.setToolTipText("Create switch"); |
---|
| 772 | + switchButton.setToolTipText("Create item switcher"); |
---|
728 | 773 | switchButton.addActionListener(this); |
---|
729 | 774 | |
---|
730 | 775 | oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
743 | 788 | lightButton.setToolTipText("Create light"); |
---|
744 | 789 | lightButton.addActionListener(this); |
---|
745 | 790 | |
---|
| 791 | + for (int i=6; --i>=0;) |
---|
| 792 | + { |
---|
| 793 | + oe.toolboxPanel.Return(); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 797 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 798 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 799 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 800 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 801 | + } |
---|
| 802 | + |
---|
746 | 803 | // EDIT panel |
---|
747 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
748 | | - editButton.setToolTipText("Edit selection"); |
---|
| 804 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + editButton.setToolTipText("Pin selection controls"); |
---|
749 | 806 | editButton.addActionListener(this); |
---|
750 | 807 | |
---|
751 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
752 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 808 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
753 | 810 | uneditButton.addActionListener(this); |
---|
754 | 811 | |
---|
755 | 812 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
756 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 813 | + allParamsButton.setToolTipText("Show all controle"); |
---|
757 | 814 | allParamsButton.addActionListener(this); |
---|
758 | 815 | |
---|
759 | 816 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
770 | 827 | |
---|
771 | 828 | editCommandsPanel.preferredHeight = 1; |
---|
772 | 829 | |
---|
| 830 | + SetPinStates(false); |
---|
773 | 831 | // oe.treePanel.add(commandsPanel); |
---|
774 | 832 | // oe.treePanel.Return(); |
---|
775 | 833 | |
---|
.. | .. |
---|
796 | 854 | |
---|
797 | 855 | oe.treePanel.add(copyOptionsPanel); |
---|
798 | 856 | oe.treePanel.Return(); |
---|
| 857 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 858 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 859 | + sliderPane.preferredHeight = 1; |
---|
799 | 860 | |
---|
800 | 861 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
801 | 862 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
818 | 879 | dgr.addDragGestureListener(this); |
---|
819 | 880 | }catch(Exception e) {} |
---|
820 | 881 | */ |
---|
821 | | - radio.layout = sevenButton; |
---|
| 882 | + radio.layout = sixButton; // sevenButton; |
---|
822 | 883 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
823 | 884 | } |
---|
824 | 885 | |
---|
.. | .. |
---|
843 | 904 | boxCB.addItemListener(this); |
---|
844 | 905 | |
---|
845 | 906 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
846 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 907 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
847 | 908 | zoomBoxCB.addItemListener(this); |
---|
848 | 909 | |
---|
849 | 910 | if (true) // Globals.ADVANCED) |
---|
850 | 911 | { |
---|
851 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
852 | | - supportCB.setToolTipText("Enable rigging"); |
---|
853 | | - supportCB.addItemListener(this); |
---|
| 912 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 913 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 914 | +// supportCB.addItemListener(this); |
---|
| 915 | + |
---|
| 916 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 917 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 918 | + freezeCB.addItemListener(this); |
---|
854 | 919 | |
---|
855 | 920 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
856 | 921 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
905 | 970 | oeilCB.addItemListener(this); |
---|
906 | 971 | |
---|
907 | 972 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
908 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 973 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
909 | 974 | shadowCB.addItemListener(this); |
---|
910 | 975 | |
---|
911 | 976 | panel.Return(); |
---|
.. | .. |
---|
914 | 979 | toggleTextureCB.addItemListener(this); |
---|
915 | 980 | |
---|
916 | 981 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
917 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 982 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
918 | 983 | toggleSwitchCB.addItemListener(this); |
---|
919 | 984 | |
---|
920 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
921 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
922 | | - autosaveCB.addItemListener(this); |
---|
| 985 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 986 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 987 | + autokeepCB.addItemListener(this); |
---|
923 | 988 | |
---|
924 | 989 | panel.Return(); |
---|
925 | 990 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
948 | 1013 | { |
---|
949 | 1014 | cRadio radioButton = new cRadio(obj.name); |
---|
950 | 1015 | |
---|
951 | | - // Patch to avoid bug with transparency. |
---|
| 1016 | + // June 2019. Patch to avoid bug with transparency. |
---|
952 | 1017 | radioButton.hadMaterial = obj.material != null; |
---|
953 | 1018 | if (!radioButton.hadMaterial) |
---|
954 | 1019 | { |
---|
.. | .. |
---|
956 | 1021 | } |
---|
957 | 1022 | |
---|
958 | 1023 | radioButton.SetObject(obj); |
---|
959 | | - radioButton.layout = sevenButton; |
---|
| 1024 | + radioButton.layout = sixButton; // sevenButton; |
---|
960 | 1025 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
961 | 1026 | radioButton.addActionListener(this); |
---|
962 | 1027 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
985 | 1050 | cCheckBox slowCB; |
---|
986 | 1051 | cCheckBox boxCB; |
---|
987 | 1052 | cCheckBox zoomBoxCB; |
---|
| 1053 | + cCheckBox freezeCB; |
---|
988 | 1054 | //cToggleButton trackCB; |
---|
989 | 1055 | cCheckBox trackCB; |
---|
990 | 1056 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
995 | 1061 | |
---|
996 | 1062 | cCheckBox oeilCB; |
---|
997 | 1063 | cCheckBox shadowCB; |
---|
998 | | - cCheckBox autosaveCB; |
---|
| 1064 | + cCheckBox autokeepCB; |
---|
999 | 1065 | cCheckBox lookAtCB; |
---|
1000 | 1066 | |
---|
1001 | 1067 | // static int COLOR = 1; |
---|
.. | .. |
---|
1103 | 1169 | { |
---|
1104 | 1170 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1105 | 1171 | } |
---|
1106 | | - else if(e.getSource() == autosaveCB) |
---|
| 1172 | + else if(e.getSource() == freezeCB) |
---|
1107 | 1173 | { |
---|
1108 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1174 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1175 | + } |
---|
| 1176 | + else if(e.getSource() == autokeepCB) |
---|
| 1177 | + { |
---|
| 1178 | + Globals.REPLACEONMAKE ^= true; |
---|
1109 | 1179 | } |
---|
1110 | 1180 | else if(e.getSource() == lookAtCB) |
---|
1111 | 1181 | { |
---|
.. | .. |
---|
1187 | 1257 | } |
---|
1188 | 1258 | } |
---|
1189 | 1259 | |
---|
1190 | | - String string = (String) object; |
---|
1191 | | - |
---|
1192 | 1260 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1193 | 1261 | // if( object instanceof java.io.File[]) |
---|
1194 | 1262 | // { |
---|
.. | .. |
---|
1196 | 1264 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1197 | 1265 | // return; |
---|
1198 | 1266 | // } |
---|
| 1267 | + |
---|
| 1268 | + String string = object.toString(); |
---|
1199 | 1269 | |
---|
1200 | 1270 | // File path for Mac and Windows |
---|
1201 | 1271 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1445 | 1515 | animationItem.addItemListener(this); |
---|
1446 | 1516 | animationItem.setState(Globals.ANIMATION); |
---|
1447 | 1517 | |
---|
| 1518 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1519 | + archiveItem.addActionListener(this); |
---|
| 1520 | + |
---|
1448 | 1521 | menu.add("-"); |
---|
1449 | 1522 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1450 | 1523 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1457 | 1530 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1458 | 1531 | reduce34MorphItem.addActionListener(this); |
---|
1459 | 1532 | menu.add("-"); |
---|
| 1533 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1534 | + memoryItem.addActionListener(this); |
---|
1460 | 1535 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1461 | 1536 | computeAOItem.addActionListener(this); |
---|
1462 | 1537 | |
---|
.. | .. |
---|
1465 | 1540 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1466 | 1541 | mirrorItem.addActionListener(this); |
---|
1467 | 1542 | menu.add("-"); |
---|
1468 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1469 | | - memoryItem.addActionListener(this); |
---|
1470 | 1543 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1471 | 1544 | analyzeItem.addActionListener(this); |
---|
1472 | 1545 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1614 | 1687 | |
---|
1615 | 1688 | makeSomething(shadow); |
---|
1616 | 1689 | } |
---|
| 1690 | + |
---|
| 1691 | + private void ClearUnpinned() |
---|
| 1692 | + { |
---|
| 1693 | + //for (Object3D obj : listUI) |
---|
| 1694 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1695 | + { |
---|
| 1696 | + Object3D obj = listUI.elementAt(i); |
---|
| 1697 | + if (!obj.pinned) |
---|
| 1698 | + { |
---|
| 1699 | + obj.CloseUI(); |
---|
| 1700 | + listUI.remove(i); |
---|
| 1701 | + } |
---|
| 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 |
---|
| 1713 | + } |
---|
1617 | 1714 | |
---|
1618 | 1715 | /** |
---|
1619 | 1716 | * applyExample |
---|
.. | .. |
---|
2093 | 2190 | Composite csg = new GroupLeaf(); |
---|
2094 | 2191 | csg.count = 5; |
---|
2095 | 2192 | group(csg); |
---|
2096 | | - Composite child = new cGroup(); |
---|
| 2193 | + Composite child = new cGroup("Branch"); |
---|
2097 | 2194 | csg.addChild(child); |
---|
2098 | 2195 | child.addChild(csg); |
---|
2099 | 2196 | } else |
---|
2100 | 2197 | if (source == doubleItem) |
---|
2101 | 2198 | { |
---|
2102 | | - Composite csg = new GroupLeaf(); |
---|
| 2199 | + Composite csg = new GroupLeaf("Fork"); |
---|
2103 | 2200 | csg.count = 5; |
---|
2104 | 2201 | group(csg); |
---|
2105 | | - Composite child = new cGroup(); |
---|
| 2202 | + Composite child = new cGroup("Branch A"); |
---|
2106 | 2203 | csg.addChild(child); |
---|
2107 | 2204 | child.addChild(csg); |
---|
2108 | | - child = new cGroup(); |
---|
| 2205 | + child = new cGroup("Branch B"); |
---|
2109 | 2206 | csg.addChild(child); |
---|
2110 | 2207 | child.addChild(csg); |
---|
2111 | 2208 | } else |
---|
2112 | 2209 | if (source == tripleItem) |
---|
2113 | 2210 | { |
---|
2114 | | - Composite csg = new GroupLeaf(); |
---|
| 2211 | + Composite csg = new GroupLeaf("Trident"); |
---|
2115 | 2212 | csg.count = 4; |
---|
2116 | 2213 | group(csg); |
---|
2117 | 2214 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2175 | 2272 | } else |
---|
2176 | 2273 | if (source == undoButton) |
---|
2177 | 2274 | { |
---|
| 2275 | + // Go to previous version |
---|
| 2276 | + //if (!Undo()) |
---|
| 2277 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2178 | 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(); |
---|
2179 | 2289 | } else |
---|
2180 | 2290 | if (source == redoButton) |
---|
2181 | 2291 | { |
---|
| 2292 | + // Go to next version |
---|
2182 | 2293 | Redo(); |
---|
2183 | 2294 | } else |
---|
2184 | 2295 | if (source == saveButton) |
---|
2185 | 2296 | { |
---|
2186 | | - Save(); |
---|
| 2297 | + // Save a new version |
---|
| 2298 | + if (!Save(true)) |
---|
| 2299 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2187 | 2300 | } else |
---|
2188 | 2301 | if (source == oneStepButton) |
---|
2189 | 2302 | { |
---|
.. | .. |
---|
2192 | 2305 | } else |
---|
2193 | 2306 | if (source == screenfitButton) |
---|
2194 | 2307 | { |
---|
2195 | | - //Reload(lastConverter, lastFilename, true); |
---|
2196 | 2308 | ScreenFit(); |
---|
2197 | 2309 | } else |
---|
2198 | 2310 | if (source == screenfitpointButton) |
---|
2199 | 2311 | { |
---|
2200 | | - //Reload(lastConverter, lastFilename, true); |
---|
2201 | 2312 | ScreenFitPoint(); |
---|
2202 | 2313 | } else |
---|
2203 | 2314 | if (source == snapobjectButton) |
---|
2204 | 2315 | { |
---|
2205 | | - //Reload(lastConverter, lastFilename, true); |
---|
2206 | 2316 | SnapObject(); |
---|
2207 | 2317 | } else |
---|
2208 | 2318 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2566 | 2676 | { |
---|
2567 | 2677 | StepAll(); |
---|
2568 | 2678 | } else |
---|
2569 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2679 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2570 | 2680 | { |
---|
2571 | 2681 | //int indices[] = jList.getSelectedIndices(); |
---|
2572 | 2682 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2726 | 2836 | } else |
---|
2727 | 2837 | if (source == ungroupItem || source == ungroupButton) |
---|
2728 | 2838 | { |
---|
2729 | | - //ungroup(); |
---|
| 2839 | + boolean hasRoot = false; |
---|
| 2840 | + |
---|
2730 | 2841 | for (int i=0; i<group.selection.size(); i++) |
---|
2731 | 2842 | { |
---|
2732 | | - Ungroup(group.selection.get(i)); |
---|
| 2843 | + if (group.selection.get(i) == group) |
---|
| 2844 | + { |
---|
| 2845 | + hasRoot = true; |
---|
| 2846 | + break; |
---|
| 2847 | + } |
---|
2733 | 2848 | } |
---|
2734 | 2849 | |
---|
2735 | | - ClearSelection(false); |
---|
2736 | | - |
---|
2737 | | - refreshContents(); |
---|
| 2850 | + if (!hasRoot) |
---|
| 2851 | + { |
---|
| 2852 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2853 | + { |
---|
| 2854 | + Ungroup(group.selection.get(i)); |
---|
| 2855 | + } |
---|
| 2856 | + |
---|
| 2857 | + ClearSelection(false); |
---|
| 2858 | + |
---|
| 2859 | + refreshContents(); |
---|
| 2860 | + } |
---|
2738 | 2861 | } else |
---|
2739 | 2862 | if (source == genUVItem) |
---|
2740 | 2863 | { |
---|
.. | .. |
---|
3035 | 3158 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3036 | 3159 | { |
---|
3037 | 3160 | obj = (Object3D)e.nextElement(); |
---|
3038 | | - obj.SetBumpTexture(null); |
---|
| 3161 | + obj.ResetBumpTexture(); |
---|
3039 | 3162 | } |
---|
3040 | 3163 | |
---|
3041 | 3164 | refreshContents(); |
---|
.. | .. |
---|
3049 | 3172 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3050 | 3173 | } |
---|
3051 | 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 | + |
---|
3052 | 3200 | refreshContents(); |
---|
3053 | 3201 | } else |
---|
3054 | 3202 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3152 | 3300 | // centralPanel.setVisible(true); |
---|
3153 | 3301 | // XYZPanel.setVisible(true); |
---|
3154 | 3302 | bigThree.ClearUI(); |
---|
| 3303 | + bigThree.add(scenePanel); |
---|
3155 | 3304 | bigThree.add(centralPanel); |
---|
3156 | | - bigThree.add(XYZPanel); |
---|
3157 | 3305 | bigThree.FlushUI(); |
---|
3158 | 3306 | |
---|
3159 | 3307 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3233 | 3381 | // centralPanel.setVisible(true); |
---|
3234 | 3382 | // XYZPanel.setVisible(false); |
---|
3235 | 3383 | bigThree.ClearUI(); |
---|
3236 | | - bigThree.add(scenePanel); |
---|
3237 | 3384 | bigThree.add(centralPanel); |
---|
| 3385 | + bigThree.add(scenePanel); |
---|
3238 | 3386 | bigThree.FlushUI(); |
---|
3239 | 3387 | |
---|
3240 | 3388 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3326 | 3474 | } else |
---|
3327 | 3475 | if (source == editItem || source == editButton) |
---|
3328 | 3476 | { |
---|
| 3477 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3478 | + { |
---|
| 3479 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3480 | + child.pinned = true; |
---|
| 3481 | + } |
---|
| 3482 | + |
---|
3329 | 3483 | EditSelection(false); |
---|
3330 | 3484 | } else |
---|
3331 | 3485 | if (source == uneditButton) |
---|
.. | .. |
---|
3335 | 3489 | Object3D child = (Object3D)e.nextElement(); |
---|
3336 | 3490 | if(child.editWindow != null) |
---|
3337 | 3491 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3492 | + child.pinned = false; |
---|
3338 | 3493 | child.CloseUI(); |
---|
3339 | 3494 | listUI.remove(child); |
---|
3340 | 3495 | |
---|
.. | .. |
---|
3351 | 3506 | //copy.ClearUI(); |
---|
3352 | 3507 | for (Object3D obj : listUI) |
---|
3353 | 3508 | { |
---|
| 3509 | + obj.pinned = false; |
---|
3354 | 3510 | obj.CloseUI(); |
---|
3355 | 3511 | } |
---|
3356 | 3512 | listUI.clear(); |
---|
.. | .. |
---|
3360 | 3516 | { |
---|
3361 | 3517 | assert(copy == group); |
---|
3362 | 3518 | |
---|
3363 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3519 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3364 | 3520 | |
---|
3365 | 3521 | for (Object3D obj : listUI) |
---|
3366 | 3522 | { |
---|
.. | .. |
---|
3409 | 3565 | } |
---|
3410 | 3566 | |
---|
3411 | 3567 | copy = group; |
---|
| 3568 | + |
---|
| 3569 | + SetUndoStates(); |
---|
| 3570 | + |
---|
3412 | 3571 | //Globals.theRenderer.object = group; |
---|
3413 | 3572 | if(!useclient) |
---|
3414 | 3573 | { |
---|
.. | .. |
---|
3435 | 3594 | currentLayout = sevenButton; |
---|
3436 | 3595 | */ |
---|
3437 | 3596 | radio.layout.doClick(); |
---|
| 3597 | + |
---|
| 3598 | + ClearUnpinned(); |
---|
| 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) |
---|
| 3603 | + EditSelection(false); |
---|
3438 | 3604 | keepparent = group.parent; |
---|
3439 | 3605 | // PARENT = NULL or not??? |
---|
3440 | 3606 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
4027 | 4193 | |
---|
4028 | 4194 | try |
---|
4029 | 4195 | { |
---|
4030 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4196 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4031 | 4197 | } |
---|
4032 | 4198 | catch (Exception e) |
---|
4033 | 4199 | { |
---|
.. | .. |
---|
4502 | 4668 | // } |
---|
4503 | 4669 | // } |
---|
4504 | 4670 | |
---|
4505 | | - static boolean allparams = true; |
---|
4506 | | - |
---|
4507 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4508 | | - |
---|
4509 | 4671 | void EditSelection(boolean newWindow) |
---|
4510 | 4672 | { |
---|
| 4673 | + if (group.selection == null) |
---|
| 4674 | + { |
---|
| 4675 | + EditElement(group, newWindow); // ? new |
---|
| 4676 | + return; |
---|
| 4677 | + } |
---|
| 4678 | + |
---|
4511 | 4679 | // aConstraints.gridy = 0; |
---|
4512 | 4680 | for (int i=0; i<group.selection.size(); i++) |
---|
4513 | 4681 | { |
---|
.. | .. |
---|
4518 | 4686 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4519 | 4687 | if(elem != group || !newWindow) |
---|
4520 | 4688 | { |
---|
4521 | | - // if (!(elem instanceof Composite)) |
---|
4522 | | - // newWindow = false; |
---|
4523 | | - listUI.add(elem); |
---|
4524 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4525 | | - System.out.println("edit : " + elem); |
---|
4526 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4689 | + EditElement(elem, newWindow); // ? new |
---|
4527 | 4690 | } |
---|
4528 | 4691 | } |
---|
4529 | 4692 | } |
---|
.. | .. |
---|
4598 | 4761 | //new Exception().printStackTrace(); |
---|
4599 | 4762 | |
---|
4600 | 4763 | freezemodel = true; |
---|
4601 | | - |
---|
| 4764 | + ClearUnpinned(); |
---|
| 4765 | + |
---|
4602 | 4766 | /**/ |
---|
4603 | 4767 | //switch (event.id) |
---|
4604 | 4768 | { |
---|
.. | .. |
---|
4631 | 4795 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4632 | 4796 | // a camera |
---|
4633 | 4797 | { |
---|
4634 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4798 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4635 | 4799 | { |
---|
4636 | 4800 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4637 | 4801 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4640 | 4804 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4641 | 4805 | } |
---|
4642 | 4806 | |
---|
| 4807 | + if (tps != null && tps.length == 1) |
---|
| 4808 | + { |
---|
| 4809 | + EditSelection(false); |
---|
| 4810 | + } |
---|
| 4811 | + |
---|
| 4812 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4813 | + |
---|
4643 | 4814 | refreshContents(); |
---|
4644 | 4815 | //return true; |
---|
4645 | 4816 | } |
---|
.. | .. |
---|
4649 | 4820 | freezemodel = false; |
---|
4650 | 4821 | } |
---|
4651 | 4822 | |
---|
| 4823 | + void SetPinStates(boolean enabled) |
---|
| 4824 | + { |
---|
| 4825 | + editButton.setEnabled(enabled); |
---|
| 4826 | + uneditButton.setEnabled(enabled); |
---|
| 4827 | + unselectButton.setEnabled(enabled); |
---|
| 4828 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4829 | + } |
---|
| 4830 | + |
---|
4652 | 4831 | void refreshContents(boolean cp) |
---|
4653 | 4832 | { |
---|
4654 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4655 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4833 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4834 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4656 | 4835 | { |
---|
4657 | 4836 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4658 | 4837 | |
---|
.. | .. |
---|
4751 | 4930 | |
---|
4752 | 4931 | if (cut) |
---|
4753 | 4932 | { |
---|
4754 | | - if (Globals.SAVEONMAKE) |
---|
4755 | | - Save(); |
---|
| 4933 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4934 | +// Save(); |
---|
4756 | 4935 | //int indices[] = jList.getSelectedIndices(); |
---|
4757 | 4936 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4758 | 4937 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4855 | 5034 | |
---|
4856 | 5035 | void paste(boolean expand) |
---|
4857 | 5036 | { |
---|
| 5037 | + if (Globals.REPLACEONMAKE) |
---|
| 5038 | + Save(); |
---|
| 5039 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5040 | + Globals.REPLACEONMAKE = false; |
---|
4858 | 5041 | // if (GrafreeD.clipboard == null) |
---|
4859 | 5042 | // return; |
---|
4860 | 5043 | boolean first = true; |
---|
.. | .. |
---|
4914 | 5097 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4915 | 5098 | } |
---|
4916 | 5099 | |
---|
| 5100 | + Globals.REPLACEONMAKE = keep; |
---|
4917 | 5101 | ResetModel(); |
---|
4918 | 5102 | refreshContents(); |
---|
4919 | 5103 | } |
---|
.. | .. |
---|
5049 | 5233 | |
---|
5050 | 5234 | void group(Object3D csg, boolean grab) |
---|
5051 | 5235 | { |
---|
| 5236 | + if (Globals.REPLACEONMAKE) |
---|
| 5237 | + Save(); |
---|
| 5238 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5239 | + Globals.REPLACEONMAKE = false; |
---|
5052 | 5240 | if (//false) // why?? |
---|
5053 | 5241 | !group.selection.isEmpty()) |
---|
5054 | 5242 | { |
---|
.. | .. |
---|
5162 | 5350 | //node.add(csg); |
---|
5163 | 5351 | //makeSomething(node); |
---|
5164 | 5352 | makeSomething(csg); |
---|
| 5353 | + Globals.REPLACEONMAKE = keep; |
---|
5165 | 5354 | } |
---|
5166 | 5355 | |
---|
5167 | 5356 | void Ungroup(Object3D g) |
---|
5168 | 5357 | { |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
| 5359 | + Save(); |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
5169 | 5362 | if (g instanceof HiddenObject) |
---|
5170 | 5363 | { |
---|
5171 | 5364 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5182 | 5375 | objEditor.makeSomething(g.get(i), false); |
---|
5183 | 5376 | } |
---|
5184 | 5377 | } |
---|
| 5378 | + Globals.REPLACEONMAKE = keep; |
---|
5185 | 5379 | } |
---|
5186 | 5380 | |
---|
5187 | 5381 | void ungroup() |
---|
.. | .. |
---|
5472 | 5666 | |
---|
5473 | 5667 | cButton restoreCameraButton; |
---|
5474 | 5668 | |
---|
5475 | | - cButton minButton; |
---|
5476 | | - cButton maxButton; |
---|
5477 | | - cButton fullButton; |
---|
5478 | | - cButton undoButton; |
---|
5479 | | - cButton redoButton; |
---|
5480 | 5669 | cButton saveButton; |
---|
5481 | 5670 | cButton oneStepButton; |
---|
5482 | 5671 | |
---|
.. | .. |
---|
5550 | 5739 | private MenuItem pasteLinkItem; |
---|
5551 | 5740 | private MenuItem pasteCloneItem; |
---|
5552 | 5741 | private MenuItem pasteExpandItem; |
---|
5553 | | - private MenuItem clearItem; |
---|
| 5742 | + private MenuItem deleteItem; |
---|
5554 | 5743 | private MenuItem clearAllItem; |
---|
5555 | 5744 | private MenuItem genUVItem; |
---|
5556 | 5745 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5634 | 5823 | private MenuItem attachBumpItem; |
---|
5635 | 5824 | private MenuItem detachBumpItem; |
---|
5636 | 5825 | private MenuItem pigmentBumpItem; |
---|
| 5826 | + private MenuItem embedTexturesItem; |
---|
| 5827 | + private MenuItem deEmbedTexturesItem; |
---|
5637 | 5828 | |
---|
5638 | 5829 | private MenuItem particleItem; |
---|
5639 | 5830 | private MenuItem ragdollItem; |
---|