Fix some FBX loader problems

Fix exception when loading geometry without gui, fix loading nodes
without models (nested nodes)
experimental
Rena4ka 10 years ago
parent 1f795a7485
commit 1b43cb6d4a
  1. 6
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java

@ -780,8 +780,8 @@ public class SceneLoader implements AssetLoader {
int index = unIndexMap[i]; int index = unIndexMap[i];
if(index > srcCount) if(index > srcCount)
throw new AssetLoadException("Invalid texcoord mapping. Unexpected lookup texcoord " + index + " from " + srcCount); throw new AssetLoadException("Invalid texcoord mapping. Unexpected lookup texcoord " + index + " from " + srcCount);
float u = (float) data.uv[2 * index + 0]; float u = index >= 0 ? (float) data.uv[2 * index + 0] : 0;
float v = (float) data.uv[2 * index + 1]; float v = index >= 0 ? (float) data.uv[2 * index + 1] : 0;
tcBuf.put(u).put(v); tcBuf.put(u).put(v);
} }
} }
@ -959,11 +959,9 @@ public class SceneLoader implements AssetLoader {
// Build mesh nodes // Build mesh nodes
for(long nodeId : modelDataMap.keySet()) { for(long nodeId : modelDataMap.keySet()) {
ModelData data = modelDataMap.get(nodeId); ModelData data = modelDataMap.get(nodeId);
if(data.type.equals("Mesh")) {
Node node = createNode(data); Node node = createNode(data);
modelMap.put(nodeId, node); modelMap.put(nodeId, node);
} }
}
// Link model nodes into scene // Link model nodes into scene
for(long modelId : modelMap.keySet()) { for(long modelId : modelMap.keySet()) {
List<Long> refs = refMap.get(modelId); List<Long> refs = refMap.get(modelId);

Loading…
Cancel
Save