Normand Briere
2019-07-21 76522bc3ee92bd50dbd946d7f865666be4ad7bac
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;
....@@ -9374,13 +9395,13 @@
93749395 void ResetOptions()
93759396 {
93769397 options1[0] = 100;
9377
- options1[1] = 0.00001f;
9378
- options1[2] = 20;
9398
+ options1[1] = 0.025f;
9399
+ options1[2] = 0.01f;
93799400 options1[3] = 0;
93809401 options1[4] = 0;
93819402
93829403 options2[0] = 0;
9383
- options2[1] = 1;
9404
+ options2[1] = 0.75f;
93849405 options2[2] = 0;
93859406 options2[3] = 0;
93869407
....@@ -11014,9 +11035,9 @@
1101411035
1101511036 gl.glMatrixMode(GL.GL_MODELVIEW);
1101611037
11017
-//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
11018
-//gl.glEnable(gl.GL_POLYGON_SMOOTH);
11019
-//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);
1102011041 } else
1102111042 {
1102211043 //gl.glDisable(GL.GL_TEXTURE_2D);
....@@ -11027,7 +11048,7 @@
1102711048 //System.out.println("BLENDING ON");
1102811049 gl.glEnable(GL.GL_BLEND);
1102911050 gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
11030
-
11051
+// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE);
1103111052 gl.glMatrixMode(gl.GL_PROJECTION);
1103211053 gl.glLoadIdentity();
1103311054
....@@ -11513,7 +11534,7 @@
1151311534 if ((TRACK || SHADOWTRACK) || zoomonce)
1151411535 {
1151511536 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
11516
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11537
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1151711538 pingthread.StepToTarget(true); // true);
1151811539 // zoomonce = false;
1151911540 }
....@@ -13361,9 +13382,10 @@
1336113382 "DP3 " + dest + ".z," + "normals," + "eye;" +
1336213383 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1336313384 //"MOV " + dest + ".w," + "normal.z;" +
13364
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13365
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13366
- //"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
1336713389 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1336813390 "RCP " + dest + ".w," + dest + ".w;" +
1336913391 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -13928,7 +13950,7 @@
1392813950
1392913951 // fev 2014???
1393013952 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
13931
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
13953
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1393213954 pingthread.StepToTarget(true); // true);
1393313955 }
1393413956 // if (!LIVE)
....@@ -14282,12 +14304,12 @@
1428214304 void GoDown(int mod)
1428314305 {
1428414306 MODIFIERS |= COMMAND;
14285
- /*
14307
+ /**/
1428614308 if((mod&SHIFT) == SHIFT)
1428714309 manipCamera.RotatePosition(0, -speed);
1428814310 else
14289
- manipCamera.BackForth(0, -speed*delta, getWidth());
14290
- */
14311
+ manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14312
+ /**/
1429114313 if ((mod & SHIFT) == SHIFT)
1429214314 {
1429314315 mouseMode = mouseMode; // VR??
....@@ -14303,12 +14325,12 @@
1430314325 void GoUp(int mod)
1430414326 {
1430514327 MODIFIERS |= COMMAND;
14306
- /*
14328
+ /**/
1430714329 if((mod&SHIFT) == SHIFT)
1430814330 manipCamera.RotatePosition(0, speed);
1430914331 else
14310
- manipCamera.BackForth(0, speed*delta, getWidth());
14311
- */
14332
+ manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14333
+ /**/
1431214334 if ((mod & SHIFT) == SHIFT)
1431314335 {
1431414336 mouseMode = mouseMode;
....@@ -14324,12 +14346,12 @@
1432414346 void GoLeft(int mod)
1432514347 {
1432614348 MODIFIERS |= COMMAND;
14327
- /*
14349
+ /**/
1432814350 if((mod&SHIFT) == SHIFT)
14329
- manipCamera.RotatePosition(speed, 0);
14330
- else
1433114351 manipCamera.Translate(speed*delta, 0, getWidth());
14332
- */
14352
+ else
14353
+ manipCamera.RotatePosition(speed, 0);
14354
+ /**/
1433314355 if ((mod & SHIFT) == SHIFT)
1433414356 {
1433514357 mouseMode = mouseMode;
....@@ -14345,12 +14367,12 @@
1434514367 void GoRight(int mod)
1434614368 {
1434714369 MODIFIERS |= COMMAND;
14348
- /*
14370
+ /**/
1434914371 if((mod&SHIFT) == SHIFT)
14350
- manipCamera.RotatePosition(-speed, 0);
14351
- else
1435214372 manipCamera.Translate(-speed*delta, 0, getWidth());
14353
- */
14373
+ else
14374
+ manipCamera.RotatePosition(-speed, 0);
14375
+ /**/
1435414376 if ((mod & SHIFT) == SHIFT)
1435514377 {
1435614378 mouseMode = mouseMode;
....@@ -14589,7 +14611,8 @@
1458914611 Globals.MOUSEDRAGGED = false;
1459014612
1459114613 movingcamera = false;
14592
- X = Y = 0;
14614
+ X = 0; // getBounds().width/2;
14615
+ Y = 0; // getBounds().height/2;
1459314616 //System.out.println("mouseReleased: " + e);
1459414617 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1459514618 }
....@@ -14930,7 +14953,9 @@
1493014953 case 'E' : COMPACT ^= true;
1493114954 repaint();
1493214955 break;
14933
- case 'W' : DEBUGHSB ^= true;
14956
+ case 'W' : // Wide Window (fullscreen)
14957
+ //DEBUGHSB ^= true;
14958
+ ObjEditor.theFrame.ToggleFullScreen();
1493414959 repaint();
1493514960 break;
1493614961 case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break;
....@@ -14956,13 +14981,7 @@
1495614981 repaint();
1495714982 break;
1495814983 case 'l':
14959
- lightMode ^= true;
14960
- Globals.lighttouched = true;
14961
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14962
- targetLookAt.set(manipCamera.lookAt);
14963
- repaint();
14964
- break;
14965
- case 'L':
14984
+ //case 'L':
1496614985 if (lightMode)
1496714986 {
1496814987 lightMode = false;
....@@ -15105,11 +15124,14 @@
1510515124 case '_':
1510615125 kompactbit = 5;
1510715126 break;
15108
- case '+':
15109
- kompactbit = 6;
15110
- break;
15127
+// case '+':
15128
+// kompactbit = 6;
15129
+// break;
1511115130 case ' ':
15112
- ObjEditor.theFrame.ToggleFullScreen();
15131
+ lightMode ^= true;
15132
+ Globals.lighttouched = true;
15133
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15134
+ targetLookAt.set(manipCamera.lookAt);
1511315135 repaint();
1511415136 break;
1511515137 //case '`' :
....@@ -15156,8 +15178,9 @@
1515615178 case DELETE:
1515715179 ClearSelection();
1515815180 break;
15159
- /*
1516015181 case '+':
15182
+
15183
+ /*
1516115184 //fontsize += 1;
1516215185 bbzoom *= 2;
1516315186 repaint();
....@@ -15174,17 +15197,17 @@
1517415197 case '=':
1517515198 IncDepth();
1517615199 //fontsize += 1;
15177
- object.editWindow.refreshContents(true);
15200
+ object.GetWindow().refreshContents(true);
1517815201 maskbit = 6;
1517915202 break;
1518015203 case '-': //if (PixelThreshold>1) PixelThreshold /= 2;
1518115204 DecDepth();
1518215205 maskbit = 5;
1518315206 //if(fontsize > 1) fontsize -= 1;
15184
- if (object.editWindow == null)
15185
- new Exception().printStackTrace();
15186
- else
15187
- object.editWindow.refreshContents(true);
15207
+// if (object.editWindow == null)
15208
+// new Exception().printStackTrace();
15209
+// else
15210
+ object.GetWindow().refreshContents(true);
1518815211 break;
1518915212 case '{':
1519015213 manipCamera.shaper_fovy /= 1.1;
....@@ -15408,7 +15431,7 @@
1540815431 }
1540915432 */
1541015433
15411
- object.editWindow.EditSelection(false);
15434
+ object.GetWindow().EditSelection(false);
1541215435 }
1541315436
1541415437 void SelectParent()
....@@ -15425,10 +15448,10 @@
1542515448 {
1542615449 //selectees.remove(i);
1542715450 System.out.println("select parent of " + elem);
15428
- group.editWindow.Select(elem.parent.GetTreePath(), first, true);
15451
+ group.GetWindow().Select(elem.parent.GetTreePath(), first, true);
1542915452 } else
1543015453 {
15431
- group.editWindow.Select(elem.GetTreePath(), first, true);
15454
+ group.GetWindow().Select(elem.GetTreePath(), first, true);
1543215455 }
1543315456
1543415457 first = false;
....@@ -15470,12 +15493,12 @@
1547015493 for (int j = 0; j < group.children.size(); j++)
1547115494 {
1547215495 elem = (Object3D) group.children.elementAt(j);
15473
- object.editWindow.Select(elem.GetTreePath(), first, true);
15496
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1547415497 first = false;
1547515498 }
1547615499 } else
1547715500 {
15478
- object.editWindow.Select(elem.GetTreePath(), first, true);
15501
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1547915502 }
1548015503
1548115504 first = false;
....@@ -15486,21 +15509,21 @@
1548615509 {
1548715510 //Composite group = (Composite) object;
1548815511 Object3D group = object;
15489
- group.editWindow.loadClipboard(true); // ClearSelection(false);
15512
+ group.GetWindow().loadClipboard(true); // ClearSelection(false);
1549015513 }
1549115514
1549215515 void ResetTransform(int mask)
1549315516 {
1549415517 //Composite group = (Composite) object;
1549515518 Object3D group = object;
15496
- group.editWindow.ResetTransform(mask);
15519
+ group.GetWindow().ResetTransform(mask);
1549715520 }
1549815521
1549915522 void FlipTransform()
1550015523 {
1550115524 //Composite group = (Composite) object;
1550215525 Object3D group = object;
15503
- group.editWindow.FlipTransform();
15526
+ group.GetWindow().FlipTransform();
1550415527 // group.editWindow.ReduceMesh(true);
1550515528 }
1550615529
....@@ -15508,7 +15531,7 @@
1550815531 {
1550915532 //Composite group = (Composite) object;
1551015533 Object3D group = object;
15511
- group.editWindow.PrintMemory();
15534
+ group.GetWindow().PrintMemory();
1551215535 // group.editWindow.ReduceMesh(true);
1551315536 }
1551415537
....@@ -15516,7 +15539,7 @@
1551615539 {
1551715540 //Composite group = (Composite) object;
1551815541 Object3D group = object;
15519
- group.editWindow.ResetCentroid();
15542
+ group.GetWindow().ResetCentroid();
1552015543 }
1552115544
1552215545 void IncDepth()
....@@ -15692,6 +15715,7 @@
1569215715 info.bounds.y += (height - desired) / 2;
1569315716 }
1569415717 }
15718
+
1569515719 info.g = gr;
1569615720 info.camera = renderCamera;
1569715721 /*
....@@ -15701,23 +15725,44 @@
1570115725 */
1570215726 if (!isRenderer)
1570315727 {
15704
- object.drawEditHandles(info, 0);
15705
-
15706
- 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)
1570715731 {
15708
- 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)
1570915738 {
15710
- case Object3D.hitCenter: gr.setColor(Color.pink);
15711
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15712
- break;
15713
- case Object3D.hitRotate: gr.setColor(Color.yellow);
15714
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15715
- break;
15716
- case Object3D.hitScale: gr.setColor(Color.cyan);
15717
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15718
- 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;
1571915746 }
15720
-
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
+ }
1572115766 }
1572215767 }
1572315768 }
....@@ -16515,6 +16560,14 @@
1651516560 }
1651616561 }
1651716562
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
+
1651816571 class SelectBuffer implements GLEventListener
1651916572 {
1652016573
....@@ -16594,6 +16647,17 @@
1659416647
1659516648 //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
1659616649
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
+
1659716661 //int tmp = selection_view;
1659816662 //selection_view = -1;
1659916663 int temp = DrawMode();
....@@ -16605,6 +16669,17 @@
1660516669 // temp = DEFAULT; // patch for selection debug
1660616670 Globals.drawMode = temp; // WARNING
1660716671
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
+
1660816683 //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view);
1660916684
1661016685 // trying different ways of getting the depth info over
....@@ -16708,29 +16783,31 @@
1670816783 }
1670916784
1671016785 if (!movingcamera && !PAINTMODE)
16711
- object.editWindow.ScreenFitPoint(); // fev 2014
16786
+ object.GetWindow().ScreenFitPoint(); // fev 2014
1671216787
16713
- 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)
1671416789 {
16715
- 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);
1671616791
16717
- Object3D group = new Object3D("inst" + paintcount++);
16792
+ if (object.GetWindow().copy.selection.Size() > 0)
16793
+ {
16794
+ Object3D paintobj = object.GetWindow().copy.selection.elementAt(0);
1671816795
16719
- group.CreateMaterial(); // use a void leaf to select instances
16720
-
16721
- group.add(paintobj); // link
16722
-
16723
- object.editWindow.SnapObject(group);
16724
-
16725
- Object3D folder = object.editWindow.copy;
16726
-
16727
- if (object.editWindow.copy.selection.Size() > 0)
16728
- folder = object.editWindow.copy.selection.elementAt(0);
16729
-
16730
- folder.add(group);
16731
-
16732
- object.editWindow.ResetModel();
16733
- 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
+ }
1673416811 }
1673516812 else
1673616813 paintcount = 0;
....@@ -16769,6 +16846,11 @@
1676916846 //System.out.println("objects[color] = " + objects[color]);
1677016847 //objects[color].Select();
1677116848 indexcount = 0;
16849
+ ObjEditor window = object.GetWindow();
16850
+ if (window != null && deselect)
16851
+ {
16852
+ window.Select(null, deselect, true);
16853
+ }
1677216854 object.Select(color, deselect);
1677316855 }
1677416856