From 76522bc3ee92bd50dbd946d7f865666be4ad7bac Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sat, 20 Jul 2019 20:50:56 -0400 Subject: [PATCH] cTexture serial change --- CameraPane.java | 92 +++++++++++++++++++++++++++++++++------------ 1 files changed, 67 insertions(+), 25 deletions(-) diff --git a/CameraPane.java b/CameraPane.java index 80b657b..b55d184 100644 --- a/CameraPane.java +++ b/CameraPane.java @@ -2298,10 +2298,17 @@ HANDLES ^= true; } + Object3D paintFolder; + void TogglePaint() { PAINTMODE ^= true; paintcount = 0; + + if (PAINTMODE) + { + paintFolder = GetFolder(); + } } void SwapCamera(int a, int b) @@ -7923,7 +7930,7 @@ String pigment = Object3D.GetPigment(tex); String bump = Object3D.GetBump(tex); - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) { // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); // System.out.println("; bump = " + bump); @@ -7957,7 +7964,7 @@ String pigment = Object3D.GetPigment(tex); - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) { // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); // System.out.println("; bump = " + bump); @@ -7986,7 +7993,7 @@ String bump = Object3D.GetBump(tex); - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) { // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); // System.out.println("; bump = " + bump); @@ -8124,7 +8131,7 @@ usedtextures.put(pigment, pigment); usedtextures.put(bump, bump); - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) { // System.out.print("BIND +++++++++++++++ pigment = " + pigment); // System.out.println("; bump = " + bump); @@ -8166,7 +8173,7 @@ usedtextures.put(pigment, pigment); - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) { // System.out.print("BIND +++++++++++++++ pigment = " + pigment); // System.out.println("; bump = " + bump); @@ -8199,7 +8206,7 @@ usedtextures.put(bump, bump); - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) { // System.out.print("BIND +++++++++++++++ pigment = " + pigment); // System.out.println("; bump = " + bump); @@ -8510,7 +8517,7 @@ return false; } - boolean newtex = false; + //boolean newtex = false; com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); @@ -8542,7 +8549,7 @@ texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT); texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT); - return newtex; + return true; // Warning: not used. } ShadowBuffer shadowPBuf; @@ -15708,6 +15715,7 @@ info.bounds.y += (height - desired) / 2; } } + info.g = gr; info.camera = renderCamera; /* @@ -15717,6 +15725,8 @@ */ if (!isRenderer) { + Grafreed.Assert(object != null); + Grafreed.Assert(object.selection != null); if (object.selection.Size() > 0) { int hitSomething = object.selection.get(0).hitSomething; @@ -16550,6 +16560,14 @@ } } + private Object3D GetFolder() + { + Object3D folder = object.GetWindow().copy; + if (object.GetWindow().copy.selection.Size() > 0) + folder = object.GetWindow().copy.selection.elementAt(0); + return folder; + } + class SelectBuffer implements GLEventListener { @@ -16629,6 +16647,17 @@ //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); + if (PAINTMODE) + { + if (object.GetWindow().copy.selection.Size() > 0) + { + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); + + // Make what you paint not selectable. + paintobj.ResetSelectable(); + } + } + //int tmp = selection_view; //selection_view = -1; int temp = DrawMode(); @@ -16640,6 +16669,17 @@ // temp = DEFAULT; // patch for selection debug Globals.drawMode = temp; // WARNING + if (PAINTMODE) + { + if (object.GetWindow().copy.selection.Size() > 0) + { + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); + + // Revert. + paintobj.RestoreSelectable(); + } + } + //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); // trying different ways of getting the depth info over @@ -16745,27 +16785,29 @@ if (!movingcamera && !PAINTMODE) object.GetWindow().ScreenFitPoint(); // fev 2014 - if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) + if (PAINTMODE) // && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) { - Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); - - Object3D group = new Object3D("inst" + paintcount++); - - group.CreateMaterial(); // use a void leaf to select instances - - group.add(paintobj); // link - - object.GetWindow().SnapObject(group); - - Object3D folder = object.GetWindow().copy; + //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); if (object.GetWindow().copy.selection.Size() > 0) - folder = object.GetWindow().copy.selection.elementAt(0); + { + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); - folder.add(group); - - object.GetWindow().ResetModel(); - object.GetWindow().refreshContents(); + Object3D inst = new Object3D("inst" + paintcount++); + + inst.CreateMaterial(); // use a void leaf to select instances + + inst.add(paintobj); // link + + object.GetWindow().SnapObject(inst); + + Object3D folder = paintFolder; // GetFolder(); + + folder.add(inst); + + object.GetWindow().ResetModel(); + object.GetWindow().refreshContents(); + } } else paintcount = 0; -- Gitblit v1.6.2