glTF Properly ignore morph animation until they are supported

This commit is contained in:
Rémy Bouquet 2017-10-07 10:27:03 +02:00
parent 556e3de1c0
commit 132b0abc50

View File

@ -761,16 +761,6 @@ public class GltfLoader implements AssetLoader {
times = readAccessorData(timeIndex, floatArrayPopulator); times = readAccessorData(timeIndex, floatArrayPopulator);
addToCache("accessors", timeIndex, times, accessors.size()); addToCache("accessors", timeIndex, times, accessors.size());
} }
// if (animData.times == null) {
// animData.times = times;
// } else {
// //check if we are loading the same time array
// if (animData.times != times) {
// //TODO there might be work to do here... if the inputs are different we might want to merge the different times array...
// //easier said than done.
// logger.log(Level.WARNING, "Channel has different input accessors for samplers");
// }
// }
if (targetPath.equals("translation")) { if (targetPath.equals("translation")) {
animData.timeArrays.add(new AnimData.TimeData(times, AnimData.Type.Translation)); animData.timeArrays.add(new AnimData.TimeData(times, AnimData.Type.Translation));
@ -784,6 +774,12 @@ public class GltfLoader implements AssetLoader {
animData.timeArrays.add(new AnimData.TimeData(times, AnimData.Type.Rotation)); animData.timeArrays.add(new AnimData.TimeData(times, AnimData.Type.Rotation));
Quaternion[] rotations = readAccessorData(dataIndex, quaternionArrayPopulator); Quaternion[] rotations = readAccessorData(dataIndex, quaternionArrayPopulator);
animData.rotations = rotations; animData.rotations = rotations;
} else {
//TODO support weights
logger.log(Level.WARNING, "Morph animation is not supported");
animatedNodes[targetNode] = null;
continue;
} }
animatedNodes[targetNode] = customContentManager.readExtensionAndExtras("channel", channel, animData); animatedNodes[targetNode] = customContentManager.readExtensionAndExtras("channel", channel, animData);
} }