public ResourceSource locateResource(String resourceName) { // Trim off any prepended local dir. while (resourceName.startsWith("./") && resourceName.length() > 2) { resourceName = resourceName.substring(2); } while (resourceName.startsWith(".\\") && resourceName.length() > 2) { resourceName = resourceName.substring(2); } return _baseSource.getRelativeSource(resourceName); }
public ResourceSource locateResource(String resourceName) { // Trim off any prepended local dir. while (resourceName.startsWith("./") && resourceName.length() > 2) { resourceName = resourceName.substring(2); } while (resourceName.startsWith(".\\") && resourceName.length() > 2) { resourceName = resourceName.substring(2); } return _baseSource.getRelativeSource(resourceName); }
/** * Load a .mtl resource * * @param fileName * the name of the mtl resource to load. * @param modelSource * a source to pull the mtl relatively. Used only if a material locator was not set on this importer. * @param store * our material store to place the contents of the file in. */ private void loadMaterialLibrary(final String fileName, final ResourceSource modelSource, final Map<String, ObjMaterial> store) { final ResourceSource source; if (_materialLocator == null) { source = modelSource.getRelativeSource(fileName); } else { source = _materialLocator.locateResource(fileName); } if (source == null) { throw new Error("Unable to locate mtllib '" + fileName + "'"); } loadMaterialLibrary(source, store); }
final ResourceSource texSrc = source.getRelativeSource(page.file);
final Page page = _pages.get(0); final ResourceSource texSrc = source.getRelativeSource("./" + page.file);