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 }
....@@ -5673,10 +5770,12 @@
56735770 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
56745771
56755772 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)))
56775775 {
56785776 Globals.lighttouched = true;
56795777 } // all panes...
5778
+
56805779 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56815780 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56825781 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5844,16 +5943,27 @@
58445943 tex = GetTextures();
58455944 }
58465945
5847
- boolean failed = false;
5946
+ boolean failedPigment = false;
5947
+ boolean failedBump = false;
58485948
58495949 try
58505950 {
5851
- display.BindTextures(tex, texres);
5951
+ display.BindPigmentTexture(tex, texres);
58525952 }
58535953 catch (Exception e)
58545954 {
58555955 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;
58575967 }
58585968
58595969 if (!compiled)
....@@ -5876,8 +5986,11 @@
58765986 }
58775987 }
58785988
5879
- if (!failed)
5880
- display.ReleaseTextures(tex);
5989
+ if (!failedBump)
5990
+ display.ReleaseBumpTexture(tex);
5991
+
5992
+ if (!failedPigment)
5993
+ display.ReleasePigmentTexture(tex);
58815994
58825995 display.PopMaterial(this, selected);
58835996 }
....@@ -6250,6 +6363,11 @@
62506363 // dec 2012
62516364 new Exception().printStackTrace();
62526365 return;
6366
+ }
6367
+
6368
+ if (dontselect)
6369
+ {
6370
+ //bRep.GenerateNormalsMINE();
62536371 }
62546372
62556373 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -7102,7 +7220,7 @@
71027220 spot.translate(32, 32);
71037221 spotw = spot.x + spot.width;
71047222 spoth = spot.y + spot.height;
7105
- info.g.setColor(Color.blue);
7223
+ info.g.setColor(Color.cyan);
71067224 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
71077225 // if (CameraPane.Xmin > spot.x)
71087226 // {
....@@ -7120,11 +7238,12 @@
71207238 // {
71217239 // CameraPane.Ymax = spoth;
71227240 // }
7123
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7124
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7241
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7242
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
71257243 spot.translate(0, -32);
7126
- info.g.setColor(Color.green);
7244
+ info.g.setColor(Color.yellow);
71277245 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7246
+ info.g.setColor(Color.green);
71287247 // if (CameraPane.Xmin > spot.x)
71297248 // {
71307249 // CameraPane.Xmin = spot.x;
....@@ -7442,19 +7561,20 @@
74427561 switch (info.pane.RenderCamera().viewCode)
74437562 {
74447563 case 3: // '\001'
7445
- if (modified)
7564
+ if (modified || opposite)
74467565 {
74477566 //LA.matScale(toParent, 1, hScale, vScale);
74487567 LA.matScale(toParent, totalScale, 1, 1);
74497568 } // vScale, 1);
74507569 else
74517570 {
7571
+ // EXCEPTION!
74527572 LA.matScale(toParent, totalScale, totalScale, totalScale);
74537573 } // vScale, 1);
74547574 break;
74557575
74567576 case 2: // '\002'
7457
- if (modified)
7577
+ if (modified || opposite)
74587578 {
74597579 //LA.matScale(toParent, hScale, 1, vScale);
74607580 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7465,7 +7585,7 @@
74657585 break;
74667586
74677587 case 1: // '\003'
7468
- if (modified)
7588
+ if (modified || opposite)
74697589 {
74707590 //LA.matScale(toParent, hScale, vScale, 1);
74717591 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7685,6 +7805,10 @@
76857805 editWindow = null;
76867806 } // ?
76877807 }
7808
+ else
7809
+ {
7810
+ //editWindow.closeUI();
7811
+ }
76887812 }
76897813
76907814 boolean root; // patch for edit windows