Normand Briere
2019-07-21 5a546232b84ce65d8779d29e9171e7e2df013614
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;
....@@ -16553,6 +16560,14 @@
1655316560 }
1655416561 }
1655516562
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
+
1655616571 class SelectBuffer implements GLEventListener
1655716572 {
1655816573
....@@ -16632,6 +16647,17 @@
1663216647
1663316648 //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
1663416649
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
+
1663516661 //int tmp = selection_view;
1663616662 //selection_view = -1;
1663716663 int temp = DrawMode();
....@@ -16643,6 +16669,17 @@
1664316669 // temp = DEFAULT; // patch for selection debug
1664416670 Globals.drawMode = temp; // WARNING
1664516671
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
+
1664616683 //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view);
1664716684
1664816685 // trying different ways of getting the depth info over
....@@ -16748,27 +16785,29 @@
1674816785 if (!movingcamera && !PAINTMODE)
1674916786 object.GetWindow().ScreenFitPoint(); // fev 2014
1675016787
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)
1675216789 {
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);
1676416791
1676516792 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);
1676716795
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
+ }
1677216811 }
1677316812 else
1677416813 paintcount = 0;