.. | .. |
---|
2065 | 2065 | //System.err.println("Oeil on"); |
---|
2066 | 2066 | OEIL = true; |
---|
2067 | 2067 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
2068 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 2068 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
2069 | 2069 | //pingthread.StepToTarget(true); |
---|
2070 | 2070 | } |
---|
2071 | 2071 | |
---|
.. | .. |
---|
2298 | 2298 | HANDLES ^= true; |
---|
2299 | 2299 | } |
---|
2300 | 2300 | |
---|
| 2301 | + Object3D paintFolder; |
---|
| 2302 | + |
---|
2301 | 2303 | void TogglePaint() |
---|
2302 | 2304 | { |
---|
2303 | 2305 | PAINTMODE ^= true; |
---|
2304 | 2306 | paintcount = 0; |
---|
| 2307 | + |
---|
| 2308 | + if (PAINTMODE) |
---|
| 2309 | + { |
---|
| 2310 | + paintFolder = GetFolder(); |
---|
| 2311 | + } |
---|
2305 | 2312 | } |
---|
2306 | 2313 | |
---|
2307 | 2314 | void SwapCamera(int a, int b) |
---|
.. | .. |
---|
8503 | 8510 | return texture!=null?texture.texturedata:null; |
---|
8504 | 8511 | } |
---|
8505 | 8512 | |
---|
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 |
---|
8507 | 8514 | { |
---|
8508 | 8515 | if (/*tex == null ||*/ ambientOcclusion ) // || !textureon) |
---|
8509 | 8516 | { |
---|
.. | .. |
---|
8515 | 8522 | com.sun.opengl.util.texture.Texture texture = GetTexture(tex, bump, resolution); |
---|
8516 | 8523 | |
---|
8517 | 8524 | if (texture == null) |
---|
8518 | | - return false; |
---|
| 8525 | + return texture; |
---|
8519 | 8526 | /**/ |
---|
8520 | 8527 | |
---|
8521 | 8528 | if (textureon || tex.equals("DEFAULT_TEXTURE") || tex.equals("DEFAULT_TEXTURE_BUMP") || tex.equals("WHITE_NOISE")) // || tex.equals("IMMORTAL")) |
---|
.. | .. |
---|
11028 | 11035 | |
---|
11029 | 11036 | gl.glMatrixMode(GL.GL_MODELVIEW); |
---|
11030 | 11037 | |
---|
11031 | | -//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST); |
---|
11032 | | -//gl.glEnable(gl.GL_POLYGON_SMOOTH); |
---|
11033 | | -//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); |
---|
11034 | 11041 | } else |
---|
11035 | 11042 | { |
---|
11036 | 11043 | //gl.glDisable(GL.GL_TEXTURE_2D); |
---|
.. | .. |
---|
11041 | 11048 | //System.out.println("BLENDING ON"); |
---|
11042 | 11049 | gl.glEnable(GL.GL_BLEND); |
---|
11043 | 11050 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); |
---|
11044 | | - |
---|
| 11051 | +// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE); |
---|
11045 | 11052 | gl.glMatrixMode(gl.GL_PROJECTION); |
---|
11046 | 11053 | gl.glLoadIdentity(); |
---|
11047 | 11054 | |
---|
.. | .. |
---|
11527 | 11534 | if ((TRACK || SHADOWTRACK) || zoomonce) |
---|
11528 | 11535 | { |
---|
11529 | 11536 | if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode) |
---|
11530 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 11537 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
11531 | 11538 | pingthread.StepToTarget(true); // true); |
---|
11532 | 11539 | // zoomonce = false; |
---|
11533 | 11540 | } |
---|
.. | .. |
---|
13943 | 13950 | |
---|
13944 | 13951 | // fev 2014??? |
---|
13945 | 13952 | if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode) |
---|
13946 | | - object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
| 13953 | + object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK); |
---|
13947 | 13954 | pingthread.StepToTarget(true); // true); |
---|
13948 | 13955 | } |
---|
13949 | 13956 | // if (!LIVE) |
---|
.. | .. |
---|
14297 | 14304 | void GoDown(int mod) |
---|
14298 | 14305 | { |
---|
14299 | 14306 | MODIFIERS |= COMMAND; |
---|
14300 | | - /* |
---|
| 14307 | + /**/ |
---|
14301 | 14308 | if((mod&SHIFT) == SHIFT) |
---|
14302 | 14309 | manipCamera.RotatePosition(0, -speed); |
---|
14303 | 14310 | else |
---|
14304 | | - manipCamera.BackForth(0, -speed*delta, getWidth()); |
---|
14305 | | - */ |
---|
| 14311 | + manipCamera.BackForth(0, -speed*delta, 0); // getWidth()); |
---|
| 14312 | + /**/ |
---|
14306 | 14313 | if ((mod & SHIFT) == SHIFT) |
---|
14307 | 14314 | { |
---|
14308 | 14315 | mouseMode = mouseMode; // VR?? |
---|
.. | .. |
---|
14318 | 14325 | void GoUp(int mod) |
---|
14319 | 14326 | { |
---|
14320 | 14327 | MODIFIERS |= COMMAND; |
---|
14321 | | - /* |
---|
| 14328 | + /**/ |
---|
14322 | 14329 | if((mod&SHIFT) == SHIFT) |
---|
14323 | 14330 | manipCamera.RotatePosition(0, speed); |
---|
14324 | 14331 | else |
---|
14325 | | - manipCamera.BackForth(0, speed*delta, getWidth()); |
---|
14326 | | - */ |
---|
| 14332 | + manipCamera.BackForth(0, speed*delta, 0); // getWidth()); |
---|
| 14333 | + /**/ |
---|
14327 | 14334 | if ((mod & SHIFT) == SHIFT) |
---|
14328 | 14335 | { |
---|
14329 | 14336 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14339 | 14346 | void GoLeft(int mod) |
---|
14340 | 14347 | { |
---|
14341 | 14348 | MODIFIERS |= COMMAND; |
---|
14342 | | - /* |
---|
| 14349 | + /**/ |
---|
14343 | 14350 | if((mod&SHIFT) == SHIFT) |
---|
14344 | | - manipCamera.RotatePosition(speed, 0); |
---|
14345 | | - else |
---|
14346 | 14351 | manipCamera.Translate(speed*delta, 0, getWidth()); |
---|
14347 | | - */ |
---|
| 14352 | + else |
---|
| 14353 | + manipCamera.RotatePosition(speed, 0); |
---|
| 14354 | + /**/ |
---|
14348 | 14355 | if ((mod & SHIFT) == SHIFT) |
---|
14349 | 14356 | { |
---|
14350 | 14357 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14360 | 14367 | void GoRight(int mod) |
---|
14361 | 14368 | { |
---|
14362 | 14369 | MODIFIERS |= COMMAND; |
---|
14363 | | - /* |
---|
| 14370 | + /**/ |
---|
14364 | 14371 | if((mod&SHIFT) == SHIFT) |
---|
14365 | | - manipCamera.RotatePosition(-speed, 0); |
---|
14366 | | - else |
---|
14367 | 14372 | manipCamera.Translate(-speed*delta, 0, getWidth()); |
---|
14368 | | - */ |
---|
| 14373 | + else |
---|
| 14374 | + manipCamera.RotatePosition(-speed, 0); |
---|
| 14375 | + /**/ |
---|
14369 | 14376 | if ((mod & SHIFT) == SHIFT) |
---|
14370 | 14377 | { |
---|
14371 | 14378 | mouseMode = mouseMode; |
---|
.. | .. |
---|
14604 | 14611 | Globals.MOUSEDRAGGED = false; |
---|
14605 | 14612 | |
---|
14606 | 14613 | movingcamera = false; |
---|
14607 | | - X = Y = 0; |
---|
| 14614 | + X = 0; // getBounds().width/2; |
---|
| 14615 | + Y = 0; // getBounds().height/2; |
---|
14608 | 14616 | //System.out.println("mouseReleased: " + e); |
---|
14609 | 14617 | clickEnd(e.getX(), e.getY(), e.getModifiersEx()); |
---|
14610 | 14618 | } |
---|
.. | .. |
---|
14945 | 14953 | case 'E' : COMPACT ^= true; |
---|
14946 | 14954 | repaint(); |
---|
14947 | 14955 | break; |
---|
14948 | | - case 'W' : DEBUGHSB ^= true; |
---|
| 14956 | + case 'W' : // Wide Window (fullscreen) |
---|
| 14957 | + //DEBUGHSB ^= true; |
---|
| 14958 | + ObjEditor.theFrame.ToggleFullScreen(); |
---|
14949 | 14959 | repaint(); |
---|
14950 | 14960 | break; |
---|
14951 | 14961 | case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break; |
---|
.. | .. |
---|
14971 | 14981 | repaint(); |
---|
14972 | 14982 | break; |
---|
14973 | 14983 | case 'l': |
---|
14974 | | - lightMode ^= true; |
---|
14975 | | - Globals.lighttouched = true; |
---|
14976 | | - manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
14977 | | - targetLookAt.set(manipCamera.lookAt); |
---|
14978 | | - repaint(); |
---|
14979 | | - break; |
---|
14980 | | - case 'L': |
---|
| 14984 | + //case 'L': |
---|
14981 | 14985 | if (lightMode) |
---|
14982 | 14986 | { |
---|
14983 | 14987 | lightMode = false; |
---|
.. | .. |
---|
15124 | 15128 | // kompactbit = 6; |
---|
15125 | 15129 | // break; |
---|
15126 | 15130 | case ' ': |
---|
15127 | | - ObjEditor.theFrame.ToggleFullScreen(); |
---|
| 15131 | + lightMode ^= true; |
---|
| 15132 | + Globals.lighttouched = true; |
---|
| 15133 | + manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera; |
---|
| 15134 | + targetLookAt.set(manipCamera.lookAt); |
---|
15128 | 15135 | repaint(); |
---|
15129 | 15136 | break; |
---|
15130 | 15137 | //case '`' : |
---|
.. | .. |
---|
15190 | 15197 | case '=': |
---|
15191 | 15198 | IncDepth(); |
---|
15192 | 15199 | //fontsize += 1; |
---|
15193 | | - object.editWindow.refreshContents(true); |
---|
| 15200 | + object.GetWindow().refreshContents(true); |
---|
15194 | 15201 | maskbit = 6; |
---|
15195 | 15202 | break; |
---|
15196 | 15203 | case '-': //if (PixelThreshold>1) PixelThreshold /= 2; |
---|
15197 | 15204 | DecDepth(); |
---|
15198 | 15205 | maskbit = 5; |
---|
15199 | 15206 | //if(fontsize > 1) fontsize -= 1; |
---|
15200 | | - if (object.editWindow == null) |
---|
15201 | | - new Exception().printStackTrace(); |
---|
15202 | | - else |
---|
15203 | | - object.editWindow.refreshContents(true); |
---|
| 15207 | +// if (object.editWindow == null) |
---|
| 15208 | +// new Exception().printStackTrace(); |
---|
| 15209 | +// else |
---|
| 15210 | + object.GetWindow().refreshContents(true); |
---|
15204 | 15211 | break; |
---|
15205 | 15212 | case '{': |
---|
15206 | 15213 | manipCamera.shaper_fovy /= 1.1; |
---|
.. | .. |
---|
15424 | 15431 | } |
---|
15425 | 15432 | */ |
---|
15426 | 15433 | |
---|
15427 | | - object.editWindow.EditSelection(false); |
---|
| 15434 | + object.GetWindow().EditSelection(false); |
---|
15428 | 15435 | } |
---|
15429 | 15436 | |
---|
15430 | 15437 | void SelectParent() |
---|
.. | .. |
---|
15441 | 15448 | { |
---|
15442 | 15449 | //selectees.remove(i); |
---|
15443 | 15450 | System.out.println("select parent of " + elem); |
---|
15444 | | - group.editWindow.Select(elem.parent.GetTreePath(), first, true); |
---|
| 15451 | + group.GetWindow().Select(elem.parent.GetTreePath(), first, true); |
---|
15445 | 15452 | } else |
---|
15446 | 15453 | { |
---|
15447 | | - group.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15454 | + group.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15448 | 15455 | } |
---|
15449 | 15456 | |
---|
15450 | 15457 | first = false; |
---|
.. | .. |
---|
15486 | 15493 | for (int j = 0; j < group.children.size(); j++) |
---|
15487 | 15494 | { |
---|
15488 | 15495 | elem = (Object3D) group.children.elementAt(j); |
---|
15489 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15496 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15490 | 15497 | first = false; |
---|
15491 | 15498 | } |
---|
15492 | 15499 | } else |
---|
15493 | 15500 | { |
---|
15494 | | - object.editWindow.Select(elem.GetTreePath(), first, true); |
---|
| 15501 | + object.GetWindow().Select(elem.GetTreePath(), first, true); |
---|
15495 | 15502 | } |
---|
15496 | 15503 | |
---|
15497 | 15504 | first = false; |
---|
.. | .. |
---|
15502 | 15509 | { |
---|
15503 | 15510 | //Composite group = (Composite) object; |
---|
15504 | 15511 | Object3D group = object; |
---|
15505 | | - group.editWindow.loadClipboard(true); // ClearSelection(false); |
---|
| 15512 | + group.GetWindow().loadClipboard(true); // ClearSelection(false); |
---|
15506 | 15513 | } |
---|
15507 | 15514 | |
---|
15508 | 15515 | void ResetTransform(int mask) |
---|
15509 | 15516 | { |
---|
15510 | 15517 | //Composite group = (Composite) object; |
---|
15511 | 15518 | Object3D group = object; |
---|
15512 | | - group.editWindow.ResetTransform(mask); |
---|
| 15519 | + group.GetWindow().ResetTransform(mask); |
---|
15513 | 15520 | } |
---|
15514 | 15521 | |
---|
15515 | 15522 | void FlipTransform() |
---|
15516 | 15523 | { |
---|
15517 | 15524 | //Composite group = (Composite) object; |
---|
15518 | 15525 | Object3D group = object; |
---|
15519 | | - group.editWindow.FlipTransform(); |
---|
| 15526 | + group.GetWindow().FlipTransform(); |
---|
15520 | 15527 | // group.editWindow.ReduceMesh(true); |
---|
15521 | 15528 | } |
---|
15522 | 15529 | |
---|
.. | .. |
---|
15524 | 15531 | { |
---|
15525 | 15532 | //Composite group = (Composite) object; |
---|
15526 | 15533 | Object3D group = object; |
---|
15527 | | - group.editWindow.PrintMemory(); |
---|
| 15534 | + group.GetWindow().PrintMemory(); |
---|
15528 | 15535 | // group.editWindow.ReduceMesh(true); |
---|
15529 | 15536 | } |
---|
15530 | 15537 | |
---|
.. | .. |
---|
15532 | 15539 | { |
---|
15533 | 15540 | //Composite group = (Composite) object; |
---|
15534 | 15541 | Object3D group = object; |
---|
15535 | | - group.editWindow.ResetCentroid(); |
---|
| 15542 | + group.GetWindow().ResetCentroid(); |
---|
15536 | 15543 | } |
---|
15537 | 15544 | |
---|
15538 | 15545 | void IncDepth() |
---|
.. | .. |
---|
15708 | 15715 | info.bounds.y += (height - desired) / 2; |
---|
15709 | 15716 | } |
---|
15710 | 15717 | } |
---|
| 15718 | + |
---|
15711 | 15719 | info.g = gr; |
---|
15712 | 15720 | info.camera = renderCamera; |
---|
15713 | 15721 | /* |
---|
.. | .. |
---|
15717 | 15725 | */ |
---|
15718 | 15726 | if (!isRenderer) |
---|
15719 | 15727 | { |
---|
15720 | | - object.drawEditHandles(info, 0); |
---|
15721 | | - |
---|
15722 | | - 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) |
---|
15723 | 15731 | { |
---|
15724 | | - 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) |
---|
15725 | 15738 | { |
---|
15726 | | - case Object3D.hitCenter: gr.setColor(Color.pink); |
---|
15727 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15728 | | - break; |
---|
15729 | | - case Object3D.hitRotate: gr.setColor(Color.yellow); |
---|
15730 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15731 | | - break; |
---|
15732 | | - case Object3D.hitScale: gr.setColor(Color.cyan); |
---|
15733 | | - gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
15734 | | - 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; |
---|
15735 | 15746 | } |
---|
15736 | | - |
---|
| 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 | + } |
---|
15737 | 15766 | } |
---|
15738 | 15767 | } |
---|
15739 | 15768 | } |
---|
.. | .. |
---|
16531 | 16560 | } |
---|
16532 | 16561 | } |
---|
16533 | 16562 | |
---|
| 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 | + |
---|
16534 | 16571 | class SelectBuffer implements GLEventListener |
---|
16535 | 16572 | { |
---|
16536 | 16573 | |
---|
.. | .. |
---|
16610 | 16647 | |
---|
16611 | 16648 | //gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); |
---|
16612 | 16649 | |
---|
| 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 | + |
---|
16613 | 16661 | //int tmp = selection_view; |
---|
16614 | 16662 | //selection_view = -1; |
---|
16615 | 16663 | int temp = DrawMode(); |
---|
.. | .. |
---|
16621 | 16669 | // temp = DEFAULT; // patch for selection debug |
---|
16622 | 16670 | Globals.drawMode = temp; // WARNING |
---|
16623 | 16671 | |
---|
| 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 | + |
---|
16624 | 16683 | //gl.glBindTexture(GL.GL_TEXTURE_2D, selection_view); |
---|
16625 | 16684 | |
---|
16626 | 16685 | // trying different ways of getting the depth info over |
---|
.. | .. |
---|
16724 | 16783 | } |
---|
16725 | 16784 | |
---|
16726 | 16785 | if (!movingcamera && !PAINTMODE) |
---|
16727 | | - object.editWindow.ScreenFitPoint(); // fev 2014 |
---|
| 16786 | + object.GetWindow().ScreenFitPoint(); // fev 2014 |
---|
16728 | 16787 | |
---|
16729 | | - 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) |
---|
16730 | 16789 | { |
---|
16731 | | - 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); |
---|
16732 | 16791 | |
---|
16733 | | - Object3D group = new Object3D("inst" + paintcount++); |
---|
| 16792 | + if (object.GetWindow().copy.selection.Size() > 0) |
---|
| 16793 | + { |
---|
| 16794 | + Object3D paintobj = object.GetWindow().copy.selection.elementAt(0); |
---|
16734 | 16795 | |
---|
16735 | | - group.CreateMaterial(); // use a void leaf to select instances |
---|
16736 | | - |
---|
16737 | | - group.add(paintobj); // link |
---|
16738 | | - |
---|
16739 | | - object.editWindow.SnapObject(group); |
---|
16740 | | - |
---|
16741 | | - Object3D folder = object.editWindow.copy; |
---|
16742 | | - |
---|
16743 | | - if (object.editWindow.copy.selection.Size() > 0) |
---|
16744 | | - folder = object.editWindow.copy.selection.elementAt(0); |
---|
16745 | | - |
---|
16746 | | - folder.add(group); |
---|
16747 | | - |
---|
16748 | | - object.editWindow.ResetModel(); |
---|
16749 | | - 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 | + } |
---|
16750 | 16811 | } |
---|
16751 | 16812 | else |
---|
16752 | 16813 | paintcount = 0; |
---|