public AssetLinkNode(ModelKey key) { this(key.getName(), key); }
objName = key.getName();
blenderKey = (BlenderKey) modelKey; } else { blenderKey = new BlenderKey(modelKey.getName());
public AssetLinkNode(ModelKey key) { this(key.getName(), key); }
public AssetLinkNode(ModelKey key) { this(key.getName(), key); }
protected void loadMtlLib(String name) throws IOException{ if (!name.toLowerCase().endsWith(".mtl")) throw new IOException("Expected .mtl file! Got: " + name); // NOTE: Cut off any relative/absolute paths name = new File(name).getName(); try { matList = (MaterialList) assetManager.loadAsset(key.getFolder() + name); } catch (AssetNotFoundException ex){ throw new AssetNotFoundException("Cannot find material " + name + " for model " + key.getName()); } if (matList != null){ // create face lists for every material for (String matName : matList.keySet()){ matFaces.put(matName, new ArrayList<Face>()); } }else{ logger.log(Level.WARNING, "Can't find MTL file. " + "Using default material for OBJ."); } }
@Override public void read(JmeImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); BinaryImporter importer = BinaryImporter.getInstance(); AssetManager loaderManager = e.getAssetManager(); assetLoaderKeys = (ArrayList<ModelKey>) capsule.readSavableArrayList("assetLoaderKeyList", new ArrayList<ModelKey>()); for (Iterator<ModelKey> it = assetLoaderKeys.iterator(); it.hasNext();) { ModelKey modelKey = it.next(); AssetInfo info = loaderManager.locateAsset(modelKey); Spatial child = null; if (info != null) { child = (Spatial) importer.load(info); } if (child != null) { child.parent = this; children.add(child); assetChildren.put(modelKey, child); } else { Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Could not load linked child spatial: {0}", modelKey.getName()); } } }
objName = key.getName();
objName = key.getName();