|
|
@ -104,7 +104,7 @@ public class SceneLoader implements AssetLoader { |
|
|
|
loadScene(stream); |
|
|
|
loadScene(stream); |
|
|
|
linkScene(); |
|
|
|
linkScene(); |
|
|
|
if(warnings.size() > 0) |
|
|
|
if(warnings.size() > 0) |
|
|
|
logger.log(Level.WARNING, "Model load finished with warnings:\n" + String.join("\n", warnings)); |
|
|
|
logger.log(Level.WARNING, "Model load finished with warnings:\n" + join(warnings, "\n")); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
releaseObjects(); |
|
|
|
releaseObjects(); |
|
|
|
if(stream != null) |
|
|
|
if(stream != null) |
|
|
@ -430,10 +430,6 @@ public class SceneLoader implements AssetLoader { |
|
|
|
animControl.setAnimations(anims); |
|
|
|
animControl.setAnimations(anims); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean haveAnyChannel(FbxAnimNode anims) { |
|
|
|
|
|
|
|
return anims != null && anims.haveAnyChannel(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void releaseObjects() { |
|
|
|
private void releaseObjects() { |
|
|
|
// Reset settings
|
|
|
|
// Reset settings
|
|
|
|
unitSize = 1; |
|
|
|
unitSize = 1; |
|
|
@ -461,4 +457,19 @@ public class SceneLoader implements AssetLoader { |
|
|
|
animControl = null; |
|
|
|
animControl = null; |
|
|
|
sceneNode = null; |
|
|
|
sceneNode = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean haveAnyChannel(FbxAnimNode anims) { |
|
|
|
|
|
|
|
return anims != null && anims.haveAnyChannel(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String join(List<String> list, String glue) { |
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
|
|
|
for(int i = 0; i < list.size(); ++i) { |
|
|
|
|
|
|
|
if(sb.length() != 0) |
|
|
|
|
|
|
|
sb.append(glue); |
|
|
|
|
|
|
|
sb.append(list.get(i)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return sb.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|