If we are loading a material from a J3O file, do not crash on missing material parameters, but log it instead.

Fixes test crash on any tests using cornellbox.j3o
experimental
shadowislord 10 years ago
parent b7ae8e6e3a
commit bf2656abf3
  1. 5
      jme3-core/src/main/java/com/jme3/material/Material.java

@ -1320,9 +1320,14 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
param.setName(param.getName().substring(2));
}
if (def.getMaterialParam(name) == null) {
logger.log(Level.WARNING, "The material parameter is not defined: " +
name + ". Ignoring..");
} else {
checkSetParam(param.getVarType(), param.getName());
paramValues.put(param.getName(), param);
}
}
if (applyDefaultValues) {
// compatability with old versions where default vars were

Loading…
Cancel
Save