.. | .. |
---|
2298 | 2298 | HANDLES ^= true; |
---|
2299 | 2299 | } |
---|
2300 | 2300 | |
---|
| 2301 | + Object3D paintFolder; |
---|
| 2302 | + |
---|
2301 | 2303 | void TogglePaint() |
---|
2302 | 2304 | { |
---|
2303 | 2305 | PAINTMODE ^= true; |
---|
2304 | 2306 | paintcount = 0; |
---|
| 2307 | + |
---|
| 2308 | + if (PAINTMODE) |
---|
| 2309 | + { |
---|
| 2310 | + paintFolder = GetFolder(); |
---|
| 2311 | + } |
---|
2305 | 2312 | } |
---|
2306 | 2313 | |
---|
2307 | 2314 | void SwapCamera(int a, int b) |
---|
.. | .. |
---|
7923 | 7930 | String pigment = Object3D.GetPigment(tex); |
---|
7924 | 7931 | String bump = Object3D.GetBump(tex); |
---|
7925 | 7932 | |
---|
7926 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7933 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7927 | 7934 | { |
---|
7928 | 7935 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7929 | 7936 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7957 | 7964 | |
---|
7958 | 7965 | String pigment = Object3D.GetPigment(tex); |
---|
7959 | 7966 | |
---|
7960 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7967 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7961 | 7968 | { |
---|
7962 | 7969 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7963 | 7970 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
7986 | 7993 | |
---|
7987 | 7994 | String bump = Object3D.GetBump(tex); |
---|
7988 | 7995 | |
---|
7989 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 7996 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
7990 | 7997 | { |
---|
7991 | 7998 | // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment); |
---|
7992 | 7999 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8124 | 8131 | usedtextures.put(pigment, pigment); |
---|
8125 | 8132 | usedtextures.put(bump, bump); |
---|
8126 | 8133 | |
---|
8127 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8134 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8128 | 8135 | { |
---|
8129 | 8136 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8130 | 8137 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8166 | 8173 | |
---|
8167 | 8174 | usedtextures.put(pigment, pigment); |
---|
8168 | 8175 | |
---|
8169 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8176 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8170 | 8177 | { |
---|
8171 | 8178 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8172 | 8179 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8199 | 8206 | |
---|
8200 | 8207 | usedtextures.put(bump, bump); |
---|
8201 | 8208 | |
---|
8202 | | - if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
| 8209 | + //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES)) |
---|
8203 | 8210 | { |
---|
8204 | 8211 | // System.out.print("BIND +++++++++++++++ pigment = " + pigment); |
---|
8205 | 8212 | // System.out.println("; bump = " + bump); |
---|
.. | .. |
---|
8510 | 8517 | return false; |
---|
8511 | 8518 | } |
---|
8512 | 8519 | |
---|
8513 | | - boolean newtex = false; |
---|
| 8520 | + //boolean newtex = false; |
---|
8514 | 8521 | |
---|
8515 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8516 | 8523 | |
---|
.. | .. |
---|
8542 | 8549 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT); |
---|
8543 | 8550 | texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT); |
---|
8544 | 8551 | |
---|
8545 | | - return newtex; |
---|
| 8552 | + return true; // Warning: not used. |
---|
8546 | 8553 | } |
---|
8547 | 8554 | |
---|
8548 | 8555 | ShadowBuffer shadowPBuf; |
---|
.. | .. |
---|
16553 | 16560 | } |
---|
16554 | 16561 | } |
---|
16555 | 16562 | |
---|
| 16563 | + private Object3D GetFolder() |
---|
| 16564 | + { |
---|
| 16565 | + Object3D folder = object.GetWindow().copy; |
---|
| 16566 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16567 | + folder = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16568 | + return folder; |
---|
| 16569 | + } |
---|
| 16570 | + |
---|
16556 | 16571 | class SelectBuffer implements GLEventListener |
---|
16557 | 16572 | { |
---|
16558 | 16573 | |
---|
.. | .. |
---|
16632 | 16647 | |
---|
16633 | 16648 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16634 | 16649 | |
---|
| 16650 | + if (PAINTMODE) |
---|
| 16651 | + { |
---|
| 16652 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16653 | + { |
---|
| 16654 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16655 | + |
---|
| 16656 | + // Make what you paint not selectable. |
---|
| 16657 | + paintobj.ResetSelectable(); |
---|
| 16658 | + } |
---|
| 16659 | + } |
---|
| 16660 | + |
---|
16635 | 16661 | //int tmp = selection_view; |
---|
16636 | 16662 | //selection_view = -1; |
---|
16637 | 16663 | int temp = DrawMode(); |
---|
.. | .. |
---|
16643 | 16669 | // temp = DEFAULT; // patch for selection debug |
---|
16644 | 16670 | Globals.drawMode = temp; // WARNING |
---|
16645 | 16671 | |
---|
| 16672 | + if (PAINTMODE) |
---|
| 16673 | + { |
---|
| 16674 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16675 | + { |
---|
| 16676 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16677 | + |
---|
| 16678 | + // Revert. |
---|
| 16679 | + paintobj.RestoreSelectable(); |
---|
| 16680 | + } |
---|
| 16681 | + } |
---|
| 16682 | + |
---|
16646 | 16683 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16647 | 16684 | |
---|
16648 | 16685 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16748 | 16785 | if (!movingcamera && !PAINTMODE) |
---|
16749 | 16786 | object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16750 | 16787 | |
---|
16751 | | - if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
| 16788 | + if (PAINTMODE) // && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0) |
---|
16752 | 16789 | { |
---|
16753 | | - Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16754 | | - |
---|
16755 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
16756 | | - |
---|
16757 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16758 | | - |
---|
16759 | | - group.add(paintobj); // link |
---|
16760 | | - |
---|
16761 | | - object.GetWindow().SnapObject(group); |
---|
16762 | | - |
---|
16763 | | - Object3D folder = object.GetWindow().copy; |
---|
| 16790 | + //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0); |
---|
16764 | 16791 | |
---|
16765 | 16792 | if (object.GetWindow().copy.selection.Size() > 0) |
---|
16766 | | - folder = object.GetWindow().copy.selection.elementAt(0); |
---|
| 16793 | + { |
---|
| 16794 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16767 | 16795 | |
---|
16768 | | - folder.add(group); |
---|
16769 | | - |
---|
16770 | | - object.GetWindow().ResetModel(); |
---|
16771 | | - object.GetWindow().refreshContents(); |
---|
| 16796 | + Object3D inst = new Object3D("inst" + paintcount++); |
---|
| 16797 | + |
---|
| 16798 | + inst.CreateMaterial(); // use a void leaf to select instances |
---|
| 16799 | + |
---|
| 16800 | + inst.add(paintobj); // link |
---|
| 16801 | + |
---|
| 16802 | + object.GetWindow().SnapObject(inst); |
---|
| 16803 | + |
---|
| 16804 | + Object3D folder = paintFolder; // GetFolder(); |
---|
| 16805 | + |
---|
| 16806 | + folder.add(inst); |
---|
| 16807 | + |
---|
| 16808 | + object.GetWindow().ResetModel(); |
---|
| 16809 | + object.GetWindow().refreshContents(); |
---|
| 16810 | + } |
---|
16772 | 16811 | } |
---|
16773 | 16812 | else |
---|
16774 | 16813 | paintcount = 0; |
---|