Normand Briere
2019-07-28 a434119e65146fe53d612c28e1ee7af532d1b70a
GroupEditor.java
....@@ -23,6 +23,31 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row3)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF));
32
+ skyboxButton.setToolTipText(s);
33
+ skyboxButton.addActionListener(new ActionListener()
34
+ {
35
+ @Override
36
+ public void actionPerformed(ActionEvent e)
37
+ {
38
+ ChangeSkybox(path);
39
+ }
40
+ });
41
+ }
42
+
43
+ public void ChangeSkybox(String name)
44
+ {
45
+ cameraView.envyoff = false;
46
+ cameraView.skyboxname = name;
47
+ cameraView.skyboxext = "jpg";
48
+ cameraView.repaint();
49
+ }
50
+
2651 //ObjEditor objEditor;
2752 public void closeUI2()
2853 {
....@@ -60,6 +85,12 @@
6085 this.copy = this.group = group;
6186 //selectees = this.group.selectees;
6287
88
+ if (copy.versions == null)
89
+ {
90
+ copy.versions = new byte[100][];
91
+ copy.versionindex = -1;
92
+ }
93
+
6394 if(ui)
6495 SetupUI(objEditor);
6596 }
....@@ -80,10 +111,22 @@
80111 SetupViews(objEditor);
81112
82113 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
114
+
115
+ if (copy.versions == null)
116
+ {
117
+ copy.versions = new byte[100][];
118
+ copy.versionindex = -1;
119
+
120
+ Save(true);
121
+ }
83122 }
84123
85124 void CloneSelection(boolean supports)
86125 {
126
+ if (Globals.REPLACEONMAKE)
127
+ Save();
128
+ boolean keep = Globals.REPLACEONMAKE;
129
+ Globals.REPLACEONMAKE = false;
87130 // Object3D keep = GrafreeD.clipboard;
88131 //Object3D obj;
89132 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +137,7 @@
94137
95138 makeSomething(clone, i==group.selection.size()-1);
96139 }
140
+ Globals.REPLACEONMAKE = keep;
97141 }
98142
99143 void CloneClipboard(boolean supports)
....@@ -189,8 +233,8 @@
189233 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190234 // pasteExpandItem.addActionListener(this);
191235 menu.add("-");
192
- clearItem = menu.add(new MenuItem("Clear"));
193
- clearItem.addActionListener(this);
236
+ deleteItem = menu.add(new MenuItem("Delete"));
237
+ deleteItem.addActionListener(this);
194238
195239 if (Globals.ADVANCED)
196240 {
....@@ -220,7 +264,7 @@
220264 // toggleSwitchItem.addItemListener(this);
221265 // toggleSwitchItem.setState(CameraPane.SWITCH);
222266
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
267
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224268 toggleHandleItem.addItemListener(this);
225269 toggleHandleItem.setState(CameraPane.HANDLES);
226270
....@@ -380,13 +424,14 @@
380424 shadowYItem.addActionListener(this);
381425 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382426 shadowZItem.addActionListener(this);
427
+ attributeItem = menu.add(new MenuItem("Attribute"));
428
+ attributeItem.addActionListener(this);
429
+
383430 if (Globals.ADVANCED)
384431 {
385432 menu.add("-");
386433 linkerItem = menu.add(new MenuItem("Linker"));
387434 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390435 templateItem = menu.add(new MenuItem("Template"));
391436 templateItem.addActionListener(this);
392437 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -415,7 +460,7 @@
415460 genNormalsMESHItem.addActionListener(this);
416461 if (Globals.ADVANCED)
417462 {
418
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
463
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
419464 genNormalsMINEItem.addActionListener(this);
420465 }
421466 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -508,10 +553,15 @@
508553 attachBumpItem.addActionListener(this);
509554 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
510555 pigmentBumpItem.addActionListener(this);
556
+ //embedTexturesItem
511557 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
512558 detachPigmentItem.addActionListener(this);
513559 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
514560 detachBumpItem.addActionListener(this);
561
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
562
+ embedTexturesItem.addActionListener(this);
563
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
564
+ deEmbedTexturesItem.addActionListener(this);
515565 menu.add("-");
516566 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
517567 sortbysizeItem.addActionListener(this);
....@@ -538,6 +588,7 @@
538588 buildToolsMenu(menu);
539589 }
540590
591
+
541592 void SetupUI2(ObjEditor oe)
542593 {
543594 // June 2019
....@@ -590,48 +641,66 @@
590641 //minButton.setToolTipText("Minimize window");
591642 //minButton.addActionListener(this);
592643
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ maxButton.setToolTipText("Maximize window");
648
+ maxButton.addActionListener(this);
649
+ }
596650
597651 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598652 fullButton.setToolTipText("Full-screen window");
599653 fullButton.addActionListener(this);
600654
655
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ screenfitButton.setToolTipText("Screen fit");
657
+ screenfitButton.addActionListener(this);
658
+
601659 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602660 restoreCameraButton.setToolTipText("Restore viewpoint");
603661 restoreCameraButton.addActionListener(this);
604662
663
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ saveButton.setToolTipText("New version");
665
+ saveButton.addActionListener(this);
666
+
605667 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
668
+ undoButton.setToolTipText("Previous version");
607669 undoButton.addActionListener(this);
670
+ undoButton.setEnabled(false);
671
+
672
+ cGridBag updown = new cGridBag().setVertical(true);
673
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ restoreButton.setToolTipText("Restore current");
675
+ restoreButton.addActionListener(this);
676
+ restoreButton.setEnabled(false);
677
+
678
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ replaceButton.setToolTipText("Replace current");
680
+ replaceButton.addActionListener(this);
681
+ replaceButton.setEnabled(false);
682
+
683
+ copyOptionsPanel.add(updown);
608684
609685 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
- redoButton.setToolTipText("Redo changes");
686
+ redoButton.setToolTipText("Next version");
611687 redoButton.addActionListener(this);
688
+ redoButton.setEnabled(false);
612689
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);
690
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618691 liveCB.setToolTipText("Enable animation");
619692 liveCB.addItemListener(this);
620693
621
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622695 oneStepButton.setToolTipText("Animate one step forward");
623696 oneStepButton.addActionListener(this);
624697
625
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
698
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626699 fastCB.setToolTipText("Fast mode");
627700 fastCB.addItemListener(this);
628701
629702 //oe.toolboxPanel.Return();
630703
631
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
- screenfitButton.setToolTipText("Screen fit");
633
- screenfitButton.addActionListener(this);
634
-
635704 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636705 // trackCB.setToolTipText("Enable tracking");
637706 // trackCB.addItemListener(this);
....@@ -644,31 +713,32 @@
644713 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645714 snapobjectButton.addActionListener(this);
646715 snapobjectButton.setToolTipText("Snap Object");
716
+
717
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
718
+ fourButton.addActionListener(this);
719
+ fourButton.setToolTipText("Show control panel only");
647720 }
648721
649722 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
650723
651
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- twoButton.setToolTipText("Show center view only");
724
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ twoButton.setToolTipText("Show 3D view only");
653726 twoButton.addActionListener(this);
654727 this.fullscreenLayout = twoButton;
655728
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");
729
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ threeButton.setToolTipText("Show controls and 3D view");
664731 threeButton.addActionListener(this);
665
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
- sevenButton.setToolTipText("3-column layout");
667
- sevenButton.addActionListener(this);
732
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ sixButton.setToolTipText("Show 3D view and controls");
734
+ sixButton.addActionListener(this);
735
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+// sevenButton.setToolTipText("3-column layout");
737
+// sevenButton.addActionListener(this);
668738 //
669739
670
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- rootButton.setToolTipText("Edit selection in new tab");
740
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ rootButton.setToolTipText("Open selection in new tab");
672742 rootButton.addActionListener(this);
673743
674744 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -677,28 +747,30 @@
677747 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
678748 //clearButton.addActionListener(this);
679749
750
+ cGridBag row1 = new cGridBag();
751
+
680752 // INSERT
681
- oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682754 gridButton.setToolTipText("Create grid");
683755 gridButton.addActionListener(this);
684756
685
- oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
757
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686758 boxButton.setToolTipText("Create box");
687759 boxButton.addActionListener(this);
688760
689
- oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
761
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690762 sphereButton.setToolTipText("Create sphere");
691763 sphereButton.addActionListener(this);
692764
693
- oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694766 coneButton.setToolTipText("Create cone");
695767 coneButton.addActionListener(this);
696768
697
- oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698770 torusButton.setToolTipText("Create torus");
699771 torusButton.addActionListener(this);
700772
701
- oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
773
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702774 superButton.setToolTipText("Create superellipsoid");
703775 superButton.addActionListener(this);
704776
....@@ -709,51 +781,157 @@
709781 kleinButton.addActionListener(this);
710782 }
711783
712
- oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
784
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713785 particlesButton.setToolTipText("Create particle system");
714786 particlesButton.addActionListener(this);
715787
716
- oe.toolboxPanel.Return();
788
+ oe.toolboxPanel.add(row1);
717789
718
- oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
790
+ cGridBag row2 = new cGridBag();
791
+
792
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719793 groupButton.setToolTipText("Create group");
720794 groupButton.addActionListener(this);
721795
722
- oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
796
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723797 compositeButton.setToolTipText("Create composite");
724798 compositeButton.addActionListener(this);
725799
726
- oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
- switchButton.setToolTipText("Create switch");
800
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ switchButton.setToolTipText("Create item switcher");
728802 switchButton.addActionListener(this);
729803
730
- oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
804
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731805 loopButton.setToolTipText("Create loop");
732806 loopButton.addActionListener(this);
733807
734
- oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
808
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735809 textureButton.setToolTipText("Create texture");
736810 textureButton.addActionListener(this);
737811
738
- oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
812
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739813 overlayButton.setToolTipText("Create overlay");
740814 overlayButton.addActionListener(this);
741815
742
- oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
816
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743817 lightButton.setToolTipText("Create light");
744818 lightButton.addActionListener(this);
745819
820
+ oe.toolboxPanel.add(row2);
821
+
822
+ // ENVYMAPS
823
+ cGridBag row3 = new cGridBag();
824
+ row3.preferredHeight = 20;
825
+
826
+ AddSkyboxButton("default", "rgb", row3);
827
+ AddSkyboxButton("default", "cornell", row3);
828
+ AddSkyboxButton("default", "uffizi", row3);
829
+ AddSkyboxButton("default", "CloudyHills", row3);
830
+ AddSkyboxButton("default", "skycube", row3);
831
+
832
+ oe.toolboxPanel.add(row3);
833
+
834
+ cGridBag row4 = new cGridBag();
835
+ row4.preferredHeight = 20;
836
+
837
+ AddSkyboxButton("bridge", "Bridge2", row4);
838
+ AddSkyboxButton("urban", "GamlaStan2", row4);
839
+ AddSkyboxButton("urban", "Parliament", row4);
840
+ AddSkyboxButton("urban", "Roundabout", row4);
841
+
842
+ oe.toolboxPanel.add(row4);
843
+
844
+ cGridBag row5 = new cGridBag();
845
+ row5.preferredHeight = 20;
846
+
847
+ AddSkyboxButton("urban", "SaintLazarusChurch", row5);
848
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row5);
849
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row5);
850
+ AddSkyboxButton("urban", "UnionSquare", row5);
851
+
852
+ oe.toolboxPanel.add(row5);
853
+
854
+ cGridBag row6 = new cGridBag();
855
+ row6.preferredHeight = 20;
856
+
857
+ AddSkyboxButton("park", "BerzeliiPark", row6);
858
+ AddSkyboxButton("park", "Buddha", row6);
859
+ AddSkyboxButton("park", "CNTower2", row6);
860
+ //AddSkyboxButton("park", "Fatbursparken", row6);
861
+ AddSkyboxButton("park", "NiagaraFalls1", row6);
862
+
863
+ oe.toolboxPanel.add(row6);
864
+
865
+ cGridBag row7 = new cGridBag();
866
+ row7.preferredHeight = 20;
867
+
868
+ AddSkyboxButton("park", "NiagaraFalls3", row7);
869
+ AddSkyboxButton("park", "Park", row7);
870
+ //AddSkyboxButton("park", "Park2", row6);
871
+ //AddSkyboxButton("park", "Path", row6);
872
+ AddSkyboxButton("park", "Pond", row7);
873
+ AddSkyboxButton("park", "Skansen", row7);
874
+
875
+ oe.toolboxPanel.add(row7);
876
+
877
+ cGridBag row8 = new cGridBag();
878
+ row8.preferredHeight = 20;
879
+
880
+ AddSkyboxButton("park", "Skansen2", row8);
881
+ AddSkyboxButton("park", "Skansen3", row8);
882
+ AddSkyboxButton("park", "Skansen4", row8);
883
+ AddSkyboxButton("park", "Skansen5", row8);
884
+
885
+ oe.toolboxPanel.add(row8);
886
+
887
+ cGridBag row9 = new cGridBag();
888
+ row9.preferredHeight = 20;
889
+
890
+ AddSkyboxButton("park", "Stairs", row9);
891
+ //AddSkyboxButton("park", "Tantolunden", row6);
892
+ //AddSkyboxButton("park", "Tantolunden3", row6);
893
+ AddSkyboxButton("park", "Tantolunden4", row9);
894
+
895
+ oe.toolboxPanel.add(row9);
896
+/*
897
+BerzeliiPark
898
+Buddha
899
+CNTower2
900
+Fatbursparken
901
+NiagaraFalls1
902
+NiagaraFalls3
903
+Park
904
+Park2
905
+Path
906
+Pond
907
+Skansen
908
+Skansen2
909
+Skansen3
910
+Skansen4
911
+Skansen5
912
+Stairs
913
+Tantolunden
914
+Tantolunden3
915
+Tantolunden4
916
+ */
917
+
918
+ for (int i=1; --i>=0;)
919
+ {
920
+ //oe.toolboxPanel.Return();
921
+ oe.toolboxPanel.add(new cGridBag());
922
+ }
923
+
746924 // EDIT panel
747
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
- editButton.setToolTipText("Edit selection");
925
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
926
+ editButton.setToolTipText("Pin selection controls");
749927 editButton.addActionListener(this);
750928
751
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
- uneditButton.setToolTipText("Unedit selection");
929
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
930
+ uneditButton.setToolTipText("Remove selection controls");
753931 uneditButton.addActionListener(this);
754932
755933 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
- allParamsButton.setToolTipText("Edit all params");
934
+ allParamsButton.setToolTipText("Show all controle");
757935 allParamsButton.addActionListener(this);
758936
759937 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -770,6 +948,7 @@
770948
771949 editCommandsPanel.preferredHeight = 1;
772950
951
+ SetPinStates(false);
773952 // oe.treePanel.add(commandsPanel);
774953 // oe.treePanel.Return();
775954
....@@ -796,9 +975,12 @@
796975
797976 oe.treePanel.add(copyOptionsPanel);
798977 oe.treePanel.Return();
978
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
979
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
980
+ sliderPane.preferredHeight = 1;
799981
800
-// mainPanel.setDividerLocation(0.5); //1.0);
801
-// mainPanel.setResizeWeight(0.5);
982
+// mainPanel.setDividerLocation(0.1); //1.0);
983
+ mainPanel.setResizeWeight(0.4);
802984
803985 //jList.addListSelectionListener(this);
804986 oe.jTree.addTreeSelectionListener(this);
....@@ -806,7 +988,7 @@
806988 //jTree.setEditable(true);
807989 oe.jTree.setDragEnabled(true);
808990 //jTree.setPreferredSize(new Dimension(10,10));
809
- jSP.setPreferredSize(new Dimension(100,200));
991
+ //jSP.setPreferredSize(new Dimension(100,200));
810992
811993 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
812994
....@@ -818,7 +1000,7 @@
8181000 dgr.addDragGestureListener(this);
8191001 }catch(Exception e) {}
8201002 */
821
- radio.layout = sevenButton;
1003
+ radio.layout = sixButton; // sevenButton;
8221004 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
8231005 }
8241006
....@@ -843,14 +1025,18 @@
8431025 boxCB.addItemListener(this);
8441026
8451027 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
846
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1028
+ zoomBoxCB.setToolTipText("Display only for wheel");
8471029 zoomBoxCB.addItemListener(this);
8481030
8491031 if (true) // Globals.ADVANCED)
8501032 {
851
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
- supportCB.setToolTipText("Enable rigging");
853
- supportCB.addItemListener(this);
1033
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1034
+// supportCB.setToolTipText("Enable rigging");
1035
+// supportCB.addItemListener(this);
1036
+
1037
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1038
+ freezeCB.setToolTipText("Fast moving camera");
1039
+ freezeCB.addItemListener(this);
8541040
8551041 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
8561042 // localCB.addItemListener(this);
....@@ -905,7 +1091,7 @@
9051091 oeilCB.addItemListener(this);
9061092
9071093 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
- shadowCB.setToolTipText("Compute shadows when live");
1094
+ shadowCB.setToolTipText("When live compute shadows");
9091095 shadowCB.addItemListener(this);
9101096
9111097 panel.Return();
....@@ -914,12 +1100,12 @@
9141100 toggleTextureCB.addItemListener(this);
9151101
9161102 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
- toggleSwitchCB.setToolTipText("Use switch");
1103
+ toggleSwitchCB.setToolTipText("Choose a single item");
9181104 toggleSwitchCB.addItemListener(this);
9191105
920
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
- autosaveCB.setToolTipText("Auto-save on structure change");
922
- autosaveCB.addItemListener(this);
1106
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1107
+ autokeepCB.setToolTipText("On structure change");
1108
+ autokeepCB.addItemListener(this);
9231109
9241110 panel.Return();
9251111 if (Globals.ADVANCED)
....@@ -948,7 +1134,7 @@
9481134 {
9491135 cRadio radioButton = new cRadio(obj.name);
9501136
951
- // Patch to avoid bug with transparency.
1137
+ // June 2019. Patch to avoid bug with transparency.
9521138 radioButton.hadMaterial = obj.material != null;
9531139 if (!radioButton.hadMaterial)
9541140 {
....@@ -956,7 +1142,7 @@
9561142 }
9571143
9581144 radioButton.SetObject(obj);
959
- radioButton.layout = sevenButton;
1145
+ radioButton.layout = sixButton; // sevenButton;
9601146 radioButton.SetCamera(cameraView.renderCamera, false);
9611147 radioButton.addActionListener(this);
9621148 radioPanel.add(radioButton);
....@@ -985,6 +1171,7 @@
9851171 cCheckBox slowCB;
9861172 cCheckBox boxCB;
9871173 cCheckBox zoomBoxCB;
1174
+ cCheckBox freezeCB;
9881175 //cToggleButton trackCB;
9891176 cCheckBox trackCB;
9901177 cCheckBox smoothfocusCB;
....@@ -995,7 +1182,7 @@
9951182
9961183 cCheckBox oeilCB;
9971184 cCheckBox shadowCB;
998
- cCheckBox autosaveCB;
1185
+ cCheckBox autokeepCB;
9991186 cCheckBox lookAtCB;
10001187
10011188 // static int COLOR = 1;
....@@ -1103,9 +1290,13 @@
11031290 {
11041291 Globals.COMPUTESHADOWWHENLIVE ^= true;
11051292 }
1106
- else if(e.getSource() == autosaveCB)
1293
+ else if(e.getSource() == freezeCB)
11071294 {
1108
- Globals.SAVEONMAKE ^= true;
1295
+ Globals.FREEZEONMOVE ^= true;
1296
+ }
1297
+ else if(e.getSource() == autokeepCB)
1298
+ {
1299
+ Globals.REPLACEONMAKE ^= true;
11091300 }
11101301 else if(e.getSource() == lookAtCB)
11111302 {
....@@ -1187,8 +1378,6 @@
11871378 }
11881379 }
11891380
1190
- String string = (String) object;
1191
-
11921381 System.out.println("Transfer = " + object + "; drop : " + target);
11931382 // if( object instanceof java.io.File[])
11941383 // {
....@@ -1196,6 +1385,8 @@
11961385 // objEditor.DropFile((java.io.File[]) object, true);
11971386 // return;
11981387 // }
1388
+
1389
+ String string = object.toString();
11991390
12001391 // File path for Mac and Windows
12011392 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1445,6 +1636,9 @@
14451636 animationItem.addItemListener(this);
14461637 animationItem.setState(Globals.ANIMATION);
14471638
1639
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1640
+ archiveItem.addActionListener(this);
1641
+
14481642 menu.add("-");
14491643 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14501644 parseverticesItem.addActionListener(this);
....@@ -1457,6 +1651,8 @@
14571651 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14581652 reduce34MorphItem.addActionListener(this);
14591653 menu.add("-");
1654
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1655
+ memoryItem.addActionListener(this);
14601656 menu.add(computeAOItem = new MenuItem("Compute AO"));
14611657 computeAOItem.addActionListener(this);
14621658
....@@ -1465,8 +1661,6 @@
14651661 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14661662 mirrorItem.addActionListener(this);
14671663 menu.add("-");
1468
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1469
- memoryItem.addActionListener(this);
14701664 menu.add(analyzeItem = new MenuItem("Analyze"));
14711665 analyzeItem.addActionListener(this);
14721666 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1614,6 +1808,30 @@
16141808
16151809 makeSomething(shadow);
16161810 }
1811
+
1812
+ private void ClearUnpinned()
1813
+ {
1814
+ //for (Object3D obj : listUI)
1815
+ for (int i=listUI.size(); --i>=0;)
1816
+ {
1817
+ Object3D obj = listUI.elementAt(i);
1818
+ if (!obj.pinned)
1819
+ {
1820
+ obj.CloseUI();
1821
+ listUI.remove(i);
1822
+ }
1823
+ }
1824
+ }
1825
+
1826
+ private void EditElement(Object3D elem, boolean newWindow)
1827
+ {
1828
+ // if (!(elem instanceof Composite))
1829
+ // newWindow = false;
1830
+ listUI.add(elem);
1831
+ elem.openEditWindow(this, newWindow); //, false);
1832
+ System.out.println("edit : " + elem);
1833
+ elem.editWindow.refreshContents(true); // ? new
1834
+ }
16171835
16181836 /**
16191837 * applyExample
....@@ -2042,6 +2260,23 @@
20422260 {
20432261 makeSomething(new Light());
20442262 } else
2263
+// if (source == skybox1Button ||
2264
+// source == skybox2Button ||
2265
+// source == skybox3Button ||
2266
+// source == skybox4Button ||
2267
+// source == skybox5Button ||
2268
+// source == skybox6Button ||
2269
+// source == skybox7Button ||
2270
+// source == skybox11Button ||
2271
+// source == skybox12Button ||
2272
+// source == skybox13Button ||
2273
+// source == skybox14Button ||
2274
+// source == skybox15Button ||
2275
+// source == skybox16Button ||
2276
+// source == skybox17Button)
2277
+// {
2278
+// ChangeSkybox(source);
2279
+// } else
20452280 if (source == csgItem)
20462281 {
20472282 group(new CSG());
....@@ -2093,25 +2328,25 @@
20932328 Composite csg = new GroupLeaf();
20942329 csg.count = 5;
20952330 group(csg);
2096
- Composite child = new cGroup();
2331
+ Composite child = new cGroup("Branch");
20972332 csg.addChild(child);
20982333 child.addChild(csg);
20992334 } else
21002335 if (source == doubleItem)
21012336 {
2102
- Composite csg = new GroupLeaf();
2337
+ Composite csg = new GroupLeaf("Fork");
21032338 csg.count = 5;
21042339 group(csg);
2105
- Composite child = new cGroup();
2340
+ Composite child = new cGroup("Branch A");
21062341 csg.addChild(child);
21072342 child.addChild(csg);
2108
- child = new cGroup();
2343
+ child = new cGroup("Branch B");
21092344 csg.addChild(child);
21102345 child.addChild(csg);
21112346 } else
21122347 if (source == tripleItem)
21132348 {
2114
- Composite csg = new GroupLeaf();
2349
+ Composite csg = new GroupLeaf("Trident");
21152350 csg.count = 4;
21162351 group(csg);
21172352 Composite child = new cGroup();
....@@ -2127,7 +2362,7 @@
21272362 if (source == computeAOItem)
21282363 {
21292364 Globals.drawMode = CameraPane.OCCLUSION;
2130
- Globals.theRenderer.repaint();
2365
+ cameraView.repaint();
21312366 } else
21322367 if (source == recompileItem)
21332368 {
....@@ -2175,15 +2410,31 @@
21752410 } else
21762411 if (source == undoButton)
21772412 {
2413
+ // Go to previous version
2414
+ //if (!Undo())
2415
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21782416 Undo();
2417
+ } else
2418
+ if (source == restoreButton)
2419
+ {
2420
+ // Restore current version
2421
+ Restore();
2422
+ } else
2423
+ if (source == replaceButton)
2424
+ {
2425
+ // Overwrite current version
2426
+ Replace();
21792427 } else
21802428 if (source == redoButton)
21812429 {
2430
+ // Go to next version
21822431 Redo();
21832432 } else
21842433 if (source == saveButton)
21852434 {
2186
- Save();
2435
+ // Save a new version
2436
+ if (!Save(true))
2437
+ java.awt.Toolkit.getDefaultToolkit().beep();
21872438 } else
21882439 if (source == oneStepButton)
21892440 {
....@@ -2192,17 +2443,14 @@
21922443 } else
21932444 if (source == screenfitButton)
21942445 {
2195
- //Reload(lastConverter, lastFilename, true);
21962446 ScreenFit();
21972447 } else
21982448 if (source == screenfitpointButton)
21992449 {
2200
- //Reload(lastConverter, lastFilename, true);
22012450 ScreenFitPoint();
22022451 } else
22032452 if (source == snapobjectButton)
22042453 {
2205
- //Reload(lastConverter, lastFilename, true);
22062454 SnapObject();
22072455 } else
22082456 // if (event.getSource() == recompileButton)
....@@ -2566,7 +2814,7 @@
25662814 {
25672815 StepAll();
25682816 } else
2569
- if (source == clearItem) // || event.getSource() == clearButton)
2817
+ if (source == deleteItem) // || event.getSource() == clearButton)
25702818 {
25712819 //int indices[] = jList.getSelectedIndices();
25722820 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2726,15 +2974,28 @@
27262974 } else
27272975 if (source == ungroupItem || source == ungroupButton)
27282976 {
2729
- //ungroup();
2977
+ boolean hasRoot = false;
2978
+
27302979 for (int i=0; i<group.selection.size(); i++)
27312980 {
2732
- Ungroup(group.selection.get(i));
2981
+ if (group.selection.get(i) == group)
2982
+ {
2983
+ hasRoot = true;
2984
+ break;
2985
+ }
27332986 }
27342987
2735
- ClearSelection(false);
2736
-
2737
- refreshContents();
2988
+ if (!hasRoot)
2989
+ {
2990
+ for (int i=0; i<group.selection.size(); i++)
2991
+ {
2992
+ Ungroup(group.selection.get(i));
2993
+ }
2994
+
2995
+ ClearSelection(false);
2996
+
2997
+ refreshContents();
2998
+ }
27382999 } else
27393000 if (source == genUVItem)
27403001 {
....@@ -3035,7 +3296,7 @@
30353296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
30363297 {
30373298 obj = (Object3D)e.nextElement();
3038
- obj.SetBumpTexture(null);
3299
+ obj.ResetBumpTexture();
30393300 }
30403301
30413302 refreshContents();
....@@ -3049,6 +3310,31 @@
30493310 obj.SetBumpTexture(obj.GetPigmentTexture());
30503311 }
30513312
3313
+ refreshContents();
3314
+ } else
3315
+ if (source == embedTexturesItem)
3316
+ {
3317
+ Object3D obj;
3318
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3319
+ {
3320
+ obj = (Object3D)e.nextElement();
3321
+ obj.EmbedTextures(true);
3322
+ }
3323
+
3324
+ refreshContents();
3325
+ } else
3326
+ if (source == deEmbedTexturesItem)
3327
+ {
3328
+ Object3D obj;
3329
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3330
+ {
3331
+ obj = (Object3D)e.nextElement();
3332
+ obj.EmbedTextures(false);
3333
+ }
3334
+
3335
+ CameraPane.texturepigment.clear();
3336
+ CameraPane.texturebump.clear();
3337
+
30523338 refreshContents();
30533339 } else
30543340 if (source == flashSelectionButton)
....@@ -3152,8 +3438,8 @@
31523438 // centralPanel.setVisible(true);
31533439 // XYZPanel.setVisible(true);
31543440 bigThree.ClearUI();
3441
+ bigThree.add(scenePanel);
31553442 bigThree.add(centralPanel);
3156
- bigThree.add(XYZPanel);
31573443 bigThree.FlushUI();
31583444
31593445 cameraView.requestFocusInWindow();
....@@ -3233,8 +3519,8 @@
32333519 // centralPanel.setVisible(true);
32343520 // XYZPanel.setVisible(false);
32353521 bigThree.ClearUI();
3236
- bigThree.add(scenePanel);
32373522 bigThree.add(centralPanel);
3523
+ bigThree.add(scenePanel);
32383524 bigThree.FlushUI();
32393525
32403526 cameraView.requestFocusInWindow();
....@@ -3326,6 +3612,12 @@
33263612 } else
33273613 if (source == editItem || source == editButton)
33283614 {
3615
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3616
+ {
3617
+ Object3D child = (Object3D)e.nextElement();
3618
+ child.pinned = true;
3619
+ }
3620
+
33293621 EditSelection(false);
33303622 } else
33313623 if (source == uneditButton)
....@@ -3335,6 +3627,7 @@
33353627 Object3D child = (Object3D)e.nextElement();
33363628 if(child.editWindow != null)
33373629 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3630
+ child.pinned = false;
33383631 child.CloseUI();
33393632 listUI.remove(child);
33403633
....@@ -3351,6 +3644,7 @@
33513644 //copy.ClearUI();
33523645 for (Object3D obj : listUI)
33533646 {
3647
+ obj.pinned = false;
33543648 obj.CloseUI();
33553649 }
33563650 listUI.clear();
....@@ -3360,7 +3654,7 @@
33603654 {
33613655 assert(copy == group);
33623656
3363
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3657
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
33643658
33653659 for (Object3D obj : listUI)
33663660 {
....@@ -3409,6 +3703,9 @@
34093703 }
34103704
34113705 copy = group;
3706
+
3707
+ SetUndoStates();
3708
+
34123709 //Globals.theRenderer.object = group;
34133710 if(!useclient)
34143711 {
....@@ -3435,6 +3732,13 @@
34353732 currentLayout = sevenButton;
34363733 */
34373734 radio.layout.doClick();
3735
+
3736
+ ClearUnpinned();
3737
+ //Grafreed.Assert(group != null);
3738
+ //Grafreed.Assert(group.selection != null);
3739
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3740
+ if (group.selection == null || group.selection.size() == 1)
3741
+ EditSelection(false);
34383742 keepparent = group.parent;
34393743 // PARENT = NULL or not???
34403744 //group.parent = null; // ROOT
....@@ -4027,7 +4331,7 @@
40274331
40284332 try
40294333 {
4030
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4334
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
40314335 }
40324336 catch (Exception e)
40334337 {
....@@ -4502,12 +4806,14 @@
45024806 // }
45034807 // }
45044808
4505
- static boolean allparams = true;
4506
-
4507
- static Vector<Object3D> listUI = new Vector<Object3D>();
4508
-
45094809 void EditSelection(boolean newWindow)
45104810 {
4811
+ if (group.selection == null)
4812
+ {
4813
+ EditElement(group, newWindow); // ? new
4814
+ return;
4815
+ }
4816
+
45114817 // aConstraints.gridy = 0;
45124818 for (int i=0; i<group.selection.size(); i++)
45134819 {
....@@ -4518,12 +4824,7 @@
45184824 Object3D elem = (Object3D)group.selection.elementAt(i);
45194825 if(elem != group || !newWindow)
45204826 {
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
4827
+ EditElement(elem, newWindow); // ? new
45274828 }
45284829 }
45294830 }
....@@ -4598,7 +4899,8 @@
45984899 //new Exception().printStackTrace();
45994900
46004901 freezemodel = true;
4601
-
4902
+ ClearUnpinned();
4903
+
46024904 /**/
46034905 //switch (event.id)
46044906 {
....@@ -4631,7 +4933,7 @@
46314933 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
46324934 // a camera
46334935 {
4634
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4936
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
46354937 {
46364938 CameraPane.camerachangeframe = 0; // don't refuse it
46374939 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4640,6 +4942,13 @@
46404942 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
46414943 }
46424944
4945
+ if (tps != null && tps.length == 1)
4946
+ {
4947
+ EditSelection(false);
4948
+ }
4949
+
4950
+ SetPinStates(tps != null && tps.length > 0);
4951
+
46434952 refreshContents();
46444953 //return true;
46454954 }
....@@ -4649,10 +4958,18 @@
46494958 freezemodel = false;
46504959 }
46514960
4961
+ void SetPinStates(boolean enabled)
4962
+ {
4963
+ editButton.setEnabled(enabled);
4964
+ uneditButton.setEnabled(enabled);
4965
+ unselectButton.setEnabled(enabled);
4966
+ flashSelectionButton.setEnabled(enabled);
4967
+ }
4968
+
46524969 void refreshContents(boolean cp)
46534970 {
4654
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4971
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4972
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46564973 {
46574974 objEditor.ClearInfo(); // .GetMaterial());
46584975
....@@ -4751,8 +5068,8 @@
47515068
47525069 if (cut)
47535070 {
4754
- if (Globals.SAVEONMAKE)
4755
- Save();
5071
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5072
+// Save();
47565073 //int indices[] = jList.getSelectedIndices();
47575074 //for (int i = indices.length - 1; i >= 0; i--)
47585075 //jList.remove(indices[i]);
....@@ -4855,6 +5172,10 @@
48555172
48565173 void paste(boolean expand)
48575174 {
5175
+ if (Globals.REPLACEONMAKE)
5176
+ Save();
5177
+ boolean keep = Globals.REPLACEONMAKE;
5178
+ Globals.REPLACEONMAKE = false;
48585179 // if (GrafreeD.clipboard == null)
48595180 // return;
48605181 boolean first = true;
....@@ -4914,6 +5235,7 @@
49145235 Grafreed.clipboard.get(0).parent = keepparent;
49155236 }
49165237
5238
+ Globals.REPLACEONMAKE = keep;
49175239 ResetModel();
49185240 refreshContents();
49195241 }
....@@ -5049,6 +5371,10 @@
50495371
50505372 void group(Object3D csg, boolean grab)
50515373 {
5374
+ if (Globals.REPLACEONMAKE)
5375
+ Save();
5376
+ boolean keep = Globals.REPLACEONMAKE;
5377
+ Globals.REPLACEONMAKE = false;
50525378 if (//false) // why??
50535379 !group.selection.isEmpty())
50545380 {
....@@ -5162,10 +5488,15 @@
51625488 //node.add(csg);
51635489 //makeSomething(node);
51645490 makeSomething(csg);
5491
+ Globals.REPLACEONMAKE = keep;
51655492 }
51665493
51675494 void Ungroup(Object3D g)
51685495 {
5496
+ if (Globals.REPLACEONMAKE)
5497
+ Save();
5498
+ boolean keep = Globals.REPLACEONMAKE;
5499
+ Globals.REPLACEONMAKE = false;
51695500 if (g instanceof HiddenObject)
51705501 {
51715502 HiddenObject h = (HiddenObject) g;
....@@ -5182,6 +5513,7 @@
51825513 objEditor.makeSomething(g.get(i), false);
51835514 }
51845515 }
5516
+ Globals.REPLACEONMAKE = keep;
51855517 }
51865518
51875519 void ungroup()
....@@ -5472,11 +5804,6 @@
54725804
54735805 cButton restoreCameraButton;
54745806
5475
- cButton minButton;
5476
- cButton maxButton;
5477
- cButton fullButton;
5478
- cButton undoButton;
5479
- cButton redoButton;
54805807 cButton saveButton;
54815808 cButton oneStepButton;
54825809
....@@ -5486,6 +5813,22 @@
54865813 cButton switchButton;
54875814 cButton loopButton;
54885815 cButton textureButton;
5816
+
5817
+ cButton skybox1Button;
5818
+ cButton skybox2Button;
5819
+ cButton skybox3Button;
5820
+ cButton skybox4Button;
5821
+ cButton skybox5Button;
5822
+ cButton skybox6Button;
5823
+ cButton skybox7Button;
5824
+
5825
+ cButton skybox11Button;
5826
+ cButton skybox12Button;
5827
+ cButton skybox13Button;
5828
+ cButton skybox14Button;
5829
+ cButton skybox15Button;
5830
+ cButton skybox16Button;
5831
+ cButton skybox17Button;
54895832
54905833 cButton gridButton;
54915834 cButton boxButton;
....@@ -5550,7 +5893,7 @@
55505893 private MenuItem pasteLinkItem;
55515894 private MenuItem pasteCloneItem;
55525895 private MenuItem pasteExpandItem;
5553
- private MenuItem clearItem;
5896
+ private MenuItem deleteItem;
55545897 private MenuItem clearAllItem;
55555898 private MenuItem genUVItem;
55565899 private MenuItem genNormalsMESHItem;
....@@ -5634,6 +5977,8 @@
56345977 private MenuItem attachBumpItem;
56355978 private MenuItem detachBumpItem;
56365979 private MenuItem pigmentBumpItem;
5980
+ private MenuItem embedTexturesItem;
5981
+ private MenuItem deEmbedTexturesItem;
56375982
56385983 private MenuItem particleItem;
56395984 private MenuItem ragdollItem;