SDK:
- fix Ogre binary importer asset list managing git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10236 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
527a7b5321
commit
f158717981
@ -61,7 +61,7 @@ public class OgreBinaryMeshDataObject extends SpatialAssetDataObject {
|
|||||||
listListener.start();
|
listListener.start();
|
||||||
Spatial spatial = mgr.loadModel(assetKey);
|
Spatial spatial = mgr.loadModel(assetKey);
|
||||||
//replace transient xml files in list of assets for this model
|
//replace transient xml files in list of assets for this model
|
||||||
replaceXmlFiles();
|
replaceXmlFiles(mgr);
|
||||||
listListener.stop();
|
listListener.stop();
|
||||||
savable = spatial;
|
savable = spatial;
|
||||||
lock.releaseLock();
|
lock.releaseLock();
|
||||||
@ -81,21 +81,18 @@ public class OgreBinaryMeshDataObject extends SpatialAssetDataObject {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void replaceXmlFiles() {
|
private void replaceXmlFiles(ProjectAssetManager mgr) {
|
||||||
List<FileObject> newFiles = new ArrayList<FileObject>();
|
for (int i = 0; i < assetList.size(); i++) {
|
||||||
for (Iterator<FileObject> it = assetList.iterator(); it.hasNext();) {
|
FileObject fileObject = assetList.get(i);
|
||||||
FileObject fileObject = it.next();
|
|
||||||
if (fileObject.hasExt("xml")) {
|
if (fileObject.hasExt("xml")) {
|
||||||
FileObject binaryFile = fileObject.getParent().getFileObject(fileObject.getName());
|
FileObject binaryFile = fileObject.getParent().getFileObject(fileObject.getName());
|
||||||
if (binaryFile != null) {
|
if (binaryFile != null) {
|
||||||
newFiles.add(binaryFile);
|
assetList.remove(i);
|
||||||
it.remove();
|
assetList.add(i, binaryFile);
|
||||||
|
assetKeyList.remove(i);
|
||||||
|
assetKeyList.add(i, new AssetKey(mgr.getRelativeAssetPath(binaryFile.getPath())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Iterator<FileObject> it = newFiles.iterator(); it.hasNext();) {
|
|
||||||
FileObject fileObject = it.next();
|
|
||||||
assetList.add(fileObject);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user