Normand Briere
2019-10-15 8f471ab58f8676229d29cde03aba3597d096cf84
Color/parallax
4 files modified
27 ■■■■■ changed files
ObjEditor.java 4 ●●●● patch | view | raw | blame | history
Object3D.java 12 ●●●● patch | view | raw | blame | history
Torus.java 3 ●●●● patch | view | raw | blame | history
cMaterial.java 8 ●●●●● patch | view | raw | blame | history
ObjEditor.java
....@@ -729,7 +729,7 @@
729729 si.SendInfo("#children = " + sel.Size(), "regular");
730730 }
731731 si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
732
- si.SendInfo((debug ? " Complete path: " : " ") + sel.GetPath(), "regular");
732
+ si.SendInfo((debug ? " Path: " : " ") + sel.GetPath(), "regular");
733733 si.SendInfo((debug ? " Texture: " : " ") + sel.GetTextures(), "bold");
734734 if (sel.GetTextures().pigmentdata != null)
735735 si.SendInfo(" EMBEDDED ", "regular");
....@@ -5457,7 +5457,7 @@
54575457 if (!cNumberSlider.frozen)
54585458 {
54595459 //System.out.println("Propagate = " + propagate);
5460
- copy.UpdateMaterial(anchor, current, propagate);
5460
+ copy.UpdateMaterial(anchor, current, propagate, true);
54615461
54625462 if (copy.material != null)
54635463 {
Object3D.java
....@@ -1428,7 +1428,7 @@
14281428
14291429 blockloop = true;
14301430
1431
- other.parent = parent;
1431
+ // other.parent = parent;
14321432
14331433 //System.out.println("COPY " + this + " to " + other);
14341434 //new Exception().printStackTrace();
....@@ -1464,7 +1464,7 @@
14641464 Object3D obj = (Object3D)Children().get(i);
14651465 if (IsContainedIn(obj))
14661466 {
1467
-// assert(false); // ?!?!?!?!?!
1467
+ assert(false); // ?!?!?!?!?!
14681468 c.Children().setElementAt(c, i);
14691469 }
14701470 else
....@@ -2562,7 +2562,7 @@
25622562 return b;
25632563 }
25642564
2565
- void UpdateMaterial(cMaterial anchor, cMaterial current, boolean propagate)
2565
+ void UpdateMaterial(cMaterial anchor, cMaterial current, boolean propagate, boolean colorparallax)
25662566 {
25672567 if (blockloop)
25682568 {
....@@ -2572,7 +2572,7 @@
25722572 // super.UpdateMaterial(anchor, current, false);
25732573 if (material != null)
25742574 {
2575
- material.UpdateMaterial(anchor, current);
2575
+ material.UpdateMaterial(anchor, current, colorparallax);
25762576 }
25772577
25782578 if (!propagate)
....@@ -2586,7 +2586,7 @@
25862586 if (child == null)
25872587 continue;
25882588 blockloop = true;
2589
- child.UpdateMaterial(anchor, current, propagate);
2589
+ child.UpdateMaterial(anchor, current, propagate, false);
25902590 blockloop = false;
25912591 Children().release(i);
25922592 }
....@@ -2600,7 +2600,7 @@
26002600 if (child == null)
26012601 continue;
26022602 blockloop = true;
2603
- child.UpdateMaterial(anchor, current, propagate);
2603
+ child.UpdateMaterial(anchor, current, propagate, false);
26042604 blockloop = false;
26052605 Children().release(i);
26062606 }
Torus.java
....@@ -2,7 +2,8 @@
22
33 class Torus extends Biparam implements java.io.Serializable
44 {
5
- static final long serialVersionUID = -7637054329820073252L; // Old
5
+ static final long serialVersionUID = 331691015398062098L; // new
6
+ // -7637054329820073252L; // Old
67
78 Torus()
89 {
cMaterial.java
....@@ -78,10 +78,11 @@
7878 //Invariants();
7979 }
8080
81
- void UpdateMaterial(cMaterial anchor, cMaterial current)
81
+ void UpdateMaterial(cMaterial anchor, cMaterial current, boolean colorparallax)
8282 {
8383 //color *= Factor(anchor.color, current.color);
84
- color = current.color;
84
+ if (colorparallax)
85
+ color = current.color;
8586 //if (anchor.saturation == 0)
8687 // anchor.saturation = 0.001f;
8788 if (anchor.modulation == 0)
....@@ -109,7 +110,8 @@
109110 // if (anchor.parallax == 0)
110111 // anchor.parallax = 0.001f;
111112 //parallax *= Factor(anchor.parallax, current.parallax);
112
- parallax = current.parallax;
113
+ if (colorparallax)
114
+ parallax = current.parallax;
113115 fakedepth *= Factor(anchor.fakedepth, current.fakedepth);
114116 shadowbias *= Factor(anchor.shadowbias, current.shadowbias);
115117 }