.. | .. |
---|
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(); |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
| 122 | + |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
| 125 | + |
---|
| 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 | + } |
---|
127 | 143 | } |
---|
128 | | - |
---|
129 | | - for (int i = 0; i < Size(); i++) |
---|
| 144 | + |
---|
| 145 | + void RestoreSupports() |
---|
130 | 146 | { |
---|
131 | | - Object3D child = (Object3D) get(i); |
---|
132 | | - if (child == null) |
---|
133 | | - continue; |
---|
| 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 | + } |
---|
| 169 | + } |
---|
| 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("copy of " + this.name); |
---|
| 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 | + if (blockloop) |
---|
| 223 | + return; |
---|
| 224 | + |
---|
134 | 225 | blockloop = true; |
---|
135 | | - child.SaveSupports(); |
---|
| 226 | + |
---|
| 227 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 228 | + |
---|
| 229 | + RestoreBigData(o); |
---|
| 230 | + |
---|
| 231 | + //hashtable.remove(GetUUID()); |
---|
| 232 | + |
---|
| 233 | + for (int i=0; i<Size(); i++) |
---|
| 234 | + { |
---|
| 235 | + get(i).RestoreBigData(hashtable); |
---|
| 236 | + } |
---|
| 237 | + |
---|
136 | 238 | blockloop = false; |
---|
137 | 239 | } |
---|
138 | | -} |
---|
139 | 240 | |
---|
140 | | -void RestoreSupports() |
---|
141 | | -{ |
---|
142 | | - if (blockloop) |
---|
143 | | - return; |
---|
144 | | - |
---|
145 | | - support = transientsupport; |
---|
146 | | - link2master = transientlink2master; |
---|
147 | | - transientsupport = null; |
---|
148 | | - transientlink2master = false; |
---|
149 | | - |
---|
150 | | - if (bRep != null) |
---|
| 241 | + void RestoreBigData(Object3D o) |
---|
151 | 242 | { |
---|
152 | | - bRep.RestoreSupports(); |
---|
| 243 | + this.bRep = o.bRep; |
---|
| 244 | + if (this.bRep != null) |
---|
| 245 | + this.bRep.support = o.transientrep; |
---|
| 246 | + // this.support = o.support; |
---|
| 247 | + // this.fileparent = o.fileparent; |
---|
153 | 248 | } |
---|
154 | | - |
---|
155 | | - for (int i = 0; i < Size(); i++) |
---|
156 | | - { |
---|
157 | | - Object3D child = (Object3D) get(i); |
---|
158 | | - if (child == null) |
---|
159 | | - continue; |
---|
160 | | - blockloop = true; |
---|
161 | | - child.RestoreSupports(); |
---|
162 | | - blockloop = false; |
---|
163 | | - } |
---|
164 | | -} |
---|
165 | | - |
---|
166 | | -void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
167 | | -{ |
---|
168 | | - if (hashtable.containsKey(GetUUID())) |
---|
169 | | - return; |
---|
170 | | - |
---|
171 | | - Object3D o = new Object3D(); |
---|
172 | | - o.bRep = this.bRep; |
---|
173 | | - if (this.bRep != null) |
---|
174 | | - { |
---|
175 | | - o.transientrep = this.bRep.support; |
---|
176 | | - o.bRep.support = null; |
---|
177 | | - } |
---|
178 | | - |
---|
179 | | -// o.support = this.support; |
---|
180 | | -// o.fileparent = this.fileparent; |
---|
181 | | -// if (this.bRep != null) |
---|
182 | | -// o.bRep = this.bRep.support; |
---|
183 | | - |
---|
184 | | - hashtable.put(GetUUID(), o); |
---|
185 | | - |
---|
186 | | - this.bRep = null; |
---|
187 | | -// if (this.bRep != null) |
---|
188 | | -// this.bRep.support = null; |
---|
189 | | -// this.support = null; |
---|
190 | | -// this.fileparent = null; |
---|
191 | | - |
---|
192 | | - for (int i=0; i<Size(); i++) |
---|
193 | | - { |
---|
194 | | - get(i).ExtractBigData(hashtable); |
---|
195 | | - } |
---|
196 | | -} |
---|
197 | | - |
---|
198 | | -void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
199 | | -{ |
---|
200 | | - if (!hashtable.containsKey(GetUUID())) |
---|
201 | | - return; |
---|
202 | | - |
---|
203 | | - Object3D o = hashtable.get(GetUUID()); |
---|
204 | | - |
---|
205 | | - this.bRep = o.bRep; |
---|
206 | | - if (this.bRep != null) |
---|
207 | | - this.bRep.support = o.transientrep; |
---|
208 | | -// this.support = o.support; |
---|
209 | | -// this.fileparent = o.fileparent; |
---|
210 | | - |
---|
211 | | - hashtable.remove(GetUUID()); |
---|
212 | | - |
---|
213 | | - for (int i=0; i<Size(); i++) |
---|
214 | | - { |
---|
215 | | - get(i).RestoreBigData(hashtable); |
---|
216 | | - } |
---|
217 | | -} |
---|
218 | 249 | |
---|
219 | 250 | // MOCAP SUPPORT |
---|
220 | 251 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
539 | 570 | toParent = LA.newMatrix(); |
---|
540 | 571 | fromParent = LA.newMatrix(); |
---|
541 | 572 | } |
---|
| 573 | + |
---|
542 | 574 | if (toParentMarked == null) |
---|
543 | 575 | { |
---|
544 | 576 | if (maxcount != 1) |
---|
545 | 577 | { |
---|
546 | 578 | new Exception().printStackTrace(); |
---|
547 | 579 | } |
---|
| 580 | + |
---|
548 | 581 | toParentMarked = LA.newMatrix(); |
---|
549 | 582 | fromParentMarked = LA.newMatrix(); |
---|
550 | 583 | } |
---|
.. | .. |
---|
855 | 888 | |
---|
856 | 889 | if (marked && Globals.isLIVE() && live && |
---|
857 | 890 | //TEMP21aug2018 |
---|
858 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 891 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
859 | 892 | currentframe != Globals.framecount) |
---|
860 | 893 | { |
---|
861 | 894 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
867 | 900 | |
---|
868 | 901 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
869 | 902 | |
---|
870 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 903 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 904 | + (step == 1 && changedir)) |
---|
871 | 905 | { |
---|
872 | 906 | countdown = 1; |
---|
873 | 907 | delay = speedup?8:1; |
---|
.. | .. |
---|
939 | 973 | if (material == null || material.multiply) |
---|
940 | 974 | return true; |
---|
941 | 975 | |
---|
| 976 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
942 | 977 | return material.opacity > 0.99; |
---|
943 | 978 | } |
---|
944 | 979 | |
---|
.. | .. |
---|
2360 | 2395 | } |
---|
2361 | 2396 | */ |
---|
2362 | 2397 | } |
---|
| 2398 | + else |
---|
| 2399 | + { |
---|
| 2400 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2401 | + } |
---|
2363 | 2402 | } |
---|
2364 | 2403 | |
---|
2365 | 2404 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2401 | 2440 | { |
---|
2402 | 2441 | editWindow.refreshContents(); |
---|
2403 | 2442 | } |
---|
| 2443 | + else |
---|
| 2444 | + { |
---|
| 2445 | + if (manipWindow != null) |
---|
| 2446 | + { |
---|
| 2447 | + manipWindow.refreshContents(); |
---|
| 2448 | + } |
---|
| 2449 | + } |
---|
| 2450 | + |
---|
2404 | 2451 | //if (parent != null) |
---|
2405 | 2452 | //parent.refreshEditWindow(); |
---|
2406 | 2453 | } |
---|
.. | .. |
---|
2685 | 2732 | //Touch(); |
---|
2686 | 2733 | } |
---|
2687 | 2734 | |
---|
| 2735 | + void GenNormalsMeshS() |
---|
| 2736 | + { |
---|
| 2737 | + selection.GenNormalsMesh(); |
---|
| 2738 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2739 | +// { |
---|
| 2740 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2741 | +// selectee.GenNormals(crease); |
---|
| 2742 | +// } |
---|
| 2743 | + |
---|
| 2744 | + //Touch(); |
---|
| 2745 | + } |
---|
| 2746 | + |
---|
2688 | 2747 | void ClearColorsS() |
---|
2689 | 2748 | { |
---|
2690 | 2749 | selection.ClearColors(); |
---|
.. | .. |
---|
2816 | 2875 | if (child == null) |
---|
2817 | 2876 | continue; |
---|
2818 | 2877 | child.GenNormals(crease); |
---|
| 2878 | +// Children().release(i); |
---|
| 2879 | + } |
---|
| 2880 | + blockloop = false; |
---|
| 2881 | + } |
---|
| 2882 | + |
---|
| 2883 | + void GenNormalsMesh() |
---|
| 2884 | + { |
---|
| 2885 | + if (blockloop) |
---|
| 2886 | + return; |
---|
| 2887 | + |
---|
| 2888 | + blockloop = true; |
---|
| 2889 | + GenNormalsMesh0(); |
---|
| 2890 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2891 | + { |
---|
| 2892 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2893 | + if (child == null) |
---|
| 2894 | + continue; |
---|
| 2895 | + child.GenNormalsMesh(); |
---|
2819 | 2896 | // Children().release(i); |
---|
2820 | 2897 | } |
---|
2821 | 2898 | blockloop = false; |
---|
.. | .. |
---|
2984 | 3061 | if (bRep != null) |
---|
2985 | 3062 | { |
---|
2986 | 3063 | bRep.GenerateNormals(crease); |
---|
| 3064 | + Touch(); |
---|
| 3065 | + } |
---|
| 3066 | + } |
---|
| 3067 | + |
---|
| 3068 | + void GenNormalsMesh0() |
---|
| 3069 | + { |
---|
| 3070 | + if (bRep != null) |
---|
| 3071 | + { |
---|
| 3072 | + bRep.GenerateNormalsMesh(); |
---|
2987 | 3073 | Touch(); |
---|
2988 | 3074 | } |
---|
2989 | 3075 | } |
---|
.. | .. |
---|
3438 | 3524 | if (blockloop) |
---|
3439 | 3525 | return; |
---|
3440 | 3526 | |
---|
3441 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3527 | + if (//marked || // does not make sense |
---|
| 3528 | + (bRep != null || material != null)) // borderline... |
---|
3442 | 3529 | live = h; |
---|
3443 | 3530 | |
---|
3444 | 3531 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3459 | 3546 | return; |
---|
3460 | 3547 | |
---|
3461 | 3548 | //if (bRep != null) |
---|
3462 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3549 | + if (//marked || // does not make sense |
---|
| 3550 | + (bRep != null || material != null)) // borderline... |
---|
3463 | 3551 | link2master = h; |
---|
3464 | 3552 | |
---|
3465 | 3553 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3479 | 3567 | if (blockloop) |
---|
3480 | 3568 | return; |
---|
3481 | 3569 | |
---|
3482 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3570 | + if (//marked || // does not make sense |
---|
| 3571 | + (bRep != null || material != null)) // borderline... |
---|
3483 | 3572 | hide = h; |
---|
3484 | 3573 | |
---|
3485 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3499 | 3588 | if (blockloop) |
---|
3500 | 3589 | return; |
---|
3501 | 3590 | |
---|
3502 | | - if (bRep != null && material != null) // borderline... |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
3503 | 3592 | marked = h; |
---|
3504 | 3593 | |
---|
3505 | 3594 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3509 | 3598 | continue; |
---|
3510 | 3599 | blockloop = true; |
---|
3511 | 3600 | child.MarkLeaves(h); |
---|
| 3601 | + blockloop = false; |
---|
| 3602 | + // release(i); |
---|
| 3603 | + } |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + void RewindLeaves(boolean h) |
---|
| 3607 | + { |
---|
| 3608 | + if (blockloop) |
---|
| 3609 | + return; |
---|
| 3610 | + |
---|
| 3611 | + if (bRep != null || material != null) // borderline... |
---|
| 3612 | + rewind = h; |
---|
| 3613 | + |
---|
| 3614 | + for (int i = 0; i < Size(); i++) |
---|
| 3615 | + { |
---|
| 3616 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3617 | + if (child == null) |
---|
| 3618 | + continue; |
---|
| 3619 | + blockloop = true; |
---|
| 3620 | + child.RewindLeaves(h); |
---|
| 3621 | + blockloop = false; |
---|
| 3622 | + // release(i); |
---|
| 3623 | + } |
---|
| 3624 | + } |
---|
| 3625 | + |
---|
| 3626 | + void RandomLeaves(boolean h) |
---|
| 3627 | + { |
---|
| 3628 | + if (blockloop) |
---|
| 3629 | + return; |
---|
| 3630 | + |
---|
| 3631 | + if (bRep != null || material != null) // borderline... |
---|
| 3632 | + random = h; |
---|
| 3633 | + |
---|
| 3634 | + for (int i = 0; i < Size(); i++) |
---|
| 3635 | + { |
---|
| 3636 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3637 | + if (child == null) |
---|
| 3638 | + continue; |
---|
| 3639 | + blockloop = true; |
---|
| 3640 | + child.RandomLeaves(h); |
---|
3512 | 3641 | blockloop = false; |
---|
3513 | 3642 | // release(i); |
---|
3514 | 3643 | } |
---|
.. | .. |
---|
4286 | 4415 | } |
---|
4287 | 4416 | } |
---|
4288 | 4417 | |
---|
| 4418 | + void RepairSOV() |
---|
| 4419 | + { |
---|
| 4420 | + if (blockloop) |
---|
| 4421 | + return; |
---|
| 4422 | + |
---|
| 4423 | + String texname = this.GetPigmentTexture(); |
---|
| 4424 | + |
---|
| 4425 | + if (texname.startsWith("sov")) |
---|
| 4426 | + { |
---|
| 4427 | + String[] s = texname.split("/"); |
---|
| 4428 | + |
---|
| 4429 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4430 | + |
---|
| 4431 | + texname = sname[0]; |
---|
| 4432 | + |
---|
| 4433 | + if (sname.length > 1) |
---|
| 4434 | + { |
---|
| 4435 | + texname += "Color.jpg"; |
---|
| 4436 | + } |
---|
| 4437 | + |
---|
| 4438 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4439 | + } |
---|
| 4440 | + |
---|
| 4441 | + texname = this.GetBumpTexture(); |
---|
| 4442 | + |
---|
| 4443 | + if (texname.startsWith("sov")) |
---|
| 4444 | + { |
---|
| 4445 | + String[] s = texname.split("/"); |
---|
| 4446 | + |
---|
| 4447 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4448 | + |
---|
| 4449 | + texname = sname[0]; |
---|
| 4450 | + |
---|
| 4451 | + if (sname.length > 1) |
---|
| 4452 | + { |
---|
| 4453 | + texname += "Bump.jpg"; |
---|
| 4454 | + } |
---|
| 4455 | + |
---|
| 4456 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4457 | + } |
---|
| 4458 | + |
---|
| 4459 | + for (int i=0; i<Size(); i++) |
---|
| 4460 | + { |
---|
| 4461 | + blockloop = true; |
---|
| 4462 | + get(i).RepairSOV(); |
---|
| 4463 | + blockloop = false; |
---|
| 4464 | + } |
---|
| 4465 | + } |
---|
| 4466 | + |
---|
4289 | 4467 | void RepairTexture() |
---|
4290 | 4468 | { |
---|
4291 | 4469 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
4800 | 4978 | } |
---|
4801 | 4979 | } |
---|
4802 | 4980 | |
---|
| 4981 | + ObjEditor GetWindow() |
---|
| 4982 | + { |
---|
| 4983 | + if (editWindow != null) |
---|
| 4984 | + return editWindow; |
---|
| 4985 | + |
---|
| 4986 | + return manipWindow; |
---|
| 4987 | + } |
---|
| 4988 | + |
---|
4803 | 4989 | cTreePath Select(int indexcount, boolean deselect) |
---|
4804 | 4990 | { |
---|
4805 | 4991 | if (hide || dontselect) |
---|
.. | .. |
---|
4836 | 5022 | if (leaf != null) |
---|
4837 | 5023 | { |
---|
4838 | 5024 | cTreePath tp = new cTreePath(this, leaf); |
---|
4839 | | - if (editWindow != null) |
---|
| 5025 | + ObjEditor window = GetWindow(); |
---|
| 5026 | + if (window != null) |
---|
4840 | 5027 | { |
---|
4841 | 5028 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4842 | | - editWindow.Select(tp, deselect, true); |
---|
| 5029 | + window.Select(tp, deselect, true); |
---|
4843 | 5030 | } |
---|
4844 | 5031 | |
---|
4845 | 5032 | return tp; |
---|
.. | .. |
---|
4856 | 5043 | |
---|
4857 | 5044 | if (child == null) |
---|
4858 | 5045 | continue; |
---|
| 5046 | + |
---|
4859 | 5047 | if (child.HasTransparency() && child.size() != 0) |
---|
4860 | 5048 | { |
---|
4861 | 5049 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4865 | 5053 | if (leaf != null) |
---|
4866 | 5054 | { |
---|
4867 | 5055 | cTreePath tp = new cTreePath(this, leaf); |
---|
4868 | | - if (editWindow != null) |
---|
| 5056 | + ObjEditor window = GetWindow(); |
---|
| 5057 | + if (window != null) |
---|
4869 | 5058 | { |
---|
4870 | | - editWindow.Select(tp, deselect, true); |
---|
| 5059 | + window.Select(tp, deselect, true); |
---|
4871 | 5060 | } |
---|
4872 | 5061 | |
---|
4873 | 5062 | return tp; |
---|
.. | .. |
---|
5509 | 5698 | boolean NeedSupport() |
---|
5510 | 5699 | { |
---|
5511 | 5700 | return |
---|
5512 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5701 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5513 | 5702 | // PROBLEM with CROWD!! |
---|
5514 | 5703 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5515 | 5704 | } |
---|
5516 | 5705 | |
---|
5517 | 5706 | static boolean DEBUG_SELECTION = false; |
---|
| 5707 | + |
---|
| 5708 | + boolean IsLive() |
---|
| 5709 | + { |
---|
| 5710 | + if (live) |
---|
| 5711 | + return true; |
---|
| 5712 | + |
---|
| 5713 | + if (parent == null) |
---|
| 5714 | + return false; |
---|
| 5715 | + |
---|
| 5716 | + return parent.IsLive(); |
---|
| 5717 | + } |
---|
5518 | 5718 | |
---|
5519 | 5719 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5520 | 5720 | { |
---|
.. | .. |
---|
5577 | 5777 | support = support; |
---|
5578 | 5778 | |
---|
5579 | 5779 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5580 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5780 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5581 | 5781 | |
---|
5582 | 5782 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5583 | 5783 | { |
---|
.. | .. |
---|
5597 | 5797 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5598 | 5798 | |
---|
5599 | 5799 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5600 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5800 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5801 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5601 | 5802 | { |
---|
5602 | 5803 | Globals.lighttouched = true; |
---|
5603 | 5804 | } // all panes... |
---|
| 5805 | + |
---|
5604 | 5806 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5605 | 5807 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5606 | 5808 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5728 | 5930 | if (GetBRep() != null) |
---|
5729 | 5931 | { |
---|
5730 | 5932 | display.NextIndex(); |
---|
| 5933 | + |
---|
5731 | 5934 | // vertex color conflict : gl.glCallList(list); |
---|
5732 | 5935 | DrawNode(display, root, selected); |
---|
5733 | 5936 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5768 | 5971 | tex = GetTextures(); |
---|
5769 | 5972 | } |
---|
5770 | 5973 | |
---|
5771 | | - boolean failed = false; |
---|
| 5974 | + boolean failedPigment = false; |
---|
| 5975 | + boolean failedBump = false; |
---|
5772 | 5976 | |
---|
5773 | 5977 | try |
---|
5774 | 5978 | { |
---|
5775 | | - display.BindTextures(tex, texres); |
---|
| 5979 | + display.BindPigmentTexture(tex, texres); |
---|
5776 | 5980 | } |
---|
5777 | 5981 | catch (Exception e) |
---|
5778 | 5982 | { |
---|
5779 | 5983 | System.err.println("FAILED: " + this); |
---|
5780 | | - failed = true; |
---|
| 5984 | + failedPigment = true; |
---|
| 5985 | + } |
---|
| 5986 | + |
---|
| 5987 | + try |
---|
| 5988 | + { |
---|
| 5989 | + display.BindBumpTexture(tex, texres); |
---|
| 5990 | + } |
---|
| 5991 | + catch (Exception e) |
---|
| 5992 | + { |
---|
| 5993 | + //System.err.println("FAILED: " + this); |
---|
| 5994 | + failedBump = true; |
---|
5781 | 5995 | } |
---|
5782 | 5996 | |
---|
5783 | 5997 | if (!compiled) |
---|
.. | .. |
---|
5800 | 6014 | } |
---|
5801 | 6015 | } |
---|
5802 | 6016 | |
---|
5803 | | - if (!failed) |
---|
5804 | | - display.ReleaseTextures(tex); |
---|
| 6017 | + if (!failedBump) |
---|
| 6018 | + display.ReleaseBumpTexture(tex); |
---|
| 6019 | + |
---|
| 6020 | + if (!failedPigment) |
---|
| 6021 | + display.ReleasePigmentTexture(tex); |
---|
5805 | 6022 | |
---|
5806 | 6023 | display.PopMaterial(this, selected); |
---|
5807 | 6024 | } |
---|
.. | .. |
---|
6174 | 6391 | // dec 2012 |
---|
6175 | 6392 | new Exception().printStackTrace(); |
---|
6176 | 6393 | return; |
---|
| 6394 | + } |
---|
| 6395 | + |
---|
| 6396 | + if (dontselect) |
---|
| 6397 | + { |
---|
| 6398 | + //bRep.GenerateNormalsMINE(); |
---|
6177 | 6399 | } |
---|
6178 | 6400 | |
---|
6179 | 6401 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
7026 | 7248 | spot.translate(32, 32); |
---|
7027 | 7249 | spotw = spot.x + spot.width; |
---|
7028 | 7250 | spoth = spot.y + spot.height; |
---|
7029 | | - info.g.setColor(Color.blue); |
---|
| 7251 | + info.g.setColor(Color.cyan); |
---|
7030 | 7252 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7031 | 7253 | // if (CameraPane.Xmin > spot.x) |
---|
7032 | 7254 | // { |
---|
.. | .. |
---|
7044 | 7266 | // { |
---|
7045 | 7267 | // CameraPane.Ymax = spoth; |
---|
7046 | 7268 | // } |
---|
7047 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7048 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7269 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7270 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7049 | 7271 | spot.translate(0, -32); |
---|
7050 | | - info.g.setColor(Color.green); |
---|
| 7272 | + info.g.setColor(Color.yellow); |
---|
7051 | 7273 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7274 | + info.g.setColor(Color.green); |
---|
7052 | 7275 | // if (CameraPane.Xmin > spot.x) |
---|
7053 | 7276 | // { |
---|
7054 | 7277 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7366 | 7589 | switch (info.pane.RenderCamera().viewCode) |
---|
7367 | 7590 | { |
---|
7368 | 7591 | case 3: // '\001' |
---|
7369 | | - if (modified) |
---|
| 7592 | + if (modified || opposite) |
---|
7370 | 7593 | { |
---|
7371 | 7594 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7372 | 7595 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7373 | 7596 | } // vScale, 1); |
---|
7374 | 7597 | else |
---|
7375 | 7598 | { |
---|
| 7599 | + // EXCEPTION! |
---|
7376 | 7600 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7377 | 7601 | } // vScale, 1); |
---|
7378 | 7602 | break; |
---|
7379 | 7603 | |
---|
7380 | 7604 | case 2: // '\002' |
---|
7381 | | - if (modified) |
---|
| 7605 | + if (modified || opposite) |
---|
7382 | 7606 | { |
---|
7383 | 7607 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7384 | 7608 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7389 | 7613 | break; |
---|
7390 | 7614 | |
---|
7391 | 7615 | case 1: // '\003' |
---|
7392 | | - if (modified) |
---|
| 7616 | + if (modified || opposite) |
---|
7393 | 7617 | { |
---|
7394 | 7618 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7395 | 7619 | LA.matScale(toParent, 1, 1, totalScale); |
---|
.. | .. |
---|
7609 | 7833 | editWindow = null; |
---|
7610 | 7834 | } // ? |
---|
7611 | 7835 | } |
---|
| 7836 | + else |
---|
| 7837 | + { |
---|
| 7838 | + //editWindow.closeUI(); |
---|
| 7839 | + } |
---|
7612 | 7840 | } |
---|
7613 | 7841 | |
---|
7614 | 7842 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7766 | 7994 | } |
---|
7767 | 7995 | |
---|
7768 | 7996 | transient ObjEditor editWindow; |
---|
| 7997 | + transient ObjEditor manipWindow; |
---|
| 7998 | + |
---|
| 7999 | + transient boolean pinned; |
---|
| 8000 | + |
---|
7769 | 8001 | transient ObjectUI objectUI; |
---|
7770 | 8002 | public static int povDepth = 0; |
---|
7771 | 8003 | private static cVector tbMin = new cVector(); |
---|