.. | .. |
---|
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) |
---|
.. | .. |
---|
8503 | 8510 | return texture!=null?texture.texturedata:null; |
---|
8504 | 8511 | } |
---|
8505 | 8512 | |
---|
8506 | | - boolean BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
| 8513 | + com.sun.opengl.util.texture.Texture BindTexture(String tex, boolean bump, int resolution) throws Exception |
---|
8507 | 8514 | { |
---|
8508 | 8515 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8509 | 8516 | { |
---|
.. | .. |
---|
8515 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8516 | 8523 | |
---|
8517 | 8524 | if (texture == null) |
---|
8518 | | - return false; |
---|
| 8525 | + return texture; |
---|
8519 | 8526 | /**/ |
---|
8520 | 8527 | |
---|
8521 | 8528 | if (textureon || tex.equals("DEFAULT_TEXTURE") || tex.equals("DEFAULT_TEXTURE_BUMP") || tex.equals("WHITE_NOISE")) // || tex.equals("IMMORTAL")) |
---|
.. | .. |
---|
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; |
---|