.. | .. |
---|
300 | 300 | } |
---|
301 | 301 | |
---|
302 | 302 | boolean live = false; |
---|
| 303 | + boolean dontselect = false; |
---|
303 | 304 | boolean hide = false; |
---|
304 | 305 | boolean link2master = false; // performs reset support/master at each frame |
---|
305 | 306 | boolean marked = false; // animation node |
---|
.. | .. |
---|
797 | 798 | |
---|
798 | 799 | if (marked && Globals.isLIVE() && live && |
---|
799 | 800 | //TEMP21aug2018 |
---|
800 | | - Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 801 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
801 | 802 | currentframe != Globals.framecount) |
---|
802 | 803 | { |
---|
803 | 804 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
912 | 913 | fromParent = null; // LA.newMatrix(); |
---|
913 | 914 | bRep = null; // new BoundaryRep(); |
---|
914 | 915 | |
---|
| 916 | + if (oname != null && oname.equals("LeftHand")) |
---|
| 917 | + { |
---|
| 918 | + name = oname; |
---|
| 919 | + } |
---|
| 920 | + |
---|
915 | 921 | /* |
---|
916 | 922 | float hue = (float)Math.random(); |
---|
917 | 923 | Color col; |
---|
.. | .. |
---|
954 | 960 | |
---|
955 | 961 | public Object clone() |
---|
956 | 962 | { |
---|
957 | | - return GrafreeD.clone(this); |
---|
| 963 | + return Grafreed.clone(this); |
---|
958 | 964 | } |
---|
959 | 965 | |
---|
960 | 966 | Object3D copyExpand() |
---|
.. | .. |
---|
1470 | 1476 | BoundaryRep.SEUIL = other.material.cameralight; |
---|
1471 | 1477 | |
---|
1472 | 1478 | // Set default to 0.1 |
---|
1473 | | - BoundaryRep.SEUIL /= 2; |
---|
| 1479 | + BoundaryRep.SEUIL /= 4; // 2; |
---|
1474 | 1480 | System.out.println("SEUIL = " + BoundaryRep.SEUIL); |
---|
1475 | 1481 | } |
---|
1476 | 1482 | |
---|
.. | .. |
---|
1729 | 1735 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1730 | 1736 | o.bRep = transientrep; |
---|
1731 | 1737 | if (clone) |
---|
1732 | | - o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
| 1738 | + o.bRep = (BoundaryRep) Grafreed.clone(transientrep); |
---|
1733 | 1739 | o.CreateMaterial(); |
---|
1734 | 1740 | o.SetAttributes(this, -1); |
---|
1735 | 1741 | //parent |
---|
.. | .. |
---|
1742 | 1748 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1743 | 1749 | o.bRep = bRep; |
---|
1744 | 1750 | if (clone) |
---|
1745 | | - o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 1751 | + o.bRep = (BoundaryRep) Grafreed.clone(bRep); |
---|
1746 | 1752 | o.CreateMaterial(); |
---|
1747 | 1753 | //o.overwriteThis(this, -1); |
---|
1748 | 1754 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
1829 | 1835 | if (obj.name == null) |
---|
1830 | 1836 | continue; // can't be a null one |
---|
1831 | 1837 | |
---|
| 1838 | + // Try perfect match first. |
---|
1832 | 1839 | if (n.equals(obj.name)) |
---|
1833 | 1840 | { |
---|
1834 | 1841 | theobj = obj; |
---|
1835 | 1842 | count++; |
---|
1836 | 1843 | } |
---|
1837 | 1844 | } |
---|
| 1845 | + |
---|
| 1846 | + // not needed: n = n.split(":")[0]; // Poser generates a count |
---|
1838 | 1847 | |
---|
1839 | 1848 | if (count != 1) |
---|
1840 | 1849 | for (int i=Size(); --i>=0;) |
---|
.. | .. |
---|
2983 | 2992 | blockloop = false; |
---|
2984 | 2993 | } |
---|
2985 | 2994 | |
---|
| 2995 | + void TransformChildren() |
---|
| 2996 | + { |
---|
| 2997 | + if (toParent != null) |
---|
| 2998 | + { |
---|
| 2999 | + for (int i=Size(); --i>=0;) |
---|
| 3000 | + { |
---|
| 3001 | + Object3D v = get(i); |
---|
| 3002 | + |
---|
| 3003 | + if (v.toParent == null) |
---|
| 3004 | + { |
---|
| 3005 | + v.toParent = LA.newMatrix(); |
---|
| 3006 | + v.fromParent = LA.newMatrix(); |
---|
| 3007 | + } |
---|
| 3008 | + |
---|
| 3009 | +// LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3010 | +// LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3011 | + LA.matConcat(toParent, v.toParent, v.toParent); |
---|
| 3012 | + LA.matConcat(v.fromParent, fromParent, v.fromParent); |
---|
| 3013 | + } |
---|
| 3014 | + |
---|
| 3015 | + toParent = null; // LA.matIdentity(toParent); |
---|
| 3016 | + fromParent = null; // LA.matIdentity(fromParent); |
---|
| 3017 | + |
---|
| 3018 | + Touch(); |
---|
| 3019 | + } |
---|
| 3020 | + } |
---|
| 3021 | + |
---|
2986 | 3022 | void TransformGeometry() |
---|
2987 | 3023 | { |
---|
2988 | 3024 | Object3D obj = this; |
---|
.. | .. |
---|
3204 | 3240 | |
---|
3205 | 3241 | BoundaryRep sup = bRep.support; |
---|
3206 | 3242 | bRep.support = null; |
---|
3207 | | - BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 3243 | + BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3208 | 3244 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3209 | | - temprep.SplitInTwo(reduction34, onlyone); |
---|
| 3245 | + |
---|
| 3246 | + while(temprep.SplitInTwo(reduction34, onlyone)); |
---|
| 3247 | + |
---|
3210 | 3248 | bRep = temprep; |
---|
3211 | 3249 | bRep.support = sup; |
---|
3212 | 3250 | Touch(); |
---|
.. | .. |
---|
3728 | 3766 | if (child == null) |
---|
3729 | 3767 | continue; |
---|
3730 | 3768 | |
---|
3731 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3769 | + if (Grafreed.RENDERME > 0) |
---|
3732 | 3770 | { |
---|
3733 | 3771 | if (child instanceof Merge) |
---|
3734 | 3772 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3879 | 3917 | if (child == null) |
---|
3880 | 3918 | continue; |
---|
3881 | 3919 | |
---|
3882 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3920 | + if (Grafreed.RENDERME > 0) |
---|
3883 | 3921 | { |
---|
3884 | 3922 | if (child instanceof Merge) |
---|
3885 | 3923 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4074 | 4112 | if (child == null) |
---|
4075 | 4113 | continue; |
---|
4076 | 4114 | |
---|
4077 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4115 | + if (Grafreed.RENDERME > 0) |
---|
4078 | 4116 | { |
---|
4079 | 4117 | if (child instanceof Merge) |
---|
4080 | 4118 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4681 | 4719 | |
---|
4682 | 4720 | cTreePath SelectLeaf(int indexcount, boolean deselect) |
---|
4683 | 4721 | { |
---|
4684 | | - if (hide) |
---|
| 4722 | + if (hide || dontselect) |
---|
4685 | 4723 | return null; |
---|
4686 | 4724 | |
---|
4687 | 4725 | if (count <= 0) |
---|
.. | .. |
---|
4707 | 4745 | |
---|
4708 | 4746 | cTreePath Select(int indexcount, boolean deselect) |
---|
4709 | 4747 | { |
---|
4710 | | - if (hide) |
---|
| 4748 | + if (hide || dontselect) |
---|
4711 | 4749 | return null; |
---|
4712 | 4750 | |
---|
4713 | 4751 | if (count <= 0) |
---|
.. | .. |
---|
5377 | 5415 | boolean NeedSupport() |
---|
5378 | 5416 | { |
---|
5379 | 5417 | return |
---|
5380 | | - CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
| 5418 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
5381 | 5419 | // PROBLEM with CROWD!! |
---|
5382 | | - && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
| 5420 | + && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5383 | 5421 | } |
---|
5384 | 5422 | |
---|
5385 | 5423 | static boolean DEBUG_SELECTION = false; |
---|
.. | .. |
---|
5394 | 5432 | } |
---|
5395 | 5433 | |
---|
5396 | 5434 | if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5397 | | - hide) |
---|
| 5435 | + (hide || dontselect)) |
---|
5398 | 5436 | return; |
---|
5399 | 5437 | |
---|
5400 | 5438 | if (name != null && name.contains("sclera")) |
---|
.. | .. |
---|
5636 | 5674 | tex = GetTextures(); |
---|
5637 | 5675 | } |
---|
5638 | 5676 | |
---|
5639 | | - display.BindTextures(tex, texres); |
---|
| 5677 | + boolean failed = false; |
---|
| 5678 | + |
---|
| 5679 | + try |
---|
| 5680 | + { |
---|
| 5681 | + display.BindTextures(tex, texres); |
---|
| 5682 | + } |
---|
| 5683 | + catch (Exception e) |
---|
| 5684 | + { |
---|
| 5685 | + System.err.println("FAILED: " + this); |
---|
| 5686 | + failed = true; |
---|
| 5687 | + } |
---|
5640 | 5688 | |
---|
5641 | 5689 | if (!compiled) |
---|
5642 | 5690 | { |
---|
.. | .. |
---|
5658 | 5706 | } |
---|
5659 | 5707 | } |
---|
5660 | 5708 | |
---|
5661 | | - display.ReleaseTextures(tex); |
---|
| 5709 | + if (!failed) |
---|
| 5710 | + display.ReleaseTextures(tex); |
---|
5662 | 5711 | |
---|
5663 | 5712 | display.PopMaterial(this, selected); |
---|
5664 | 5713 | } |
---|
.. | .. |
---|
5787 | 5836 | |
---|
5788 | 5837 | void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5789 | 5838 | { |
---|
| 5839 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 5840 | + return; |
---|
| 5841 | + |
---|
5790 | 5842 | if (hide) |
---|
5791 | 5843 | return; |
---|
5792 | 5844 | // shadow optimisation |
---|
.. | .. |
---|
5911 | 5963 | { |
---|
5912 | 5964 | if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5913 | 5965 | return; // no shadow for transparent objects |
---|
| 5966 | + |
---|
| 5967 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 5968 | + return; |
---|
5914 | 5969 | |
---|
5915 | 5970 | if (hide) |
---|
5916 | 5971 | return; |
---|
.. | .. |
---|
7368 | 7423 | //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")"; |
---|
7369 | 7424 | //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString(); |
---|
7370 | 7425 | //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString(); |
---|
| 7426 | + |
---|
| 7427 | + String objname; |
---|
| 7428 | + |
---|
7371 | 7429 | if (false) //parent != null) |
---|
7372 | 7430 | { |
---|
7373 | | - return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
| 7431 | + objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7374 | 7432 | } else |
---|
7375 | 7433 | { |
---|
7376 | | - return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this); |
---|
| 7434 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7377 | 7435 | } // + super.toString(); |
---|
7378 | 7436 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
| 7437 | + |
---|
| 7438 | + if (!Globals.ADVANCED) |
---|
| 7439 | + return objname; |
---|
| 7440 | + |
---|
| 7441 | + return objname + " " + System.identityHashCode(this); |
---|
7379 | 7442 | } |
---|
7380 | 7443 | |
---|
7381 | 7444 | public int hashCode() |
---|
.. | .. |
---|
7567 | 7630 | { |
---|
7568 | 7631 | assert(bRep != null); |
---|
7569 | 7632 | if (!(support instanceof GenericJoint)) // support.bRep != null) |
---|
7570 | | - GrafreeD.Assert(support.bRep == bRep.support); |
---|
| 7633 | + Grafreed.Assert(support.bRep == bRep.support); |
---|
7571 | 7634 | } |
---|
7572 | 7635 | else |
---|
7573 | 7636 | { |
---|