|
|
@ -142,6 +142,7 @@ public class MaterialPreviewRenderer implements SceneListener { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int lastErrorHash = 0; |
|
|
|
private int lastErrorHash = 0; |
|
|
|
|
|
|
|
|
|
|
|
private void smartLog(String expText, String message) { |
|
|
|
private void smartLog(String expText, String message) { |
|
|
|
int hash = message.hashCode(); |
|
|
|
int hash = message.hashCode(); |
|
|
|
if (hash != lastErrorHash) { |
|
|
|
if (hash != lastErrorHash) { |
|
|
@ -160,7 +161,9 @@ public class MaterialPreviewRenderer implements SceneListener { |
|
|
|
for (MatParam matParam : mat.getParams()) { |
|
|
|
for (MatParam matParam : mat.getParams()) { |
|
|
|
dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue()); |
|
|
|
dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (mat.getActiveTechnique() != null) { |
|
|
|
dummy.selectTechnique(mat.getActiveTechnique().getDef().getName(), SceneApplication.getApplication().getRenderManager()); |
|
|
|
dummy.selectTechnique(mat.getActiveTechnique().getDef().getName(), SceneApplication.getApplication().getRenderManager()); |
|
|
|
|
|
|
|
} |
|
|
|
dummy.getAdditionalRenderState().set(mat.getAdditionalRenderState()); |
|
|
|
dummy.getAdditionalRenderState().set(mat.getAdditionalRenderState()); |
|
|
|
|
|
|
|
|
|
|
|
//creating a dummy geom and assigning the dummy material to it
|
|
|
|
//creating a dummy geom and assigning the dummy material to it
|
|
|
@ -183,6 +186,8 @@ public class MaterialPreviewRenderer implements SceneListener { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} catch (NullPointerException npe) { |
|
|
|
} catch (NullPointerException npe) { |
|
|
|
//utterly bad, but for some reason I get random NPE here and can't figure out why so to avoid bigger issues, I just catch it.
|
|
|
|
//utterly bad, but for some reason I get random NPE here and can't figure out why so to avoid bigger issues, I just catch it.
|
|
|
|
|
|
|
|
//the printStackTrace is intended, it will show up in debug mode, but won't be displayed in standzrd mode
|
|
|
|
|
|
|
|
npe.printStackTrace(); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -191,7 +196,6 @@ public class MaterialPreviewRenderer implements SceneListener { |
|
|
|
return dummy; |
|
|
|
return dummy; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void switchDisplay(DisplayType type) { |
|
|
|
public void switchDisplay(DisplayType type) { |
|
|
|
switch (type) { |
|
|
|
switch (type) { |
|
|
|
case Box: |
|
|
|
case Box: |
|
|
|