Normand Briere
2019-06-25 21104baa536c6b3d3d0f9ecb7231222ed706f0e8
Object3D.java
....@@ -181,7 +181,7 @@
181181 return;
182182 }
183183
184
- Object3D o = new Object3D();
184
+ Object3D o = new Object3D("copy of " + this.name);
185185
186186 hashtable.put(GetUUID(), o);
187187
....@@ -219,16 +219,23 @@
219219 if (!hashtable.containsKey(GetUUID()))
220220 return;
221221
222
+ if (blockloop)
223
+ return;
224
+
225
+ blockloop = true;
226
+
222227 Object3D o = hashtable.get(GetUUID());
223228
224229 RestoreBigData(o);
225230
226
- hashtable.remove(GetUUID());
231
+ //hashtable.remove(GetUUID());
227232
228233 for (int i=0; i<Size(); i++)
229234 {
230235 get(i).RestoreBigData(hashtable);
231236 }
237
+
238
+ blockloop = false;
232239 }
233240
234241 void RestoreBigData(Object3D o)
....@@ -881,7 +888,7 @@
881888
882889 if (marked && Globals.isLIVE() && live &&
883890 //TEMP21aug2018
884
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
891
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
885892 currentframe != Globals.framecount)
886893 {
887894 currentframe = Globals.framecount;
....@@ -893,7 +900,8 @@
893900
894901 boolean changedir = random && Math.random() < 0.01; // && !link2master;
895902
896
- if (transformcount*factor > maxcount || (step == 1 && changedir))
903
+ if (transformcount*factor >= maxcount && (rewind || random) ||
904
+ (step == 1 && changedir))
897905 {
898906 countdown = 1;
899907 delay = speedup?8:1;
....@@ -965,6 +973,7 @@
965973 if (material == null || material.multiply)
966974 return true;
967975
976
+ // Transparent objects are dynamic because we have to sort the triangles.
968977 return material.opacity > 0.99;
969978 }
970979
....@@ -2386,6 +2395,10 @@
23862395 }
23872396 */
23882397 }
2398
+ else
2399
+ {
2400
+ //((ObjEditor)editWindow).SetupUI2(null);
2401
+ }
23892402 }
23902403
23912404 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2427,6 +2440,14 @@
24272440 {
24282441 editWindow.refreshContents();
24292442 }
2443
+ else
2444
+ {
2445
+ if (manipWindow != null)
2446
+ {
2447
+ manipWindow.refreshContents();
2448
+ }
2449
+ }
2450
+
24302451 //if (parent != null)
24312452 //parent.refreshEditWindow();
24322453 }
....@@ -3503,7 +3524,8 @@
35033524 if (blockloop)
35043525 return;
35053526
3506
- if (marked || (bRep != null && material != null)) // borderline...
3527
+ if (//marked || // does not make sense
3528
+ (bRep != null || material != null)) // borderline...
35073529 live = h;
35083530
35093531 for (int i = 0; i < Size(); i++)
....@@ -3524,7 +3546,8 @@
35243546 return;
35253547
35263548 //if (bRep != null)
3527
- if (marked || (bRep != null && material != null)) // borderline...
3549
+ if (//marked || // does not make sense
3550
+ (bRep != null || material != null)) // borderline...
35283551 link2master = h;
35293552
35303553 for (int i = 0; i < Size(); i++)
....@@ -3544,7 +3567,8 @@
35443567 if (blockloop)
35453568 return;
35463569
3547
- if (marked || (bRep != null && material != null)) // borderline...
3570
+ if (//marked || // does not make sense
3571
+ (bRep != null || material != null)) // borderline...
35483572 hide = h;
35493573
35503574 for (int i = 0; i < Size(); i++)
....@@ -3564,7 +3588,7 @@
35643588 if (blockloop)
35653589 return;
35663590
3567
- if (bRep != null && material != null) // borderline...
3591
+ if (bRep != null || material != null) // borderline...
35683592 marked = h;
35693593
35703594 for (int i = 0; i < Size(); i++)
....@@ -3574,6 +3598,46 @@
35743598 continue;
35753599 blockloop = true;
35763600 child.MarkLeaves(h);
3601
+ blockloop = false;
3602
+ // release(i);
3603
+ }
3604
+ }
3605
+
3606
+ void RewindLeaves(boolean h)
3607
+ {
3608
+ if (blockloop)
3609
+ return;
3610
+
3611
+ if (bRep != null || material != null) // borderline...
3612
+ rewind = 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.RewindLeaves(h);
3621
+ blockloop = false;
3622
+ // release(i);
3623
+ }
3624
+ }
3625
+
3626
+ void RandomLeaves(boolean h)
3627
+ {
3628
+ if (blockloop)
3629
+ return;
3630
+
3631
+ if (bRep != null || material != null) // borderline...
3632
+ random = h;
3633
+
3634
+ for (int i = 0; i < Size(); i++)
3635
+ {
3636
+ Object3D child = (Object3D) get(i); // reserve(i);
3637
+ if (child == null)
3638
+ continue;
3639
+ blockloop = true;
3640
+ child.RandomLeaves(h);
35773641 blockloop = false;
35783642 // release(i);
35793643 }
....@@ -4914,6 +4978,14 @@
49144978 }
49154979 }
49164980
4981
+ ObjEditor GetWindow()
4982
+ {
4983
+ if (editWindow != null)
4984
+ return editWindow;
4985
+
4986
+ return manipWindow;
4987
+ }
4988
+
49174989 cTreePath Select(int indexcount, boolean deselect)
49184990 {
49194991 if (hide || dontselect)
....@@ -4950,10 +5022,11 @@
49505022 if (leaf != null)
49515023 {
49525024 cTreePath tp = new cTreePath(this, leaf);
4953
- if (editWindow != null)
5025
+ ObjEditor window = GetWindow();
5026
+ if (window != null)
49545027 {
49555028 //System.out.println("editWindow = " + editWindow + " vs " + this);
4956
- editWindow.Select(tp, deselect, true);
5029
+ window.Select(tp, deselect, true);
49575030 }
49585031
49595032 return tp;
....@@ -4979,9 +5052,10 @@
49795052 if (leaf != null)
49805053 {
49815054 cTreePath tp = new cTreePath(this, leaf);
4982
- if (editWindow != null)
5055
+ ObjEditor window = GetWindow();
5056
+ if (window != null)
49835057 {
4984
- editWindow.Select(tp, deselect, true);
5058
+ window.Select(tp, deselect, true);
49855059 }
49865060
49875061 return tp;
....@@ -5702,7 +5776,7 @@
57025776 support = support;
57035777
57045778 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5705
- boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5779
+ boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
57065780
57075781 if (!usecalllists && bRep != null && bRep.displaylist > 0)
57085782 {
....@@ -5723,7 +5797,7 @@
57235797
57245798 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57255799 //(touched || (bRep != null && bRep.displaylist <= 0)))
5726
- (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0)))
5800
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0)))
57275801 {
57285802 Globals.lighttouched = true;
57295803 } // all panes...
....@@ -6315,6 +6389,11 @@
63156389 // dec 2012
63166390 new Exception().printStackTrace();
63176391 return;
6392
+ }
6393
+
6394
+ if (dontselect)
6395
+ {
6396
+ //bRep.GenerateNormalsMINE();
63186397 }
63196398
63206399 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -7752,6 +7831,10 @@
77527831 editWindow = null;
77537832 } // ?
77547833 }
7834
+ else
7835
+ {
7836
+ //editWindow.closeUI();
7837
+ }
77557838 }
77567839
77577840 boolean root; // patch for edit windows
....@@ -7909,6 +7992,8 @@
79097992 }
79107993
79117994 transient ObjEditor editWindow;
7995
+ transient ObjEditor manipWindow;
7996
+
79127997 transient ObjectUI objectUI;
79137998 public static int povDepth = 0;
79147999 private static cVector tbMin = new cVector();