Normand Briere
2019-07-21 5a546232b84ce65d8779d29e9171e7e2df013614
CameraPane.java
....@@ -2065,7 +2065,7 @@
20652065 //System.err.println("Oeil on");
20662066 OEIL = true;
20672067 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
2068
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
2068
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
20692069 //pingthread.StepToTarget(true);
20702070 }
20712071
....@@ -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)
....@@ -2396,128 +2403,6 @@
23962403 public GL GetGL() // INTERFACE
23972404 {
23982405 return currentGL;
2399
- }
2400
-
2401
- private void GetRemoteZip(String url, String name, boolean unzip, boolean save)
2402
- {
2403
- java.net.URL u;
2404
- InputStream is = null;
2405
- DataInputStream dis;
2406
- java.util.zip.ZipInputStream zis;
2407
- //String s;
2408
-
2409
- System.out.println("GetRemoteZip " + name);
2410
-
2411
- int total = 0; // dis.available();
2412
-
2413
- byte[] bytes = new byte[16384];
2414
-
2415
- try
2416
- {
2417
- u = new java.net.URL(url + name);
2418
- is = u.openStream();
2419
-
2420
- System.out.println(url + name);
2421
-
2422
- if (unzip)
2423
- {
2424
- //dis = new DataInputStream(new BufferedInputStream(is));
2425
- zis = new java.util.zip.ZipInputStream(new BufferedInputStream(is));
2426
- //while ((s = dis.readLine()) != null)
2427
-
2428
- if (save)
2429
- new java.io.File(name).mkdirs();
2430
-
2431
- // FileOutputStream stream = new FileOutputStream("test.zip");
2432
- //
2433
- // int count;
2434
- //
2435
- // while ((count = dis.read(bytes)) != -1)
2436
- // {
2437
- // //System.out.println(s);
2438
- // System.out.println(count);
2439
- // total += count;
2440
- // stream.write(bytes);
2441
- // }
2442
- //
2443
- // stream.close();
2444
-
2445
- // now iterate through each item in the stream. The get next
2446
- // entry call will return a ZipEntry for each file in the
2447
- // stream
2448
- java.util.zip.ZipEntry entry;
2449
- while((entry = zis.getNextEntry())!=null)
2450
- {
2451
- if (entry.getName().endsWith(".gsm"))
2452
- {
2453
- continue;
2454
- }
2455
-
2456
- String s = String.format("Entry: %s len %d added %TD",
2457
- entry.getName(), entry.getSize(),
2458
- new java.util.Date(entry.getTime()));
2459
- System.out.println(s);
2460
-
2461
- if (save)
2462
- {
2463
- // Once we get the entry from the stream, the stream is
2464
- // positioned read to read the raw data, and we keep
2465
- // reading until read returns 0 or less.
2466
- String outpath = name + "/" + entry.getName();
2467
- FileOutputStream output = null;
2468
- try
2469
- {
2470
- output = new FileOutputStream(outpath);
2471
- int len = 0;
2472
- while ((len = zis.read(bytes)) > 0)
2473
- {
2474
- output.write(bytes, 0, len);
2475
- }
2476
- }
2477
- finally
2478
- {
2479
- // we must always close the output file
2480
- if(output!=null) output.close();
2481
- }
2482
- }
2483
- }
2484
- }
2485
- }
2486
- catch (java.net.MalformedURLException mue)
2487
- {
2488
- System.err.println("Ouch - a MalformedURLException happened.");
2489
- mue.printStackTrace();
2490
- //System.exit(2);
2491
- }
2492
- catch (IOException ioe)
2493
- {
2494
- //System.err.println("Oops - an IOException happened.");
2495
- //ioe.printStackTrace();
2496
- //System.exit(3);
2497
- }
2498
- finally
2499
- {
2500
- try
2501
- {
2502
- if (is != null)
2503
- is.close();
2504
- }
2505
- catch (IOException ioe)
2506
- {
2507
- }
2508
- }
2509
-
2510
- // System.out.println("length = " + total);
2511
-
2512
-// try
2513
-// {
2514
-// Runtime.getRuntime().exec("/usr/local/bin/wget https://archive3d.net/?a=download&do=get&id=7caca905");
2515
-// }
2516
-// catch (Exception e)
2517
-// {
2518
-// e.printStackTrace();
2519
-// }
2520
-
25212406 }
25222407
25232408 /**/
....@@ -8045,7 +7930,7 @@
80457930 String pigment = Object3D.GetPigment(tex);
80467931 String bump = Object3D.GetBump(tex);
80477932
8048
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7933
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
80497934 {
80507935 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
80517936 // System.out.println("; bump = " + bump);
....@@ -8079,7 +7964,7 @@
80797964
80807965 String pigment = Object3D.GetPigment(tex);
80817966
8082
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7967
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
80837968 {
80847969 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
80857970 // System.out.println("; bump = " + bump);
....@@ -8108,7 +7993,7 @@
81087993
81097994 String bump = Object3D.GetBump(tex);
81107995
8111
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7996
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
81127997 {
81137998 // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
81147999 // System.out.println("; bump = " + bump);
....@@ -8246,7 +8131,7 @@
82468131 usedtextures.put(pigment, pigment);
82478132 usedtextures.put(bump, bump);
82488133
8249
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8134
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
82508135 {
82518136 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
82528137 // System.out.println("; bump = " + bump);
....@@ -8288,7 +8173,7 @@
82888173
82898174 usedtextures.put(pigment, pigment);
82908175
8291
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8176
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
82928177 {
82938178 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
82948179 // System.out.println("; bump = " + bump);
....@@ -8321,7 +8206,7 @@
83218206
83228207 usedtextures.put(bump, bump);
83238208
8324
- if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8209
+ //if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
83258210 {
83268211 // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
83278212 // System.out.println("; bump = " + bump);
....@@ -8632,7 +8517,7 @@
86328517 return false;
86338518 }
86348519
8635
- boolean newtex = false;
8520
+ //boolean newtex = false;
86368521
86378522 com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution);
86388523
....@@ -8664,7 +8549,7 @@
86648549 texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_S, GetGL().GL_REPEAT);
86658550 texture.setTexParameteri(GetGL().GL_TEXTURE_WRAP_T, GetGL().GL_REPEAT);
86668551
8667
- return newtex;
8552
+ return true; // Warning: not used.
86688553 }
86698554
86708555 ShadowBuffer shadowPBuf;
....@@ -11150,9 +11035,9 @@
1115011035
1115111036 gl.glMatrixMode(GL.GL_MODELVIEW);
1115211037
11153
-//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
11154
-//gl.glEnable(gl.GL_POLYGON_SMOOTH);
11155
-//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);
1115611041 } else
1115711042 {
1115811043 //gl.glDisable(GL.GL_TEXTURE_2D);
....@@ -11163,7 +11048,7 @@
1116311048 //System.out.println("BLENDING ON");
1116411049 gl.glEnable(GL.GL_BLEND);
1116511050 gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
11166
-
11051
+// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE);
1116711052 gl.glMatrixMode(gl.GL_PROJECTION);
1116811053 gl.glLoadIdentity();
1116911054
....@@ -11649,7 +11534,7 @@
1164911534 if ((TRACK || SHADOWTRACK) || zoomonce)
1165011535 {
1165111536 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
11652
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11537
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1165311538 pingthread.StepToTarget(true); // true);
1165411539 // zoomonce = false;
1165511540 }
....@@ -14065,7 +13950,7 @@
1406513950
1406613951 // fev 2014???
1406713952 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
14068
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
13953
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1406913954 pingthread.StepToTarget(true); // true);
1407013955 }
1407113956 // if (!LIVE)
....@@ -14419,12 +14304,12 @@
1441914304 void GoDown(int mod)
1442014305 {
1442114306 MODIFIERS |= COMMAND;
14422
- /*
14307
+ /**/
1442314308 if((mod&SHIFT) == SHIFT)
1442414309 manipCamera.RotatePosition(0, -speed);
1442514310 else
14426
- manipCamera.BackForth(0, -speed*delta, getWidth());
14427
- */
14311
+ manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14312
+ /**/
1442814313 if ((mod & SHIFT) == SHIFT)
1442914314 {
1443014315 mouseMode = mouseMode; // VR??
....@@ -14440,12 +14325,12 @@
1444014325 void GoUp(int mod)
1444114326 {
1444214327 MODIFIERS |= COMMAND;
14443
- /*
14328
+ /**/
1444414329 if((mod&SHIFT) == SHIFT)
1444514330 manipCamera.RotatePosition(0, speed);
1444614331 else
14447
- manipCamera.BackForth(0, speed*delta, getWidth());
14448
- */
14332
+ manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14333
+ /**/
1444914334 if ((mod & SHIFT) == SHIFT)
1445014335 {
1445114336 mouseMode = mouseMode;
....@@ -14461,12 +14346,12 @@
1446114346 void GoLeft(int mod)
1446214347 {
1446314348 MODIFIERS |= COMMAND;
14464
- /*
14349
+ /**/
1446514350 if((mod&SHIFT) == SHIFT)
14466
- manipCamera.RotatePosition(speed, 0);
14467
- else
1446814351 manipCamera.Translate(speed*delta, 0, getWidth());
14469
- */
14352
+ else
14353
+ manipCamera.RotatePosition(speed, 0);
14354
+ /**/
1447014355 if ((mod & SHIFT) == SHIFT)
1447114356 {
1447214357 mouseMode = mouseMode;
....@@ -14482,12 +14367,12 @@
1448214367 void GoRight(int mod)
1448314368 {
1448414369 MODIFIERS |= COMMAND;
14485
- /*
14370
+ /**/
1448614371 if((mod&SHIFT) == SHIFT)
14487
- manipCamera.RotatePosition(-speed, 0);
14488
- else
1448914372 manipCamera.Translate(-speed*delta, 0, getWidth());
14490
- */
14373
+ else
14374
+ manipCamera.RotatePosition(-speed, 0);
14375
+ /**/
1449114376 if ((mod & SHIFT) == SHIFT)
1449214377 {
1449314378 mouseMode = mouseMode;
....@@ -14726,7 +14611,8 @@
1472614611 Globals.MOUSEDRAGGED = false;
1472714612
1472814613 movingcamera = false;
14729
- X = Y = 0;
14614
+ X = 0; // getBounds().width/2;
14615
+ Y = 0; // getBounds().height/2;
1473014616 //System.out.println("mouseReleased: " + e);
1473114617 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1473214618 }
....@@ -15067,7 +14953,9 @@
1506714953 case 'E' : COMPACT ^= true;
1506814954 repaint();
1506914955 break;
15070
- case 'W' : DEBUGHSB ^= true;
14956
+ case 'W' : // Wide Window (fullscreen)
14957
+ //DEBUGHSB ^= true;
14958
+ ObjEditor.theFrame.ToggleFullScreen();
1507114959 repaint();
1507214960 break;
1507314961 case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break;
....@@ -15093,13 +14981,7 @@
1509314981 repaint();
1509414982 break;
1509514983 case 'l':
15096
- lightMode ^= true;
15097
- Globals.lighttouched = true;
15098
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15099
- targetLookAt.set(manipCamera.lookAt);
15100
- repaint();
15101
- break;
15102
- case 'L':
14984
+ //case 'L':
1510314985 if (lightMode)
1510414986 {
1510514987 lightMode = false;
....@@ -15246,7 +15128,10 @@
1524615128 // kompactbit = 6;
1524715129 // break;
1524815130 case ' ':
15249
- ObjEditor.theFrame.ToggleFullScreen();
15131
+ lightMode ^= true;
15132
+ Globals.lighttouched = true;
15133
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15134
+ targetLookAt.set(manipCamera.lookAt);
1525015135 repaint();
1525115136 break;
1525215137 //case '`' :
....@@ -15295,12 +15180,6 @@
1529515180 break;
1529615181 case '+':
1529715182
15298
- //for (int i=0; i<0x7FFFFFFF; i++)
15299
- {
15300
- //String.format("%08X", i); // "7caca905"
15301
- GetRemoteZip("https://archive3d.net/?a=download&do=get&id=", "7caca905", true, true);
15302
- }
15303
-
1530415183 /*
1530515184 //fontsize += 1;
1530615185 bbzoom *= 2;
....@@ -15318,17 +15197,17 @@
1531815197 case '=':
1531915198 IncDepth();
1532015199 //fontsize += 1;
15321
- object.editWindow.refreshContents(true);
15200
+ object.GetWindow().refreshContents(true);
1532215201 maskbit = 6;
1532315202 break;
1532415203 case '-': //if (PixelThreshold>1) PixelThreshold /= 2;
1532515204 DecDepth();
1532615205 maskbit = 5;
1532715206 //if(fontsize > 1) fontsize -= 1;
15328
- if (object.editWindow == null)
15329
- new Exception().printStackTrace();
15330
- else
15331
- object.editWindow.refreshContents(true);
15207
+// if (object.editWindow == null)
15208
+// new Exception().printStackTrace();
15209
+// else
15210
+ object.GetWindow().refreshContents(true);
1533215211 break;
1533315212 case '{':
1533415213 manipCamera.shaper_fovy /= 1.1;
....@@ -15552,7 +15431,7 @@
1555215431 }
1555315432 */
1555415433
15555
- object.editWindow.EditSelection(false);
15434
+ object.GetWindow().EditSelection(false);
1555615435 }
1555715436
1555815437 void SelectParent()
....@@ -15569,10 +15448,10 @@
1556915448 {
1557015449 //selectees.remove(i);
1557115450 System.out.println("select parent of " + elem);
15572
- group.editWindow.Select(elem.parent.GetTreePath(), first, true);
15451
+ group.GetWindow().Select(elem.parent.GetTreePath(), first, true);
1557315452 } else
1557415453 {
15575
- group.editWindow.Select(elem.GetTreePath(), first, true);
15454
+ group.GetWindow().Select(elem.GetTreePath(), first, true);
1557615455 }
1557715456
1557815457 first = false;
....@@ -15614,12 +15493,12 @@
1561415493 for (int j = 0; j < group.children.size(); j++)
1561515494 {
1561615495 elem = (Object3D) group.children.elementAt(j);
15617
- object.editWindow.Select(elem.GetTreePath(), first, true);
15496
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1561815497 first = false;
1561915498 }
1562015499 } else
1562115500 {
15622
- object.editWindow.Select(elem.GetTreePath(), first, true);
15501
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1562315502 }
1562415503
1562515504 first = false;
....@@ -15630,21 +15509,21 @@
1563015509 {
1563115510 //Composite group = (Composite) object;
1563215511 Object3D group = object;
15633
- group.editWindow.loadClipboard(true); // ClearSelection(false);
15512
+ group.GetWindow().loadClipboard(true); // ClearSelection(false);
1563415513 }
1563515514
1563615515 void ResetTransform(int mask)
1563715516 {
1563815517 //Composite group = (Composite) object;
1563915518 Object3D group = object;
15640
- group.editWindow.ResetTransform(mask);
15519
+ group.GetWindow().ResetTransform(mask);
1564115520 }
1564215521
1564315522 void FlipTransform()
1564415523 {
1564515524 //Composite group = (Composite) object;
1564615525 Object3D group = object;
15647
- group.editWindow.FlipTransform();
15526
+ group.GetWindow().FlipTransform();
1564815527 // group.editWindow.ReduceMesh(true);
1564915528 }
1565015529
....@@ -15652,7 +15531,7 @@
1565215531 {
1565315532 //Composite group = (Composite) object;
1565415533 Object3D group = object;
15655
- group.editWindow.PrintMemory();
15534
+ group.GetWindow().PrintMemory();
1565615535 // group.editWindow.ReduceMesh(true);
1565715536 }
1565815537
....@@ -15660,7 +15539,7 @@
1566015539 {
1566115540 //Composite group = (Composite) object;
1566215541 Object3D group = object;
15663
- group.editWindow.ResetCentroid();
15542
+ group.GetWindow().ResetCentroid();
1566415543 }
1566515544
1566615545 void IncDepth()
....@@ -15836,6 +15715,7 @@
1583615715 info.bounds.y += (height - desired) / 2;
1583715716 }
1583815717 }
15718
+
1583915719 info.g = gr;
1584015720 info.camera = renderCamera;
1584115721 /*
....@@ -15845,23 +15725,44 @@
1584515725 */
1584615726 if (!isRenderer)
1584715727 {
15848
- object.drawEditHandles(info, 0);
15849
-
15850
- 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)
1585115731 {
15852
- 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)
1585315738 {
15854
- case Object3D.hitCenter: gr.setColor(Color.pink);
15855
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15856
- break;
15857
- case Object3D.hitRotate: gr.setColor(Color.yellow);
15858
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15859
- break;
15860
- case Object3D.hitScale: gr.setColor(Color.cyan);
15861
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15862
- 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;
1586315746 }
15864
-
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
+ }
1586515766 }
1586615767 }
1586715768 }
....@@ -16659,6 +16560,14 @@
1665916560 }
1666016561 }
1666116562
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
+
1666216571 class SelectBuffer implements GLEventListener
1666316572 {
1666416573
....@@ -16738,6 +16647,17 @@
1673816647
1673916648 //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
1674016649
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
+
1674116661 //int tmp = selection_view;
1674216662 //selection_view = -1;
1674316663 int temp = DrawMode();
....@@ -16749,6 +16669,17 @@
1674916669 // temp = DEFAULT; // patch for selection debug
1675016670 Globals.drawMode = temp; // WARNING
1675116671
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
+
1675216683 //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view);
1675316684
1675416685 // trying different ways of getting the depth info over
....@@ -16852,29 +16783,31 @@
1685216783 }
1685316784
1685416785 if (!movingcamera && !PAINTMODE)
16855
- object.editWindow.ScreenFitPoint(); // fev 2014
16786
+ object.GetWindow().ScreenFitPoint(); // fev 2014
1685616787
16857
- 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)
1685816789 {
16859
- 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);
1686016791
16861
- Object3D group = new Object3D("inst" + paintcount++);
16792
+ if (object.GetWindow().copy.selection.Size() > 0)
16793
+ {
16794
+ Object3D paintobj = object.GetWindow().copy.selection.elementAt(0);
1686216795
16863
- group.CreateMaterial(); // use a void leaf to select instances
16864
-
16865
- group.add(paintobj); // link
16866
-
16867
- object.editWindow.SnapObject(group);
16868
-
16869
- Object3D folder = object.editWindow.copy;
16870
-
16871
- if (object.editWindow.copy.selection.Size() > 0)
16872
- folder = object.editWindow.copy.selection.elementAt(0);
16873
-
16874
- folder.add(group);
16875
-
16876
- object.editWindow.ResetModel();
16877
- 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
+ }
1687816811 }
1687916812 else
1688016813 paintcount = 0;