.. | .. |
---|
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; |
---|
| 27 | + // TEMPORARY for mocap undo. No need to be transient. |
---|
| 28 | + mocap.reader.BVHReader.BVHResult savebvh; |
---|
| 29 | + Object3D saveskeleton; |
---|
30 | 30 | // |
---|
31 | 31 | |
---|
| 32 | + byte[] versions[]; |
---|
| 33 | + int versionindex = -1; |
---|
| 34 | + |
---|
32 | 35 | ScriptNode scriptnode; |
---|
33 | 36 | |
---|
34 | 37 | void InitOthers() |
---|
.. | .. |
---|
170 | 173 | |
---|
171 | 174 | void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
172 | 175 | { |
---|
| 176 | + Object3D o; |
---|
| 177 | + |
---|
173 | 178 | if (hashtable.containsKey(GetUUID())) |
---|
174 | 179 | { |
---|
175 | | - Object3D o = hashtable.get(GetUUID()); |
---|
| 180 | + o = hashtable.get(GetUUID()); |
---|
176 | 181 | |
---|
177 | 182 | Grafreed.Assert(this.bRep == o.bRep); |
---|
178 | | - if (this.bRep != null) |
---|
179 | | - assert(this.bRep.support == o.transientrep); |
---|
| 183 | + //if (this.bRep != null) |
---|
| 184 | + // assert(this.bRep.support == o.transientrep); |
---|
| 185 | + if (this.support != null) |
---|
| 186 | + assert(this.support.bRep == o.transientrep); |
---|
| 187 | + } |
---|
| 188 | + else |
---|
| 189 | + { |
---|
| 190 | + o = new Object3D("copy of " + this.name); |
---|
180 | 191 | |
---|
181 | | - return; |
---|
| 192 | + hashtable.put(GetUUID(), o); |
---|
182 | 193 | } |
---|
183 | 194 | |
---|
184 | | - Object3D o = new Object3D(); |
---|
185 | | - |
---|
186 | | - hashtable.put(GetUUID(), o); |
---|
187 | | - |
---|
188 | | - for (int i=0; i<Size(); i++) |
---|
| 195 | + if (!blockloop) |
---|
189 | 196 | { |
---|
190 | | - get(i).ExtractBigData(hashtable); |
---|
| 197 | + blockloop = true; |
---|
| 198 | + |
---|
| 199 | + for (int i=0; i<Size(); i++) |
---|
| 200 | + { |
---|
| 201 | + get(i).ExtractBigData(hashtable); |
---|
| 202 | + } |
---|
| 203 | + |
---|
| 204 | + blockloop = false; |
---|
191 | 205 | } |
---|
192 | 206 | |
---|
193 | 207 | ExtractBigData(o); |
---|
.. | .. |
---|
195 | 209 | |
---|
196 | 210 | void ExtractBigData(Object3D o) |
---|
197 | 211 | { |
---|
| 212 | + if (o.bRep != null) |
---|
| 213 | + Grafreed.Assert(o.bRep == this.bRep); |
---|
| 214 | + |
---|
198 | 215 | o.bRep = this.bRep; |
---|
199 | | - if (this.bRep != null) |
---|
| 216 | +// July 2019 if (this.bRep != null) |
---|
| 217 | +// { |
---|
| 218 | +// o.transientrep = this.bRep.support; |
---|
| 219 | +// o.bRep.support = null; |
---|
| 220 | +// } |
---|
| 221 | + o.selection = this.selection; |
---|
| 222 | + o.versions = this.versions; |
---|
| 223 | + o.versionindex = this.versionindex; |
---|
| 224 | + |
---|
| 225 | + if (this.support != null) |
---|
200 | 226 | { |
---|
201 | | - o.transientrep = this.bRep.support; |
---|
202 | | - o.bRep.support = null; |
---|
| 227 | + if (o.transientrep != null) |
---|
| 228 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 229 | + |
---|
| 230 | + o.transientrep = this.support.bRep; |
---|
| 231 | + this.support.bRep = null; |
---|
203 | 232 | } |
---|
204 | 233 | |
---|
205 | 234 | // o.support = this.support; |
---|
.. | .. |
---|
223 | 252 | |
---|
224 | 253 | RestoreBigData(o); |
---|
225 | 254 | |
---|
226 | | - hashtable.remove(GetUUID()); |
---|
| 255 | + if (blockloop) |
---|
| 256 | + return; |
---|
| 257 | + |
---|
| 258 | + blockloop = true; |
---|
| 259 | + |
---|
| 260 | + //hashtable.remove(GetUUID()); |
---|
227 | 261 | |
---|
228 | 262 | for (int i=0; i<Size(); i++) |
---|
229 | 263 | { |
---|
230 | 264 | get(i).RestoreBigData(hashtable); |
---|
231 | 265 | } |
---|
| 266 | + |
---|
| 267 | + blockloop = false; |
---|
232 | 268 | } |
---|
233 | 269 | |
---|
234 | 270 | void RestoreBigData(Object3D o) |
---|
235 | 271 | { |
---|
236 | 272 | this.bRep = o.bRep; |
---|
237 | | - if (this.bRep != null) |
---|
238 | | - this.bRep.support = o.transientrep; |
---|
| 273 | + if (this.support != null && o.transientrep != null) |
---|
| 274 | + { |
---|
| 275 | + this.support.bRep = o.transientrep; |
---|
| 276 | + } |
---|
| 277 | + |
---|
| 278 | + this.selection = o.selection; |
---|
| 279 | + |
---|
| 280 | + this.versions = o.versions; |
---|
| 281 | + this.versionindex = o.versionindex; |
---|
| 282 | +// July 2019 if (this.bRep != null) |
---|
| 283 | +// this.bRep.support = o.transientrep; |
---|
239 | 284 | // this.support = o.support; |
---|
240 | 285 | // this.fileparent = o.fileparent; |
---|
241 | 286 | } |
---|
.. | .. |
---|
381 | 426 | } |
---|
382 | 427 | |
---|
383 | 428 | boolean live = false; |
---|
| 429 | + transient boolean keepdontselect; |
---|
384 | 430 | boolean dontselect = false; |
---|
385 | 431 | boolean hide = false; |
---|
386 | 432 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
881 | 927 | |
---|
882 | 928 | if (marked && Globals.isLIVE() && live && |
---|
883 | 929 | //TEMP21aug2018 |
---|
884 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 930 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
885 | 931 | currentframe != Globals.framecount) |
---|
886 | 932 | { |
---|
887 | 933 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
893 | 939 | |
---|
894 | 940 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
895 | 941 | |
---|
896 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 942 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 943 | + (step == 1 && changedir)) |
---|
897 | 944 | { |
---|
898 | 945 | countdown = 1; |
---|
899 | 946 | delay = speedup?8:1; |
---|
.. | .. |
---|
965 | 1012 | if (material == null || material.multiply) |
---|
966 | 1013 | return true; |
---|
967 | 1014 | |
---|
| 1015 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
968 | 1016 | return material.opacity > 0.99; |
---|
969 | 1017 | } |
---|
970 | 1018 | |
---|
.. | .. |
---|
1365 | 1413 | toParent = LA.newMatrix(); |
---|
1366 | 1414 | fromParent = LA.newMatrix(); |
---|
1367 | 1415 | } |
---|
| 1416 | + |
---|
1368 | 1417 | LA.matCopy(other.toParent, toParent); |
---|
1369 | 1418 | LA.matCopy(other.fromParent, fromParent); |
---|
1370 | 1419 | |
---|
.. | .. |
---|
2386 | 2435 | } |
---|
2387 | 2436 | */ |
---|
2388 | 2437 | } |
---|
| 2438 | + else |
---|
| 2439 | + { |
---|
| 2440 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2441 | + } |
---|
2389 | 2442 | } |
---|
2390 | 2443 | |
---|
2391 | 2444 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2427 | 2480 | { |
---|
2428 | 2481 | editWindow.refreshContents(); |
---|
2429 | 2482 | } |
---|
| 2483 | + else |
---|
| 2484 | + { |
---|
| 2485 | + if (manipWindow != null) |
---|
| 2486 | + { |
---|
| 2487 | + manipWindow.refreshContents(); |
---|
| 2488 | + } |
---|
| 2489 | + } |
---|
| 2490 | + |
---|
2430 | 2491 | //if (parent != null) |
---|
2431 | 2492 | //parent.refreshEditWindow(); |
---|
2432 | 2493 | } |
---|
.. | .. |
---|
3057 | 3118 | { |
---|
3058 | 3119 | if (bRep != null) |
---|
3059 | 3120 | { |
---|
3060 | | - bRep.GenerateNormalsMINE(); |
---|
| 3121 | + bRep.MergeNormals(); //.GenerateNormalsMINE(); |
---|
3061 | 3122 | Touch(); |
---|
3062 | 3123 | } |
---|
3063 | 3124 | } |
---|
.. | .. |
---|
3503 | 3564 | if (blockloop) |
---|
3504 | 3565 | return; |
---|
3505 | 3566 | |
---|
3506 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3567 | + if (//marked || // does not make sense |
---|
| 3568 | + (bRep != null || material != null)) // borderline... |
---|
3507 | 3569 | live = h; |
---|
3508 | 3570 | |
---|
3509 | 3571 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3524 | 3586 | return; |
---|
3525 | 3587 | |
---|
3526 | 3588 | //if (bRep != null) |
---|
3527 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3589 | + if (//marked || // does not make sense |
---|
| 3590 | + (bRep != null || material != null)) // borderline... |
---|
3528 | 3591 | link2master = h; |
---|
3529 | 3592 | |
---|
3530 | 3593 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3544 | 3607 | if (blockloop) |
---|
3545 | 3608 | return; |
---|
3546 | 3609 | |
---|
3547 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3610 | + if (//marked || // does not make sense |
---|
| 3611 | + (bRep != null || material != null)) // borderline... |
---|
3548 | 3612 | hide = h; |
---|
3549 | 3613 | |
---|
3550 | 3614 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3564 | 3628 | if (blockloop) |
---|
3565 | 3629 | return; |
---|
3566 | 3630 | |
---|
3567 | | - if (bRep != null && material != null) // borderline... |
---|
| 3631 | + if (bRep != null || material != null) // borderline... |
---|
3568 | 3632 | marked = h; |
---|
3569 | 3633 | |
---|
3570 | 3634 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3574 | 3638 | continue; |
---|
3575 | 3639 | blockloop = true; |
---|
3576 | 3640 | child.MarkLeaves(h); |
---|
| 3641 | + blockloop = false; |
---|
| 3642 | + // release(i); |
---|
| 3643 | + } |
---|
| 3644 | + } |
---|
| 3645 | + |
---|
| 3646 | + void RewindLeaves(boolean h) |
---|
| 3647 | + { |
---|
| 3648 | + if (blockloop) |
---|
| 3649 | + return; |
---|
| 3650 | + |
---|
| 3651 | + if (bRep != null || material != null) // borderline... |
---|
| 3652 | + rewind = h; |
---|
| 3653 | + |
---|
| 3654 | + for (int i = 0; i < Size(); i++) |
---|
| 3655 | + { |
---|
| 3656 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3657 | + if (child == null) |
---|
| 3658 | + continue; |
---|
| 3659 | + blockloop = true; |
---|
| 3660 | + child.RewindLeaves(h); |
---|
| 3661 | + blockloop = false; |
---|
| 3662 | + // release(i); |
---|
| 3663 | + } |
---|
| 3664 | + } |
---|
| 3665 | + |
---|
| 3666 | + void RandomLeaves(boolean h) |
---|
| 3667 | + { |
---|
| 3668 | + if (blockloop) |
---|
| 3669 | + return; |
---|
| 3670 | + |
---|
| 3671 | + if (bRep != null || material != null) // borderline... |
---|
| 3672 | + random = h; |
---|
| 3673 | + |
---|
| 3674 | + for (int i = 0; i < Size(); i++) |
---|
| 3675 | + { |
---|
| 3676 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3677 | + if (child == null) |
---|
| 3678 | + continue; |
---|
| 3679 | + blockloop = true; |
---|
| 3680 | + child.RandomLeaves(h); |
---|
3577 | 3681 | blockloop = false; |
---|
3578 | 3682 | // release(i); |
---|
3579 | 3683 | } |
---|
.. | .. |
---|
4351 | 4455 | } |
---|
4352 | 4456 | } |
---|
4353 | 4457 | |
---|
| 4458 | + void RepairSOV() |
---|
| 4459 | + { |
---|
| 4460 | + if (blockloop) |
---|
| 4461 | + return; |
---|
| 4462 | + |
---|
| 4463 | + String texname = this.GetPigmentTexture(); |
---|
| 4464 | + |
---|
| 4465 | + if (texname.startsWith("sov")) |
---|
| 4466 | + { |
---|
| 4467 | + String[] s = texname.split("/"); |
---|
| 4468 | + |
---|
| 4469 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4470 | + |
---|
| 4471 | + texname = sname[0]; |
---|
| 4472 | + |
---|
| 4473 | + if (sname.length > 1) |
---|
| 4474 | + { |
---|
| 4475 | + texname += "Color.jpg"; |
---|
| 4476 | + } |
---|
| 4477 | + |
---|
| 4478 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4479 | + } |
---|
| 4480 | + |
---|
| 4481 | + texname = this.GetBumpTexture(); |
---|
| 4482 | + |
---|
| 4483 | + if (texname.startsWith("sov")) |
---|
| 4484 | + { |
---|
| 4485 | + String[] s = texname.split("/"); |
---|
| 4486 | + |
---|
| 4487 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4488 | + |
---|
| 4489 | + texname = sname[0]; |
---|
| 4490 | + |
---|
| 4491 | + if (sname.length > 1) |
---|
| 4492 | + { |
---|
| 4493 | + texname += "Bump.jpg"; |
---|
| 4494 | + } |
---|
| 4495 | + |
---|
| 4496 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4497 | + } |
---|
| 4498 | + |
---|
| 4499 | + for (int i=0; i<Size(); i++) |
---|
| 4500 | + { |
---|
| 4501 | + blockloop = true; |
---|
| 4502 | + get(i).RepairSOV(); |
---|
| 4503 | + blockloop = false; |
---|
| 4504 | + } |
---|
| 4505 | + } |
---|
| 4506 | + |
---|
4354 | 4507 | void RepairTexture() |
---|
4355 | 4508 | { |
---|
4356 | 4509 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
4865 | 5018 | } |
---|
4866 | 5019 | } |
---|
4867 | 5020 | |
---|
| 5021 | + ObjEditor GetWindow() |
---|
| 5022 | + { |
---|
| 5023 | + if (editWindow != null) |
---|
| 5024 | + return editWindow; |
---|
| 5025 | + |
---|
| 5026 | + return manipWindow; |
---|
| 5027 | + } |
---|
| 5028 | + |
---|
4868 | 5029 | cTreePath Select(int indexcount, boolean deselect) |
---|
4869 | 5030 | { |
---|
4870 | 5031 | if (hide || dontselect) |
---|
.. | .. |
---|
4901 | 5062 | if (leaf != null) |
---|
4902 | 5063 | { |
---|
4903 | 5064 | cTreePath tp = new cTreePath(this, leaf); |
---|
4904 | | - if (editWindow != null) |
---|
| 5065 | + ObjEditor window = GetWindow(); |
---|
| 5066 | + if (window != null) |
---|
4905 | 5067 | { |
---|
4906 | 5068 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4907 | | - editWindow.Select(tp, deselect, true); |
---|
| 5069 | + window.Select(tp, deselect, true); |
---|
4908 | 5070 | } |
---|
4909 | 5071 | |
---|
4910 | 5072 | return tp; |
---|
.. | .. |
---|
4921 | 5083 | |
---|
4922 | 5084 | if (child == null) |
---|
4923 | 5085 | continue; |
---|
| 5086 | + |
---|
4924 | 5087 | if (child.HasTransparency() && child.size() != 0) |
---|
4925 | 5088 | { |
---|
4926 | 5089 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4930 | 5093 | if (leaf != null) |
---|
4931 | 5094 | { |
---|
4932 | 5095 | cTreePath tp = new cTreePath(this, leaf); |
---|
4933 | | - if (editWindow != null) |
---|
| 5096 | + ObjEditor window = GetWindow(); |
---|
| 5097 | + if (window != null) |
---|
4934 | 5098 | { |
---|
4935 | | - editWindow.Select(tp, deselect, true); |
---|
| 5099 | + window.Select(tp, deselect, true); |
---|
4936 | 5100 | } |
---|
4937 | 5101 | |
---|
4938 | 5102 | return tp; |
---|
.. | .. |
---|
5252 | 5416 | continue; |
---|
5253 | 5417 | child.ResetDisplayList(); |
---|
5254 | 5418 | // release(i); |
---|
| 5419 | + } |
---|
| 5420 | + |
---|
| 5421 | + blockloop = false; |
---|
| 5422 | + } |
---|
| 5423 | + |
---|
| 5424 | + void ResetSelectable() |
---|
| 5425 | + { |
---|
| 5426 | + if (blockloop) |
---|
| 5427 | + return; |
---|
| 5428 | + |
---|
| 5429 | + blockloop = true; |
---|
| 5430 | + |
---|
| 5431 | + keepdontselect = dontselect; |
---|
| 5432 | + dontselect = true; |
---|
| 5433 | + |
---|
| 5434 | + Object3D child; |
---|
| 5435 | + int nb = Size(); |
---|
| 5436 | + for (int i = 0; i < nb; i++) |
---|
| 5437 | + { |
---|
| 5438 | + child = (Object3D) get(i); |
---|
| 5439 | + if (child == null) |
---|
| 5440 | + continue; |
---|
| 5441 | + child.ResetSelectable(); |
---|
| 5442 | + } |
---|
| 5443 | + |
---|
| 5444 | + blockloop = false; |
---|
| 5445 | + } |
---|
| 5446 | + |
---|
| 5447 | + void RestoreSelectable() |
---|
| 5448 | + { |
---|
| 5449 | + if (blockloop) |
---|
| 5450 | + return; |
---|
| 5451 | + |
---|
| 5452 | + blockloop = true; |
---|
| 5453 | + |
---|
| 5454 | + dontselect = keepdontselect; |
---|
| 5455 | + |
---|
| 5456 | + Object3D child; |
---|
| 5457 | + int nb = Size(); |
---|
| 5458 | + for (int i = 0; i < nb; i++) |
---|
| 5459 | + { |
---|
| 5460 | + child = (Object3D) get(i); |
---|
| 5461 | + if (child == null) |
---|
| 5462 | + continue; |
---|
| 5463 | + child.RestoreSelectable(); |
---|
5255 | 5464 | } |
---|
5256 | 5465 | |
---|
5257 | 5466 | blockloop = false; |
---|
.. | .. |
---|
5653 | 5862 | support = support; |
---|
5654 | 5863 | |
---|
5655 | 5864 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5656 | | - boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5865 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5657 | 5866 | |
---|
5658 | 5867 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5659 | 5868 | { |
---|
.. | .. |
---|
5673 | 5882 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5674 | 5883 | |
---|
5675 | 5884 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5676 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5885 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5886 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5677 | 5887 | { |
---|
5678 | 5888 | Globals.lighttouched = true; |
---|
5679 | 5889 | } // all panes... |
---|
| 5890 | + |
---|
5680 | 5891 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5681 | 5892 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5682 | 5893 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5804 | 6015 | if (GetBRep() != null) |
---|
5805 | 6016 | { |
---|
5806 | 6017 | display.NextIndex(); |
---|
| 6018 | + |
---|
5807 | 6019 | // vertex color conflict : gl.glCallList(list); |
---|
5808 | 6020 | DrawNode(display, root, selected); |
---|
5809 | 6021 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5844 | 6056 | tex = GetTextures(); |
---|
5845 | 6057 | } |
---|
5846 | 6058 | |
---|
5847 | | - boolean failed = false; |
---|
| 6059 | + boolean failedPigment = false; |
---|
| 6060 | + boolean failedBump = false; |
---|
5848 | 6061 | |
---|
5849 | 6062 | try |
---|
5850 | 6063 | { |
---|
5851 | | - display.BindTextures(tex, texres); |
---|
| 6064 | + display.BindPigmentTexture(tex, texres); |
---|
5852 | 6065 | } |
---|
5853 | 6066 | catch (Exception e) |
---|
5854 | 6067 | { |
---|
5855 | 6068 | System.err.println("FAILED: " + this); |
---|
5856 | | - failed = true; |
---|
| 6069 | + failedPigment = true; |
---|
| 6070 | + } |
---|
| 6071 | + |
---|
| 6072 | + try |
---|
| 6073 | + { |
---|
| 6074 | + display.BindBumpTexture(tex, texres); |
---|
| 6075 | + } |
---|
| 6076 | + catch (Exception e) |
---|
| 6077 | + { |
---|
| 6078 | + //System.err.println("FAILED: " + this); |
---|
| 6079 | + failedBump = true; |
---|
5857 | 6080 | } |
---|
5858 | 6081 | |
---|
5859 | 6082 | if (!compiled) |
---|
.. | .. |
---|
5876 | 6099 | } |
---|
5877 | 6100 | } |
---|
5878 | 6101 | |
---|
5879 | | - if (!failed) |
---|
5880 | | - display.ReleaseTextures(tex); |
---|
| 6102 | + if (!failedBump) |
---|
| 6103 | + display.ReleaseBumpTexture(tex); |
---|
| 6104 | + |
---|
| 6105 | + if (!failedPigment) |
---|
| 6106 | + display.ReleasePigmentTexture(tex); |
---|
5881 | 6107 | |
---|
5882 | 6108 | display.PopMaterial(this, selected); |
---|
5883 | 6109 | } |
---|
.. | .. |
---|
6250 | 6476 | // dec 2012 |
---|
6251 | 6477 | new Exception().printStackTrace(); |
---|
6252 | 6478 | return; |
---|
| 6479 | + } |
---|
| 6480 | + |
---|
| 6481 | + if (dontselect) |
---|
| 6482 | + { |
---|
| 6483 | + //bRep.GenerateNormalsMINE(); |
---|
6253 | 6484 | } |
---|
6254 | 6485 | |
---|
6255 | 6486 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
7102 | 7333 | spot.translate(32, 32); |
---|
7103 | 7334 | spotw = spot.x + spot.width; |
---|
7104 | 7335 | spoth = spot.y + spot.height; |
---|
7105 | | - info.g.setColor(Color.blue); |
---|
| 7336 | + info.g.setColor(Color.cyan); |
---|
7106 | 7337 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7107 | 7338 | // if (CameraPane.Xmin > spot.x) |
---|
7108 | 7339 | // { |
---|
.. | .. |
---|
7120 | 7351 | // { |
---|
7121 | 7352 | // CameraPane.Ymax = spoth; |
---|
7122 | 7353 | // } |
---|
7123 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7124 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7354 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7355 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7125 | 7356 | spot.translate(0, -32); |
---|
7126 | | - info.g.setColor(Color.green); |
---|
| 7357 | + info.g.setColor(Color.yellow); |
---|
7127 | 7358 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7359 | + info.g.setColor(Color.green); |
---|
7128 | 7360 | // if (CameraPane.Xmin > spot.x) |
---|
7129 | 7361 | // { |
---|
7130 | 7362 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7141 | 7373 | // { |
---|
7142 | 7374 | // CameraPane.Ymax = spoth; |
---|
7143 | 7375 | // } |
---|
7144 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7145 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7376 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7377 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
7146 | 7378 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7147 | 7379 | // if (CameraPane.Xmin > boundary.x) |
---|
7148 | 7380 | // { |
---|
.. | .. |
---|
7442 | 7674 | switch (info.pane.RenderCamera().viewCode) |
---|
7443 | 7675 | { |
---|
7444 | 7676 | case 3: // '\001' |
---|
7445 | | - if (modified) |
---|
| 7677 | + if (modified || opposite) |
---|
7446 | 7678 | { |
---|
7447 | 7679 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7448 | 7680 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7449 | 7681 | } // vScale, 1); |
---|
7450 | 7682 | else |
---|
7451 | 7683 | { |
---|
| 7684 | + // EXCEPTION! |
---|
7452 | 7685 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7453 | 7686 | } // vScale, 1); |
---|
7454 | 7687 | break; |
---|
7455 | 7688 | |
---|
7456 | 7689 | case 2: // '\002' |
---|
7457 | | - if (modified) |
---|
| 7690 | + if (modified || opposite) |
---|
7458 | 7691 | { |
---|
7459 | 7692 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7460 | 7693 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7465 | 7698 | break; |
---|
7466 | 7699 | |
---|
7467 | 7700 | case 1: // '\003' |
---|
7468 | | - if (modified) |
---|
| 7701 | + if (modified || opposite) |
---|
7469 | 7702 | { |
---|
7470 | 7703 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7471 | 7704 | LA.matScale(toParent, 1, 1, totalScale); |
---|
.. | .. |
---|
7685 | 7918 | editWindow = null; |
---|
7686 | 7919 | } // ? |
---|
7687 | 7920 | } |
---|
| 7921 | + else |
---|
| 7922 | + { |
---|
| 7923 | + //editWindow.closeUI(); |
---|
| 7924 | + } |
---|
7688 | 7925 | } |
---|
7689 | 7926 | |
---|
7690 | 7927 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7842 | 8079 | } |
---|
7843 | 8080 | |
---|
7844 | 8081 | transient ObjEditor editWindow; |
---|
| 8082 | + transient ObjEditor manipWindow; |
---|
| 8083 | + |
---|
| 8084 | + transient boolean pinned; |
---|
| 8085 | + |
---|
7845 | 8086 | transient ObjectUI objectUI; |
---|
7846 | 8087 | public static int povDepth = 0; |
---|
7847 | 8088 | private static cVector tbMin = new cVector(); |
---|