Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
Object3D.java
....@@ -300,6 +300,7 @@
300300 }
301301
302302 boolean live = false;
303
+ boolean dontselect = false;
303304 boolean hide = false;
304305 boolean link2master = false; // performs reset support/master at each frame
305306 boolean marked = false; // animation node
....@@ -1834,12 +1835,15 @@
18341835 if (obj.name == null)
18351836 continue; // can't be a null one
18361837
1838
+ // Try perfect match first.
18371839 if (n.equals(obj.name))
18381840 {
18391841 theobj = obj;
18401842 count++;
18411843 }
18421844 }
1845
+
1846
+ // not needed: n = n.split(":")[0]; // Poser generates a count
18431847
18441848 if (count != 1)
18451849 for (int i=Size(); --i>=0;)
....@@ -3002,8 +3006,10 @@
30023006 v.fromParent = LA.newMatrix();
30033007 }
30043008
3005
- LA.matConcat(v.toParent, toParent, v.toParent);
3006
- LA.matConcat(fromParent, v.fromParent, v.fromParent);
3009
+// LA.matConcat(v.toParent, toParent, v.toParent);
3010
+// LA.matConcat(fromParent, v.fromParent, v.fromParent);
3011
+ LA.matConcat(toParent, v.toParent, v.toParent);
3012
+ LA.matConcat(v.fromParent, fromParent, v.fromParent);
30073013 }
30083014
30093015 toParent = null; // LA.matIdentity(toParent);
....@@ -3236,7 +3242,9 @@
32363242 bRep.support = null;
32373243 BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32383244 // bRep.SplitInTwo(onlyone); // thread...
3239
- temprep.SplitInTwo(reduction34, onlyone);
3245
+
3246
+ while(temprep.SplitInTwo(reduction34, onlyone));
3247
+
32403248 bRep = temprep;
32413249 bRep.support = sup;
32423250 Touch();
....@@ -4711,7 +4719,7 @@
47114719
47124720 cTreePath SelectLeaf(int indexcount, boolean deselect)
47134721 {
4714
- if (hide)
4722
+ if (hide || dontselect)
47154723 return null;
47164724
47174725 if (count <= 0)
....@@ -4737,7 +4745,7 @@
47374745
47384746 cTreePath Select(int indexcount, boolean deselect)
47394747 {
4740
- if (hide)
4748
+ if (hide || dontselect)
47414749 return null;
47424750
47434751 if (count <= 0)
....@@ -5407,7 +5415,7 @@
54075415 boolean NeedSupport()
54085416 {
54095417 return
5410
- CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
5418
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
54115419 // PROBLEM with CROWD!!
54125420 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
54135421 }
....@@ -5424,7 +5432,7 @@
54245432 }
54255433
54265434 if (display.DrawMode() == iCameraPane.SELECTION &&
5427
- hide)
5435
+ (hide || dontselect))
54285436 return;
54295437
54305438 if (name != null && name.contains("sclera"))
....@@ -5666,7 +5674,17 @@
56665674 tex = GetTextures();
56675675 }
56685676
5669
- display.BindTextures(tex, texres);
5677
+ boolean failed = false;
5678
+
5679
+ try
5680
+ {
5681
+ display.BindTextures(tex, texres);
5682
+ }
5683
+ catch (Exception e)
5684
+ {
5685
+ System.err.println("FAILED: " + this);
5686
+ failed = true;
5687
+ }
56705688
56715689 if (!compiled)
56725690 {
....@@ -5688,7 +5706,8 @@
56885706 }
56895707 }
56905708
5691
- display.ReleaseTextures(tex);
5709
+ if (!failed)
5710
+ display.ReleaseTextures(tex);
56925711
56935712 display.PopMaterial(this, selected);
56945713 }
....@@ -5817,6 +5836,9 @@
58175836
58185837 void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
58195838 {
5839
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
5840
+ return;
5841
+
58205842 if (hide)
58215843 return;
58225844 // shadow optimisation
....@@ -5942,6 +5964,9 @@
59425964 if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
59435965 return; // no shadow for transparent objects
59445966
5967
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
5968
+ return;
5969
+
59455970 if (hide)
59465971 return;
59475972