From 6ed65dcb597fb2153cef75bf1845978f1115658c Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Fri, 14 Dec 2018 22:53:55 -0500 Subject: [PATCH] Repair shadow, normal push + attractor mesh. --- ObjEditor.java | 40 +++++++++++++++++++++++++++++----------- 1 files changed, 29 insertions(+), 11 deletions(-) diff --git a/ObjEditor.java b/ObjEditor.java index a0dc1a7..f7c8293 100644 --- a/ObjEditor.java +++ b/ObjEditor.java @@ -160,12 +160,16 @@ objEditor.ctrlPanel.remove(slowerButton); objEditor.ctrlPanel.remove(fasterButton); objEditor.ctrlPanel.remove(remarkButton); + + Remove(normalpushField); } public ObjEditor GetEditor() { return objEditor; //.GetEditor(); } + + // Sometimes myself, sometimes my callee's. ObjEditor objEditor; /* @@ -814,7 +818,7 @@ aConstraints.fill = GridBagConstraints.VERTICAL; jlabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.gridwidth = 2; + aConstraints.gridwidth = 1; ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); aConstraints.gridx += 1; aConstraints.fill = GridBagConstraints.HORIZONTAL; @@ -983,6 +987,9 @@ Return(); + normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); + Return(); + // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); // ObjEditor.aConstraints.gridx += 1; @@ -1446,7 +1453,7 @@ aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; //aConstraints.weightx = 0; - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1456,7 +1463,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1466,7 +1473,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1476,7 +1483,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1486,7 +1493,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1555,7 +1562,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1624,7 +1631,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -1695,7 +1702,7 @@ aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); aConstraints.gridx = 0; aConstraints.gridy += 1; aConstraints.gridwidth = 1; @@ -3549,7 +3556,13 @@ //System.out.println("PARENT = " + parent); //if (parent != null) // parent.applySelf(); - refreshContents(); + if (e.getSource() == normalpushField) + { + objEditor.refreshContents(); + //Refresh(); + } + else + refreshContents(); // ??? client.refreshEditWindow(); } //else @@ -3561,7 +3574,7 @@ //group.name = nameField.getText(); //objEditor.applySelf(); - assert (objEditor == this); + // OCT2018: assert (objEditor == this); if (copy.selection == null || copy.selection.size() == 0) //super.applySelf() ; else @@ -3585,6 +3598,9 @@ objEditor.copy = keep; } } + + if (normalpushField != null) + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; } void SnapObject() @@ -4629,4 +4645,6 @@ NumberSlider opacityPowerField; JTree jTree; //ObjectUI parent; + + NumberSlider normalpushField; } -- Gitblit v1.6.2