.. | .. |
---|
36 | 36 | Object3D versionlist[]; |
---|
37 | 37 | int versionindex = -1; |
---|
38 | 38 | |
---|
| 39 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 40 | + |
---|
39 | 41 | ScriptNode scriptnode; |
---|
40 | 42 | |
---|
41 | 43 | void InitOthers() |
---|
.. | .. |
---|
269 | 271 | // |
---|
270 | 272 | // return null; |
---|
271 | 273 | // } |
---|
| 274 | + |
---|
| 275 | + transient boolean tag; |
---|
| 276 | + |
---|
| 277 | + void TagObjects(Object3D o, boolean tag) |
---|
| 278 | + { |
---|
| 279 | + if (blockloop) |
---|
| 280 | + return; |
---|
| 281 | + |
---|
| 282 | + o.tag = tag; |
---|
| 283 | + |
---|
| 284 | + if (o == this) |
---|
| 285 | + return; |
---|
| 286 | + |
---|
| 287 | + blockloop = true; |
---|
| 288 | + |
---|
| 289 | + for (int i=0; i<Size(); i++) |
---|
| 290 | + { |
---|
| 291 | + get(i).TagObjects(o, tag); |
---|
| 292 | + } |
---|
| 293 | + |
---|
| 294 | + blockloop = false; |
---|
| 295 | + } |
---|
| 296 | + |
---|
| 297 | + boolean HasTags() |
---|
| 298 | + { |
---|
| 299 | + if (blockloop) |
---|
| 300 | + return false; |
---|
| 301 | + |
---|
| 302 | + blockloop = true; |
---|
| 303 | + |
---|
| 304 | + boolean hasTags = false; |
---|
| 305 | + |
---|
| 306 | + for (int i=0; i<Size(); i++) |
---|
| 307 | + { |
---|
| 308 | + hasTags |= get(i).tag || get(i).HasTags(); |
---|
| 309 | + |
---|
| 310 | + if (hasTags) |
---|
| 311 | + break; |
---|
| 312 | + } |
---|
| 313 | + |
---|
| 314 | + blockloop = false; |
---|
| 315 | + |
---|
| 316 | + return hasTags; |
---|
| 317 | + } |
---|
272 | 318 | |
---|
273 | 319 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
274 | 320 | { |
---|
.. | .. |
---|
2468 | 2514 | else |
---|
2469 | 2515 | { |
---|
2470 | 2516 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
2471 | | - ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2517 | + if (objectUI != null) |
---|
| 2518 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2519 | + else |
---|
| 2520 | + //new Exception().printStackTrace(); |
---|
| 2521 | + System.err.println("objectUI is null"); |
---|
2472 | 2522 | } |
---|
2473 | 2523 | } |
---|
2474 | 2524 | |
---|
.. | .. |
---|
3572 | 3622 | |
---|
3573 | 3623 | void ClearMaterials() |
---|
3574 | 3624 | { |
---|
| 3625 | + if (blockloop) |
---|
| 3626 | + return; |
---|
| 3627 | + |
---|
| 3628 | + blockloop = true; |
---|
| 3629 | + |
---|
3575 | 3630 | ClearMaterial(); |
---|
3576 | | - for (int i = 0; i < size(); i++) |
---|
| 3631 | + for (int i = 0; i < Size(); i++) |
---|
3577 | 3632 | { |
---|
3578 | | - Object3D child = (Object3D) reserve(i); |
---|
| 3633 | + Object3D child = (Object3D) get(i); |
---|
3579 | 3634 | if (child == null) |
---|
3580 | 3635 | continue; |
---|
3581 | 3636 | child.ClearMaterials(); |
---|
3582 | | - release(i); |
---|
3583 | 3637 | } |
---|
| 3638 | + |
---|
| 3639 | + blockloop = false; |
---|
| 3640 | + } |
---|
| 3641 | + |
---|
| 3642 | + void ClearVersionList() |
---|
| 3643 | + { |
---|
| 3644 | + this.versionlist = null; |
---|
| 3645 | + this.versionindex = -1; |
---|
| 3646 | + this.versiontable = null; |
---|
| 3647 | + } |
---|
| 3648 | + |
---|
| 3649 | + void ClearVersions() |
---|
| 3650 | + { |
---|
| 3651 | + if (blockloop) |
---|
| 3652 | + return; |
---|
| 3653 | + |
---|
| 3654 | + blockloop = true; |
---|
| 3655 | + |
---|
| 3656 | + ClearVersionList(); |
---|
| 3657 | + for (int i = 0; i < Size(); i++) |
---|
| 3658 | + { |
---|
| 3659 | + Object3D child = (Object3D) get(i); |
---|
| 3660 | + if (child == null) |
---|
| 3661 | + continue; |
---|
| 3662 | + child.ClearVersions(); |
---|
| 3663 | + } |
---|
| 3664 | + |
---|
| 3665 | + blockloop = false; |
---|
3584 | 3666 | } |
---|
3585 | 3667 | |
---|
3586 | 3668 | void FlipV(boolean flip) |
---|
.. | .. |
---|
5570 | 5652 | if (fullname == null) |
---|
5571 | 5653 | return ""; |
---|
5572 | 5654 | |
---|
| 5655 | + if (fullname.pigment != null) |
---|
| 5656 | + { |
---|
| 5657 | + return fullname.pigment; |
---|
| 5658 | + } |
---|
| 5659 | + |
---|
5573 | 5660 | // System.out.println("Fullname = " + fullname); |
---|
5574 | 5661 | |
---|
5575 | 5662 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5582 | 5669 | |
---|
5583 | 5670 | if (split.length == 0) |
---|
5584 | 5671 | { |
---|
5585 | | - return ""; |
---|
| 5672 | + return fullname.pigment = ""; |
---|
5586 | 5673 | } |
---|
5587 | 5674 | |
---|
5588 | 5675 | if (split.length <= 2) |
---|
.. | .. |
---|
5590 | 5677 | if (fullname.name.endsWith(":")) |
---|
5591 | 5678 | { |
---|
5592 | 5679 | // Windows |
---|
5593 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5680 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5594 | 5681 | } |
---|
5595 | 5682 | |
---|
5596 | | - return split[0]; |
---|
| 5683 | + return fullname.pigment = split[0]; |
---|
5597 | 5684 | } |
---|
5598 | 5685 | |
---|
5599 | 5686 | // Windows |
---|
5600 | 5687 | assert(split.length == 4); |
---|
5601 | 5688 | |
---|
5602 | | - return split[0] + ":" + split[1]; |
---|
| 5689 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5603 | 5690 | } |
---|
5604 | 5691 | |
---|
5605 | 5692 | static String GetBump(cTexture fullname) |
---|
5606 | 5693 | { |
---|
5607 | 5694 | if (fullname == null) |
---|
5608 | 5695 | return ""; |
---|
| 5696 | + |
---|
| 5697 | + if (fullname.bump != null) |
---|
| 5698 | + { |
---|
| 5699 | + return fullname.bump; |
---|
| 5700 | + } |
---|
5609 | 5701 | |
---|
5610 | 5702 | // System.out.println("Fullname = " + fullname); |
---|
5611 | 5703 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5617 | 5709 | |
---|
5618 | 5710 | if (split.length == 0) |
---|
5619 | 5711 | { |
---|
5620 | | - return ""; |
---|
| 5712 | + return fullname.bump = ""; |
---|
5621 | 5713 | } |
---|
5622 | 5714 | |
---|
5623 | 5715 | if (split.length == 1) |
---|
5624 | 5716 | { |
---|
5625 | | - return ""; |
---|
| 5717 | + return fullname.bump = ""; |
---|
5626 | 5718 | } |
---|
5627 | 5719 | |
---|
5628 | 5720 | if (split.length == 2) |
---|
.. | .. |
---|
5630 | 5722 | if (fullname.name.endsWith(":")) |
---|
5631 | 5723 | { |
---|
5632 | 5724 | // Windows |
---|
5633 | | - return ""; |
---|
| 5725 | + return fullname.bump = ""; |
---|
5634 | 5726 | } |
---|
5635 | 5727 | |
---|
5636 | | - return split[1]; |
---|
| 5728 | + return fullname.bump = split[1]; |
---|
5637 | 5729 | } |
---|
5638 | 5730 | |
---|
5639 | 5731 | // Windows |
---|
5640 | 5732 | assert(split.length == 4); |
---|
5641 | 5733 | |
---|
5642 | | - return split[2] + ":" + split[3]; |
---|
| 5734 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5643 | 5735 | } |
---|
5644 | 5736 | |
---|
5645 | 5737 | String GetPigmentTexture() |
---|
.. | .. |
---|
5722 | 5814 | texname = ""; |
---|
5723 | 5815 | |
---|
5724 | 5816 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5817 | + |
---|
| 5818 | + GetTextures().pigment = null; |
---|
| 5819 | + |
---|
5725 | 5820 | Touch(); |
---|
5726 | 5821 | } |
---|
5727 | 5822 | |
---|
.. | .. |
---|
5794 | 5889 | texname = ""; |
---|
5795 | 5890 | |
---|
5796 | 5891 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5892 | + |
---|
| 5893 | + GetTextures().bump = null; |
---|
5797 | 5894 | |
---|
5798 | 5895 | Touch(); |
---|
5799 | 5896 | } |
---|
.. | .. |
---|
7398 | 7495 | boundary.y = spot.y - 30; |
---|
7399 | 7496 | boundary.width = spot.width + 60; |
---|
7400 | 7497 | boundary.height = spot.height + 60; |
---|
7401 | | - clickInfo.g.setColor(Color.red); |
---|
| 7498 | + clickInfo.g.setColor(Color.white); |
---|
7402 | 7499 | int spotw = spot.x + spot.width; |
---|
7403 | 7500 | int spoth = spot.y + spot.height; |
---|
7404 | 7501 | clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7418 | 7515 | // { |
---|
7419 | 7516 | // CameraPane.Ymax = spoth; |
---|
7420 | 7517 | // } |
---|
7421 | | - spot.translate(32, 32); |
---|
| 7518 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7519 | +// { |
---|
| 7520 | +// CameraPane.Xmin = spot.x; |
---|
| 7521 | +// } |
---|
| 7522 | +// if (CameraPane.Xmax < spotw) |
---|
| 7523 | +// { |
---|
| 7524 | +// CameraPane.Xmax = spotw; |
---|
| 7525 | +// } |
---|
| 7526 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7527 | +// { |
---|
| 7528 | +// CameraPane.Ymin = spot.y; |
---|
| 7529 | +// } |
---|
| 7530 | +// if (CameraPane.Ymax < spoth) |
---|
| 7531 | +// { |
---|
| 7532 | +// CameraPane.Ymax = spoth; |
---|
| 7533 | +// } |
---|
| 7534 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7535 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
| 7536 | + spot.translate(32, 0); |
---|
| 7537 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7538 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7539 | + |
---|
| 7540 | + spot.translate(32, 64); |
---|
7422 | 7541 | spotw = spot.x + spot.width; |
---|
7423 | 7542 | spoth = spot.y + spot.height; |
---|
7424 | 7543 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7439 | 7558 | // { |
---|
7440 | 7559 | // CameraPane.Ymax = spoth; |
---|
7441 | 7560 | // } |
---|
7442 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7443 | | - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7444 | | - spot.translate(0, -32); |
---|
7445 | | - clickInfo.g.setColor(Color.yellow); |
---|
7446 | | - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7447 | 7561 | clickInfo.g.setColor(Color.green); |
---|
7448 | | -// if (CameraPane.Xmin > spot.x) |
---|
7449 | | -// { |
---|
7450 | | -// CameraPane.Xmin = spot.x; |
---|
7451 | | -// } |
---|
7452 | | -// if (CameraPane.Xmax < spotw) |
---|
7453 | | -// { |
---|
7454 | | -// CameraPane.Xmax = spotw; |
---|
7455 | | -// } |
---|
7456 | | -// if (CameraPane.Ymin > spot.y) |
---|
7457 | | -// { |
---|
7458 | | -// CameraPane.Ymin = spot.y; |
---|
7459 | | -// } |
---|
7460 | | -// if (CameraPane.Ymax < spoth) |
---|
7461 | | -// { |
---|
7462 | | -// CameraPane.Ymax = spoth; |
---|
7463 | | -// } |
---|
7464 | 7562 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7465 | 7563 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7466 | 7564 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7519 | 7617 | retval = true; |
---|
7520 | 7618 | } |
---|
7521 | 7619 | spot.translate(0, 32); |
---|
| 7620 | + spot.translate(32, 0); |
---|
| 7621 | + spot.translate(0, 32); |
---|
7522 | 7622 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7523 | 7623 | { |
---|
7524 | 7624 | hitSomething = hitScale; |
---|
7525 | 7625 | |
---|
7526 | 7626 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7527 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7627 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7528 | 7628 | double sign = 1; |
---|
7529 | 7629 | if (hScale < 0) |
---|
7530 | 7630 | { |
---|
.. | .. |
---|
7536 | 7636 | //hScale = 0.01; |
---|
7537 | 7637 | } |
---|
7538 | 7638 | |
---|
7539 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7639 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7540 | 7640 | sign = 1; |
---|
7541 | 7641 | if (vScale < 0) |
---|
7542 | 7642 | { |
---|
.. | .. |
---|
7751 | 7851 | break; |
---|
7752 | 7852 | |
---|
7753 | 7853 | case hitScale: // scale |
---|
7754 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7854 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7755 | 7855 | double sign = 1; |
---|
7756 | 7856 | if (hScale < 0) |
---|
7757 | 7857 | { |
---|
.. | .. |
---|
7763 | 7863 | //hScale = 0.01; |
---|
7764 | 7864 | } |
---|
7765 | 7865 | |
---|
7766 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7866 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7767 | 7867 | sign = 1; |
---|
7768 | 7868 | if (vScale < 0) |
---|
7769 | 7869 | { |
---|
.. | .. |
---|
7796 | 7896 | case 3: // '\001' |
---|
7797 | 7897 | if (modified || opposite) |
---|
7798 | 7898 | { |
---|
| 7899 | + if (modified && opposite) |
---|
| 7900 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7901 | + else |
---|
7799 | 7902 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7800 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7903 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7801 | 7904 | } // vScale, 1); |
---|
7802 | 7905 | else |
---|
7803 | 7906 | { |
---|
7804 | 7907 | // EXCEPTION! |
---|
7805 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7908 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7806 | 7909 | } // vScale, 1); |
---|
7807 | 7910 | break; |
---|
7808 | 7911 | |
---|
7809 | 7912 | case 2: // '\002' |
---|
7810 | 7913 | if (modified || opposite) |
---|
7811 | 7914 | { |
---|
7812 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7813 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 7915 | + if (modified && opposite) |
---|
| 7916 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7917 | + else |
---|
| 7918 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 7919 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7814 | 7920 | } else |
---|
7815 | 7921 | { |
---|
7816 | 7922 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7820 | 7926 | case 1: // '\003' |
---|
7821 | 7927 | if (modified || opposite) |
---|
7822 | 7928 | { |
---|
7823 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7824 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 7929 | + if (modified && opposite) |
---|
| 7930 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7931 | + else |
---|
| 7932 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 7933 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7825 | 7934 | } else |
---|
7826 | 7935 | { |
---|
7827 | 7936 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|