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"))
....@@ -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;