From ff877160e8fbc3ece8e301b5ad986be14996fb1a Mon Sep 17 00:00:00 2001 From: Nehon Date: Fri, 13 Feb 2015 18:14:21 +0100 Subject: [PATCH] One can now select the technique in the shader node editor through a combo box in the tool bar --- .../EditableMatDefFile.java | 17 +-- .../editor/Bundle.properties | 1 + .../materialdefinition/editor/Diagram.java | 1 + .../editor/MatDefEditorToolBar.form | 66 +++++++++++ .../editor/MatDefEditorToolBar.java | 105 ++++++++++++++++++ .../editor/MatDefEditorlElement.java | 37 +++--- .../editor/OutBusPanel.java | 2 + .../navigator/node/ShaderNodeNode.java | 26 +---- .../navigator/node/TechniqueNode.java | 4 +- .../shadervisual/MatDefShaderElement.java | 8 +- .../materials/MaterialPreviewRenderer.java | 2 +- 11 files changed, 219 insertions(+), 50 deletions(-) create mode 100644 sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.form create mode 100644 sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/EditableMatDefFile.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/EditableMatDefFile.java index 5cd40f6fe..6ce9dd2d9 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/EditableMatDefFile.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/EditableMatDefFile.java @@ -61,12 +61,9 @@ public class EditableMatDefFile { private TechniqueBlock currentTechnique; private MaterialDef materialDef; private ProjectAssetManager assetManager; -// MatParamTopComponent matParamComponent; private ShaderGenerator glsl100; - private ShaderGenerator glsl150; - private final String selectedTechnique = "Default"; - private final static String GLSL100 = "GLSL100"; - private final static String GLSL150 = "GLSL150"; + private ShaderGenerator glsl150; + private final static String GLSL100 = "GLSL100"; private Lookup lookup; private boolean loaded = false; private boolean dirty = false; @@ -137,7 +134,9 @@ public class EditableMatDefFile { } } if (materialDef != null && !matParseError) { - currentTechnique = matDefStructure.getTechniques().get(0); + if(currentTechnique == null){ + currentTechnique = matDefStructure.getTechniques().get(0); + } registerListener(matDefStructure); obj.getLookupContents().add(matDefStructure); @@ -170,7 +169,7 @@ public class EditableMatDefFile { public String getShaderCode(String version, Shader.ShaderType type) { try { - material.selectTechnique("Default", SceneApplication.getApplication().getRenderManager()); + material.selectTechnique(currentTechnique.getName(), SceneApplication.getApplication().getRenderManager()); Shader s; if (version.equals(GLSL100)) { glsl100.initialize(material.getActiveTechnique()); @@ -194,6 +193,10 @@ public class EditableMatDefFile { public TechniqueBlock getCurrentTechnique() { return currentTechnique; } + + public void setCurrentTechnique(TechniqueBlock tech){ + this.currentTechnique = tech; + } public MatDefBlock getMatDefStructure() { return matDefStructure; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties index c3c41f44a..1e401f9a9 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties @@ -12,3 +12,4 @@ BackdropPanel.bringToFrontButton.toolTipText=Toggle back/front NodeToolBar.codeButton.toolTipText=Display code NodeToolBar.deleteButton.toolTipText=Delete node NodeToolBar.deleteButton.text= +MatDefEditorToolBar.jLabel1.text=Technique diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java index a6ff5a6d7..423a0c1be 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java @@ -5,6 +5,7 @@ package com.jme3.gde.materialdefinition.editor; import com.jme3.gde.core.assets.ProjectAssetManager; +import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.materialdefinition.dialog.AddAttributeDialog; import com.jme3.gde.materialdefinition.dialog.AddMaterialParameterDialog; import com.jme3.gde.materialdefinition.dialog.AddNodeDialog; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.form b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.form new file mode 100644 index 000000000..38d7c8c1e --- /dev/null +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.form @@ -0,0 +1,66 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java new file mode 100644 index 000000000..dbbdefb82 --- /dev/null +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java @@ -0,0 +1,105 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.jme3.gde.materialdefinition.editor; + +import com.jme3.gde.materialdefinition.fileStructure.TechniqueBlock; +import java.awt.Component; +import java.util.List; +import javax.swing.DefaultComboBoxModel; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.ListCellRenderer; + +/** + * + * @author Nehon + */ +public class MatDefEditorToolBar extends javax.swing.JPanel { + + private MatDefEditorlElement parent; + private final DefaultComboBoxModel comboModel = new DefaultComboBoxModel(); + /** + * Creates new form MatDefEditorToolBar + */ + public MatDefEditorToolBar() { + initComponents(); + techniqueComboBox.setModel(comboModel); + final DefaultListCellRenderer renderer = new DefaultListCellRenderer(); + techniqueComboBox.setRenderer(new ListCellRenderer() { + + public Component getListCellRendererComponent(JList list, TechniqueBlock value, int index, boolean isSelected, boolean cellHasFocus) { + JLabel c = (JLabel)renderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + c.setText(value.getName()); + return c; + } + }); + + } + + public void setParent(MatDefEditorlElement parent) { + this.parent = parent; + } + + public void addTechnique(List tech){ + for (TechniqueBlock tech1 : tech) { + comboModel.addElement(tech1); + } + + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + techniqueComboBox = new javax.swing.JComboBox(); + + setPreferredSize(new java.awt.Dimension(474, 25)); + + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(MatDefEditorToolBar.class, "MatDefEditorToolBar.jLabel1.text")); // NOI18N + + techniqueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + techniqueComboBox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + techniqueComboBoxActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(techniqueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 337, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE) + .addComponent(techniqueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + }// //GEN-END:initComponents + + private void techniqueComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_techniqueComboBoxActionPerformed + parent.switchTechnique((TechniqueBlock)techniqueComboBox.getSelectedItem()); + }//GEN-LAST:event_techniqueComboBoxActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + private javax.swing.JComboBox techniqueComboBox; + // End of variables declaration//GEN-END:variables +} diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java index e29bf9723..0184a29d8 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java @@ -32,6 +32,7 @@ package com.jme3.gde.materialdefinition.editor; import com.jme3.gde.core.assets.ProjectAssetManager; +import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.materialdefinition.EditableMatDefFile; import com.jme3.gde.materialdefinition.MatDefDataObject; import com.jme3.gde.materialdefinition.MatDefMetaData; @@ -44,6 +45,7 @@ import com.jme3.gde.materialdefinition.fileStructure.leaves.MatParamBlock; import com.jme3.gde.materialdefinition.fileStructure.leaves.OutputMappingBlock; import com.jme3.gde.materialdefinition.fileStructure.leaves.WorldParamBlock; import com.jme3.gde.materialdefinition.navigator.MatDefNavigatorPanel; +import com.jme3.gde.materialdefinition.shadervisual.MatDefShaderElement; import com.jme3.gde.materialdefinition.utils.MaterialUtils; import com.jme3.material.Material; import com.jme3.shader.Shader; @@ -69,7 +71,6 @@ import javax.swing.Action; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.JToolBar; import org.netbeans.core.spi.multiview.CloseOperationState; import org.netbeans.core.spi.multiview.MultiViewElement; import org.netbeans.core.spi.multiview.MultiViewElementCallback; @@ -80,7 +81,6 @@ import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.nodes.Children; import org.openide.nodes.Node; -import org.openide.text.EditorSupport; import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.LookupEvent; @@ -101,12 +101,13 @@ import org.openide.windows.TopComponent; public final class MatDefEditorlElement extends JPanel implements MultiViewElement { protected MatDefDataObject obj; - private JToolBar toolbar = new JToolBar(); + private final MatDefEditorToolBar toolbar = new MatDefEditorToolBar(); private transient MultiViewElementCallback callback; InstanceContent content; Selectable prevNode; MatDefMetaData metaData; + @SuppressWarnings("LeakingThisInConstructor") public MatDefEditorlElement(final Lookup lkp) { initComponents(); obj = lkp.lookup(MatDefDataObject.class); @@ -115,7 +116,9 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme final EditableMatDefFile file = obj.getEditableFile(); shaderEditPanel1.setVisible(false); shaderEditPanel1.setParent(this); - reload(file, lkp); + toolbar.setParent(this); + toolbar.addTechnique(lkp.lookup(MatDefBlock.class).getTechniques()); + reload(file, lkp); } private void initDiagram(Lookup lkp) throws NumberFormatException { @@ -127,7 +130,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme ProjectAssetManager manager = obj.getLookup().lookup(ProjectAssetManager.class); final MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); - TechniqueBlock technique = getTechnique(matDef); + TechniqueBlock technique = getTechnique(); diagram1.setCurrentTechniqueName(technique.getName()); @@ -219,6 +222,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme diagram1.revalidate(); jScrollPane1.addComponentListener(diagram1); + mat.selectTechnique(obj.getEditableFile().getCurrentTechnique().getName(), SceneApplication.getApplication().getRenderManager()); diagram1.refreshPreviews(mat); final Lookup.Result resMat = obj.getLookup().lookupResult(Material.class); resMat.addLookupListener(new LookupListener() { @@ -226,6 +230,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme Collection col = (Collection) resMat.allInstances(); if (!col.isEmpty()) { Material material = col.iterator().next(); + material.selectTechnique(obj.getEditableFile().getCurrentTechnique().getName(), SceneApplication.getApplication().getRenderManager()); diagram1.refreshPreviews(material); } } @@ -247,6 +252,11 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme } } + public void switchTechnique(TechniqueBlock tech) { + obj.getEditableFile().setCurrentTechnique(tech); + reload(obj.getEditableFile(), obj.getLookup()); + } + @Override public String getName() { return "MatDefVisualElement"; @@ -278,6 +288,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme Collection col = (Collection) resMat.allInstances(); if (!col.isEmpty()) { Material material = col.iterator().next(); + material.selectTechnique(obj.getEditableFile().getCurrentTechnique().getName(), SceneApplication.getApplication().getRenderManager()); diagram1.refreshPreviews(material); } @@ -510,8 +521,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme } public void notifyAddNode(ShaderNodeBlock node, ShaderNodeDefinition def) { - MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); - TechniqueBlock technique = getTechnique(matDef); + TechniqueBlock technique = getTechnique(); if (def.getType() == Shader.ShaderType.Vertex) { technique.addVertexShaderNode(node); } else if (def.getType() == Shader.ShaderType.Fragment) { @@ -526,15 +536,14 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme } public void notifyAddWorldParam(String name) { - MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); WorldParamBlock param = new WorldParamBlock(name); - getTechnique(matDef).addWorldParam(param); + getTechnique().addWorldParam(param); } public void notifyRemoveNode(NodePanel node) { MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); if (node.getType() == NodePanel.NodeType.Fragment || node.getType() == NodePanel.NodeType.Vertex) { - TechniqueBlock technique = getTechnique(matDef); + TechniqueBlock technique = getTechnique(); for (ShaderNodeBlock shaderNodeBlock : technique.getShaderNodes()) { if (shaderNodeBlock.getName().equals(node.getName())) { technique.removeShaderNode(shaderNodeBlock); @@ -543,9 +552,9 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme } else if (node.getType() == NodePanel.NodeType.MatParam) { matDef.removeMatParam(new MatParamBlock("", node.getKey().replaceAll("MatParam.", ""), "", "")); } else if (node.getType() == NodePanel.NodeType.WorldParam) { - getTechnique(matDef).removeWorldParam(new WorldParamBlock(node.getKey().replaceAll("WorldParam.", ""))); + getTechnique().removeWorldParam(new WorldParamBlock(node.getKey().replaceAll("WorldParam.", ""))); } else if (node.getType() == NodePanel.NodeType.Attribute) { - getTechnique(matDef).cleanupMappings("Attr", node.getKey().replaceAll("Attr.", "")); + getTechnique().cleanupMappings("Attr", node.getKey().replaceAll("Attr.", "")); } } @@ -634,8 +643,8 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme } - private TechniqueBlock getTechnique(MatDefBlock matDef) { - TechniqueBlock technique = matDef.getTechniques().get(0); + private TechniqueBlock getTechnique() { + TechniqueBlock technique = obj.getEditableFile().getCurrentTechnique(); return technique; } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java index 1cadfb0e0..ee3c18009 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java @@ -4,6 +4,7 @@ */ package com.jme3.gde.materialdefinition.editor; +import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.materialdefinition.fileStructure.leaves.InputMappingBlock; import com.jme3.gde.materialdefinition.fileStructure.leaves.OutputMappingBlock; import com.jme3.material.Material; @@ -183,6 +184,7 @@ public class OutBusPanel extends DraggablePanel implements ComponentListener, Se preview.showMaterial(mat); } else { Material vmat = mat.clone(); + vmat.selectTechnique(mat.getActiveTechnique().getDef().getName(), SceneApplication.getApplication().getRenderManager()); vmat.getAdditionalRenderState().setWireframe(true); preview.showMaterial(vmat); } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/ShaderNodeNode.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/ShaderNodeNode.java index 421a4022c..46063b261 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/ShaderNodeNode.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/ShaderNodeNode.java @@ -38,26 +38,11 @@ public class ShaderNodeNode extends AbstractMatDefNode implements Selectable, Pr ShaderNodeBlock shaderNode; ShaderNodeDefinition def; String key = ""; + String techName = ""; - public ShaderNodeNode(final Lookup lookup, final ShaderNodeBlock shaderNode) { -// super(Children.create(new ChildFactory() { -// @Override -// protected boolean createKeys(List list) { -// list.addAll(shaderNode.getInputs()); -// List out = shaderNode.getOutputs(); -// if (out != null) { -// list.addAll(shaderNode.getOutputs()); -// } -// -// return true; -// } -// -// @Override -// protected Node createNodeForKey(MappingBlock key) { -// return new MappingNode(lookup, key); -// } -// }, true), lookup); + public ShaderNodeNode(final Lookup lookup, final ShaderNodeBlock shaderNode, final String techName) { super(new MappingNodeChildren(lookup, shaderNode), lookup); + this.techName = techName; this.shaderNode = shaderNode; setName(shaderNode.getName()); key = makeKey(); @@ -138,9 +123,8 @@ public class ShaderNodeNode extends AbstractMatDefNode implements Selectable, Pr } } - private String makeKey() { - String defName = lookup.lookup(MatDefDataObject.class).getEditableFile().getCurrentTechnique().getName(); - return defName + "/" + getName(); + private String makeKey() { + return techName + "/" + getName(); } public String getKey() { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/TechniqueNode.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/TechniqueNode.java index 51ad77467..09b4bf971 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/TechniqueNode.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/TechniqueNode.java @@ -56,7 +56,7 @@ public class TechniqueNode extends AbstractMatDefNode implements Selectable, Pro } - protected TechniqueBlock getDef() { + public TechniqueBlock getDef() { return def; } @@ -116,7 +116,7 @@ public class TechniqueNode extends AbstractMatDefNode implements Selectable, Pro @Override protected Node[] createNodes(ShaderNodeBlock key) { - return new Node[]{new ShaderNodeNode(lookup, key)}; + return new Node[]{new ShaderNodeNode(lookup, key, def.getName())}; } } } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/MatDefShaderElement.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/MatDefShaderElement.java index a8515f866..c89ace348 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/MatDefShaderElement.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/MatDefShaderElement.java @@ -31,12 +31,9 @@ */ package com.jme3.gde.materialdefinition.shadervisual; -import com.jme3.gde.core.assets.ProjectAssetManager; -import com.jme3.gde.materialdefinition.EditableMatDefFile; import com.jme3.gde.materialdefinition.MatDefDataObject; import javax.swing.Action; import javax.swing.JComponent; -import javax.swing.JEditorPane; import javax.swing.JPanel; import javax.swing.text.EditorKit; import org.netbeans.core.spi.multiview.CloseOperationState; @@ -58,10 +55,11 @@ position = 3000) @Messages("LBL_MatDef_SHADER=Shader") public final class MatDefShaderElement extends JPanel implements MultiViewElement { - private MatDefDataObject obj; - private ShaderVisualToolBar toolbar = new ShaderVisualToolBar(); + private final MatDefDataObject obj; + private final ShaderVisualToolBar toolbar = new ShaderVisualToolBar(); private transient MultiViewElementCallback callback; + @SuppressWarnings("LeakingThisInConstructor") public MatDefShaderElement(Lookup lkp) { obj = lkp.lookup(MatDefDataObject.class); assert obj != null; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java index df11b15f4..7681e28ae 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java @@ -147,7 +147,7 @@ public class MaterialPreviewRenderer implements SceneListener { for (MatParam matParam : mat.getParams()) { dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue()); } - + dummy.selectTechnique(mat.getActiveTechnique().getDef().getName(), SceneApplication.getApplication().getRenderManager()); dummy.getAdditionalRenderState().set(mat.getAdditionalRenderState()); //creating a dummy geom and assigning the dummy material to it