From 33504fc9a180903aace77613264550754fba5706 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Thu, 15 Aug 2019 12:03:58 -0400 Subject: [PATCH] Shadow RGB --- Object3D.java | 123 ++++++++++++++++++++++++++++------------ 1 files changed, 85 insertions(+), 38 deletions(-) diff --git a/Object3D.java b/Object3D.java index f760249..3772174 100644 --- a/Object3D.java +++ b/Object3D.java @@ -22,6 +22,7 @@ //static final long serialVersionUID = -607422624994562685L; static final long serialVersionUID = 5022536242724664900L; + // Use GetUUID for backward compatibility with null. private UUID uuid = UUID.randomUUID(); // TEMPORARY for mocap undo. No need to be transient. @@ -32,7 +33,7 @@ String skyboxname; String skyboxext; - byte[] versions[]; + Object3D versionlist[]; int versionindex = -1; ScriptNode scriptnode; @@ -222,7 +223,7 @@ // o.bRep.support = null; // } o.selection = this.selection; - o.versions = this.versions; + o.versionlist = this.versionlist; o.versionindex = this.versionindex; if (this.support != null) @@ -245,6 +246,29 @@ // this.support = null; // this.fileparent = null; } + +// Object3D GetObject(java.util.UUID uuid) +// { +// if (this.uuid.equals(uuid)) +// return this; +// +// if (blockloop) +// return null; +// +// blockloop = true; +// +// for (int i=0; i<Size(); i++) +// { +// Object3D o = get(i).GetObject(uuid); +// +// if (o != null) +// return o; +// } +// +// blockloop = false; +// +// return null; +// } void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) { @@ -280,7 +304,7 @@ this.selection = o.selection; - this.versions = o.versions; + this.versionlist = o.versionlist; this.versionindex = o.versionindex; // July 2019 if (this.bRep != null) // this.bRep.support = o.transientrep; @@ -2444,6 +2468,11 @@ else { //((ObjEditor)editWindow).SetupUI2(null); + if (objectUI != null) + ((ObjEditor)objectUI).pinButton.setSelected(pinned); + else + //new Exception().printStackTrace(); + System.err.println("objectUI is null"); } } @@ -5545,6 +5574,11 @@ if (fullname == null) return ""; + if (fullname.pigment != null) + { + return fullname.pigment; + } + // System.out.println("Fullname = " + fullname); // Does not work on Windows due to C: @@ -5557,7 +5591,7 @@ if (split.length == 0) { - return ""; + return fullname.pigment = ""; } if (split.length <= 2) @@ -5565,22 +5599,27 @@ if (fullname.name.endsWith(":")) { // Windows - return fullname.name.substring(0, fullname.name.length()-1); + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); } - return split[0]; + return fullname.pigment = split[0]; } // Windows assert(split.length == 4); - return split[0] + ":" + split[1]; + return fullname.pigment = split[0] + ":" + split[1]; } static String GetBump(cTexture fullname) { if (fullname == null) return ""; + + if (fullname.bump != null) + { + return fullname.bump; + } // System.out.println("Fullname = " + fullname); // Does not work on Windows due to C: @@ -5592,12 +5631,12 @@ if (split.length == 0) { - return ""; + return fullname.bump = ""; } if (split.length == 1) { - return ""; + return fullname.bump = ""; } if (split.length == 2) @@ -5605,16 +5644,16 @@ if (fullname.name.endsWith(":")) { // Windows - return ""; + return fullname.bump = ""; } - return split[1]; + return fullname.bump = split[1]; } // Windows assert(split.length == 4); - return split[2] + ":" + split[3]; + return fullname.bump = split[2] + ":" + split[3]; } String GetPigmentTexture() @@ -5697,6 +5736,9 @@ texname = ""; GetTextures().name = texname + ":" + GetBump(GetTextures()); + + GetTextures().pigment = null; + Touch(); } @@ -5769,6 +5811,8 @@ texname = ""; GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; + + GetTextures().bump = null; Touch(); } @@ -7393,7 +7437,29 @@ // { // CameraPane.Ymax = spoth; // } - spot.translate(32, 32); +// if (CameraPane.Xmin > spot.x) +// { +// CameraPane.Xmin = spot.x; +// } +// if (CameraPane.Xmax < spotw) +// { +// CameraPane.Xmax = spotw; +// } +// if (CameraPane.Ymin > spot.y) +// { +// CameraPane.Ymin = spot.y; +// } +// if (CameraPane.Ymax < spoth) +// { +// CameraPane.Ymax = spoth; +// } + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 + spot.translate(32, 0); + clickInfo.g.setColor(Color.yellow); + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); + + spot.translate(32, 64); spotw = spot.x + spot.width; spoth = spot.y + spot.height; clickInfo.g.setColor(Color.cyan); @@ -7414,28 +7480,7 @@ // { // CameraPane.Ymax = spoth; // } - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 - spot.translate(0, -32); - clickInfo.g.setColor(Color.yellow); - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); clickInfo.g.setColor(Color.green); -// if (CameraPane.Xmin > spot.x) -// { -// CameraPane.Xmin = spot.x; -// } -// if (CameraPane.Xmax < spotw) -// { -// CameraPane.Xmax = spotw; -// } -// if (CameraPane.Ymin > spot.y) -// { -// CameraPane.Ymin = spot.y; -// } -// if (CameraPane.Ymax < spoth) -// { -// CameraPane.Ymax = spoth; -// } clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); @@ -7494,12 +7539,14 @@ retval = true; } spot.translate(0, 32); + spot.translate(32, 0); + spot.translate(0, 32); if (spot.contains(clickInfo.x, clickInfo.y)) { hitSomething = hitScale; double scale = 0.005f * clickInfo.camera.Distance(); - double hScale = (double) (clickInfo.x - centerPt.x) / 32; + double hScale = (double) (clickInfo.x - centerPt.x) / 64; double sign = 1; if (hScale < 0) { @@ -7511,7 +7558,7 @@ //hScale = 0.01; } - double vScale = (double) (clickInfo.y - centerPt.y) / 32; + double vScale = (double) (clickInfo.y - centerPt.y) / 64; sign = 1; if (vScale < 0) { @@ -7726,7 +7773,7 @@ break; case hitScale: // scale - double hScale = (double) (clickInfo.x - centerPt.x) / 32; + double hScale = (double) (clickInfo.x - centerPt.x) / 64; double sign = 1; if (hScale < 0) { @@ -7738,7 +7785,7 @@ //hScale = 0.01; } - double vScale = (double) (clickInfo.y - centerPt.y) / 32; + double vScale = (double) (clickInfo.y - centerPt.y) / 64; sign = 1; if (vScale < 0) { -- Gitblit v1.6.2