Normand Briere
2019-07-21 5a546232b84ce65d8779d29e9171e7e2df013614
CameraPane.java
....@@ -335,14 +335,28 @@
335335 display.options1[2] = material.shadowbias;
336336 display.options1[3] = material.aniso;
337337 display.options1[4] = material.anisoV;
338
+// System.out.println("display.options1[0] " + display.options1[0]);
339
+// System.out.println("display.options1[1] " + display.options1[1]);
340
+// System.out.println("display.options1[2] " + display.options1[2]);
341
+// System.out.println("display.options1[3] " + display.options1[3]);
342
+// System.out.println("display.options1[4] " + display.options1[4]);
338343 display.options2[0] = material.opacity;
339344 display.options2[1] = material.diffuse;
340345 display.options2[2] = material.factor;
346
+// System.out.println("display.options2[0] " + display.options2[0]);
347
+// System.out.println("display.options2[1] " + display.options2[1]);
348
+// System.out.println("display.options2[2] " + display.options2[2]);
341349
342350 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
351
+// System.out.println("display.options3[0] " + display.options3[0]);
352
+// System.out.println("display.options3[1] " + display.options3[1]);
353
+// System.out.println("display.options3[2] " + display.options3[2]);
343354 display.options4[0] = material.cameralight/0.2f;
344355 display.options4[1] = material.subsurface;
345356 display.options4[2] = material.sheen;
357
+// System.out.println("display.options4[0] " + display.options4[0]);
358
+// System.out.println("display.options4[1] " + display.options4[1]);
359
+// System.out.println("display.options4[2] " + display.options4[2]);
346360
347361 // if (display.CURRENTANTIALIAS > 0)
348362 // display.options3[3] /= 4;
....@@ -2051,7 +2065,7 @@
20512065 //System.err.println("Oeil on");
20522066 OEIL = true;
20532067 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
2054
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
2068
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
20552069 //pingthread.StepToTarget(true);
20562070 }
20572071
....@@ -2284,10 +2298,17 @@
22842298 HANDLES ^= true;
22852299 }
22862300
2301
+ Object3D paintFolder;
2302
+
22872303 void TogglePaint()
22882304 {
22892305 PAINTMODE ^= true;
22902306 paintcount = 0;
2307
+
2308
+ if (PAINTMODE)
2309
+ {
2310
+ paintFolder = GetFolder();
2311
+ }
22912312 }
22922313
22932314 void SwapCamera(int a, int b)
....@@ -7909,7 +7930,7 @@
79097930 String pigment = Object3D.GetPigment(tex);
79107931 String bump = Object3D.GetBump(tex);
79117932
7912
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7933
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
79137934 {
79147935 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
79157936 // System.out.println("; bump = " + bump);
....@@ -7943,7 +7964,7 @@
79437964
79447965 String pigment = Object3D.GetPigment(tex);
79457966
7946
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7967
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
79477968 {
79487969 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
79497970 // System.out.println("; bump = " + bump);
....@@ -7972,7 +7993,7 @@
79727993
79737994 String bump = Object3D.GetBump(tex);
79747995
7975
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7996
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
79767997 {
79777998 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
79787999 // System.out.println("; bump = " + bump);
....@@ -8110,7 +8131,7 @@
81108131 usedtextures.put(pigment, pigment);
81118132 usedtextures.put(bump, bump);
81128133
8113
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8134
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
81148135 {
81158136 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
81168137 // System.out.println("; bump = " + bump);
....@@ -8152,7 +8173,7 @@
81528173
81538174 usedtextures.put(pigment, pigment);
81548175
8155
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8176
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
81568177 {
81578178 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
81588179 // System.out.println("; bump = " + bump);
....@@ -8185,7 +8206,7 @@
81858206
81868207 usedtextures.put(bump, bump);
81878208
8188
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8209
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
81898210 {
81908211 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
81918212 // System.out.println("; bump = " + bump);
....@@ -8496,7 +8517,7 @@
84968517 return false;
84978518 }
84988519
8499
- boolean newtex = false;
8520
+ //boolean newtex = false;
85008521
85018522 com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution);
85028523
....@@ -8528,7 +8549,7 @@
85288549 texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT);
85298550 texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT);
85308551
8531
- return newtex;
8552
+ return true; // Warning: not used.
85328553 }
85338554
85348555 ShadowBuffer shadowPBuf;
....@@ -9366,11 +9387,35 @@
93669387 jy8[3] = 0.5f;
93679388 }
93689389
9369
- float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
9390
+ float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
93709391 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
93719392 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
93729393 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
93739394
9395
+ void ResetOptions()
9396
+ {
9397
+ options1[0] = 100;
9398
+ options1[1] = 0.025f;
9399
+ options1[2] = 0.01f;
9400
+ options1[3] = 0;
9401
+ options1[4] = 0;
9402
+
9403
+ options2[0] = 0;
9404
+ options2[1] = 0.75f;
9405
+ options2[2] = 0;
9406
+ options2[3] = 0;
9407
+
9408
+ options3[0] = 1;
9409
+ options3[1] = 1;
9410
+ options3[2] = 1;
9411
+ options3[3] = 0;
9412
+
9413
+ options4[0] = 1;
9414
+ options4[1] = 0;
9415
+ options4[2] = 1;
9416
+ options4[3] = 0;
9417
+ }
9418
+
93749419 static int imagecount = 0; // movie generation
93759420
93769421 static int jitter = 0;
....@@ -10481,6 +10526,7 @@
1048110526 ANTIALIAS = 0;
1048210527 //System.out.println("RESTART");
1048310528 AAtimer.restart();
10529
+ Globals.TIMERRUNNING = true;
1048410530 }
1048510531 }
1048610532 }
....@@ -10989,9 +11035,9 @@
1098911035
1099011036 gl.glMatrixMode(GL.GL_MODELVIEW);
1099111037
10992
-//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
10993
-//gl.glEnable(gl.GL_POLYGON_SMOOTH);
10994
-//gl.glEnable(gl.GL_MULTISAMPLE);
11038
+gl.glEnable(gl.GL_POLYGON_SMOOTH);
11039
+gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
11040
+gl.glEnable(gl.GL_MULTISAMPLE);
1099511041 } else
1099611042 {
1099711043 //gl.glDisable(GL.GL_TEXTURE_2D);
....@@ -11002,7 +11048,7 @@
1100211048 //System.out.println("BLENDING ON");
1100311049 gl.glEnable(GL.GL_BLEND);
1100411050 gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
11005
-
11051
+// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE);
1100611052 gl.glMatrixMode(gl.GL_PROJECTION);
1100711053 gl.glLoadIdentity();
1100811054
....@@ -11479,13 +11525,16 @@
1147911525
1148011526 void DrawObject(GL gl, boolean draw)
1148111527 {
11528
+ // To clear camera values
11529
+ ResetOptions();
11530
+
1148211531 //System.out.println("DRAW OBJECT " + mouseDown);
1148311532 // DrawMode() = SELECTION;
1148411533 //GL gl = getGL();
1148511534 if ((TRACK || SHADOWTRACK) || zoomonce)
1148611535 {
1148711536 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
11488
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11537
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1148911538 pingthread.StepToTarget(true); // true);
1149011539 // zoomonce = false;
1149111540 }
....@@ -12046,7 +12095,7 @@
1204612095 for (int i = tp.size(); --i >= 0;)
1204712096 {
1204812097 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
12049
- LA.xformPos(light, tp.get(i).GlobalTransform(), light);
12098
+ LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
1205012099 }
1205112100
1205212101
....@@ -13333,9 +13382,10 @@
1333313382 "DP3 " + dest + ".z," + "normals," + "eye;" +
1333413383 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1333513384 //"MOV " + dest + ".w," + "normal.z;" +
13336
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13337
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13338
- //"MOV " + dest + ".z," + "params2.w;" +
13385
+// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET
13386
+// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13387
+
13388
+ "MOV " + dest + ".z," + "params2.w;" + // EXACT
1333913389 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1334013390 "RCP " + dest + ".w," + dest + ".w;" +
1334113391 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -13840,6 +13890,7 @@
1384013890 else
1384113891 if (evt.getSource() == AAtimer)
1384213892 {
13893
+ Globals.TIMERRUNNING = false;
1384313894 if (mouseDown)
1384413895 {
1384513896 //new Exception().printStackTrace();
....@@ -13899,7 +13950,7 @@
1389913950
1390013951 // fev 2014???
1390113952 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
13902
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
13953
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1390313954 pingthread.StepToTarget(true); // true);
1390413955 }
1390513956 // if (!LIVE)
....@@ -13914,6 +13965,7 @@
1391413965 return;
1391513966
1391613967 AAtimer.restart(); //
13968
+ Globals.TIMERRUNNING = true;
1391713969
1391813970 // waslive = LIVE;
1391913971 // LIVE = false;
....@@ -14252,12 +14304,12 @@
1425214304 void GoDown(int mod)
1425314305 {
1425414306 MODIFIERS |= COMMAND;
14255
- /*
14307
+ /**/
1425614308 if((mod&SHIFT) == SHIFT)
1425714309 manipCamera.RotatePosition(0, -speed);
1425814310 else
14259
- manipCamera.BackForth(0, -speed*delta, getWidth());
14260
- */
14311
+ manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14312
+ /**/
1426114313 if ((mod & SHIFT) == SHIFT)
1426214314 {
1426314315 mouseMode = mouseMode; // VR??
....@@ -14273,12 +14325,12 @@
1427314325 void GoUp(int mod)
1427414326 {
1427514327 MODIFIERS |= COMMAND;
14276
- /*
14328
+ /**/
1427714329 if((mod&SHIFT) == SHIFT)
1427814330 manipCamera.RotatePosition(0, speed);
1427914331 else
14280
- manipCamera.BackForth(0, speed*delta, getWidth());
14281
- */
14332
+ manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14333
+ /**/
1428214334 if ((mod & SHIFT) == SHIFT)
1428314335 {
1428414336 mouseMode = mouseMode;
....@@ -14294,12 +14346,12 @@
1429414346 void GoLeft(int mod)
1429514347 {
1429614348 MODIFIERS |= COMMAND;
14297
- /*
14349
+ /**/
1429814350 if((mod&SHIFT) == SHIFT)
14299
- manipCamera.RotatePosition(speed, 0);
14300
- else
1430114351 manipCamera.Translate(speed*delta, 0, getWidth());
14302
- */
14352
+ else
14353
+ manipCamera.RotatePosition(speed, 0);
14354
+ /**/
1430314355 if ((mod & SHIFT) == SHIFT)
1430414356 {
1430514357 mouseMode = mouseMode;
....@@ -14315,12 +14367,12 @@
1431514367 void GoRight(int mod)
1431614368 {
1431714369 MODIFIERS |= COMMAND;
14318
- /*
14370
+ /**/
1431914371 if((mod&SHIFT) == SHIFT)
14320
- manipCamera.RotatePosition(-speed, 0);
14321
- else
1432214372 manipCamera.Translate(-speed*delta, 0, getWidth());
14323
- */
14373
+ else
14374
+ manipCamera.RotatePosition(-speed, 0);
14375
+ /**/
1432414376 if ((mod & SHIFT) == SHIFT)
1432514377 {
1432614378 mouseMode = mouseMode;
....@@ -14559,7 +14611,8 @@
1455914611 Globals.MOUSEDRAGGED = false;
1456014612
1456114613 movingcamera = false;
14562
- X = Y = 0;
14614
+ X = 0; // getBounds().width/2;
14615
+ Y = 0; // getBounds().height/2;
1456314616 //System.out.println("mouseReleased: " + e);
1456414617 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1456514618 }
....@@ -14900,7 +14953,9 @@
1490014953 case 'E' : COMPACT ^= true;
1490114954 repaint();
1490214955 break;
14903
- case 'W' : DEBUGHSB ^= true;
14956
+ case 'W' : // Wide Window (fullscreen)
14957
+ //DEBUGHSB ^= true;
14958
+ ObjEditor.theFrame.ToggleFullScreen();
1490414959 repaint();
1490514960 break;
1490614961 case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break;
....@@ -14926,13 +14981,7 @@
1492614981 repaint();
1492714982 break;
1492814983 case 'l':
14929
- lightMode ^= true;
14930
- Globals.lighttouched = true;
14931
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14932
- targetLookAt.set(manipCamera.lookAt);
14933
- repaint();
14934
- break;
14935
- case 'L':
14984
+ //case 'L':
1493614985 if (lightMode)
1493714986 {
1493814987 lightMode = false;
....@@ -15075,11 +15124,14 @@
1507515124 case '_':
1507615125 kompactbit = 5;
1507715126 break;
15078
- case '+':
15079
- kompactbit = 6;
15080
- break;
15127
+// case '+':
15128
+// kompactbit = 6;
15129
+// break;
1508115130 case ' ':
15082
- ObjEditor.theFrame.ToggleFullScreen();
15131
+ lightMode ^= true;
15132
+ Globals.lighttouched = true;
15133
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15134
+ targetLookAt.set(manipCamera.lookAt);
1508315135 repaint();
1508415136 break;
1508515137 //case '`' :
....@@ -15126,8 +15178,9 @@
1512615178 case DELETE:
1512715179 ClearSelection();
1512815180 break;
15129
- /*
1513015181 case '+':
15182
+
15183
+ /*
1513115184 //fontsize += 1;
1513215185 bbzoom *= 2;
1513315186 repaint();
....@@ -15144,17 +15197,17 @@
1514415197 case '=':
1514515198 IncDepth();
1514615199 //fontsize += 1;
15147
- object.editWindow.refreshContents(true);
15200
+ object.GetWindow().refreshContents(true);
1514815201 maskbit = 6;
1514915202 break;
1515015203 case '-': //if (PixelThreshold>1) PixelThreshold /= 2;
1515115204 DecDepth();
1515215205 maskbit = 5;
1515315206 //if(fontsize > 1) fontsize -= 1;
15154
- if (object.editWindow == null)
15155
- new Exception().printStackTrace();
15156
- else
15157
- object.editWindow.refreshContents(true);
15207
+// if (object.editWindow == null)
15208
+// new Exception().printStackTrace();
15209
+// else
15210
+ object.GetWindow().refreshContents(true);
1515815211 break;
1515915212 case '{':
1516015213 manipCamera.shaper_fovy /= 1.1;
....@@ -15378,7 +15431,7 @@
1537815431 }
1537915432 */
1538015433
15381
- object.editWindow.EditSelection(false);
15434
+ object.GetWindow().EditSelection(false);
1538215435 }
1538315436
1538415437 void SelectParent()
....@@ -15395,10 +15448,10 @@
1539515448 {
1539615449 //selectees.remove(i);
1539715450 System.out.println("select parent of " + elem);
15398
- group.editWindow.Select(elem.parent.GetTreePath(), first, true);
15451
+ group.GetWindow().Select(elem.parent.GetTreePath(), first, true);
1539915452 } else
1540015453 {
15401
- group.editWindow.Select(elem.GetTreePath(), first, true);
15454
+ group.GetWindow().Select(elem.GetTreePath(), first, true);
1540215455 }
1540315456
1540415457 first = false;
....@@ -15440,12 +15493,12 @@
1544015493 for (int j = 0; j < group.children.size(); j++)
1544115494 {
1544215495 elem = (Object3D) group.children.elementAt(j);
15443
- object.editWindow.Select(elem.GetTreePath(), first, true);
15496
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1544415497 first = false;
1544515498 }
1544615499 } else
1544715500 {
15448
- object.editWindow.Select(elem.GetTreePath(), first, true);
15501
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1544915502 }
1545015503
1545115504 first = false;
....@@ -15456,21 +15509,21 @@
1545615509 {
1545715510 //Composite group = (Composite) object;
1545815511 Object3D group = object;
15459
- group.editWindow.loadClipboard(true); // ClearSelection(false);
15512
+ group.GetWindow().loadClipboard(true); // ClearSelection(false);
1546015513 }
1546115514
1546215515 void ResetTransform(int mask)
1546315516 {
1546415517 //Composite group = (Composite) object;
1546515518 Object3D group = object;
15466
- group.editWindow.ResetTransform(mask);
15519
+ group.GetWindow().ResetTransform(mask);
1546715520 }
1546815521
1546915522 void FlipTransform()
1547015523 {
1547115524 //Composite group = (Composite) object;
1547215525 Object3D group = object;
15473
- group.editWindow.FlipTransform();
15526
+ group.GetWindow().FlipTransform();
1547415527 // group.editWindow.ReduceMesh(true);
1547515528 }
1547615529
....@@ -15478,7 +15531,7 @@
1547815531 {
1547915532 //Composite group = (Composite) object;
1548015533 Object3D group = object;
15481
- group.editWindow.PrintMemory();
15534
+ group.GetWindow().PrintMemory();
1548215535 // group.editWindow.ReduceMesh(true);
1548315536 }
1548415537
....@@ -15486,7 +15539,7 @@
1548615539 {
1548715540 //Composite group = (Composite) object;
1548815541 Object3D group = object;
15489
- group.editWindow.ResetCentroid();
15542
+ group.GetWindow().ResetCentroid();
1549015543 }
1549115544
1549215545 void IncDepth()
....@@ -15662,6 +15715,7 @@
1566215715 info.bounds.y += (height - desired) / 2;
1566315716 }
1566415717 }
15718
+
1566515719 info.g = gr;
1566615720 info.camera = renderCamera;
1566715721 /*
....@@ -15671,23 +15725,44 @@
1567115725 */
1567215726 if (!isRenderer)
1567315727 {
15674
- object.drawEditHandles(info, 0);
15675
-
15676
- if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15728
+ Grafreed.Assert(object != null);
15729
+ Grafreed.Assert(object.selection != null);
15730
+ if (object.selection.Size() > 0)
1567715731 {
15678
- switch (object.selection.get(0).hitSomething)
15732
+ int hitSomething = object.selection.get(0).hitSomething;
15733
+
15734
+ info.DX = 0;
15735
+ info.DY = 0;
15736
+ info.W = 1;
15737
+ if (hitSomething == Object3D.hitCenter)
1567915738 {
15680
- case Object3D.hitCenter: gr.setColor(Color.pink);
15681
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15682
- break;
15683
- case Object3D.hitRotate: gr.setColor(Color.yellow);
15684
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15685
- break;
15686
- case Object3D.hitScale: gr.setColor(Color.cyan);
15687
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15688
- break;
15739
+ info.DX = X;
15740
+ if (X != 0)
15741
+ info.DX -= info.bounds.width/2;
15742
+
15743
+ info.DY = Y;
15744
+ if (Y != 0)
15745
+ info.DY -= info.bounds.height/2;
1568915746 }
15690
-
15747
+
15748
+ object.drawEditHandles(info, 0);
15749
+
15750
+ if (drag && (X != 0 || Y != 0))
15751
+ {
15752
+ switch (hitSomething)
15753
+ {
15754
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15755
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15756
+ break;
15757
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15758
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15759
+ break;
15760
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15761
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15762
+ break;
15763
+ }
15764
+
15765
+ }
1569115766 }
1569215767 }
1569315768 }
....@@ -16485,6 +16560,14 @@
1648516560 }
1648616561 }
1648716562
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
+
1648816571 class SelectBuffer implements GLEventListener
1648916572 {
1649016573
....@@ -16564,6 +16647,17 @@
1656416647
1656516648 //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
1656616649
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
+
1656716661 //int tmp = selection_view;
1656816662 //selection_view = -1;
1656916663 int temp = DrawMode();
....@@ -16575,6 +16669,17 @@
1657516669 // temp = DEFAULT; // patch for selection debug
1657616670 Globals.drawMode = temp; // WARNING
1657716671
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
+
1657816683 //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view);
1657916684
1658016685 // trying different ways of getting the depth info over
....@@ -16678,29 +16783,31 @@
1667816783 }
1667916784
1668016785 if (!movingcamera && !PAINTMODE)
16681
- object.editWindow.ScreenFitPoint(); // fev 2014
16786
+ object.GetWindow().ScreenFitPoint(); // fev 2014
1668216787
16683
- 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)
1668416789 {
16685
- Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16790
+ //Object3D paintobj; // = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1668616791
16687
- Object3D group = new Object3D("inst" + paintcount++);
16792
+ if (object.GetWindow().copy.selection.Size() > 0)
16793
+ {
16794
+ Object3D paintobj = object.GetWindow().copy.selection.elementAt(0);
1668816795
16689
- group.CreateMaterial(); // use a void leaf to select instances
16690
-
16691
- group.add(paintobj); // link
16692
-
16693
- object.editWindow.SnapObject(group);
16694
-
16695
- Object3D folder = object.editWindow.copy;
16696
-
16697
- if (object.editWindow.copy.selection.Size() > 0)
16698
- folder = object.editWindow.copy.selection.elementAt(0);
16699
-
16700
- folder.add(group);
16701
-
16702
- object.editWindow.ResetModel();
16703
- object.editWindow.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
+ }
1670416811 }
1670516812 else
1670616813 paintcount = 0;
....@@ -16739,6 +16846,11 @@
1673916846 //System.out.println("objects[color] = " + objects[color]);
1674016847 //objects[color].Select();
1674116848 indexcount = 0;
16849
+ ObjEditor window = object.GetWindow();
16850
+ if (window != null && deselect)
16851
+ {
16852
+ window.Select(null, deselect, true);
16853
+ }
1674216854 object.Select(color, deselect);
1674316855 }
1674416856