.. | .. |
---|
893 | 893 | |
---|
894 | 894 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
895 | 895 | |
---|
896 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 896 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 897 | + (step == 1 && changedir)) |
---|
897 | 898 | { |
---|
898 | 899 | countdown = 1; |
---|
899 | 900 | delay = speedup?8:1; |
---|
.. | .. |
---|
3503 | 3504 | if (blockloop) |
---|
3504 | 3505 | return; |
---|
3505 | 3506 | |
---|
3506 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3507 | + if (//marked || // does not make sense |
---|
| 3508 | + (bRep != null || material != null)) // borderline... |
---|
3507 | 3509 | live = h; |
---|
3508 | 3510 | |
---|
3509 | 3511 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3524 | 3526 | return; |
---|
3525 | 3527 | |
---|
3526 | 3528 | //if (bRep != null) |
---|
3527 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3529 | + if (//marked || // does not make sense |
---|
| 3530 | + (bRep != null || material != null)) // borderline... |
---|
3528 | 3531 | link2master = h; |
---|
3529 | 3532 | |
---|
3530 | 3533 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3544 | 3547 | if (blockloop) |
---|
3545 | 3548 | return; |
---|
3546 | 3549 | |
---|
3547 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3550 | + if (//marked || // does not make sense |
---|
| 3551 | + (bRep != null || material != null)) // borderline... |
---|
3548 | 3552 | hide = h; |
---|
3549 | 3553 | |
---|
3550 | 3554 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3564 | 3568 | if (blockloop) |
---|
3565 | 3569 | return; |
---|
3566 | 3570 | |
---|
3567 | | - if (bRep != null && material != null) // borderline... |
---|
| 3571 | + if (bRep != null || material != null) // borderline... |
---|
3568 | 3572 | marked = h; |
---|
3569 | 3573 | |
---|
3570 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3574 | 3578 | continue; |
---|
3575 | 3579 | blockloop = true; |
---|
3576 | 3580 | child.MarkLeaves(h); |
---|
| 3581 | + blockloop = false; |
---|
| 3582 | + // release(i); |
---|
| 3583 | + } |
---|
| 3584 | + } |
---|
| 3585 | + |
---|
| 3586 | + void RewindLeaves(boolean h) |
---|
| 3587 | + { |
---|
| 3588 | + if (blockloop) |
---|
| 3589 | + return; |
---|
| 3590 | + |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
| 3592 | + rewind = h; |
---|
| 3593 | + |
---|
| 3594 | + for (int i = 0; i < Size(); i++) |
---|
| 3595 | + { |
---|
| 3596 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3597 | + if (child == null) |
---|
| 3598 | + continue; |
---|
| 3599 | + blockloop = true; |
---|
| 3600 | + child.RewindLeaves(h); |
---|
| 3601 | + blockloop = false; |
---|
| 3602 | + // release(i); |
---|
| 3603 | + } |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + void RandomLeaves(boolean h) |
---|
| 3607 | + { |
---|
| 3608 | + if (blockloop) |
---|
| 3609 | + return; |
---|
| 3610 | + |
---|
| 3611 | + if (bRep != null || material != null) // borderline... |
---|
| 3612 | + random = 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.RandomLeaves(h); |
---|
3577 | 3621 | blockloop = false; |
---|
3578 | 3622 | // release(i); |
---|
3579 | 3623 | } |
---|
.. | .. |
---|
4347 | 4391 | { |
---|
4348 | 4392 | blockloop = true; |
---|
4349 | 4393 | get(i).RepairShadow(); |
---|
| 4394 | + blockloop = false; |
---|
| 4395 | + } |
---|
| 4396 | + } |
---|
| 4397 | + |
---|
| 4398 | + void RepairSOV() |
---|
| 4399 | + { |
---|
| 4400 | + if (blockloop) |
---|
| 4401 | + return; |
---|
| 4402 | + |
---|
| 4403 | + String texname = this.GetPigmentTexture(); |
---|
| 4404 | + |
---|
| 4405 | + if (texname.startsWith("sov")) |
---|
| 4406 | + { |
---|
| 4407 | + String[] s = texname.split("/"); |
---|
| 4408 | + |
---|
| 4409 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4410 | + |
---|
| 4411 | + texname = sname[0]; |
---|
| 4412 | + |
---|
| 4413 | + if (sname.length > 1) |
---|
| 4414 | + { |
---|
| 4415 | + texname += "Color.jpg"; |
---|
| 4416 | + } |
---|
| 4417 | + |
---|
| 4418 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4419 | + } |
---|
| 4420 | + |
---|
| 4421 | + texname = this.GetBumpTexture(); |
---|
| 4422 | + |
---|
| 4423 | + if (texname.startsWith("sov")) |
---|
| 4424 | + { |
---|
| 4425 | + String[] s = texname.split("/"); |
---|
| 4426 | + |
---|
| 4427 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4428 | + |
---|
| 4429 | + texname = sname[0]; |
---|
| 4430 | + |
---|
| 4431 | + if (sname.length > 1) |
---|
| 4432 | + { |
---|
| 4433 | + texname += "Bump.jpg"; |
---|
| 4434 | + } |
---|
| 4435 | + |
---|
| 4436 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4437 | + } |
---|
| 4438 | + |
---|
| 4439 | + for (int i=0; i<Size(); i++) |
---|
| 4440 | + { |
---|
| 4441 | + blockloop = true; |
---|
| 4442 | + get(i).RepairSOV(); |
---|
4350 | 4443 | blockloop = false; |
---|
4351 | 4444 | } |
---|
4352 | 4445 | } |
---|
.. | .. |
---|
5673 | 5766 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5674 | 5767 | |
---|
5675 | 5768 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5676 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5769 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5770 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5677 | 5771 | { |
---|
5678 | 5772 | Globals.lighttouched = true; |
---|
5679 | 5773 | } // all panes... |
---|
| 5774 | + |
---|
5680 | 5775 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5681 | 5776 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5682 | 5777 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5844 | 5939 | tex = GetTextures(); |
---|
5845 | 5940 | } |
---|
5846 | 5941 | |
---|
5847 | | - boolean failed = false; |
---|
| 5942 | + boolean failedPigment = false; |
---|
| 5943 | + boolean failedBump = false; |
---|
5848 | 5944 | |
---|
5849 | 5945 | try |
---|
5850 | 5946 | { |
---|
5851 | | - display.BindTextures(tex, texres); |
---|
| 5947 | + display.BindPigmentTexture(tex, texres); |
---|
5852 | 5948 | } |
---|
5853 | 5949 | catch (Exception e) |
---|
5854 | 5950 | { |
---|
5855 | 5951 | System.err.println("FAILED: " + this); |
---|
5856 | | - failed = true; |
---|
| 5952 | + failedPigment = true; |
---|
| 5953 | + } |
---|
| 5954 | + |
---|
| 5955 | + try |
---|
| 5956 | + { |
---|
| 5957 | + display.BindBumpTexture(tex, texres); |
---|
| 5958 | + } |
---|
| 5959 | + catch (Exception e) |
---|
| 5960 | + { |
---|
| 5961 | + //System.err.println("FAILED: " + this); |
---|
| 5962 | + failedBump = true; |
---|
5857 | 5963 | } |
---|
5858 | 5964 | |
---|
5859 | 5965 | if (!compiled) |
---|
.. | .. |
---|
5876 | 5982 | } |
---|
5877 | 5983 | } |
---|
5878 | 5984 | |
---|
5879 | | - if (!failed) |
---|
5880 | | - display.ReleaseTextures(tex); |
---|
| 5985 | + if (!failedBump) |
---|
| 5986 | + display.ReleaseBumpTexture(tex); |
---|
| 5987 | + |
---|
| 5988 | + if (!failedPigment) |
---|
| 5989 | + display.ReleasePigmentTexture(tex); |
---|
5881 | 5990 | |
---|
5882 | 5991 | display.PopMaterial(this, selected); |
---|
5883 | 5992 | } |
---|
.. | .. |
---|
7450 | 7559 | } // vScale, 1); |
---|
7451 | 7560 | else |
---|
7452 | 7561 | { |
---|
7453 | | - LA.matScale(toParent, 1, totalScale, totalScale); |
---|
| 7562 | + // EXCEPTION! |
---|
| 7563 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7454 | 7564 | } // vScale, 1); |
---|
7455 | 7565 | break; |
---|
7456 | 7566 | |
---|