.. | .. |
---|
24 | 24 | |
---|
25 | 25 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 26 | |
---|
| 27 | + // TEMPORARY for mocap undo |
---|
| 28 | + mocap.reader.BVHReader.BVHResult bvh; |
---|
| 29 | + Object3D skeleton; |
---|
| 30 | + // |
---|
| 31 | + |
---|
27 | 32 | ScriptNode scriptnode; |
---|
28 | 33 | |
---|
29 | 34 | void InitOthers() |
---|
.. | .. |
---|
104 | 109 | |
---|
105 | 110 | // transient boolean reduced; // for morph reduction |
---|
106 | 111 | |
---|
107 | | -transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
108 | | -transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
| 112 | + transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
| 113 | + transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
109 | 114 | |
---|
110 | | -transient Object3D transientsupport; // for cloning |
---|
111 | | -transient boolean transientlink2master; |
---|
| 115 | + transient Object3D transientsupport; // for cloning |
---|
| 116 | + transient boolean transientlink2master; |
---|
112 | 117 | |
---|
113 | | -void SaveSupports() |
---|
114 | | -{ |
---|
115 | | - if (blockloop) |
---|
116 | | - return; |
---|
117 | | - |
---|
118 | | - transientsupport = support; |
---|
119 | | - transientlink2master = link2master; |
---|
120 | | - |
---|
121 | | - support = null; |
---|
122 | | - link2master = false; |
---|
123 | | - |
---|
124 | | - if (bRep != null) |
---|
| 118 | + void SaveSupports() |
---|
125 | 119 | { |
---|
126 | | - bRep.SaveSupports(); |
---|
127 | | - } |
---|
128 | | - |
---|
129 | | - for (int i = 0; i < Size(); i++) |
---|
130 | | - { |
---|
131 | | - Object3D child = (Object3D) get(i); |
---|
132 | | - if (child == null) |
---|
133 | | - continue; |
---|
134 | | - blockloop = true; |
---|
135 | | - child.SaveSupports(); |
---|
136 | | - blockloop = false; |
---|
137 | | - } |
---|
138 | | -} |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
139 | 122 | |
---|
140 | | -void RestoreSupports() |
---|
141 | | -{ |
---|
142 | | - if (blockloop) |
---|
143 | | - return; |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
144 | 125 | |
---|
145 | | - support = transientsupport; |
---|
146 | | - link2master = transientlink2master; |
---|
147 | | - transientsupport = null; |
---|
148 | | - transientlink2master = false; |
---|
149 | | - |
---|
150 | | - if (bRep != null) |
---|
151 | | - { |
---|
152 | | - bRep.RestoreSupports(); |
---|
| 126 | + support = null; |
---|
| 127 | + link2master = false; |
---|
| 128 | + |
---|
| 129 | + if (bRep != null) |
---|
| 130 | + { |
---|
| 131 | + bRep.SaveSupports(); |
---|
| 132 | + } |
---|
| 133 | + |
---|
| 134 | + for (int i = 0; i < Size(); i++) |
---|
| 135 | + { |
---|
| 136 | + Object3D child = (Object3D) get(i); |
---|
| 137 | + if (child == null) |
---|
| 138 | + continue; |
---|
| 139 | + blockloop = true; |
---|
| 140 | + child.SaveSupports(); |
---|
| 141 | + blockloop = false; |
---|
| 142 | + } |
---|
153 | 143 | } |
---|
154 | | - |
---|
155 | | - for (int i = 0; i < Size(); i++) |
---|
| 144 | + |
---|
| 145 | + void RestoreSupports() |
---|
156 | 146 | { |
---|
157 | | - Object3D child = (Object3D) get(i); |
---|
158 | | - if (child == null) |
---|
159 | | - continue; |
---|
160 | | - blockloop = true; |
---|
161 | | - child.RestoreSupports(); |
---|
162 | | - blockloop = false; |
---|
| 147 | + if (blockloop) |
---|
| 148 | + return; |
---|
| 149 | + |
---|
| 150 | + support = transientsupport; |
---|
| 151 | + link2master = transientlink2master; |
---|
| 152 | + transientsupport = null; |
---|
| 153 | + transientlink2master = false; |
---|
| 154 | + |
---|
| 155 | + if (bRep != null) |
---|
| 156 | + { |
---|
| 157 | + bRep.RestoreSupports(); |
---|
| 158 | + } |
---|
| 159 | + |
---|
| 160 | + for (int i = 0; i < Size(); i++) |
---|
| 161 | + { |
---|
| 162 | + Object3D child = (Object3D) get(i); |
---|
| 163 | + if (child == null) |
---|
| 164 | + continue; |
---|
| 165 | + blockloop = true; |
---|
| 166 | + child.RestoreSupports(); |
---|
| 167 | + blockloop = false; |
---|
| 168 | + } |
---|
163 | 169 | } |
---|
164 | | -} |
---|
| 170 | + |
---|
| 171 | + void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 172 | + { |
---|
| 173 | + if (hashtable.containsKey(GetUUID())) |
---|
| 174 | + { |
---|
| 175 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 176 | + |
---|
| 177 | + Grafreed.Assert(this.bRep == o.bRep); |
---|
| 178 | + if (this.bRep != null) |
---|
| 179 | + assert(this.bRep.support == o.transientrep); |
---|
| 180 | + |
---|
| 181 | + return; |
---|
| 182 | + } |
---|
| 183 | + |
---|
| 184 | + Object3D o = new Object3D(); |
---|
| 185 | + |
---|
| 186 | + hashtable.put(GetUUID(), o); |
---|
| 187 | + |
---|
| 188 | + for (int i=0; i<Size(); i++) |
---|
| 189 | + { |
---|
| 190 | + get(i).ExtractBigData(hashtable); |
---|
| 191 | + } |
---|
| 192 | + |
---|
| 193 | + ExtractBigData(o); |
---|
| 194 | + } |
---|
| 195 | + |
---|
| 196 | + void ExtractBigData(Object3D o) |
---|
| 197 | + { |
---|
| 198 | + o.bRep = this.bRep; |
---|
| 199 | + if (this.bRep != null) |
---|
| 200 | + { |
---|
| 201 | + o.transientrep = this.bRep.support; |
---|
| 202 | + o.bRep.support = null; |
---|
| 203 | + } |
---|
| 204 | + |
---|
| 205 | + // o.support = this.support; |
---|
| 206 | + // o.fileparent = this.fileparent; |
---|
| 207 | + // if (this.bRep != null) |
---|
| 208 | + // o.bRep = this.bRep.support; |
---|
| 209 | + |
---|
| 210 | + this.bRep = null; |
---|
| 211 | + // if (this.bRep != null) |
---|
| 212 | + // this.bRep.support = null; |
---|
| 213 | + // this.support = null; |
---|
| 214 | + // this.fileparent = null; |
---|
| 215 | + } |
---|
| 216 | + |
---|
| 217 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 218 | + { |
---|
| 219 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 220 | + return; |
---|
| 221 | + |
---|
| 222 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 223 | + |
---|
| 224 | + RestoreBigData(o); |
---|
| 225 | + |
---|
| 226 | + hashtable.remove(GetUUID()); |
---|
| 227 | + |
---|
| 228 | + for (int i=0; i<Size(); i++) |
---|
| 229 | + { |
---|
| 230 | + get(i).RestoreBigData(hashtable); |
---|
| 231 | + } |
---|
| 232 | + } |
---|
| 233 | + |
---|
| 234 | + void RestoreBigData(Object3D o) |
---|
| 235 | + { |
---|
| 236 | + this.bRep = o.bRep; |
---|
| 237 | + if (this.bRep != null) |
---|
| 238 | + this.bRep.support = o.transientrep; |
---|
| 239 | + // this.support = o.support; |
---|
| 240 | + // this.fileparent = o.fileparent; |
---|
| 241 | + } |
---|
165 | 242 | |
---|
166 | 243 | // MOCAP SUPPORT |
---|
167 | 244 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
486 | 563 | toParent = LA.newMatrix(); |
---|
487 | 564 | fromParent = LA.newMatrix(); |
---|
488 | 565 | } |
---|
| 566 | + |
---|
489 | 567 | if (toParentMarked == null) |
---|
490 | 568 | { |
---|
491 | 569 | if (maxcount != 1) |
---|
492 | 570 | { |
---|
493 | 571 | new Exception().printStackTrace(); |
---|
494 | 572 | } |
---|
| 573 | + |
---|
495 | 574 | toParentMarked = LA.newMatrix(); |
---|
496 | 575 | fromParentMarked = LA.newMatrix(); |
---|
497 | 576 | } |
---|
.. | .. |
---|
802 | 881 | |
---|
803 | 882 | if (marked && Globals.isLIVE() && live && |
---|
804 | 883 | //TEMP21aug2018 |
---|
805 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 884 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
806 | 885 | currentframe != Globals.framecount) |
---|
807 | 886 | { |
---|
808 | 887 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
814 | 893 | |
---|
815 | 894 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
816 | 895 | |
---|
817 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 896 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 897 | + (step == 1 && changedir)) |
---|
818 | 898 | { |
---|
819 | 899 | countdown = 1; |
---|
820 | 900 | delay = speedup?8:1; |
---|
.. | .. |
---|
886 | 966 | if (material == null || material.multiply) |
---|
887 | 967 | return true; |
---|
888 | 968 | |
---|
| 969 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
889 | 970 | return material.opacity > 0.99; |
---|
890 | 971 | } |
---|
891 | 972 | |
---|
.. | .. |
---|
2307 | 2388 | } |
---|
2308 | 2389 | */ |
---|
2309 | 2390 | } |
---|
| 2391 | + else |
---|
| 2392 | + { |
---|
| 2393 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2394 | + } |
---|
2310 | 2395 | } |
---|
2311 | 2396 | |
---|
2312 | 2397 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2632 | 2717 | //Touch(); |
---|
2633 | 2718 | } |
---|
2634 | 2719 | |
---|
| 2720 | + void GenNormalsMeshS() |
---|
| 2721 | + { |
---|
| 2722 | + selection.GenNormalsMesh(); |
---|
| 2723 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2724 | +// { |
---|
| 2725 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2726 | +// selectee.GenNormals(crease); |
---|
| 2727 | +// } |
---|
| 2728 | + |
---|
| 2729 | + //Touch(); |
---|
| 2730 | + } |
---|
| 2731 | + |
---|
2635 | 2732 | void ClearColorsS() |
---|
2636 | 2733 | { |
---|
2637 | 2734 | selection.ClearColors(); |
---|
.. | .. |
---|
2763 | 2860 | if (child == null) |
---|
2764 | 2861 | continue; |
---|
2765 | 2862 | child.GenNormals(crease); |
---|
| 2863 | +// Children().release(i); |
---|
| 2864 | + } |
---|
| 2865 | + blockloop = false; |
---|
| 2866 | + } |
---|
| 2867 | + |
---|
| 2868 | + void GenNormalsMesh() |
---|
| 2869 | + { |
---|
| 2870 | + if (blockloop) |
---|
| 2871 | + return; |
---|
| 2872 | + |
---|
| 2873 | + blockloop = true; |
---|
| 2874 | + GenNormalsMesh0(); |
---|
| 2875 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2876 | + { |
---|
| 2877 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2878 | + if (child == null) |
---|
| 2879 | + continue; |
---|
| 2880 | + child.GenNormalsMesh(); |
---|
2766 | 2881 | // Children().release(i); |
---|
2767 | 2882 | } |
---|
2768 | 2883 | blockloop = false; |
---|
.. | .. |
---|
2931 | 3046 | if (bRep != null) |
---|
2932 | 3047 | { |
---|
2933 | 3048 | bRep.GenerateNormals(crease); |
---|
| 3049 | + Touch(); |
---|
| 3050 | + } |
---|
| 3051 | + } |
---|
| 3052 | + |
---|
| 3053 | + void GenNormalsMesh0() |
---|
| 3054 | + { |
---|
| 3055 | + if (bRep != null) |
---|
| 3056 | + { |
---|
| 3057 | + bRep.GenerateNormalsMesh(); |
---|
2934 | 3058 | Touch(); |
---|
2935 | 3059 | } |
---|
2936 | 3060 | } |
---|
.. | .. |
---|
3385 | 3509 | if (blockloop) |
---|
3386 | 3510 | return; |
---|
3387 | 3511 | |
---|
3388 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3512 | + if (//marked || // does not make sense |
---|
| 3513 | + (bRep != null || material != null)) // borderline... |
---|
3389 | 3514 | live = h; |
---|
3390 | 3515 | |
---|
3391 | 3516 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3406 | 3531 | return; |
---|
3407 | 3532 | |
---|
3408 | 3533 | //if (bRep != null) |
---|
3409 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3534 | + if (//marked || // does not make sense |
---|
| 3535 | + (bRep != null || material != null)) // borderline... |
---|
3410 | 3536 | link2master = h; |
---|
3411 | 3537 | |
---|
3412 | 3538 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3426 | 3552 | if (blockloop) |
---|
3427 | 3553 | return; |
---|
3428 | 3554 | |
---|
3429 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3555 | + if (//marked || // does not make sense |
---|
| 3556 | + (bRep != null || material != null)) // borderline... |
---|
3430 | 3557 | hide = h; |
---|
3431 | 3558 | |
---|
3432 | 3559 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3446 | 3573 | if (blockloop) |
---|
3447 | 3574 | return; |
---|
3448 | 3575 | |
---|
3449 | | - if (bRep != null && material != null) // borderline... |
---|
| 3576 | + if (bRep != null || material != null) // borderline... |
---|
3450 | 3577 | marked = h; |
---|
3451 | 3578 | |
---|
3452 | 3579 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3456 | 3583 | continue; |
---|
3457 | 3584 | blockloop = true; |
---|
3458 | 3585 | child.MarkLeaves(h); |
---|
| 3586 | + blockloop = false; |
---|
| 3587 | + // release(i); |
---|
| 3588 | + } |
---|
| 3589 | + } |
---|
| 3590 | + |
---|
| 3591 | + void RewindLeaves(boolean h) |
---|
| 3592 | + { |
---|
| 3593 | + if (blockloop) |
---|
| 3594 | + return; |
---|
| 3595 | + |
---|
| 3596 | + if (bRep != null || material != null) // borderline... |
---|
| 3597 | + rewind = h; |
---|
| 3598 | + |
---|
| 3599 | + for (int i = 0; i < Size(); i++) |
---|
| 3600 | + { |
---|
| 3601 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3602 | + if (child == null) |
---|
| 3603 | + continue; |
---|
| 3604 | + blockloop = true; |
---|
| 3605 | + child.RewindLeaves(h); |
---|
| 3606 | + blockloop = false; |
---|
| 3607 | + // release(i); |
---|
| 3608 | + } |
---|
| 3609 | + } |
---|
| 3610 | + |
---|
| 3611 | + void RandomLeaves(boolean h) |
---|
| 3612 | + { |
---|
| 3613 | + if (blockloop) |
---|
| 3614 | + return; |
---|
| 3615 | + |
---|
| 3616 | + if (bRep != null || material != null) // borderline... |
---|
| 3617 | + random = h; |
---|
| 3618 | + |
---|
| 3619 | + for (int i = 0; i < Size(); i++) |
---|
| 3620 | + { |
---|
| 3621 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3622 | + if (child == null) |
---|
| 3623 | + continue; |
---|
| 3624 | + blockloop = true; |
---|
| 3625 | + child.RandomLeaves(h); |
---|
3459 | 3626 | blockloop = false; |
---|
3460 | 3627 | // release(i); |
---|
3461 | 3628 | } |
---|
.. | .. |
---|
4229 | 4396 | { |
---|
4230 | 4397 | blockloop = true; |
---|
4231 | 4398 | get(i).RepairShadow(); |
---|
| 4399 | + blockloop = false; |
---|
| 4400 | + } |
---|
| 4401 | + } |
---|
| 4402 | + |
---|
| 4403 | + void RepairSOV() |
---|
| 4404 | + { |
---|
| 4405 | + if (blockloop) |
---|
| 4406 | + return; |
---|
| 4407 | + |
---|
| 4408 | + String texname = this.GetPigmentTexture(); |
---|
| 4409 | + |
---|
| 4410 | + if (texname.startsWith("sov")) |
---|
| 4411 | + { |
---|
| 4412 | + String[] s = texname.split("/"); |
---|
| 4413 | + |
---|
| 4414 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4415 | + |
---|
| 4416 | + texname = sname[0]; |
---|
| 4417 | + |
---|
| 4418 | + if (sname.length > 1) |
---|
| 4419 | + { |
---|
| 4420 | + texname += "Color.jpg"; |
---|
| 4421 | + } |
---|
| 4422 | + |
---|
| 4423 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4424 | + } |
---|
| 4425 | + |
---|
| 4426 | + texname = this.GetBumpTexture(); |
---|
| 4427 | + |
---|
| 4428 | + if (texname.startsWith("sov")) |
---|
| 4429 | + { |
---|
| 4430 | + String[] s = texname.split("/"); |
---|
| 4431 | + |
---|
| 4432 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4433 | + |
---|
| 4434 | + texname = sname[0]; |
---|
| 4435 | + |
---|
| 4436 | + if (sname.length > 1) |
---|
| 4437 | + { |
---|
| 4438 | + texname += "Bump.jpg"; |
---|
| 4439 | + } |
---|
| 4440 | + |
---|
| 4441 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4442 | + } |
---|
| 4443 | + |
---|
| 4444 | + for (int i=0; i<Size(); i++) |
---|
| 4445 | + { |
---|
| 4446 | + blockloop = true; |
---|
| 4447 | + get(i).RepairSOV(); |
---|
4232 | 4448 | blockloop = false; |
---|
4233 | 4449 | } |
---|
4234 | 4450 | } |
---|
.. | .. |
---|
5456 | 5672 | boolean NeedSupport() |
---|
5457 | 5673 | { |
---|
5458 | 5674 | return |
---|
5459 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5675 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5460 | 5676 | // PROBLEM with CROWD!! |
---|
5461 | 5677 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5462 | 5678 | } |
---|
5463 | 5679 | |
---|
5464 | 5680 | static boolean DEBUG_SELECTION = false; |
---|
| 5681 | + |
---|
| 5682 | + boolean IsLive() |
---|
| 5683 | + { |
---|
| 5684 | + if (live) |
---|
| 5685 | + return true; |
---|
| 5686 | + |
---|
| 5687 | + if (parent == null) |
---|
| 5688 | + return false; |
---|
| 5689 | + |
---|
| 5690 | + return parent.IsLive(); |
---|
| 5691 | + } |
---|
5465 | 5692 | |
---|
5466 | 5693 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5467 | 5694 | { |
---|
.. | .. |
---|
5524 | 5751 | support = support; |
---|
5525 | 5752 | |
---|
5526 | 5753 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5527 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5754 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5528 | 5755 | |
---|
5529 | 5756 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5530 | 5757 | { |
---|
.. | .. |
---|
5544 | 5771 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5545 | 5772 | |
---|
5546 | 5773 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5547 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5774 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5775 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5548 | 5776 | { |
---|
5549 | 5777 | Globals.lighttouched = true; |
---|
5550 | 5778 | } // all panes... |
---|
| 5779 | + |
---|
5551 | 5780 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5552 | 5781 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5553 | 5782 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5715 | 5944 | tex = GetTextures(); |
---|
5716 | 5945 | } |
---|
5717 | 5946 | |
---|
5718 | | - boolean failed = false; |
---|
| 5947 | + boolean failedPigment = false; |
---|
| 5948 | + boolean failedBump = false; |
---|
5719 | 5949 | |
---|
5720 | 5950 | try |
---|
5721 | 5951 | { |
---|
5722 | | - display.BindTextures(tex, texres); |
---|
| 5952 | + display.BindPigmentTexture(tex, texres); |
---|
5723 | 5953 | } |
---|
5724 | 5954 | catch (Exception e) |
---|
5725 | 5955 | { |
---|
5726 | 5956 | System.err.println("FAILED: " + this); |
---|
5727 | | - failed = true; |
---|
| 5957 | + failedPigment = true; |
---|
| 5958 | + } |
---|
| 5959 | + |
---|
| 5960 | + try |
---|
| 5961 | + { |
---|
| 5962 | + display.BindBumpTexture(tex, texres); |
---|
| 5963 | + } |
---|
| 5964 | + catch (Exception e) |
---|
| 5965 | + { |
---|
| 5966 | + //System.err.println("FAILED: " + this); |
---|
| 5967 | + failedBump = true; |
---|
5728 | 5968 | } |
---|
5729 | 5969 | |
---|
5730 | 5970 | if (!compiled) |
---|
.. | .. |
---|
5747 | 5987 | } |
---|
5748 | 5988 | } |
---|
5749 | 5989 | |
---|
5750 | | - if (!failed) |
---|
5751 | | - display.ReleaseTextures(tex); |
---|
| 5990 | + if (!failedBump) |
---|
| 5991 | + display.ReleaseBumpTexture(tex); |
---|
| 5992 | + |
---|
| 5993 | + if (!failedPigment) |
---|
| 5994 | + display.ReleasePigmentTexture(tex); |
---|
5752 | 5995 | |
---|
5753 | 5996 | display.PopMaterial(this, selected); |
---|
5754 | 5997 | } |
---|
.. | .. |
---|
6121 | 6364 | // dec 2012 |
---|
6122 | 6365 | new Exception().printStackTrace(); |
---|
6123 | 6366 | return; |
---|
| 6367 | + } |
---|
| 6368 | + |
---|
| 6369 | + if (dontselect) |
---|
| 6370 | + { |
---|
| 6371 | + //bRep.GenerateNormalsMINE(); |
---|
6124 | 6372 | } |
---|
6125 | 6373 | |
---|
6126 | 6374 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
6973 | 7221 | spot.translate(32, 32); |
---|
6974 | 7222 | spotw = spot.x + spot.width; |
---|
6975 | 7223 | spoth = spot.y + spot.height; |
---|
6976 | | - info.g.setColor(Color.blue); |
---|
| 7224 | + info.g.setColor(Color.cyan); |
---|
6977 | 7225 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6978 | 7226 | // if (CameraPane.Xmin > spot.x) |
---|
6979 | 7227 | // { |
---|
.. | .. |
---|
6991 | 7239 | // { |
---|
6992 | 7240 | // CameraPane.Ymax = spoth; |
---|
6993 | 7241 | // } |
---|
6994 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6995 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7242 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7243 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6996 | 7244 | spot.translate(0, -32); |
---|
6997 | | - info.g.setColor(Color.green); |
---|
| 7245 | + info.g.setColor(Color.yellow); |
---|
6998 | 7246 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7247 | + info.g.setColor(Color.green); |
---|
6999 | 7248 | // if (CameraPane.Xmin > spot.x) |
---|
7000 | 7249 | // { |
---|
7001 | 7250 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7313 | 7562 | switch (info.pane.RenderCamera().viewCode) |
---|
7314 | 7563 | { |
---|
7315 | 7564 | case 3: // '\001' |
---|
7316 | | - if (modified) |
---|
| 7565 | + if (modified || opposite) |
---|
7317 | 7566 | { |
---|
7318 | 7567 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7319 | 7568 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7320 | 7569 | } // vScale, 1); |
---|
7321 | 7570 | else |
---|
7322 | 7571 | { |
---|
| 7572 | + // EXCEPTION! |
---|
7323 | 7573 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7324 | 7574 | } // vScale, 1); |
---|
7325 | 7575 | break; |
---|
7326 | 7576 | |
---|
7327 | 7577 | case 2: // '\002' |
---|
7328 | | - if (modified) |
---|
| 7578 | + if (modified || opposite) |
---|
7329 | 7579 | { |
---|
7330 | 7580 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7331 | 7581 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7336 | 7586 | break; |
---|
7337 | 7587 | |
---|
7338 | 7588 | case 1: // '\003' |
---|
7339 | | - if (modified) |
---|
| 7589 | + if (modified || opposite) |
---|
7340 | 7590 | { |
---|
7341 | 7591 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7342 | 7592 | LA.matScale(toParent, 1, 1, totalScale); |
---|
.. | .. |
---|
7556 | 7806 | editWindow = null; |
---|
7557 | 7807 | } // ? |
---|
7558 | 7808 | } |
---|
| 7809 | + else |
---|
| 7810 | + { |
---|
| 7811 | + //editWindow.closeUI(); |
---|
| 7812 | + } |
---|
7559 | 7813 | } |
---|
7560 | 7814 | |
---|
7561 | 7815 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7567 | 7821 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7568 | 7822 | |
---|
7569 | 7823 | Object3D /*Composite*/ parent; |
---|
7570 | | - Object3D /*Composite*/ fileparent; |
---|
| 7824 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7571 | 7825 | |
---|
7572 | 7826 | double[][] toParent; // dynamic matrix |
---|
7573 | 7827 | double[][] fromParent; |
---|