mat = PlaceholderAssets.getPlaceholderMaterial(assetManager);
public static Spatial getPlaceholderModel(AssetManager assetManager){ // What should be the size? Nobody knows // the user's expected scale... Box box = new Box(1, 1, 1); Geometry geom = new Geometry("placeholder", box); geom.setMaterial(getPlaceholderMaterial(assetManager)); return geom; }
private void applyMaterial(Geometry geom, String matName) { Material mat = null; if (matName.endsWith(".j3m")) { // load as native jme3 material instance try { mat = assetManager.loadMaterial(matName); } catch (AssetNotFoundException ex) { // Warning will be raised (see below) if (!ex.getMessage().equals(matName)) { throw ex; } } } else { if (materialList != null) { mat = materialList.get(matName); } } if (mat == null) { logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{matName, key}); mat = PlaceholderAssets.getPlaceholderMaterial(assetManager); //mat.setKey(new MaterialKey(matName)); } if (mat.isTransparent()) { geom.setQueueBucket(Bucket.Transparent); } geom.setMaterial(mat); }
private void applyMaterial(Geometry geom, String matName) { Material mat = null; if (matName == null) { // no material specified. use placeholder. mat = null; } else if (matName.endsWith(".j3m")) { // load as native jme3 material instance try { mat = assetManager.loadMaterial(matName); } catch (AssetNotFoundException ex) { // Warning will be raised (see below) if (!ex.getMessage().equals(matName)) { throw ex; } } } else { if (materialList != null) { mat = materialList.get(matName); } } if (mat == null) { logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{matName, key}); mat = PlaceholderAssets.getPlaceholderMaterial(assetManager); //mat.setKey(new MaterialKey(matName)); } if (mat.isTransparent()) { geom.setQueueBucket(Bucket.Transparent); } geom.setMaterial(mat); }
mat = PlaceholderAssets.getPlaceholderMaterial(assetManager);