.. | .. |
---|
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; |
---|
.. | .. |
---|
2386 | 2387 | } |
---|
2387 | 2388 | */ |
---|
2388 | 2389 | } |
---|
| 2390 | + else |
---|
| 2391 | + { |
---|
| 2392 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2393 | + } |
---|
2389 | 2394 | } |
---|
2390 | 2395 | |
---|
2391 | 2396 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
3503 | 3508 | if (blockloop) |
---|
3504 | 3509 | return; |
---|
3505 | 3510 | |
---|
3506 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3511 | + if (//marked || // does not make sense |
---|
| 3512 | + (bRep != null || material != null)) // borderline... |
---|
3507 | 3513 | live = h; |
---|
3508 | 3514 | |
---|
3509 | 3515 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3524 | 3530 | return; |
---|
3525 | 3531 | |
---|
3526 | 3532 | //if (bRep != null) |
---|
3527 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3533 | + if (//marked || // does not make sense |
---|
| 3534 | + (bRep != null || material != null)) // borderline... |
---|
3528 | 3535 | link2master = h; |
---|
3529 | 3536 | |
---|
3530 | 3537 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3544 | 3551 | if (blockloop) |
---|
3545 | 3552 | return; |
---|
3546 | 3553 | |
---|
3547 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3554 | + if (//marked || // does not make sense |
---|
| 3555 | + (bRep != null || material != null)) // borderline... |
---|
3548 | 3556 | hide = h; |
---|
3549 | 3557 | |
---|
3550 | 3558 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3564 | 3572 | if (blockloop) |
---|
3565 | 3573 | return; |
---|
3566 | 3574 | |
---|
3567 | | - if (bRep != null && material != null) // borderline... |
---|
| 3575 | + if (bRep != null || material != null) // borderline... |
---|
3568 | 3576 | marked = h; |
---|
3569 | 3577 | |
---|
3570 | 3578 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3574 | 3582 | continue; |
---|
3575 | 3583 | blockloop = true; |
---|
3576 | 3584 | child.MarkLeaves(h); |
---|
| 3585 | + blockloop = false; |
---|
| 3586 | + // release(i); |
---|
| 3587 | + } |
---|
| 3588 | + } |
---|
| 3589 | + |
---|
| 3590 | + void RewindLeaves(boolean h) |
---|
| 3591 | + { |
---|
| 3592 | + if (blockloop) |
---|
| 3593 | + return; |
---|
| 3594 | + |
---|
| 3595 | + if (bRep != null || material != null) // borderline... |
---|
| 3596 | + rewind = h; |
---|
| 3597 | + |
---|
| 3598 | + for (int i = 0; i < Size(); i++) |
---|
| 3599 | + { |
---|
| 3600 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3601 | + if (child == null) |
---|
| 3602 | + continue; |
---|
| 3603 | + blockloop = true; |
---|
| 3604 | + child.RewindLeaves(h); |
---|
| 3605 | + blockloop = false; |
---|
| 3606 | + // release(i); |
---|
| 3607 | + } |
---|
| 3608 | + } |
---|
| 3609 | + |
---|
| 3610 | + void RandomLeaves(boolean h) |
---|
| 3611 | + { |
---|
| 3612 | + if (blockloop) |
---|
| 3613 | + return; |
---|
| 3614 | + |
---|
| 3615 | + if (bRep != null || material != null) // borderline... |
---|
| 3616 | + random = h; |
---|
| 3617 | + |
---|
| 3618 | + for (int i = 0; i < Size(); i++) |
---|
| 3619 | + { |
---|
| 3620 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3621 | + if (child == null) |
---|
| 3622 | + continue; |
---|
| 3623 | + blockloop = true; |
---|
| 3624 | + child.RandomLeaves(h); |
---|
3577 | 3625 | blockloop = false; |
---|
3578 | 3626 | // release(i); |
---|
3579 | 3627 | } |
---|
.. | .. |
---|
4347 | 4395 | { |
---|
4348 | 4396 | blockloop = true; |
---|
4349 | 4397 | get(i).RepairShadow(); |
---|
| 4398 | + blockloop = false; |
---|
| 4399 | + } |
---|
| 4400 | + } |
---|
| 4401 | + |
---|
| 4402 | + void RepairSOV() |
---|
| 4403 | + { |
---|
| 4404 | + if (blockloop) |
---|
| 4405 | + return; |
---|
| 4406 | + |
---|
| 4407 | + String texname = this.GetPigmentTexture(); |
---|
| 4408 | + |
---|
| 4409 | + if (texname.startsWith("sov")) |
---|
| 4410 | + { |
---|
| 4411 | + String[] s = texname.split("/"); |
---|
| 4412 | + |
---|
| 4413 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4414 | + |
---|
| 4415 | + texname = sname[0]; |
---|
| 4416 | + |
---|
| 4417 | + if (sname.length > 1) |
---|
| 4418 | + { |
---|
| 4419 | + texname += "Color.jpg"; |
---|
| 4420 | + } |
---|
| 4421 | + |
---|
| 4422 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4423 | + } |
---|
| 4424 | + |
---|
| 4425 | + texname = this.GetBumpTexture(); |
---|
| 4426 | + |
---|
| 4427 | + if (texname.startsWith("sov")) |
---|
| 4428 | + { |
---|
| 4429 | + String[] s = texname.split("/"); |
---|
| 4430 | + |
---|
| 4431 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4432 | + |
---|
| 4433 | + texname = sname[0]; |
---|
| 4434 | + |
---|
| 4435 | + if (sname.length > 1) |
---|
| 4436 | + { |
---|
| 4437 | + texname += "Bump.jpg"; |
---|
| 4438 | + } |
---|
| 4439 | + |
---|
| 4440 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4441 | + } |
---|
| 4442 | + |
---|
| 4443 | + for (int i=0; i<Size(); i++) |
---|
| 4444 | + { |
---|
| 4445 | + blockloop = true; |
---|
| 4446 | + get(i).RepairSOV(); |
---|
4350 | 4447 | blockloop = false; |
---|
4351 | 4448 | } |
---|
4352 | 4449 | } |
---|
.. | .. |
---|
5673 | 5770 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5674 | 5771 | |
---|
5675 | 5772 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5676 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5773 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5774 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5677 | 5775 | { |
---|
5678 | 5776 | Globals.lighttouched = true; |
---|
5679 | 5777 | } // all panes... |
---|
| 5778 | + |
---|
5680 | 5779 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5681 | 5780 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5682 | 5781 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5844 | 5943 | tex = GetTextures(); |
---|
5845 | 5944 | } |
---|
5846 | 5945 | |
---|
5847 | | - boolean failed = false; |
---|
| 5946 | + boolean failedPigment = false; |
---|
| 5947 | + boolean failedBump = false; |
---|
5848 | 5948 | |
---|
5849 | 5949 | try |
---|
5850 | 5950 | { |
---|
5851 | | - display.BindTextures(tex, texres); |
---|
| 5951 | + display.BindPigmentTexture(tex, texres); |
---|
5852 | 5952 | } |
---|
5853 | 5953 | catch (Exception e) |
---|
5854 | 5954 | { |
---|
5855 | 5955 | System.err.println("FAILED: " + this); |
---|
5856 | | - failed = true; |
---|
| 5956 | + failedPigment = true; |
---|
| 5957 | + } |
---|
| 5958 | + |
---|
| 5959 | + try |
---|
| 5960 | + { |
---|
| 5961 | + display.BindBumpTexture(tex, texres); |
---|
| 5962 | + } |
---|
| 5963 | + catch (Exception e) |
---|
| 5964 | + { |
---|
| 5965 | + //System.err.println("FAILED: " + this); |
---|
| 5966 | + failedBump = true; |
---|
5857 | 5967 | } |
---|
5858 | 5968 | |
---|
5859 | 5969 | if (!compiled) |
---|
.. | .. |
---|
5876 | 5986 | } |
---|
5877 | 5987 | } |
---|
5878 | 5988 | |
---|
5879 | | - if (!failed) |
---|
5880 | | - display.ReleaseTextures(tex); |
---|
| 5989 | + if (!failedBump) |
---|
| 5990 | + display.ReleaseBumpTexture(tex); |
---|
| 5991 | + |
---|
| 5992 | + if (!failedPigment) |
---|
| 5993 | + display.ReleasePigmentTexture(tex); |
---|
5881 | 5994 | |
---|
5882 | 5995 | display.PopMaterial(this, selected); |
---|
5883 | 5996 | } |
---|
.. | .. |
---|
6250 | 6363 | // dec 2012 |
---|
6251 | 6364 | new Exception().printStackTrace(); |
---|
6252 | 6365 | return; |
---|
| 6366 | + } |
---|
| 6367 | + |
---|
| 6368 | + if (dontselect) |
---|
| 6369 | + { |
---|
| 6370 | + //bRep.GenerateNormalsMINE(); |
---|
6253 | 6371 | } |
---|
6254 | 6372 | |
---|
6255 | 6373 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
7450 | 7568 | } // vScale, 1); |
---|
7451 | 7569 | else |
---|
7452 | 7570 | { |
---|
7453 | | - LA.matScale(toParent, 1, totalScale, totalScale); |
---|
| 7571 | + // EXCEPTION! |
---|
| 7572 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7454 | 7573 | } // vScale, 1); |
---|
7455 | 7574 | break; |
---|
7456 | 7575 | |
---|
.. | .. |
---|
7686 | 7805 | editWindow = null; |
---|
7687 | 7806 | } // ? |
---|
7688 | 7807 | } |
---|
| 7808 | + else |
---|
| 7809 | + { |
---|
| 7810 | + //editWindow.closeUI(); |
---|
| 7811 | + } |
---|
7689 | 7812 | } |
---|
7690 | 7813 | |
---|
7691 | 7814 | boolean root; // patch for edit windows |
---|