From 8f471ab58f8676229d29cde03aba3597d096cf84 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 14 Oct 2019 20:07:35 -0400
Subject: [PATCH] Color/parallax

---
 ObjEditor.java |    4 ++--
 Torus.java     |    3 ++-
 cMaterial.java |    8 +++++---
 Object3D.java  |   12 ++++++------
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/ObjEditor.java b/ObjEditor.java
index f752583..23230d5 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -729,7 +729,7 @@
                 si.SendInfo("#children = " + sel.Size(), "regular");
             }
             si.SendInfo((debug ? "    Parent: " : "    ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
-            si.SendInfo((debug ? "    Complete path: " : "    ") + sel.GetPath(), "regular");
+            si.SendInfo((debug ? "    Path: " : "    ") + sel.GetPath(), "regular");
             si.SendInfo((debug ? "    Texture: " : "    ") + sel.GetTextures(), "bold");
             if (sel.GetTextures().pigmentdata != null)
                 si.SendInfo(" EMBEDDED ", "regular");
@@ -5457,7 +5457,7 @@
             if (!cNumberSlider.frozen)
             {
                 //System.out.println("Propagate = " + propagate);
-                copy.UpdateMaterial(anchor, current, propagate);
+                copy.UpdateMaterial(anchor, current, propagate, true);
                 
                 if (copy.material != null)
                 {
diff --git a/Object3D.java b/Object3D.java
index 0843864..31964db 100644
--- a/Object3D.java
+++ b/Object3D.java
@@ -1428,7 +1428,7 @@
         
         blockloop = true;
         
-        other.parent = parent;
+        // other.parent = parent;
         
         //System.out.println("COPY " + this + " to " + other);
         //new Exception().printStackTrace();
@@ -1464,7 +1464,7 @@
             Object3D obj = (Object3D)Children().get(i);
             if (IsContainedIn(obj))
             {
-//            assert(false); // ?!?!?!?!?!
+            assert(false); // ?!?!?!?!?!
                 c.Children().setElementAt(c, i);
             }
             else
@@ -2562,7 +2562,7 @@
         return b;
     }
 
-    void UpdateMaterial(cMaterial anchor, cMaterial current, boolean propagate)
+    void UpdateMaterial(cMaterial anchor, cMaterial current, boolean propagate, boolean colorparallax)
     {
         if (blockloop)
         {
@@ -2572,7 +2572,7 @@
 //        super.UpdateMaterial(anchor, current, false);
         if (material != null)
         {
-            material.UpdateMaterial(anchor, current);
+            material.UpdateMaterial(anchor, current, colorparallax);
         }
 
         if (!propagate)
@@ -2586,7 +2586,7 @@
             if (child == null)
                 continue;
             blockloop = true;
-            child.UpdateMaterial(anchor, current, propagate);
+            child.UpdateMaterial(anchor, current, propagate, false);
             blockloop = false;
             Children().release(i);
         }
@@ -2600,7 +2600,7 @@
             if (child == null)
                 continue;
             blockloop = true;
-            child.UpdateMaterial(anchor, current, propagate);
+            child.UpdateMaterial(anchor, current, propagate, false);
             blockloop = false;
             Children().release(i);
         }
diff --git a/Torus.java b/Torus.java
index 7bf9ec5..7090c13 100644
--- a/Torus.java
+++ b/Torus.java
@@ -2,7 +2,8 @@
 
 class Torus extends Biparam implements java.io.Serializable
 {
-        static final long serialVersionUID = -7637054329820073252L; // Old
+        static final long serialVersionUID = 331691015398062098L; // new
+                                            // -7637054329820073252L; // Old
 
     Torus()
     {
diff --git a/cMaterial.java b/cMaterial.java
index 73ae2fb..aa1c881 100644
--- a/cMaterial.java
+++ b/cMaterial.java
@@ -78,10 +78,11 @@
     //Invariants();
     }
 
-    void UpdateMaterial(cMaterial anchor, cMaterial current)
+    void UpdateMaterial(cMaterial anchor, cMaterial current, boolean colorparallax)
     {
         //color *= Factor(anchor.color, current.color);
-        color = current.color;
+        if (colorparallax)
+            color = current.color;
         //if (anchor.saturation == 0)
         //    anchor.saturation = 0.001f;
         if (anchor.modulation == 0)
@@ -109,7 +110,8 @@
 //        if (anchor.parallax == 0)
 //            anchor.parallax = 0.001f;
         //parallax *= Factor(anchor.parallax, current.parallax);
-        parallax = current.parallax;
+        if (colorparallax)
+            parallax = current.parallax;
         fakedepth *= Factor(anchor.fakedepth, current.fakedepth);
         shadowbias *= Factor(anchor.shadowbias, current.shadowbias);
     }

--
Gitblit v1.6.2