Normand Briere
2019-06-23 8088590686a45e71278f9a52bb9cc37943dc0c37
Object3D.java
....@@ -893,7 +893,8 @@
893893
894894 boolean changedir = random && Math.random() < 0.01; // && !link2master;
895895
896
- if (transformcount*factor > maxcount || (step == 1 && changedir))
896
+ if (transformcount*factor >= maxcount && (rewind || random) ||
897
+ (step == 1 && changedir))
897898 {
898899 countdown = 1;
899900 delay = speedup?8:1;
....@@ -2386,6 +2387,10 @@
23862387 }
23872388 */
23882389 }
2390
+ else
2391
+ {
2392
+ //((ObjEditor)editWindow).SetupUI2(null);
2393
+ }
23892394 }
23902395
23912396 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -3503,7 +3508,8 @@
35033508 if (blockloop)
35043509 return;
35053510
3506
- if (marked || (bRep != null && material != null)) // borderline...
3511
+ if (//marked || // does not make sense
3512
+ (bRep != null || material != null)) // borderline...
35073513 live = h;
35083514
35093515 for (int i = 0; i < Size(); i++)
....@@ -3524,7 +3530,8 @@
35243530 return;
35253531
35263532 //if (bRep != null)
3527
- if (marked || (bRep != null && material != null)) // borderline...
3533
+ if (//marked || // does not make sense
3534
+ (bRep != null || material != null)) // borderline...
35283535 link2master = h;
35293536
35303537 for (int i = 0; i < Size(); i++)
....@@ -3544,7 +3551,8 @@
35443551 if (blockloop)
35453552 return;
35463553
3547
- if (marked || (bRep != null && material != null)) // borderline...
3554
+ if (//marked || // does not make sense
3555
+ (bRep != null || material != null)) // borderline...
35483556 hide = h;
35493557
35503558 for (int i = 0; i < Size(); i++)
....@@ -3564,7 +3572,7 @@
35643572 if (blockloop)
35653573 return;
35663574
3567
- if (bRep != null && material != null) // borderline...
3575
+ if (bRep != null || material != null) // borderline...
35683576 marked = h;
35693577
35703578 for (int i = 0; i < Size(); i++)
....@@ -3574,6 +3582,46 @@
35743582 continue;
35753583 blockloop = true;
35763584 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);
35773625 blockloop = false;
35783626 // release(i);
35793627 }
....@@ -4347,6 +4395,55 @@
43474395 {
43484396 blockloop = true;
43494397 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();
43504447 blockloop = false;
43514448 }
43524449 }
....@@ -5846,16 +5943,27 @@
58465943 tex = GetTextures();
58475944 }
58485945
5849
- boolean failed = false;
5946
+ boolean failedPigment = false;
5947
+ boolean failedBump = false;
58505948
58515949 try
58525950 {
5853
- display.BindTextures(tex, texres);
5951
+ display.BindPigmentTexture(tex, texres);
58545952 }
58555953 catch (Exception e)
58565954 {
58575955 System.err.println("FAILED: " + this);
5858
- 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;
58595967 }
58605968
58615969 if (!compiled)
....@@ -5878,8 +5986,11 @@
58785986 }
58795987 }
58805988
5881
- if (!failed)
5882
- display.ReleaseTextures(tex);
5989
+ if (!failedBump)
5990
+ display.ReleaseBumpTexture(tex);
5991
+
5992
+ if (!failedPigment)
5993
+ display.ReleasePigmentTexture(tex);
58835994
58845995 display.PopMaterial(this, selected);
58855996 }
....@@ -6252,6 +6363,11 @@
62526363 // dec 2012
62536364 new Exception().printStackTrace();
62546365 return;
6366
+ }
6367
+
6368
+ if (dontselect)
6369
+ {
6370
+ //bRep.GenerateNormalsMINE();
62556371 }
62566372
62576373 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -7689,6 +7805,10 @@
76897805 editWindow = null;
76907806 } // ?
76917807 }
7808
+ else
7809
+ {
7810
+ //editWindow.closeUI();
7811
+ }
76927812 }
76937813
76947814 boolean root; // patch for edit windows