}
public Node loadDeployedModel(DeployedModel deployedModel, Entity rootEntity) {
InputStream in = null;
try {
LoaderData data=null;
if (deployedModel.getLoaderDataURL()==null) {
logger.warning("No Loader data for model "+deployedModel.getModelURL());
} else if (deployedModel.getLoaderData() == null) {
URL url = AssetUtils.getAssetURL(deployedModel.getLoaderDataURL());
in = url.openStream();
if (in==null) {
logger.severe("Unable to get loader data "+url.toExternalForm());
} else {
try {
data = LoaderData.decode(in);
deployedModel.setLoaderData(data);
} catch (JAXBException ex) {
Logger.getLogger(JmeColladaLoader.class.getName()).log(Level.SEVERE, "Error parsing loader data "+url.toExternalForm(), ex);
}
in.close();
}
}
logger.info("LOADING DEPLOYED MODEL "+deployedModel.getModelURL());
if (deployedModel.getModelURL().endsWith(".gz"))
in = new GZIPInputStream(AssetUtils.getAssetURL(deployedModel.getModelURL()).openStream());
else
in = AssetUtils.getAssetURL(deployedModel.getModelURL()).openStream();
String baseURL = deployedModel.getModelURL();
baseURL = baseURL.substring(0, baseURL.lastIndexOf('/'));
Node modelBG;
Map<String, String> deployedTextures = null;
if (data!=null)
deployedTextures = data.getDeployedTextures();
ResourceLocator resourceLocator = getDeployedResourceLocator(deployedTextures, baseURL);
if (resourceLocator!=null) {
ResourceLocatorTool.addThreadResourceLocator(