Normand Briere
2019-07-20 0a52bd4800459cd9935f360d7ca9555b6bea2146
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)
....@@ -8503,7 +8510,7 @@
85038510 return texture!=null?texture.texturedata:null;
85048511 }
85058512
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
85078514 {
85088515 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
85098516 {
....@@ -8515,7 +8522,7 @@
85158522 com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution);
85168523
85178524 if (texture == null)
8518
- return false;
8525
+ return texture;
85198526 /**/
85208527
85218528 if (textureon || tex.equals("DEFAULT_TEXTURE") || tex.equals("DEFAULT_TEXTURE_BUMP") || tex.equals("WHITE_NOISE")) // || tex.equals("IMMORTAL"))
....@@ -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;