From 475f8cbdbd96fdbf8f5b216ffebb31a51f25c2f9 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 29 Jul 2019 20:08:48 -0400
Subject: [PATCH] Save skybox.

---
 GroupEditor.java |  414 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 361 insertions(+), 53 deletions(-)

diff --git a/GroupEditor.java b/GroupEditor.java
index 1e0e863..3cb24f8 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -23,6 +23,240 @@
         DragGestureListener, DragSourceListener, DropTargetListener,
         ItemListener // ListSelectionListener
 {
+
+    public void AddSkyboxButton(String f, String s, cGridBag row)
+    {
+        cButton skyboxButton;
+        final String path = "cubemaps/" + f + "-skyboxes/" + s;
+        row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
+        //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
+        skyboxButton.setToolTipText(s);
+        skyboxButton.addActionListener(new ActionListener()
+        {
+                @Override
+                public void actionPerformed(ActionEvent e)
+                {
+                    ChangeSkybox(path);
+                }
+        });
+    }
+
+    public void AddSkyboxTab0(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Urban");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("default", "rgb", row0);
+        //AddSkyboxButton("default", "cornell", row0);
+        AddSkyboxButton("penguins", "dust", row0);
+        AddSkyboxButton("penguins", "tropic", row0);
+        AddSkyboxButton("default", "skycube", row0);
+
+        AddSkyboxButton("default", "uffizi", row1);
+        AddSkyboxButton("bridge", "Bridge", row1);
+        AddSkyboxButton("bridge", "Bridge2", row1);
+        AddSkyboxButton("urban", "GamlaStan2", row1);
+        
+        AddSkyboxButton("urban", "Parliament", row2);
+        AddSkyboxButton("urban", "Roundabout", row2);
+        AddSkyboxButton("urban", "SaintLazarusChurch", row2);
+        AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
+        
+        AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
+        AddSkyboxButton("urban", "UnionSquare", row3);
+        AddSkyboxButton("urban", "Medborgarplatsen", row3);
+        AddSkyboxButton("park", "BerzeliiPark", row3);
+        
+        AddSkyboxButton("park", "Buddha", row4);
+        AddSkyboxButton("park", "CNTower2", row4);
+        AddSkyboxButton("park", "NiagaraFalls1", row4);
+        AddSkyboxButton("park", "NiagaraFalls3", row4);
+        
+        AddSkyboxButton("park", "Park", row5);
+        AddSkyboxButton("park", "Pond", row5);
+        AddSkyboxButton("park", "Skansen", row5);
+        AddSkyboxButton("park", "Skansen2", row5);
+        
+        AddSkyboxButton("park", "Skansen3", row6);
+        AddSkyboxButton("park", "Skansen4", row6);
+        AddSkyboxButton("park", "Skansen5", row6);
+        AddSkyboxButton("park", "Stairs", row6);
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+
+    public void AddSkyboxTab1(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Nature");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("beach", "HeartInTheSand", row0);
+        AddSkyboxButton("beach", "LarnacaBeach", row0);
+        AddSkyboxButton("beach", "PalmTrees", row0);
+        AddSkyboxButton("beach", "Tenerife", row0);
+        
+        AddSkyboxButton("beach", "Tenerife2", row1);
+        AddSkyboxButton("beach", "Tenerife3", row1);
+        AddSkyboxButton("field", "FishPond", row1);
+        AddSkyboxButton("field", "Footballfield", row1);
+
+        AddSkyboxButton("field", "Meadow", row2);
+        AddSkyboxButton("field", "Sorsele", row2);
+        AddSkyboxButton("field", "Sorsele2", row2);
+        AddSkyboxButton("field", "Sorsele3", row2);
+        
+        AddSkyboxButton("forest", "Brudslojan", row3);
+        AddSkyboxButton("forest", "Langholmen2", row3);
+        AddSkyboxButton("forest", "Plants", row3);
+        AddSkyboxButton("mountain", "Maskonaive", row3);
+        
+        AddSkyboxButton("mountain", "Maskonaive2", row4);
+        AddSkyboxButton("mountain", "Maskonaive3", row4);
+        AddSkyboxButton("mountain", "Ryfjallet", row4);
+        AddSkyboxButton("mountain", "Teide", row4);
+        AddSkyboxButton("park", "Tantolunden4", row4);
+        
+        AddSkyboxButton("penguins", "wrath", row5);
+        AddSkyboxButton("penguins", "yonder", row5);
+        AddSkyboxButton("rocky", "Langholmen", row5);
+        AddSkyboxButton("rocky", "Skinnarviksberget", row5);
+        AddSkyboxButton("rocky", "Tantolunden6", row5);
+        
+        AddSkyboxButton("default", "CloudyHills", row6);
+        AddSkyboxButton("daz", "Autumn", row6);
+        AddSkyboxButton("daz", "Greenlands", row6);
+        AddSkyboxButton("daz", "MountainTrail", row6);
+        AddSkyboxButton("daz", "Oasis", row6);
+        /*
+Autumn
+Greenlands
+MountainTrail
+Oasis
+TheRock
+TopOfTheWorld
+Winter
+         */
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+    
+    public void AddSkyboxTab2(JTabbedPane skyboxpanel)
+    {
+        cGridBag tab0 = new cGridBag().setVertical(true);
+        
+        tab0.setName("Night");
+        skyboxpanel.add(tab0);
+
+        cGridBag row0 = new cGridBag();
+        cGridBag row1 = new cGridBag();
+        cGridBag row2 = new cGridBag();
+        cGridBag row3 = new cGridBag();
+        cGridBag row4 = new cGridBag();
+        cGridBag row5 = new cGridBag();
+        cGridBag row6 = new cGridBag();
+        
+        AddSkyboxButton("night", "NightPath", row0);
+        AddSkyboxButton("night", "PondNight", row0);
+        AddSkyboxButton("night", "Powerlines", row0);
+        AddSkyboxButton("night", "SwedishRoyalCastle", row0);
+        
+        AddSkyboxButton("urban", "CNTower", row1);
+        AddSkyboxButton("bridge", "ArstaBridge", row1);
+        AddSkyboxButton("rocky", "Riddarfjarden", row1);
+        AddSkyboxButton("penguins", "sleepyhollow", row1);
+        
+        AddSkyboxButton("penguins", "kenon_star", row2);
+        AddSkyboxButton("indoors", "DallasW", row2);
+        AddSkyboxButton("indoors", "MarriottMadisonWest", row2);
+        AddSkyboxButton("indoors", "Vasa", row2);
+        
+        AddSkyboxButton("winter", "Backyard", row3);
+        AddSkyboxButton("winter", "Creek", row3);
+        AddSkyboxButton("winter", "FootballField3", row3);
+        AddSkyboxButton("winter", "Forest", row3);
+        
+        AddSkyboxButton("winter", "HornstullsStrand2", row4);
+        AddSkyboxButton("winter", "House", row4);
+        AddSkyboxButton("winter", "IceLake", row4);
+        AddSkyboxButton("winter", "IceRiver", row4);
+        
+        AddSkyboxButton("winter", "Park3", row5);
+        AddSkyboxButton("winter", "PondWinter", row5);
+        AddSkyboxButton("winter", "Tantolunden5", row5);
+        AddSkyboxButton("winter", "Vindelalven", row5);
+        
+        AddSkyboxButton("daz", "TheRock", row6);
+        AddSkyboxButton("daz", "TopOfTheWorld", row6);
+        AddSkyboxButton("daz", "Winter", row6);
+        AddSkyboxButton("penguins", "desertdawn", row6);
+        
+        tab0.add(row0);
+        tab0.add(row1);
+        tab0.add(row2);
+        tab0.add(row3);
+        tab0.add(row4);
+        tab0.add(row5);
+        tab0.add(row6);
+        
+        for (int i=5; --i>=0;)
+        {
+            //oe.toolboxPanel.Return();
+            //tab0.add(new cGridBag());
+        }
+    }
+    
+    public void ChangeSkybox(String name)
+    {
+        //cameraView.envyoff = false;
+        group.skyboxname = name;
+        group.skyboxext = "jpg";
+        cameraView.repaint();
+    }
+    
     //ObjEditor objEditor;
 	public void closeUI2()
 	{
@@ -80,18 +314,20 @@
 		this.copy = this.group = copy;
 		//selectees = this.group.selectees;
 		
-        if (copy.versions == null)
-        {
-            copy.versions = new byte[100][];
-            copy.versionindex = -1;
-        }
-        
 		SetupMenu2(this); //objEditor);
 		SetupUI2(objEditor);
 		objEditor.SetupUI(true);
 		SetupViews(objEditor);
                 
                 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
+                
+        if (copy.versions == null)
+        {
+            copy.versions = new byte[100][];
+            copy.versionindex = -1;
+            
+            Save(true);
+        }
 	}
 
     void CloneSelection(boolean supports)
@@ -526,10 +762,15 @@
 		attachBumpItem.addActionListener(this);
 		pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
 		pigmentBumpItem.addActionListener(this);
+                //embedTexturesItem
 		detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
 		detachPigmentItem.addActionListener(this);
 		detachBumpItem = menu.add(new MenuItem("Detach Bump"));
 		detachBumpItem.addActionListener(this);
+		embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
+		embedTexturesItem.addActionListener(this);
+		deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
+		deEmbedTexturesItem.addActionListener(this);
 		menu.add("-");
 		sortbysizeItem = menu.add(new MenuItem("Sort by size"));
 		sortbysizeItem.addActionListener(this);
@@ -601,7 +842,7 @@
          */
                 cGridBag copyOptionsPanel = new cGridBag();
                                         
-                copyOptionsPanel.preferredHeight = 1;
+                copyOptionsPanel.preferredHeight = 2;
                 
                 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
                 
@@ -681,25 +922,25 @@
                         oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                         snapobjectButton.addActionListener(this);
                         snapobjectButton.setToolTipText("Snap Object");
+                        
+		oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+		fourButton.addActionListener(this);
+                fourButton.setToolTipText("Show control panel only");
                 }
 
 		//oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
                 
-		oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-		fourButton.addActionListener(this);
-                fourButton.setToolTipText("Show left panel only");
-                
-		oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                twoButton.setToolTipText("Show right view only");
+		oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                twoButton.setToolTipText("Show 3D view only");
 		twoButton.addActionListener(this);
                 this.fullscreenLayout = twoButton;
                 
-		oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                sixButton.setToolTipText("Show left and right");
+		oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                threeButton.setToolTipText("Show controls and 3D view");
+		threeButton.addActionListener(this);
+		oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                sixButton.setToolTipText("Show 3D view and controls");
 		sixButton.addActionListener(this);
-//		oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-//                threeButton.setToolTipText("2-column layout right");
-//		threeButton.addActionListener(this);
 //		oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
 //                sevenButton.setToolTipText("3-column layout");
 //		sevenButton.addActionListener(this);
@@ -715,28 +956,30 @@
 		//oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
 		//clearButton.addActionListener(this);
 
+                cGridBag row1 = new cGridBag();
+                
                 // INSERT
-                oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 gridButton.setToolTipText("Create grid");
                                 gridButton.addActionListener(this);
 
-                oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 boxButton.setToolTipText("Create box");
                                 boxButton.addActionListener(this);
 
-                oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 sphereButton.setToolTipText("Create sphere");
                                 sphereButton.addActionListener(this);
 
-                oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 coneButton.setToolTipText("Create cone");
                                 coneButton.addActionListener(this);
 
-                oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 torusButton.setToolTipText("Create torus");
                                 torusButton.addActionListener(this);
 
-                oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 superButton.setToolTipText("Create superellipsoid");
                                 superButton.addActionListener(this);
 
@@ -747,51 +990,56 @@
                                     kleinButton.addActionListener(this);
                 }
                 
-                oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 particlesButton.setToolTipText("Create particle system");
                                particlesButton.addActionListener(this);
 
-                oe.toolboxPanel.Return();
+                oe.toolboxPanel.add(row1);
                 
-                oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                cGridBag row2 = new cGridBag();
+                
+                row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 groupButton.setToolTipText("Create group");
                                groupButton.addActionListener(this);
 
-                oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 compositeButton.setToolTipText("Create composite");
                                compositeButton.addActionListener(this);
 
-                oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 switchButton.setToolTipText("Create item switcher");
                                switchButton.addActionListener(this);
 
-                oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 loopButton.setToolTipText("Create loop");
                                loopButton.addActionListener(this);
 
-                oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 textureButton.setToolTipText("Create texture");
                                textureButton.addActionListener(this);
 
-                oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 overlayButton.setToolTipText("Create overlay");
                                overlayButton.addActionListener(this);
 
-                oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 lightButton.setToolTipText("Create light");
                                lightButton.addActionListener(this);
 
-                for (int i=6; --i>=0;)
-                {
-                oe.toolboxPanel.Return();
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                oe.toolboxPanel.add(new cGridBag());
-                }
+                oe.toolboxPanel.add(row2);
+                
+                // ENVYMAPS
+                cGridBag skyboxpane = new cGridBag();
+                skyboxpane.preferredHeight = 100;
+                
+                oe.toolboxPanel.add(skyboxpane);
+                
+                JTabbedPane skyboxpanel = new JTabbedPane();
+                skyboxpane.add(skyboxpanel);
+                
+                AddSkyboxTab0(skyboxpanel);
+                AddSkyboxTab1(skyboxpanel);
+                AddSkyboxTab2(skyboxpanel);
                 
                 // EDIT panel
 		editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
@@ -851,8 +1099,8 @@
             versionSlider = (cNumberSlider)sliderPane.getComponent(1);
             sliderPane.preferredHeight = 1;
                 
-//        mainPanel.setDividerLocation(0.5); //1.0);
-//        mainPanel.setResizeWeight(0.5);
+//        mainPanel.setDividerLocation(0.1); //1.0);
+        mainPanel.setResizeWeight(0.4);
         
 		//jList.addListSelectionListener(this);
 		oe.jTree.addTreeSelectionListener(this);
@@ -860,7 +1108,7 @@
 		//jTree.setEditable(true);
 		oe.jTree.setDragEnabled(true);
 		//jTree.setPreferredSize(new Dimension(10,10));
-		jSP.setPreferredSize(new Dimension(100,200));
+		//jSP.setPreferredSize(new Dimension(100,200));
 		
                 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
                 
@@ -2132,6 +2380,23 @@
 		{
 			makeSomething(new Light());
 		} else
+//		if (source == skybox1Button ||
+//                    source == skybox2Button ||
+//                    source == skybox3Button ||
+//                    source == skybox4Button ||
+//                    source == skybox5Button ||
+//                    source == skybox6Button ||
+//                    source == skybox7Button ||
+//                    source == skybox11Button ||
+//                    source == skybox12Button ||
+//                    source == skybox13Button ||
+//                    source == skybox14Button ||
+//                    source == skybox15Button ||
+//                    source == skybox16Button ||
+//                    source == skybox17Button)
+//		{
+//                    ChangeSkybox(source);
+//		} else
 		if (source == csgItem)
 		{
 			group(new CSG());
@@ -2217,7 +2482,7 @@
 		if (source == computeAOItem)
 		{
                     Globals.drawMode = CameraPane.OCCLUSION;
-                    Globals.theRenderer.repaint();
+                    cameraView.repaint();
 		} else
 		if (source == recompileItem)
 		{
@@ -3151,7 +3416,7 @@
 			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
 			{
 				obj = (Object3D)e.nextElement();
-                                obj.SetBumpTexture(null);
+                                obj.ResetBumpTexture();
 			}
 			
 			refreshContents();
@@ -3165,6 +3430,31 @@
                                 obj.SetBumpTexture(obj.GetPigmentTexture());
 			}
 			
+			refreshContents();
+		} else
+		if (source == embedTexturesItem)
+		{
+			Object3D obj;
+			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
+			{
+				obj = (Object3D)e.nextElement();
+                                obj.EmbedTextures(true);
+			}
+			
+			refreshContents();
+		} else
+		if (source == deEmbedTexturesItem)
+		{
+			Object3D obj;
+			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
+			{
+				obj = (Object3D)e.nextElement();
+                                obj.EmbedTextures(false);
+			}
+			
+                CameraPane.texturepigment.clear();
+                CameraPane.texturebump.clear();
+                
 			refreshContents();
 		} else
 		if (source == flashSelectionButton)
@@ -3268,8 +3558,8 @@
 //                    centralPanel.setVisible(true);
 //                    XYZPanel.setVisible(true);
                     bigThree.ClearUI();
+                    bigThree.add(scenePanel);
                     bigThree.add(centralPanel);
-                    bigThree.add(XYZPanel);
                     bigThree.FlushUI();
                     
                     cameraView.requestFocusInWindow();
@@ -3349,8 +3639,8 @@
 //                    centralPanel.setVisible(true);
 //                    XYZPanel.setVisible(false);
                     bigThree.ClearUI();
-                    bigThree.add(scenePanel);
                     bigThree.add(centralPanel);
+                    bigThree.add(scenePanel);
                     bigThree.FlushUI();
                     
                     cameraView.requestFocusInWindow();
@@ -4161,7 +4451,7 @@
                             
                             try
                             {
-                                texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
+                                texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
                             }
                             catch (Exception e)
                             {
@@ -4798,7 +5088,7 @@
 
         void refreshContents(boolean cp)
         {
-            if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
+            if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
             if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
             {
                 objEditor.ClearInfo(); // .GetMaterial());
@@ -5644,6 +5934,22 @@
         cButton loopButton;
         cButton textureButton;
         
+        cButton skybox1Button;
+        cButton skybox2Button;
+        cButton skybox3Button;
+        cButton skybox4Button;
+        cButton skybox5Button;
+        cButton skybox6Button;
+        cButton skybox7Button;
+        
+        cButton skybox11Button;
+        cButton skybox12Button;
+        cButton skybox13Button;
+        cButton skybox14Button;
+        cButton skybox15Button;
+        cButton skybox16Button;
+        cButton skybox17Button;
+        
         cButton gridButton;
         cButton boxButton;
         cButton sphereButton;
@@ -5791,6 +6097,8 @@
 	private MenuItem attachBumpItem;
 	private MenuItem detachBumpItem;
 	private MenuItem pigmentBumpItem;
+	private MenuItem embedTexturesItem;
+	private MenuItem deEmbedTexturesItem;
 
 	private MenuItem particleItem;
 	private MenuItem ragdollItem;

--
Gitblit v1.6.2