Normand Briere
2019-07-21 76522bc3ee92bd50dbd946d7f865666be4ad7bac
CameraPane.java
....@@ -2298,10 +2298,17 @@
22982298 HANDLES ^= true;
22992299 }
23002300
2301
+ Object3D paintFolder;
2302
+
23012303 void TogglePaint()
23022304 {
23032305 PAINTMODE ^= true;
23042306 paintcount = 0;
2307
+
2308
+ if (PAINTMODE)
2309
+ {
2310
+ paintFolder = GetFolder();
2311
+ }
23052312 }
23062313
23072314 void SwapCamera(int a, int b)
....@@ -7923,7 +7930,7 @@
79237930 String pigment = Object3D.GetPigment(tex);
79247931 String bump = Object3D.GetBump(tex);
79257932
7926
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7933
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
79277934 {
79287935 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
79297936 // System.out.println("; bump = " + bump);
....@@ -7957,7 +7964,7 @@
79577964
79587965 String pigment = Object3D.GetPigment(tex);
79597966
7960
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7967
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
79617968 {
79627969 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
79637970 // System.out.println("; bump = " + bump);
....@@ -7986,7 +7993,7 @@
79867993
79877994 String bump = Object3D.GetBump(tex);
79887995
7989
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7996
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
79907997 {
79917998 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
79927999 // System.out.println("; bump = " + bump);
....@@ -8124,7 +8131,7 @@
81248131 usedtextures.put(pigment, pigment);
81258132 usedtextures.put(bump, bump);
81268133
8127
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8134
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
81288135 {
81298136 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
81308137 // System.out.println("; bump = " + bump);
....@@ -8166,7 +8173,7 @@
81668173
81678174 usedtextures.put(pigment, pigment);
81688175
8169
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8176
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
81708177 {
81718178 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
81728179 // System.out.println("; bump = " + bump);
....@@ -8199,7 +8206,7 @@
81998206
82008207 usedtextures.put(bump, bump);
82018208
8202
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8209
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
82038210 {
82048211 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
82058212 // System.out.println("; bump = " + bump);
....@@ -8510,7 +8517,7 @@
85108517 return false;
85118518 }
85128519
8513
- boolean newtex = false;
8520
+ //boolean newtex = false;
85148521
85158522 com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution);
85168523
....@@ -8542,7 +8549,7 @@
85428549 texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT);
85438550 texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT);
85448551
8545
- return newtex;
8552
+ return true; // Warning: not used.
85468553 }
85478554
85488555 ShadowBuffer shadowPBuf;
....@@ -15708,6 +15715,7 @@
1570815715 info.bounds.y += (height - desired) / 2;
1570915716 }
1571015717 }
15718
+
1571115719 info.g = gr;
1571215720 info.camera = renderCamera;
1571315721 /*
....@@ -15717,6 +15725,8 @@
1571715725 */
1571815726 if (!isRenderer)
1571915727 {
15728
+ Grafreed.Assert(object != null);
15729
+ Grafreed.Assert(object.selection != null);
1572015730 if (object.selection.Size() > 0)
1572115731 {
1572215732 int hitSomething = object.selection.get(0).hitSomething;
....@@ -16550,6 +16560,14 @@
1655016560 }
1655116561 }
1655216562
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
+
1655316571 class SelectBuffer implements GLEventListener
1655416572 {
1655516573
....@@ -16629,6 +16647,17 @@
1662916647
1663016648 //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
1663116649
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
+
1663216661 //int tmp = selection_view;
1663316662 //selection_view = -1;
1663416663 int temp = DrawMode();
....@@ -16640,6 +16669,17 @@
1664016669 // temp = DEFAULT; // patch for selection debug
1664116670 Globals.drawMode = temp; // WARNING
1664216671
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
+
1664316683 //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view);
1664416684
1664516685 // trying different ways of getting the depth info over
....@@ -16745,27 +16785,29 @@
1674516785 if (!movingcamera && !PAINTMODE)
1674616786 object.GetWindow().ScreenFitPoint(); // fev 2014
1674716787
16748
- 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)
1674916789 {
16750
- Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16751
-
16752
- Object3D group = new Object3D("inst" + paintcount++);
16753
-
16754
- group.CreateMaterial(); // use a void leaf to select instances
16755
-
16756
- group.add(paintobj); // link
16757
-
16758
- object.GetWindow().SnapObject(group);
16759
-
16760
- Object3D folder = object.GetWindow().copy;
16790
+ //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1676116791
1676216792 if (object.GetWindow().copy.selection.Size() > 0)
16763
- folder = object.GetWindow().copy.selection.elementAt(0);
16793
+ {
16794
+ Object3D paintobj = object.GetWindow().copy.selection.elementAt(0);
1676416795
16765
- folder.add(group);
16766
-
16767
- object.GetWindow().ResetModel();
16768
- 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
+ }
1676916811 }
1677016812 else
1677116813 paintcount = 0;