From 21ac57b36a9e3b909853c7d64ac29b7ad72490a3 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Mon, 02 Sep 2019 16:52:19 -0400 Subject: [PATCH] Figure panel. --- GroupEditor.java | 1929 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 1,544 insertions(+), 385 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index 5d4b4bf..ae9ebf2 100644 --- a/GroupEditor.java +++ b/GroupEditor.java @@ -16,6 +16,7 @@ //import buoy.widget.BFileChooser; class GroupEditor extends ObjEditor implements //iParse, //iCallBack, + Grafreed.iResourceCallBack, ObjectUI, Runnable, ActionListener, @@ -23,6 +24,350 @@ 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", !Globals.NIMBUSLAF)); + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); + skyboxButton.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + ChangeSkybox(path); + } + }); + } + + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) + { + cButton textureButton; + final String path = "textures/" + f + "/" + c + "/"; // + t; + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); + textureButton.setToolTipText(c + count); + textureButton.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + ChangeTexture(path + t); + } + }); + } + + 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", "", row0); + //AddSkyboxButton("default", "cornell", row0); + AddSkyboxButton("penguins", "dust", row0); + AddSkyboxButton("penguins", "tropic", row0); + AddSkyboxButton("penguins", "yonder", 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("persson", "VancouverConventionCentre", 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", "Teide", row4); + AddSkyboxButton("park", "Tantolunden4", row4); + + AddSkyboxButton("park", "Stairs", row5); + AddSkyboxButton("default", "skycube", row6); + AddSkyboxButton("rocky", "Langholmen", row5); + AddSkyboxButton("rocky", "Skinnarviksberget", row5); + + AddSkyboxButton("rocky", "Tantolunden6", row5); + AddSkyboxButton("default", "CloudyHills", row6); + AddSkyboxButton("daz", "Autumn", row6); + AddSkyboxButton("daz", "MountainTrail", 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("persson", "corona", row2); + AddSkyboxButton("persson", "spaceskybox", 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("mountain", "Ryfjallet", 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 AddSkyboxTab3(JTabbedPane skyboxpanel) + { + cGridBag tab0 = new cGridBag().setVertical(true); + + tab0.setName("Others"); + 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("mayhem", "afterrain", row0); + AddSkyboxButton("mayhem", "aqua4", row0); + AddSkyboxButton("mayhem", "aqua9", row0); + AddSkyboxButton("mayhem", "flame", row0); + + AddSkyboxButton("mayhem", "h2s", row1); + AddSkyboxButton("mayhem", "prehistoric", row1); + AddSkyboxButton("mayhem", "scorched", row1); + AddSkyboxButton("penguins", "desertdawn", row1); + + AddSkyboxButton("persson", "Citadella", row2); + AddSkyboxButton("persson", "Citadella2", row2); + AddSkyboxButton("persson", "clouds1", row2); + AddSkyboxButton("penguins", "wrath", row2); + + AddSkyboxButton("persson", "FishermansBastion", row3); + AddSkyboxButton("persson", "HeroesSquare", row3); + AddSkyboxButton("indoors", "DallasW", row3); + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); + + AddSkyboxButton("persson", "LancellottiChapel", row4); + AddSkyboxButton("persson", "PereaBeach1", row4); + AddSkyboxButton("persson", "PereaBeach2", row4); + AddSkyboxButton("persson", "redeclipse", row4); + + AddSkyboxButton("daz", "Greenlands", row5); + AddSkyboxButton("daz", "Oasis", row5); + AddSkyboxButton("elyvisions", "arch3", row5); + AddSkyboxButton("elyvisions", "calm_sea", row5); + + AddSkyboxButton("elyvisions", "rainbow", row6); + AddSkyboxButton("elyvisions", "distant_sunset", row6); + AddSkyboxButton("elyvisions", "heaven", row6); + AddSkyboxButton("elyvisions", "hot", 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 skybox) + { + if (skybox.endsWith("/")) + { + group.skyboxname = null; + group.skyboxext = null; + cameraView.repaint(); + } + else + { + //cameraView.envyoff = false; + group.skyboxname = skybox; + group.skyboxext = "jpg"; + cameraView.repaint(); + } + } + + public void CreateSkyboxPanel(cGridBag skyboxPanel) + { + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); + + AddSkyboxTab0(skyboxpane); + AddSkyboxTab1(skyboxpane); + AddSkyboxTab2(skyboxpane); + AddSkyboxTab3(skyboxpane); + + skyboxPanel.add(skyboxpane); + } + + public void ChangeTexture(String texture) + { + for (int i=0; i<group.selection.size(); i++) + { + Object3D obj = group.selection.get(i); + obj.SetPigmentTexture("@" + texture); + } + + refreshContents(); + } + //ObjEditor objEditor; public void closeUI2() { @@ -60,6 +405,16 @@ this.copy = this.group = group; //selectees = this.group.selectees; + assert(false); + +// if (copy.versionlist == null) +// { +// copy.versionlist = new Object3D[100]; +// copy.versionindex = -1; +// +// //Save(true); +// } + if(ui) SetupUI(objEditor); } @@ -80,10 +435,22 @@ SetupViews(objEditor); ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); + +// if (copy.versionlist == null) +// { +// copy.versionlist = new Object3D[100]; +// copy.versionindex = -1; +// +// //Save(true); +// } } void CloneSelection(boolean supports) { + if (Globals.REPLACEONMAKE) + Save(); + boolean keep = Globals.REPLACEONMAKE; + Globals.REPLACEONMAKE = false; // Object3D keep = GrafreeD.clipboard; //Object3D obj; for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) @@ -94,6 +461,7 @@ makeSomething(clone, i==group.selection.size()-1); } + Globals.REPLACEONMAKE = keep; } void CloneClipboard(boolean supports) @@ -150,45 +518,49 @@ void SetupMenu2(GroupEditor oe) { + oe.jTree = new cTree(); + Menu menu; oe.menuBar.add(menu = new Menu("Edit")); //editItem = menu.add(new MenuItem("Edit")); //editItem.addActionListener(this); - undoItem = menu.add(new MenuItem("Undo")); - undoItem.addActionListener(this); - redoItem = menu.add(new MenuItem("Redo")); - redoItem.addActionListener(this); - menu.add("-"); - duplicateItem = menu.add(new MenuItem("Duplicate")); + +// undoItem = menu.add(new MenuItem("Undo")); +// undoItem.addActionListener(this); +// redoItem = menu.add(new MenuItem("Redo")); +// redoItem.addActionListener(this); +// menu.add("-"); + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); duplicateItem.addActionListener(this); - cloneItem = menu.add(new MenuItem("Clone")); + + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); cloneItem.addActionListener(this); - if (Globals.ADVANCED) + //if (Globals.ADVANCED) { cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); cloneSupportItem.addActionListener(this); } + oe.jTree.popup.addSeparator(); menu.add("-"); - cutItem = menu.add(new MenuItem("Cut")); + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); cutItem.addActionListener(this); - copyItem = menu.add(new MenuItem("Copy")); + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); copyItem.addActionListener(this); pasteItem = menu.add(new MenuItem("Paste")); pasteItem.addActionListener(this); - menu.add("-"); - menu.add("-"); - pasteIntoItem = menu.add(new MenuItem("Paste into")); + oe.jTree.popup.addSeparator(); + //menu.add("-"); + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); pasteIntoItem.addActionListener(this); - pasteLinkItem = menu.add(new MenuItem("Paste link")); + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); pasteLinkItem.addActionListener(this); - pasteCloneItem = menu.add(new MenuItem("Paste clone")); + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); pasteCloneItem.addActionListener(this); -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); // pasteExpandItem.addActionListener(this); - menu.add("-"); - clearItem = menu.add(new MenuItem("Clear")); - clearItem.addActionListener(this); + //menu.add("-"); + oe.jTree.popup.addSeparator(); if (Globals.ADVANCED) { @@ -202,23 +574,23 @@ //zBufferItem.addActionListener(this); //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); //normalLensItem.addActionListener(this); - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); - revertCameraItem.addActionListener(this); + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); + restoreCameraItem.addActionListener(this); - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); - toggleFullScreenItem.addItemListener(this); - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); - cameraMenu.add("-"); +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); +// toggleFullScreenItem.addItemListener(this); +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); +// cameraMenu.add("-"); +// +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); +// toggleTextureItem.addItemListener(this); +// toggleTextureItem.setState(CameraPane.textureon); +// +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); +// toggleSwitchItem.addItemListener(this); +// toggleSwitchItem.setState(CameraPane.SWITCH); - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); - toggleTextureItem.addItemListener(this); - toggleTextureItem.setState(CameraPane.textureon); - - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); - toggleSwitchItem.addItemListener(this); - toggleSwitchItem.setState(CameraPane.SWITCH); - - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); toggleHandleItem.addItemListener(this); toggleHandleItem.setState(CameraPane.HANDLES); @@ -245,7 +617,7 @@ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); toggleDebugItem.addItemListener(this); - toggleDebugItem.setState(CameraPane.DEBUG); + toggleDebugItem.setState(Globals.DEBUG); cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); toggleFrustumItem.addItemListener(this); @@ -266,22 +638,20 @@ // animationItem.addItemListener(this); // animationItem.setState(CameraPane.ANIMATION); cameraMenu.add("-"); - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); editCameraItem.addActionListener(this); if (Globals.ADVANCED) { oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); oe.cameraMenu.add("-"); openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); openWindowItem.addActionListener(this); - editLeafItem.addActionListener(this); lookAtItem.addActionListener(this); //lookFromItem.addActinoListener(this); - //switchItem.addActionListener(this); + //switchViewItem.addActionListener(this); } oe.menuBar.add(menu = new Menu("Setting")); @@ -325,22 +695,37 @@ setMasterItem.addActionListener(this); } - oe.menuBar.add(menu = new Menu("Group")); - grabItem = menu.add(new MenuItem("Grab")); - grabItem.addActionListener(this); + oe.menuBar.add(menu = new Menu("Order")); + backItem = menu.add(new MenuItem("Back")); backItem.addActionListener(this); frontItem = menu.add(new MenuItem("Front")); frontItem.addActionListener(this); - compositeItem = menu.add(new MenuItem("Composite")); - compositeItem.addActionListener(this); +// compositeItem = menu.add(new MenuItem("Composite")); +// compositeItem.addActionListener(this); + + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); + grabItem.addActionListener(this); + + if (Globals.ADVANCED) + { hideItem = menu.add(new MenuItem("Hidden Group")); hideItem.addActionListener(this); - ungroupItem = menu.add(new MenuItem("Ungroup")); + } + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); ungroupItem.addActionListener(this); - menu.add("-"); - randomItem = menu.add(new MenuItem("Switch node")); - randomItem.addActionListener(this); + + oe.jTree.popup.addSeparator(); + + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); + deleteItem.addActionListener(this); + +// menu.add("-"); +// +// switchItem = menu.add(new MenuItem("Switch node")); +// switchItem.addActionListener(this); + if (Globals.ADVANCED) + { switchGeoItem = menu.add(new MenuItem("Switch Geometry")); switchGeoItem.addActionListener(this); switchTransfoItem = menu.add(new MenuItem("Switch Transform")); @@ -348,8 +733,6 @@ morphItem = menu.add(new MenuItem("Morph Group")); morphItem.addActionListener(this); - if (Globals.ADVANCED) - { menu.add("-"); physicsItem = menu.add(new MenuItem("Physics")); physicsItem.addActionListener(this); @@ -357,41 +740,47 @@ frameselectorItem.addActionListener(this); scriptNodeItem = menu.add(new MenuItem("Script Node")); scriptNodeItem.addActionListener(this); - cameraItem = menu.add(new MenuItem("Camera")); - cameraItem.addActionListener(this); } oe.menuBar.add(menu = new Menu("Object")); - textureItem = menu.add(new MenuItem("Texture")); - textureItem.addActionListener(this); +// textureItem = menu.add(new MenuItem("Texture")); +// textureItem.addActionListener(this); billboardItem = menu.add(new MenuItem("Billboard")); billboardItem.addActionListener(this); csgItem = menu.add(new MenuItem("CSG")); csgItem.addActionListener(this); - shadowXItem = menu.add(new MenuItem("Shadow X")); + shadowXItem = menu.add(new MenuItem("Shadow Red")); shadowXItem.addActionListener(this); - shadowYItem = menu.add(new MenuItem("Shadow Y")); + shadowYItem = menu.add(new MenuItem("Shadow Green")); shadowYItem.addActionListener(this); - shadowZItem = menu.add(new MenuItem("Shadow Z")); + shadowZItem = menu.add(new MenuItem("Shadow Blue")); shadowZItem.addActionListener(this); + + attributeItem = menu.add(new MenuItem("Attribute")); + attributeItem.addActionListener(this); if (Globals.ADVANCED) { menu.add("-"); linkerItem = menu.add(new MenuItem("Linker")); linkerItem.addActionListener(this); - attributeItem = menu.add(new MenuItem("Attribute")); - attributeItem.addActionListener(this); templateItem = menu.add(new MenuItem("Template")); templateItem.addActionListener(this); pointflowItem = menu.add(new MenuItem("Point Flow")); pointflowItem.addActionListener(this); } menu.add("-"); + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); + textureRatioRItem.addActionListener(this); + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); + textureRatioGItem.addActionListener(this); + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); + textureRatioBItem.addActionListener(this); + menu.add("-"); resetTransformItem = menu.add(new MenuItem("Reset Transform")); resetTransformItem.addActionListener(this); resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); resetCentroidItem.addActionListener(this); - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); resetCentroidXZItem.addActionListener(this); transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); transformGeometryItem.addActionListener(this); @@ -409,7 +798,7 @@ genNormalsMESHItem.addActionListener(this); if (Globals.ADVANCED) { - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); genNormalsMINEItem.addActionListener(this); } stripifyItem = menu.add(new MenuItem("Stripify")); @@ -443,6 +832,8 @@ } oe.menuBar.add(menu = new Menu("Attributes")); + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); + clearVersionsItem.addActionListener(this); clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); clearMaterialsItem.addActionListener(this); resetAllItem = menu.add(new MenuItem("Reset All")); @@ -465,10 +856,18 @@ hideleavesItem.addActionListener(this); showleavesItem = menu.add(new MenuItem("Show Leaves")); showleavesItem.addActionListener(this); - markleavesItem = menu.add(new MenuItem("Mark Leaves")); + markleavesItem = menu.add(new MenuItem("Anim Leaves")); markleavesItem.addActionListener(this); - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); unmarkleavesItem.addActionListener(this); + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); + rewindleavesItem.addActionListener(this); + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); + unrewindleavesItem.addActionListener(this); + randomleavesItem = menu.add(new MenuItem("Random Leaves")); + randomleavesItem.addActionListener(this); + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); + unrandomleavesItem.addActionListener(this); menu.add("-"); flipVItem = menu.add(new MenuItem("Flip V")); flipVItem.addActionListener(this); @@ -494,10 +893,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); @@ -508,6 +912,9 @@ shareGeometriesItem.addActionListener(this); mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); mergeGeometriesItem.addActionListener(this); + menu.add("-"); + editLeafItem = menu.add(new MenuItem("Edit leaf...")); + editLeafItem.addActionListener(this); if (Globals.ADVANCED) { // Pretty much the same as duplicate and clone. @@ -524,16 +931,97 @@ buildToolsMenu(menu); } + JTabbedPane resourcecontainer; + cGridBag currenttab; + //boolean added; // patch for jar + + int totalcount = 0; + + int tabcount = 0; + int colcount = 0; + int rowcount = 0; + int texturecount = 0; + + int columns = 5; + int rows = 7; + + public void ResourceCallBack(String[] path) + { +// for (int i = 0; i < path.length; i++) +// System.out.print(path[i] + "/"); +// System.out.println(); + + if (//rowcount == 0 || + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) + { + currenttab = new cGridBag(); + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); + currenttab.setName(tabname); + //added = false; + resourcecontainer.add(currenttab); + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); + rowcount = 1; + colcount = 0; + texturecount = 0; + } + + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) + { + //if (!added) + { + //added = true; + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); + } + + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); + totalcount++; + + if (++colcount >= columns) + { + colcount = 0; + currenttab.Return(); + + if (rowcount++ >= rows) + { + rowcount = 0; + } + } + } + else + { +// if (!path[path.length-1].equals("icons")) +// resourcecontainer.Return(); + } + } + + void CreateTexturePanel(cGridBag container) + { + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); + container.add(resourcecontainer); + + Grafreed.ParseResources("textures", this); + + // 935. System.out.println("Total = " + totalcount); + } + void SetupUI2(ObjEditor oe) { + // June 2019 + if (oe == null) + { + //super.SetupUI2(this); + //return; + } + + if (copy != group) + { + //super.SetupUI2(this); + } + //new Exception().printStackTrace(); oe.radioPanel = new JPanel(new GridBagLayout()); - oe.aConstraints.weightx = 1; - oe.aConstraints.weighty = 0; - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; - oe.aConstraints.gridwidth = 100; - oe.aConstraints.gridheight = 1; // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); oe.buttonGroup = new ButtonGroup(); @@ -554,97 +1042,268 @@ oe.radioPanel.add(dummyButton); oe.buttonGroup.add(dummyButton); */ + cGridBag versionManagerPanel = new cGridBag(); + + versionManagerPanel.preferredHeight = 4; + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); - liveCB.setToolTipText("Enable animation"); - liveCB.addItemListener(this); + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + //minButton.setToolTipText("Minimize window"); + //minButton.addActionListener(this); + + if (Globals.ADVANCED) + { +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); +// maxButton.setToolTipText("Maximize window"); +// maxButton.addActionListener(this); + } + + cButton gcButton; + +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); +// gcButton.setToolTipText("Garbage collect"); +// gcButton.addActionListener(new ActionListener() +// { +// public void actionPerformed(ActionEvent e) +// { +// System.gc(); +// } +// }); + + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + fullScreenButton.setToolTipText("Full-screen window"); + fullScreenButton.addActionListener(this); + + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + collapseButton.setToolTipText("Collapse toolbar"); + collapseButton.addActionListener(this); + +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); +// maximize3DButton.setToolTipText("Maximize 3D view"); +// maximize3DButton.addActionListener(this); + + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + twoButton.setToolTipText("Show 3D view only"); + twoButton.addActionListener(this); + this.fullscreenLayout = twoButton; + + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + threeButton.setToolTipText("Show controls and 3D view"); + threeButton.addActionListener(this); + if (Globals.ADVANCED) + { + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + sixButton.setToolTipText("Show 3D view and controls"); + sixButton.addActionListener(this); + } +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); +// sevenButton.setToolTipText("3-column layout"); +// sevenButton.addActionListener(this); + // + + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + screenfitButton.setToolTipText("Screen fit"); + screenfitButton.addActionListener(this); - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + restoreCameraButton.setToolTipText("Restore viewpoint"); + restoreCameraButton.addActionListener(this); + + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + saveVersionButton.setToolTipText("Duplicate current version"); + saveVersionButton.addActionListener(this); + + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + deleteVersionButton.setToolTipText("Delete current version"); + deleteVersionButton.addActionListener(this); + deleteVersionButton.setEnabled(false); + + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + previousVersionButton.setToolTipText("Previous version"); + previousVersionButton.addActionListener(this); + previousVersionButton.setEnabled(false); + + cGridBag updown = new cGridBag().setVertical(true); + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + restoreButton.setToolTipText("Undo (restore current version)"); + restoreButton.addActionListener(this); + restoreButton.setEnabled(false); + + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + replaceButton.setToolTipText("Save (replace current version)"); + replaceButton.addActionListener(this); + replaceButton.setEnabled(false); + + versionManagerPanel.add(updown); + + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + nextVersionButton.setToolTipText("Next version"); + nextVersionButton.addActionListener(this); + nextVersionButton.setEnabled(false); + + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); oneStepButton.setToolTipText("Animate one step forward"); oneStepButton.addActionListener(this); - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); + liveCB.setToolTipText("Enable animation"); + liveCB.addItemListener(this); + + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); fastCB.setToolTipText("Fast mode"); fastCB.addItemListener(this); - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); - trackCB.setToolTipText("Enable tracking"); - trackCB.addItemListener(this); - - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - screenfitButton.setToolTipText("Screen fit"); - screenfitButton.addActionListener(this); + //oe.toolboxPanel.Return(); + +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); +// trackCB.setToolTipText("Enable tracking"); +// trackCB.addItemListener(this); // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); // screenfitpointButton.addActionListener(this); if (Globals.ADVANCED) { - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); snapobjectButton.addActionListener(this); snapobjectButton.setToolTipText("Snap Object"); + + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + fourButton.addActionListener(this); + fourButton.setToolTipText("Show control panel only"); } - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - flashSelectionButton.setToolTipText("Show selection"); - flashSelectionButton.addActionListener(this); + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); - - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - twoButton.setToolTipText("Show center view only"); - twoButton.addActionListener(this); - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - fourButton.addActionListener(this); - fourButton.setToolTipText("Show left panel only"); - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - sixButton.setToolTipText("2-column layout left"); - 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); - // - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - rootButton.setToolTipText("Edit selection in new tab"); + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + rootButton.setToolTipText("Open selection in new tab"); rootButton.addActionListener(this); - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); closeButton.setToolTipText("Close tab"); closeButton.addActionListener(this); //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); //clearButton.addActionListener(this); - - cGridBag commandsPanel = new cGridBag(); + + cGridBag row1 = new cGridBag(); - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - editButton.setToolTipText("Edit selection"); + // INSERT + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + gridButton.setToolTipText("Create ground"); + gridButton.addActionListener(this); + + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + boxButton.setToolTipText("Create box"); + boxButton.addActionListener(this); + + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + superButton.setToolTipText("Create superellipsoid"); + superButton.addActionListener(this); + + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + sphereButton.setToolTipText("Create sphere"); + sphereButton.addActionListener(this); + + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + coneButton.setToolTipText("Create cone"); + coneButton.addActionListener(this); + + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + torusButton.setToolTipText("Create torus"); + torusButton.addActionListener(this); + + if (false) //Globals.ADVANCED) + { + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + kleinButton.setToolTipText("Create Klein bottle"); + kleinButton.addActionListener(this); + } + + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + particlesButton.setToolTipText("Create particle system"); + particlesButton.addActionListener(this); + + oe.toolboxPanel.add(row1); + + cGridBag row2 = new cGridBag(); + + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + groupButton.setToolTipText("Create group"); + groupButton.addActionListener(this); + + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + compositeButton.setToolTipText("Create composite"); + compositeButton.addActionListener(this); + + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + switchButton.setToolTipText("Create item switcher"); + switchButton.addActionListener(this); + + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + loopButton.setToolTipText("Create loop"); + loopButton.addActionListener(this); + + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + textureButton.setToolTipText("Create texture"); + textureButton.addActionListener(this); + + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + overlayButton.setToolTipText("Create overlay"); + overlayButton.addActionListener(this); + + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + lightButton.setToolTipText("Create light"); + lightButton.addActionListener(this); + + oe.toolboxPanel.add(row2); + + cGridBag textures = new cGridBag(); + + CreateTexturePanel(textures); + + int tabCount = resourcecontainer.getTabCount(); + + if (tabCount > 0) + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); + + oe.toolboxPanel.add(textures); + + textures.preferredHeight = 100; + + CreateSkyboxPanel(oe.skyboxPanel); + + // EDIT panel + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + editButton.setToolTipText("Pin selection controls"); editButton.addActionListener(this); - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - uneditButton.setToolTipText("Unedit selection"); + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + uneditButton.setToolTipText("Unpin and remove selection controls"); uneditButton.addActionListener(this); - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); - allParamsButton.setToolTipText("Edit all params"); + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); + allParamsButton.setToolTipText("Show all controls"); allParamsButton.addActionListener(this); - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - clearPanelButton.setToolTipText("Clear edit panel"); + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + clearPanelButton.setToolTipText("Clear all controls"); clearPanelButton.addActionListener(this); - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); - unselectButton.setToolTipText("Unselect"); - unselectButton.addActionListener(this); + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); + //unselectButton.setToolTipText("Unselect"); + //unselectButton.addActionListener(this); - commandsPanel.preferredHeight = 1; + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); + flashSelectionButton.setToolTipText("Highlight selection"); + flashSelectionButton.addActionListener(this); - oe.treePanel.add(commandsPanel); - oe.treePanel.Return(); + editCommandsPanel.preferredHeight = 1; + + SetPinStates(false); +// oe.treePanel.add(commandsPanel); +// oe.treePanel.Return(); // oe.aConstraints.gridx += 1; // oe.aConstraints.weighty = 0; @@ -659,34 +1318,24 @@ cGridBag jSPPanel = new cGridBag(); + jSPPanel.preferredHeight = 20; + JScrollPane jSP; //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); ResetModel(); oe.treePanel.add(jSPPanel); oe.treePanel.Return(); - cGridBag copyOptionsPanel = new cGridBag(); - - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); - colorCB.setToolTipText("Copy color when dropped"); - colorCB.addItemListener(this); - - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); - materialCB.setToolTipText("Copy material when dropped"); - materialCB.addItemListener(this); - - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); - textureCB.setToolTipText("Copy texture when dropped"); - textureCB.addItemListener(this); - - copyOptionsPanel.preferredHeight = 1; - oe.treePanel.add(copyOptionsPanel); + oe.treePanel.add(versionManagerPanel); oe.treePanel.Return(); + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); + versionSliderPane.preferredHeight = 3; -// 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); @@ -694,7 +1343,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()); @@ -706,29 +1355,49 @@ dgr.addDragGestureListener(this); }catch(Exception e) {} */ - radio.layout = sevenButton; + radio.layout = threeButton; // sixButton; oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); } void AddOptions(cGridBag panel) //, GridBagConstraints constraints) { + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); + colorCB.setToolTipText("Copy color when dropped"); + colorCB.addItemListener(this); + + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); + materialCB.setToolTipText("Copy material when dropped"); + materialCB.addItemListener(this); + + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); + textureCB.setToolTipText("Copy texture when dropped"); + textureCB.addItemListener(this); + + panel.Return(); + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); boxCB.setToolTipText("Display bounding boxes"); boxCB.addItemListener(this); panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); + zoomBoxCB.setToolTipText("Display only for wheel"); zoomBoxCB.addItemListener(this); if (true) // Globals.ADVANCED) { - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); - supportCB.setToolTipText("Enable rigging"); - supportCB.addItemListener(this); +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); +// supportCB.setToolTipText("Enable rigging"); +// supportCB.addItemListener(this); + + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); + freezeCB.setToolTipText("Fast moving camera"); + freezeCB.addItemListener(this); // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); // localCB.addItemListener(this); + panel.Return(); + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); crowdCB.setToolTipText("Used for crowds"); crowdCB.addItemListener(this); @@ -737,14 +1406,19 @@ smoothCB.setToolTipText("Snapping delay"); smoothCB.addItemListener(this); - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); - slowCB.setToolTipText("Smooth interpolation"); - slowCB.addItemListener(this); +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); +// slowCB.setToolTipText("Smooth interpolation"); +// slowCB.addItemListener(this); + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); + minshaderCB.setToolTipText("Minimal fast shader"); + minshaderCB.addItemListener(this); // constraints.gridy += 1; // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); // speakerMocapCB.addItemListener(this); + panel.Return(); + if (false) { // handled in scripts @@ -759,34 +1433,82 @@ //constraints.gridy += 1; panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); smoothfocusCB.addItemListener(this); + panel.Return(); } //constraints.gridx += 1; //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); // debugCB.addItemListener(this); + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); + trackCB.setToolTipText("Enable tracking target"); + trackCB.addItemListener(this); + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); + oeilCB.setToolTipText("Move camera when tracking"); oeilCB.addItemListener(this); + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); + shadowCB.setToolTipText("When live compute shadows"); + shadowCB.addItemListener(this); + + panel.Return(); + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); + toggleTextureCB.setToolTipText("Load textures"); + toggleTextureCB.addItemListener(this); + + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); + toggleSwitchCB.setToolTipText("Choose a single item"); + toggleSwitchCB.addItemListener(this); + + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); + autokeepCB.setToolTipText("On structure change"); + autokeepCB.addItemListener(this); + + panel.Return(); + if (Globals.ADVANCED) + { panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); lookAtCB.setToolTipText("Look-at target"); lookAtCB.addItemListener(this); + } } cGridBag fill = new cGridBag(); - fill.preferredHeight = 200; + cGridBag fill2 = new cGridBag(); + fill2.preferredHeight = 200; + cGridBag fill3 = new cGridBag(); + fill3.preferredHeight = 200; panel.add(fill); + panel.add(fill2); + panel.add(fill3); } void EditObject(Object3D obj) { + //assert(obj instanceof Composite); + +// if (obj.versionlist == null) +// { +// obj.versionlist = new Object3D[100]; +// obj.versionindex = -1; +// } + cRadio radioButton = new cRadio(obj.name); + + // June 2019. Patch to avoid bug with transparency. + radioButton.hadMaterial = obj.material != null; + if (!radioButton.hadMaterial) + { + obj.material = new cMaterial(); + } + radioButton.SetObject(obj); - radioButton.layout = sevenButton; + radioButton.layout = threeButton; // sixButton; radioButton.SetCamera(cameraView.renderCamera, false); radioButton.addActionListener(this); radioPanel.add(radioButton); @@ -796,31 +1518,41 @@ void SetupViews(ObjEditor oe) { + theFrame = this; + oe.SetupViews(); + if (Globals.DEBUG) System.out.println("SetupViews"); DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); } - JCheckBox liveCB; - JCheckBox supportCB; - JCheckBox localCB; - JCheckBox crowdCB; - JCheckBox smoothCB; - JCheckBox fastCB; - JCheckBox slowCB; - JCheckBox boxCB; - JCheckBox zoomBoxCB; - JCheckBox trackCB; - JCheckBox smoothfocusCB; + cToggleButton liveCB; + cCheckBox supportCB; + cCheckBox localCB; + cCheckBox crowdCB; + cCheckBox smoothCB; + cCheckBox minshaderCB; + + cToggleButton fastCB; + cCheckBox slowCB; + cCheckBox boxCB; + cCheckBox zoomBoxCB; + cCheckBox freezeCB; + //cToggleButton trackCB; + cCheckBox trackCB; + cCheckBox smoothfocusCB; // JCheckBox speakerMocapCB; - JCheckBox speakerCameraCB; - JCheckBox speakerFocusCB; - JCheckBox debugCB; - JCheckBox oeilCB; - JCheckBox lookAtCB; + cCheckBox speakerCameraCB; + cCheckBox speakerFocusCB; + cCheckBox debugCB; + + cCheckBox oeilCB; + cCheckBox shadowCB; + cCheckBox autokeepCB; + cCheckBox lookAtCB; // static int COLOR = 1; // static int MATERIAL = 2; @@ -828,9 +1560,9 @@ int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; - JCheckBox colorCB; - JCheckBox materialCB; - JCheckBox textureCB; + cCheckBox colorCB; + cCheckBox materialCB; + cCheckBox textureCB; public void itemStateChanged(ItemEvent e) { @@ -858,6 +1590,7 @@ } else if(e.getSource() == liveCB) { cameraView.ToggleLive(); + refreshContents(false); } else if(e.getSource() == supportCB) { @@ -873,6 +1606,12 @@ { cameraView.ToggleInertia(); cameraView.repaint(); + } + else if(e.getSource() == minshaderCB) + { + Globals.MINSHADER ^= true; + cameraView.programInitialized = false; + cameraView.repaint(); } else if(e.getSource() == localCB) { @@ -922,6 +1661,18 @@ { cameraView.ToggleOeil(); } + else if(e.getSource() == shadowCB) + { + Globals.COMPUTESHADOWWHENLIVE ^= true; + } + else if(e.getSource() == freezeCB) + { + Globals.FREEZEONMOVE ^= true; + } + else if(e.getSource() == autokeepCB) + { + Globals.REPLACEONMAKE ^= true; + } else if(e.getSource() == lookAtCB) { cameraView.ToggleLookAt(); @@ -938,7 +1689,8 @@ /**/ //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); + TreePath path = objEditor.jTree.getSelectionPath(); if ((path == null) || (path.getPathCount() <= 1)) { // We can't move the root node or an empty selection return; @@ -1001,8 +1753,6 @@ } } - String string = (String) object; - System.out.println("Transfer = " + object + "; drop : " + target); // if( object instanceof java.io.File[]) // { @@ -1010,6 +1760,8 @@ // objEditor.DropFile((java.io.File[]) object, true); // return; // } + + String string = object.toString(); // File path for Mac and Windows if (string.charAt(0) == '/' || string.charAt(1) == ':') @@ -1055,23 +1807,33 @@ assert target == objEditor.jTree; TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); + Object3D destinationLeaf; try { - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); } catch (Exception e) { System.out.println("destinationPath : " + destinationPath); return; } - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) + for (int i=group.selection.size(); --i>=0;) { + Object3D child = (Object3D)group.selection.elementAt(i); + + // Cannot move into itself + if (child == destinationLeaf) + return; + } + +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) +// { loadClipboard(true); objEditor.jTree.setSelectionPath(destinationPath); pasteInto(false, false); - } else { - loadClipboard(false); - objEditor.jTree.setSelectionPath(destinationPath); - pasteInto(false, false); // true); // ??? - } +// } else { +// loadClipboard(false); +// objEditor.jTree.setSelectionPath(destinationPath); +// pasteInto(false, false); // true); // ??? +// } } public void dropActionChanged(DropTargetDragEvent dtde) // Called if the user has modified the current drop gesture @@ -1127,7 +1889,12 @@ TreePath path; public TransferableTreePath(TreePath tp) { - path = tp; + Object[] objs = new Object[tp.getPathCount()]; + for (int i=0; i<objs.length; i++) + { + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); + } + path = new TreePath(objs); } public synchronized DataFlavor[] getTransferDataFlavors() { @@ -1176,22 +1943,30 @@ { //heightFieldItem = menu.add(new MenuItem("Height Field")); //heightFieldItem.addActionListener(this); - gridItem = menu.add(new MenuItem("Grid")); - gridItem.addActionListener(this); - rectoidItem = menu.add(new MenuItem("Box")); - rectoidItem.addActionListener(this); - ellipsoidItem = menu.add(new MenuItem("Sphere")); - ellipsoidItem.addActionListener(this); - coneItem = menu.add(new MenuItem("Cone")); - coneItem.addActionListener(this); - torusItem = menu.add(new MenuItem("Torus")); - torusItem.addActionListener(this); - superItem = menu.add(new MenuItem("Superellipsoid")); - superItem.addActionListener(this); +// gridItem = menu.add(new MenuItem("Grid")); +// gridItem.addActionListener(this); +// rectoidItem = menu.add(new MenuItem("Box")); +// rectoidItem.addActionListener(this); +// ellipsoidItem = menu.add(new MenuItem("Sphere")); +// ellipsoidItem.addActionListener(this); +// coneItem = menu.add(new MenuItem("Cone")); +// coneItem.addActionListener(this); +// torusItem = menu.add(new MenuItem("Torus")); +// torusItem.addActionListener(this); +// superItem = menu.add(new MenuItem("Superellipsoid")); +// superItem.addActionListener(this); + + cameraItem = menu.add(new MenuItem("Camera")); + cameraItem.addActionListener(this); + + if (!Globals.ADVANCED) + { kleinItem = menu.add(new MenuItem("Klein Bottle")); kleinItem.addActionListener(this); - particleItem = menu.add(new MenuItem("Particle system")); - particleItem.addActionListener(this); + } + +// particleItem = menu.add(new MenuItem("Particle system")); +// particleItem.addActionListener(this); if (Globals.ADVANCED) { ragdollItem = menu.add(new MenuItem("Rag Walk")); @@ -1217,15 +1992,15 @@ } bezierItem = menu.add(new MenuItem("Bezier Patch")); bezierItem.addActionListener(this); - overlayItem = menu.add(new MenuItem("Overlay")); - overlayItem.addActionListener(this); - lightItem = menu.add(new MenuItem("Light")); - lightItem.addActionListener(this); +// overlayItem = menu.add(new MenuItem("Overlay")); +// overlayItem.addActionListener(this); +// lightItem = menu.add(new MenuItem("Light")); +// lightItem.addActionListener(this); menu.add("-"); //superLoopItem = menu.add(new MenuItem("Super Loop")); //superLoopItem.addActionListener(this); - loopItem = menu.add(new MenuItem("Loop")); - loopItem.addActionListener(this); +// loopItem = menu.add(new MenuItem("Loop")); +// loopItem.addActionListener(this); doubleItem = menu.add(new MenuItem("Fork")); doubleItem.addActionListener(this); if (Globals.ADVANCED) @@ -1241,6 +2016,9 @@ animationItem.addItemListener(this); animationItem.setState(Globals.ANIMATION); + menu.add(archiveItem = new MenuItem("Archive3D...")); + archiveItem.addActionListener(this); + menu.add("-"); parseverticesItem = menu.add(new MenuItem("Multiplicity")); parseverticesItem.addActionListener(this); @@ -1253,6 +2031,8 @@ reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); reduce34MorphItem.addActionListener(this); menu.add("-"); + menu.add(memoryItem = new MenuItem("Memory Usage")); + memoryItem.addActionListener(this); menu.add(computeAOItem = new MenuItem("Compute AO")); computeAOItem.addActionListener(this); @@ -1261,11 +2041,9 @@ mirrorItem = menu.add(new MenuItem("Mirror Poses")); mirrorItem.addActionListener(this); menu.add("-"); - menu.add(memoryItem = new MenuItem("Memory Usage")); - memoryItem.addActionListener(this); menu.add(analyzeItem = new MenuItem("Analyze")); analyzeItem.addActionListener(this); - menu.add(dumpItem = new MenuItem("Dump")); + menu.add(dumpItem = new MenuItem("Print")); dumpItem.addActionListener(this); // menu.add(pathItem = new MenuItem("From-to path")); // pathItem.addActionListener(this); @@ -1348,24 +2126,24 @@ switch(axis) { case 0 : - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; norm = cVector.X; break; case 1 : - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; norm = cVector.Y; break; case 2 : - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; norm = cVector.Z; break; } @@ -1406,9 +2184,38 @@ shadow.material = new cMaterial(obj.material); shadow.material.diffuse = 0.0001f; shadow.material.specular = 0.0001f; + shadow.material.opacity = 0.75f; + + AllocProjectedVertices(shadow); + + shadow.projectedVertices[1].x = 300; makeSomething(shadow); } + + private void ClearUnpinned() + { + //for (Object3D obj : listUI) + for (int i=listUI.size(); --i>=0;) + { + Object3D obj = listUI.elementAt(i); + if (!obj.pinned) + { + obj.CloseUI(); + listUI.remove(i); + } + } + } + + private void EditElement(Object3D elem, boolean newWindow) + { + // if (!(elem instanceof Composite)) + // newWindow = false; + listUI.add(elem); + elem.openEditWindow(this, newWindow); //, false); + System.out.println("edit : " + elem); + elem.editWindow.refreshContents(true); // ? new + } /** * applyExample @@ -1653,7 +2460,7 @@ { ScreenFit(); } else - if (source == switchItem) + if (source == switchViewItem) { cVector v1 = new cVector(); cVector v2 = new cVector(); @@ -1662,11 +2469,11 @@ objEditor.cameraView.renderCamera.setAim(v2, v1); objEditor.cameraView.repaint(); } else - if (source == rectoidItem) + if (source == rectoidItem || source == boxButton) { makeSomething(new Box()); } else - if (source == particleItem) + if (source == particleItem || source == particlesButton) { ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); ParticleController particleController = new ParticleController(particleGeom); @@ -1745,27 +2552,27 @@ makeSomething(obj); } else - if (source == gridItem) + if (source == gridItem || source == gridButton) { makeSomething(new Grid()); } else - if (source == ellipsoidItem) + if (source == ellipsoidItem || source == sphereButton) { makeSomething(new Sphere()); } else - if (source == coneItem) + if (source == coneItem || source == coneButton) { makeSomething(new Cone()); } else - if (source == torusItem) + if (source == torusItem || source == torusButton) { makeSomething(new Torus()); } else - if (source == superItem) + if (source == superItem || source == superButton) { makeSomething(new Superellipsoid()); } else - if (source == kleinItem) + if (source == kleinItem || source == kleinButton) { makeSomething(new Klein()); } else @@ -1785,7 +2592,7 @@ { makeSomething(new BezierSurface()); } else - if (source == overlayItem) + if (source == overlayItem || source == overlayButton) { /* Object3D obj = new BezierSurface(5,8); @@ -1833,10 +2640,27 @@ s.setup(); makeSomething(s); } else - if (source == lightItem) + if (source == lightItem || source == lightButton) { 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()); @@ -1883,30 +2707,38 @@ group(g); } else - if (source == loopItem) + if (source == loopItem || source == loopButton) { + if (!group.selection.isEmpty()) + { Composite csg = new GroupLeaf(); - csg.count = 5; group(csg); - Composite child = new cGroup(); + csg.count = 5; + Composite child = new cGroup("Branch"); csg.addChild(child); child.addChild(csg); + } } else if (source == doubleItem) { - Composite csg = new GroupLeaf(); - csg.count = 5; + if (!group.selection.isEmpty()) + { + Composite csg = new GroupLeaf("Fork"); group(csg); - Composite child = new cGroup(); + csg.count = 5; + Composite child = new cGroup("Branch A"); csg.addChild(child); child.addChild(csg); - child = new cGroup(); + child = new cGroup("Branch B"); csg.addChild(child); child.addChild(csg); + } } else if (source == tripleItem) { - Composite csg = new GroupLeaf(); + if (!group.selection.isEmpty()) + { + Composite csg = new GroupLeaf("Trident"); csg.count = 4; group(csg); Composite child = new cGroup(); @@ -1918,11 +2750,12 @@ child = new cGroup(); csg.addChild(child); child.addChild(csg); + } } else if (source == computeAOItem) { Globals.drawMode = CameraPane.OCCLUSION; - Globals.theRenderer.repaint(); + cameraView.repaint(); } else if (source == recompileItem) { @@ -1937,7 +2770,7 @@ if (source == invariantsItem) { System.out.println("Invariants:"); - Grafreed.grafreeD.universe.invariants(); + Grafreed.grafreed.universe.invariants(); } else if (source == memoryItem) { @@ -1956,6 +2789,65 @@ { DumpObject(); } else + if (source == minButton) + { + Minimize(); + } else + if (source == maxButton) + { + Maximize(); + } else + if (source == fullScreenButton) + { + ToggleFullScreen(); + } else + if (source == collapseButton) + { + this.expandedLayout = radio.layout; + CollapseToolbar(); + } else +// if (source == maximize3DButton) +// { +// this.expandedLayout = radio.layout; +// radio.layout = twoButton; +// CollapseToolbar(); +// Show3DView(); +// } else + if (source == previousVersionButton) + { + // Go to previous version + //if (!Undo()) + //java.awt.Toolkit.getDefaultToolkit().beep(); + PreviousVersion(); + } else + if (source == restoreButton) + { + // Restore current version + Restore(); + //restoreButton.setEnabled(false); + } else + if (source == replaceButton) + { + // Overwrite current version + Replace(); + //replaceButton.setEnabled(false); + } else + if (source == nextVersionButton) + { + // Go to next version + NextVersion(); + } else + if (source == saveVersionButton) + { + // Save a new version + if (!Save(true)) + java.awt.Toolkit.getDefaultToolkit().beep(); + } else + if (source == deleteVersionButton) + { + // Delete a new version + DeleteVersion(); + } else if (source == oneStepButton) { Globals.ONESTEP = true; @@ -1963,17 +2855,14 @@ } else if (source == screenfitButton) { - //Reload(lastConverter, lastFilename, true); ScreenFit(); } else if (source == screenfitpointButton) { - //Reload(lastConverter, lastFilename, true); ScreenFitPoint(); } else if (source == snapobjectButton) { - //Reload(lastConverter, lastFilename, true); SnapObject(); } else // if (event.getSource() == recompileButton) @@ -2012,11 +2901,11 @@ } else if (source == undoItem) { - Undo(); + PreviousVersion(); } else if (source == redoItem) { - Redo(); + NextVersion(); } else if (source == duplicateItem) { @@ -2337,7 +3226,7 @@ { StepAll(); } else - if (source == clearItem) // || event.getSource() == clearButton) + if (source == deleteItem) // || event.getSource() == clearButton) { //int indices[] = jList.getSelectedIndices(); //for (int i = indices.length - 1; i >= 0; i--) @@ -2349,9 +3238,9 @@ { ClearSelection(true); } else - if (source == grabItem) + if (source == grabItem || source == groupButton) { - group(new cGroup(), true); + group(new cGroup(), false); // true); } else if (source == hideItem) { @@ -2369,11 +3258,11 @@ { makeSomething(new Camera()); } else - if (source == compositeItem) + if (source == compositeItem || source == compositeButton) { group(new Composite()); } else - if (source == randomItem) + if (source == switchItem || source == switchButton) { RandomNode random = new RandomNode(); group(random); @@ -2475,7 +3364,7 @@ { group(new cLinker()); } else - if (source == textureItem) + if (source == textureItem || source == textureButton) { group(new TextureNode()); } else @@ -2495,17 +3384,42 @@ { CastShadow(2); } else - if (source == ungroupItem) + if (source == ungroupItem || source == ungroupButton) { - //ungroup(); + boolean canUngroup = true; + for (int i=0; i<group.selection.size(); i++) { - Ungroup(group.selection.get(i)); + Object3D selectedItem = group.selection.get(i); + + if (selectedItem.Size() == 0) + { + // Cannot ungroup leaves + canUngroup = false; + break; + } + + if (selectedItem == group) + { + // Cannot ungroup root + canUngroup = false; + break; + } } - ClearSelection(false); - - refreshContents(); + if (canUngroup) + { + for (int i=0; i<group.selection.size(); i++) + { + Object3D selectedItem = group.selection.get(i); + + Ungroup(selectedItem); + } + + ClearSelection(false); + + refreshContents(); + } } else if (source == genUVItem) { @@ -2517,7 +3431,7 @@ } else if (source == genNormalsMESHItem) { - GenNormals(true); // TODO + GenNormalsMESH(); } else if (source == genNormalsORGANItem) { @@ -2551,6 +3465,10 @@ { ClearMaterials(); } else + if (source == clearVersionsItem) + { + ClearVersions(); + } else if (source == liveleavesItem) { LiveLeaves(true); @@ -2582,6 +3500,22 @@ if (source == unmarkleavesItem) { MarkLeaves(false); + } else + if (source == rewindleavesItem) + { + RewindLeaves(true); + } else + if (source == unrewindleavesItem) + { + RewindLeaves(false); + } else + if (source == randomleavesItem) + { + RandomLeaves(true); + } else + if (source == unrandomleavesItem) + { + RandomLeaves(false); } else if (source == flipVItem) { @@ -2674,6 +3608,18 @@ if (source == transformChildrenItem) { TransformChildren(); + } else + if (source == textureRatioRItem) + { + TextureRatio(0); + } else + if (source == textureRatioGItem) + { + TextureRatio(1); + } else + if (source == textureRatioBItem) + { + TextureRatio(2); } else if (source == resetTransformItem) { @@ -2790,7 +3736,7 @@ for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { obj = (Object3D)e.nextElement(); - obj.SetBumpTexture(null); + obj.ResetBumpTexture(); } refreshContents(); @@ -2806,6 +3752,31 @@ 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) { CameraPane.flash = true; @@ -2817,42 +3788,36 @@ if (source == twoButton) { radio.layout = twoButton; - // bug - //gridPanel.setDividerLocation(1.0); - //bigPanel.setDividerLocation(0.0); -// bigThree.remove(scenePanel); -// bigThree.remove(centralPanel); -// bigThree.remove(XYZPanel); -// aWindowConstraints.gridx = 0; -// aWindowConstraints.gridy = 0; -// aWindowConstraints.gridwidth = 1; -// // aConstraints.gridheight = 3; -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; -// aWindowConstraints.weightx = 0; -// aWindowConstraints.weighty = 1; -// //bigThree.add(jtp, aWindowConstraints); -// aWindowConstraints.weightx = 1; -// aWindowConstraints.gridwidth = 3; -// // aConstraints.gridheight = 3; -// aWindowConstraints.gridx = 1; -// aWindowConstraints.fill = GridBagConstraints.BOTH; -// bigThree.add(centralPanel, aWindowConstraints); -// aWindowConstraints.weightx = 0; -// aWindowConstraints.gridx = 4; -// aWindowConstraints.gridwidth = 1; -// // aConstraints.gridheight = 3; -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; -// //bigThree.add(XYZPanel, aWindowConstraints); -// scenePanel.setVisible(false); -// centralPanel.setVisible(true); -// XYZPanel.setVisible(false); - bigThree.ClearUI(); - bigThree.add(centralPanel); - bigThree.FlushUI(); + + if (CameraPane.FULLSCREEN) + fullscreenLayout = radio.layout; + + Show3DView(); + + cameraView.requestFocusInWindow(); + +// refreshContents(true); +// +// try +// { +// java.awt.Robot bot = new java.awt.Robot(); +// int mask = InputEvent.BUTTON1_MASK; +// bot.mouseMove(100, 100); +// bot.mousePress(mask); +// bot.mouseRelease(mask); +// } +// catch (Exception e) +// { +// +// } + } else if (source == threeButton) { radio.layout = threeButton; + + if (CameraPane.FULLSCREEN) + fullscreenLayout = radio.layout; // bigThree.remove(scenePanel); // bigThree.remove(centralPanel); @@ -2882,13 +3847,18 @@ // centralPanel.setVisible(true); // XYZPanel.setVisible(true); bigThree.ClearUI(); + bigThree.add(scenePanel); bigThree.add(centralPanel); - bigThree.add(XYZPanel); bigThree.FlushUI(); + + cameraView.requestFocusInWindow(); } else if (source == fourButton) { radio.layout = fourButton; + + if (CameraPane.FULLSCREEN) + fullscreenLayout = radio.layout; // bigThree.remove(scenePanel); // bigThree.remove(centralPanel); @@ -2920,10 +3890,15 @@ bigThree.ClearUI(); bigThree.add(scenePanel); bigThree.FlushUI(); + + cameraView.requestFocusInWindow(); } else if (source == sixButton) { radio.layout = sixButton; + + if (CameraPane.FULLSCREEN) + fullscreenLayout = radio.layout; // bigThree.remove(scenePanel); // bigThree.remove(centralPanel); @@ -2953,13 +3928,18 @@ // centralPanel.setVisible(true); // XYZPanel.setVisible(false); bigThree.ClearUI(); - bigThree.add(scenePanel); bigThree.add(centralPanel); + bigThree.add(scenePanel); bigThree.FlushUI(); + + cameraView.requestFocusInWindow(); } else if (source == sevenButton) { radio.layout = sevenButton; + + if (CameraPane.FULLSCREEN) + fullscreenLayout = radio.layout; // bigThree.remove(scenePanel); // bigThree.remove(centralPanel); @@ -2993,9 +3973,12 @@ bigThree.add(centralPanel); bigThree.add(XYZPanel); bigThree.FlushUI(); + + cameraView.requestFocusInWindow(); } else if (source == rootButton) { + Replace(); Object3D obj; for (Enumeration e = group.selection.elements(); e.hasMoreElements();) { @@ -3004,31 +3987,50 @@ EditObject(obj); } + cameraView.requestFocusInWindow(); refreshContents(true); } else if (source == closeButton) { //System.out.println("CLOSE: " + buttonGroup.getSelection()); + if (copy.versionlist != null) + Replace(); + cRadio ab; for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) { ab = (cRadio)e.nextElement(); - if(ab.getModel().isSelected() && ab.GetObject() != client) + if (ab.getModel().isSelected() && ab.GetObject() != client) { + // Patch to avoid bug with transparency. + if (!ab.hadMaterial) + { + ab.object.material = null; + } + buttonGroup.remove(ab); radioPanel.remove(ab); - ab.GetObject().editWindow = null; + //ab.GetObject().editWindow = null; + ab.GetObject().manipWindow = null; // ab.GetObject().objectUI = null; // ????????? ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); break; } } + + cameraView.requestFocusInWindow(); refreshContents(true); } else if (source == editItem || source == editButton) { + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) + { + Object3D child = (Object3D)e.nextElement(); + child.pinned = true; + } + EditSelection(false); } else if (source == uneditButton) @@ -3037,11 +4039,12 @@ { Object3D child = (Object3D)e.nextElement(); if(child.editWindow != null) - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); + child.pinned = false; child.CloseUI(); listUI.remove(child); +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); - child.editWindow = null; // ??????????? + //child.editWindow = null; // ??????????? } objEditor.ctrlPanel.FlushUI(); //objEditor.jTree.clearSelection(); @@ -3054,16 +4057,18 @@ //copy.ClearUI(); for (Object3D obj : listUI) { + obj.pinned = false; obj.CloseUI(); } listUI.clear(); + SetPinStates(group.selection.size() > 0); refreshContents(true); } else if (source == allParamsButton) { assert(copy == group); - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); for (Object3D obj : listUI) { @@ -3089,6 +4094,9 @@ } else if(source instanceof cRadio) { + if (copy.versionlist != null) + Replace(); + group.parent = keepparent; group.attributes = 0; //group.editWindow = null; @@ -3112,6 +4120,7 @@ } copy = group; + //Globals.theRenderer.object = group; if(!useclient) { @@ -3128,7 +4137,9 @@ sideView.object = group; } -// fix "+" issue group.editWindow = this; +// fix "+" issue + //group.editWindow = this; + group.manipWindow = this; /* currentLayout = radio.layout; @@ -3136,20 +4147,58 @@ currentLayout = sevenButton; */ radio.layout.doClick(); + + //assert(copy instanceof Composite); + + if (copy.versionlist == null) + { + copy.versionindex = -1; + + // Cannot work with loops + // To fix this issue, we first mark all nodes above the root, + // and check if any of these nodes are reachable below the root. + Grafreed.grafreed.universe.TagObjects(copy, true); + + if (copy instanceof Composite && !copy.HasTags()) + { + if (copy.versionlist == null) + copy.versionlist = new Object3D[100]; + + //Save(true); + } + else + copy.versionindex = -2; + + Grafreed.grafreed.universe.TagObjects(copy, false); + } + + SetVersionStates(); + + ClearUnpinned(); + + //Grafreed.Assert(group != null); + //Grafreed.Assert(group.selection != null); + SetPinStates(group.selection == null || group.selection.size() > 0); + if (group.selection == null || group.selection.size() == 1) + EditSelection(false); keepparent = group.parent; // PARENT = NULL or not??? //group.parent = null; // ROOT //group.attributes = -1; ResetModel(); + + cameraView.requestFocusInWindow(); refreshContents(true); } else if (event.getSource() == editCameraItem) { cameraView.ProtectCamera(); + cameraView.requestFocusInWindow(); cameraView.repaint(); return; - } else if (event.getSource() == revertCameraItem) + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) { cameraView.RevertCamera(); + cameraView.requestFocusInWindow(); cameraView.repaint(); return; // } else if (event.getSource() == textureButton) @@ -3164,7 +4213,6 @@ } boolean useclient = false; - cRadio radio; void ToggleRoot() { @@ -3239,6 +4287,18 @@ refreshContents(); } + void TextureRatio(int axis) + { + Object3D obj; + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) + { + obj = (Object3D)e.nextElement(); + obj.TextureRatio(axis); + } + + refreshContents(); + } + void ResetTransform() { ResetTransform(-1); @@ -3254,42 +4314,8 @@ if (obj.toParent == null) continue; - if (mask == -1) - { - if (obj instanceof Camera) // jan 2014 - { - LA.matIdentity(obj.toParent); - LA.matIdentity(obj.fromParent); - } - else - { - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); - obj.fromParent = null; // LA.matIdentity(obj.fromParent); - } - TouchTransform(obj); - continue; - } - if ((mask&2) != 0) // Scale - { - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; - } - if ((mask&4) != 0) // Rotation - { - // ? - } - if ((mask&1) != 0) // Translation - { - if (obj.toParent != null) - { - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; - } - } + obj.ResetTransform(mask); + if (obj.parent == null) { System.out.println("NULL PARENT!"); @@ -3403,7 +4429,8 @@ int size = obj.MemorySize(); - System.err.println((size/1024) + " KB is the size of " + obj); + //System.err.println((size/1024) + " KB is the size of " + obj); + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); } } catch (Exception e) @@ -3484,6 +4511,13 @@ void GenNormals(boolean crease) { group.GenNormalsS(crease); + + refreshContents(); + } + + void GenNormalsMESH() + { + group.GenNormalsMeshS(); refreshContents(); } @@ -3719,7 +4753,7 @@ try { - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); } catch (Exception e) { @@ -3789,6 +4823,12 @@ for (int i=0; i<group.selection.size(); i++) { Object3D obj = group.selection.get(i); + + if (obj.toParent == null) + { + obj.toParent = LA.newMatrix(); + obj.fromParent = LA.newMatrix(); + } LA.matTranslate(obj.toParent, i * scale, 0, 0); LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); @@ -4081,6 +5121,12 @@ refreshContents(); } + void ClearVersions() + { + group.selection.ClearVersions(); + refreshContents(); + } + void FlipV(boolean flip) { group.selection.FlipV(flip); @@ -4108,6 +5154,18 @@ void MarkLeaves(boolean hide) { group.selection.MarkLeaves(hide); + refreshContents(); + } + + void RewindLeaves(boolean hide) + { + group.selection.RewindLeaves(hide); + refreshContents(); + } + + void RandomLeaves(boolean hide) + { + group.selection.RandomLeaves(hide); refreshContents(); } @@ -4182,28 +5240,25 @@ // } // } - static boolean allparams = true; - - static Vector<Object3D> listUI = new Vector<Object3D>(); - void EditSelection(boolean newWindow) { + if (group.selection == null) + { + EditElement(group, newWindow); // ? new + return; + } + // aConstraints.gridy = 0; for (int i=0; i<group.selection.size(); i++) { //System.out.println("edit : " + objectPanel.indexOfTab("Material")); //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); Object3D elem = (Object3D)group.selection.elementAt(i); if(elem != group || !newWindow) { - // if (!(elem instanceof Composite)) - // newWindow = false; - listUI.add(elem); - elem.openEditWindow(this, newWindow); //, false); - System.out.println("edit : " + elem); - elem.editWindow.refreshContents(true); // ? new + EditElement(elem, newWindow); // ? new } } } @@ -4266,9 +5321,7 @@ freezemodel = false; } - - boolean flashIt = true; - + public void valueChanged(TreeSelectionEvent e) //public boolean handleEvent(Event event) { @@ -4278,7 +5331,8 @@ //new Exception().printStackTrace(); freezemodel = true; - + ClearUnpinned(); + /**/ //switch (event.id) { @@ -4286,7 +5340,6 @@ //case 702: // Event.LIST_DESELECT group.deselectAll(); TreePath tps[] = objEditor.jTree.getSelectionPaths(); - objEditor.ClearInfo(); // .GetMaterial()); if (tps != null) { for (int i=0; i < tps.length; i++) @@ -4295,10 +5348,8 @@ //if (child.parent != null) //child.parent.addSelectee(child); + objEditor.SetMaterial(child); group.addSelectee(child); - objEditor.SetMaterial(child); // .GetMaterial()); - objEditor.AddInfo(child, this, true); // .GetMaterial()); - System.err.println("info : " + child.GetPath()); } } // else @@ -4308,17 +5359,13 @@ // System.err.println("info : " + group.GetPath()); // } - objEditor.SetText(); // jan 2014 - - Object3D object = (Object3D) tps[0].getLastPathComponent(); - - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera)) + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) CameraPane.flash = true; - if (tps != null && tps.length > 0 && object instanceof Camera) + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) // a camera { - if (object != Globals.theRenderer.LightCamera()) + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace { CameraPane.camerachangeframe = 0; // don't refuse it Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); @@ -4327,6 +5374,13 @@ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; } + if (tps != null && tps.length == 1) + { + EditSelection(false); + } + + SetPinStates(tps != null && tps.length > 0); + refreshContents(); //return true; } @@ -4335,6 +5389,53 @@ freezemodel = false; } + + void SetPinStates(boolean enabled) + { + editButton.setEnabled(enabled); + uneditButton.setEnabled(enabled); + //unselectButton.setEnabled(enabled); + flashSelectionButton.setEnabled(enabled); + + clearPanelButton.setEnabled(!listUI.isEmpty()); + + boolean allComposites = true; + + if (group.selection != null) + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) + { + Object next = e.nextElement(); + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) + { + allComposites = false; + break; + } + } + + rootButton.setEnabled(true); // allComposites); + } + + void refreshContents(boolean cp) + { + if (Globals.SHOWINFO) + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) + { + objEditor.ClearInfo(); // .GetMaterial()); + + for (int i=0; i < group.selection.Size(); i++) + { + Object3D child = (Object3D) group.selection.get(i); + + objEditor.AddInfo(child, this, true); +// System.err.println("info : " + child.GetPath()); + } + + objEditor.SetText(); // jan 2014 + } + + super.refreshContents(cp); + } void linkSomething(Object3D thing) { @@ -4406,6 +5507,7 @@ { if (group.selection.isEmpty()) return; + Grafreed.clipboardIsTempGroup = false; Composite tGroup = null; if (group.selection.size() > 0) // 1) @@ -4416,6 +5518,8 @@ if (cut) { +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. +// Save(); //int indices[] = jList.getSelectedIndices(); //for (int i = indices.length - 1; i >= 0; i--) //jList.remove(indices[i]); @@ -4505,8 +5609,10 @@ } } + if (Grafreed.clipboardIsTempGroup) Grafreed.clipboard = tGroup; + if (cut) { ResetModel(); @@ -4516,6 +5622,10 @@ void paste(boolean expand) { + if (Globals.REPLACEONMAKE) + Save(); + boolean keep = Globals.REPLACEONMAKE; + Globals.REPLACEONMAKE = false; // if (GrafreeD.clipboard == null) // return; boolean first = true; @@ -4575,6 +5685,7 @@ Grafreed.clipboard.get(0).parent = keepparent; } + Globals.REPLACEONMAKE = keep; ResetModel(); refreshContents(); } @@ -4710,6 +5821,10 @@ void group(Object3D csg, boolean grab) { + if (Globals.REPLACEONMAKE) + Save(); + boolean keep = Globals.REPLACEONMAKE; + Globals.REPLACEONMAKE = false; if (//false) // why?? !group.selection.isEmpty()) { @@ -4823,10 +5938,15 @@ //node.add(csg); //makeSomething(node); makeSomething(csg); + Globals.REPLACEONMAKE = keep; } void Ungroup(Object3D g) { + if (Globals.REPLACEONMAKE) + Save(); + boolean keep = Globals.REPLACEONMAKE; + Globals.REPLACEONMAKE = false; if (g instanceof HiddenObject) { HiddenObject h = (HiddenObject) g; @@ -4843,6 +5963,7 @@ objEditor.makeSomething(g.get(i), false); } } + Globals.REPLACEONMAKE = keep; } void ungroup() @@ -5131,7 +6252,43 @@ cButton clearpanelButton; cButton unselectButton; + cButton restoreCameraButton; + cButton oneStepButton; + + cButton groupButton; + cButton ungroupButton; + cButton compositeButton; + cButton switchButton; + 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; + cButton coneButton; + cButton torusButton; + cButton superButton; + cButton kleinButton; + cButton particlesButton; + cButton overlayButton; + cButton lightButton; cButton screenfitButton; cButton screenfitpointButton; @@ -5144,14 +6301,6 @@ cButton setsupportButton; - cButton twoButton; - cButton sixButton; - cButton threeButton; - cButton sevenButton; - cButton fourButton; // full panel - cButton oneButton; // full XYZ - //cButton currentLayout; - // //Composite Object3D // to do !! @@ -5161,12 +6310,12 @@ //JTree jTree; private MenuItem lookAtItem; private MenuItem lookFromItem; - private MenuItem switchItem; - private MenuItem cutItem; + private MenuItem switchViewItem; + private JMenuItem cutItem; private MenuItem undoItem; private MenuItem redoItem; - private MenuItem duplicateItem; - private MenuItem cloneItem; + private JMenuItem duplicateItem; + private JMenuItem cloneItem; private MenuItem cloneSupportItem; private MenuItem overwriteGeoItem; private MenuItem overwriteMatItem; @@ -5187,13 +6336,13 @@ private MenuItem cloneGeometriesItem; private MenuItem shareGeometriesItem; private MenuItem mergeGeometriesItem; - private MenuItem copyItem; + private JMenuItem copyItem; private MenuItem pasteItem; - private MenuItem pasteIntoItem; - private MenuItem pasteLinkItem; - private MenuItem pasteCloneItem; - private MenuItem pasteExpandItem; - private MenuItem clearItem; + private JMenuItem pasteIntoItem; + private JMenuItem pasteLinkItem; + private JMenuItem pasteCloneItem; + private JMenuItem pasteExpandItem; + private JMenuItem deleteItem; private MenuItem clearAllItem; private MenuItem genUVItem; private MenuItem genNormalsMESHItem; @@ -5219,6 +6368,7 @@ private MenuItem clipMeshItem; private MenuItem smoothMeshItem; private MenuItem clearMaterialsItem; + private MenuItem clearVersionsItem; private MenuItem liveleavesItem; private MenuItem unliveleavesItem; @@ -5228,6 +6378,10 @@ private MenuItem showleavesItem; private MenuItem markleavesItem; private MenuItem unmarkleavesItem; + private MenuItem rewindleavesItem; + private MenuItem unrewindleavesItem; + private MenuItem randomleavesItem; + private MenuItem unrandomleavesItem; private MenuItem flipVItem; private MenuItem unflipVItem; @@ -5238,18 +6392,21 @@ private MenuItem maxTexturesItem; private MenuItem panoTexturesItem; + private MenuItem textureRatioRItem; + private MenuItem textureRatioGItem; + private MenuItem textureRatioBItem; private MenuItem resetCentroidItem; private MenuItem resetCentroidXZItem; private MenuItem resetTransformItem; private MenuItem transformGeometryItem; private MenuItem transformChildrenItem; private MenuItem hideItem; - private MenuItem grabItem; + private JMenuItem grabItem; private MenuItem backItem; private MenuItem frontItem; private MenuItem cameraItem; private MenuItem compositeItem; - private MenuItem randomItem; + private MenuItem switchItem; private MenuItem physicsItem; private MenuItem frameselectorItem; private MenuItem scriptNodeItem; @@ -5257,7 +6414,7 @@ private MenuItem switchTransfoItem; private MenuItem morphItem; private MenuItem linkerItem; - private MenuItem ungroupItem; + private JMenuItem ungroupItem; private MenuItem editItem; private MenuItem openWindowItem; private MenuItem editLeafItem; @@ -5273,6 +6430,8 @@ private MenuItem attachBumpItem; private MenuItem detachBumpItem; private MenuItem pigmentBumpItem; + private MenuItem embedTexturesItem; + private MenuItem deEmbedTexturesItem; private MenuItem particleItem; private MenuItem ragdollItem; @@ -5323,5 +6482,5 @@ Menu cameraMenu; MenuItem editCameraItem; - MenuItem revertCameraItem; + MenuItem restoreCameraItem; } -- Gitblit v1.6.2