Normand Briere
2018-07-01 89c1ad67bc65d24ceadfa9e95f8c5515283f1e97
Object3D.java
....@@ -355,7 +355,7 @@
355355
356356 int MemorySize()
357357 {
358
- if (memorysize == 0)
358
+ if (true) // memorysize == 0)
359359 {
360360 try
361361 {
....@@ -935,7 +935,7 @@
935935
936936 public Object clone()
937937 {
938
- return GraphreeD.clone(this);
938
+ return GrafreeD.clone(this);
939939 }
940940
941941 Object3D copyExpand()
....@@ -1446,7 +1446,16 @@
14461446 // if (other == null)
14471447 // return;
14481448
1449
- System.out.println("Link support this = " + this + "; other = " + other);
1449
+ if (other != null)
1450
+ {
1451
+ BoundaryRep.SEUIL = other.material.cameralight;
1452
+
1453
+ // Set default to 0.1
1454
+ BoundaryRep.SEUIL /= 2;
1455
+ System.out.println("SEUIL = " + BoundaryRep.SEUIL);
1456
+ }
1457
+
1458
+ System.out.println("Link this = " + this + "; support = " + other);
14501459
14511460 //if (bRep != null)
14521461 // bRep.linkVerticesThis(other.bRep);
....@@ -1701,7 +1710,7 @@
17011710 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17021711 o.bRep = transientrep;
17031712 if (clone)
1704
- o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1713
+ o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17051714 o.CreateMaterial();
17061715 o.SetAttributes(this, -1);
17071716 //parent
....@@ -1714,7 +1723,7 @@
17141723 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17151724 o.bRep = bRep;
17161725 if (clone)
1717
- o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1726
+ o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17181727 o.CreateMaterial();
17191728 //o.overwriteThis(this, -1);
17201729 o.SetAttributes(this, -1);
....@@ -1756,7 +1765,7 @@
17561765 // {
17571766 // assert(bRep == null);
17581767 // Object3D o = new Object3D("Geometry:" + this.name);
1759
-// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1768
+// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17601769 // o.CreateMaterial();
17611770 // parent.addChild(o);
17621771 // }
....@@ -1765,7 +1774,7 @@
17651774 // {
17661775 // assert(transientrep == null);
17671776 // Object3D o = new Object3D("Geometry:" + this.name);
1768
-// o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1777
+// o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17691778 // o.CreateMaterial();
17701779 // parent.addChild(o);
17711780 // }
....@@ -1816,8 +1825,9 @@
18161825 if (obj.name == null)
18171826 continue; // can't be a null one
18181827
1819
- //if (n.contains(obj.name)) // dec 2013 name.split(":")[0])) // Poser generates a count
1820
- if (n.startsWith(obj.name))
1828
+ String name = obj.name.split(":")[0]; // Poser generates a count
1829
+ //if (n.startsWith(obj.name))
1830
+ if (n.contains(name))
18211831 {
18221832 theobj = obj;
18231833 count++;
....@@ -2732,6 +2742,24 @@
27322742 blockloop = false;
27332743 }
27342744
2745
+ void GenNormalsMINE()
2746
+ {
2747
+ if (blockloop)
2748
+ return;
2749
+
2750
+ blockloop = true;
2751
+ GenNormalsMINE0();
2752
+ for (int i = 0; i < Children().Size(); i++)
2753
+ {
2754
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2755
+ if (child == null)
2756
+ continue;
2757
+ child.GenNormalsMINE();
2758
+// Children().release(i);
2759
+ }
2760
+ blockloop = false;
2761
+ }
2762
+
27352763 void ClearColors()
27362764 {
27372765 if (blockloop)
....@@ -2876,6 +2904,15 @@
28762904 if (bRep != null)
28772905 {
28782906 bRep.GenerateNormals(crease);
2907
+ Touch();
2908
+ }
2909
+ }
2910
+
2911
+ void GenNormalsMINE0()
2912
+ {
2913
+ if (bRep != null)
2914
+ {
2915
+ bRep.GenerateNormalsMINE();
28792916 Touch();
28802917 }
28812918 }
....@@ -3153,7 +3190,7 @@
31533190
31543191 BoundaryRep sup = bRep.support;
31553192 bRep.support = null;
3156
- BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);
3193
+ BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
31573194 // bRep.SplitInTwo(onlyone); // thread...
31583195 temprep.SplitInTwo(reduction34, onlyone);
31593196 bRep = temprep;
....@@ -3677,7 +3714,7 @@
36773714 if (child == null)
36783715 continue;
36793716
3680
- if (GraphreeD.RENDERME > 0)
3717
+ if (GrafreeD.RENDERME > 0)
36813718 {
36823719 if (child instanceof Merge)
36833720 ((Merge)child).renderme();
....@@ -3828,7 +3865,7 @@
38283865 if (child == null)
38293866 continue;
38303867
3831
- if (GraphreeD.RENDERME > 0)
3868
+ if (GrafreeD.RENDERME > 0)
38323869 {
38333870 if (child instanceof Merge)
38343871 ((Merge)child).renderme();
....@@ -4023,7 +4060,7 @@
40234060 if (child == null)
40244061 continue;
40254062
4026
- if (GraphreeD.RENDERME > 0)
4063
+ if (GrafreeD.RENDERME > 0)
40274064 {
40284065 if (child instanceof Merge)
40294066 ((Merge)child).renderme();
....@@ -4111,7 +4148,7 @@
41114148 if (blockloop)
41124149 return;
41134150
4114
- for (int i=0; i<size(); i++)
4151
+ for (int i=0; i<Size(); i++)
41154152 {
41164153 if (get(i).parent != this)
41174154 {
....@@ -5519,7 +5556,9 @@
55195556 display.options2[2] = material.factor;
55205557
55215558 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
5522
- display.options3[3] = material.cameralight/0.2f;
5559
+ display.options4[0] = material.cameralight/0.2f;
5560
+ display.options4[1] = material.subsurface;
5561
+ display.options4[2] = material.sheen;
55235562
55245563 // if (display.CURRENTANTIALIAS > 0)
55255564 // display.options3[3] /= 4;
....@@ -5819,12 +5858,12 @@
58195858 if (!child.HasTransparency())
58205859 {
58215860 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1;
5822
- // GraphreeD.tracein("draw ", child);
5861
+ // GrafreeD.tracein("draw ", child);
58235862 boolean wasblocked = blockdraw;
58245863 blockdraw = true;
58255864 child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected());
58265865 blockdraw = false;
5827
- // GraphreeD.traceout("draw ", child);
5866
+ // GrafreeD.traceout("draw ", child);
58285867 }
58295868
58305869 release(i);
....@@ -7731,7 +7770,7 @@
77317770 if (parent == null)
77327771 {
77337772 System.out.println("NULL PARENT");
7734
- new Exception().printStackTrace();
7773
+ //new Exception().printStackTrace();
77357774 } else
77367775 {
77377776 if (parent instanceof BezierPatch)
....@@ -8041,7 +8080,7 @@
80418080 {
80428081 assert(bRep != null);
80438082 if (!(support instanceof GenericJoint)) // support.bRep != null)
8044
- GraphreeD.Assert(support.bRep == bRep.support);
8083
+ GrafreeD.Assert(support.bRep == bRep.support);
80458084 }
80468085 else
80478086 {