I'm trying to look over the Collada code so i adopt it for other tags(so much for Collada being standardized) and i'm looking at proccessSource in ColladaImpoter and i'm noticing that the code does the same thing for ROTX.ANGLE and ROTY.ANGLE and all the other ones that use a float array even though it has a separate if statement for each. I'm wondering what the purpose of that is, i mean can i just cheat and do:
if ("float4x4".equals(p.gettype().toString())) {
Matrix4f[] transforms = new Matrix4f[floatArray.length / 16];
for (int i = 0; i < transforms.length; i++) {
transforms[i] = new Matrix4f();
float[] data = new float[16];
for (int x = 0; x < 16; x++) {
data[x] = floatArray[(16 * i) + x];
}
transforms[i].set(data, true); // collada matrices are
// in row order.
}
put(source.getid().toString(), transforms);
} else {
put(source.getid().toString(), floatArray);
}
Or is declaring what to do with the float array needed for each name tag?
Another question, about channels, the importer uses channels to decide which bone to apply an animation should go to(processAnimation) but the channel also contains regular(not exporter depended) as to what the animation is for(translate,scale,rotation,transform). Why does processAnimation use the source name instead?
As you've noticed, a few areas are a bit strange. A lot of decisions were made without fully understanding the format, and I've been going back and cleaning up some areas. But obviously missed a few. If you come across such items as you have listed it most likely was not done for a good reason. Therefore, if you find and fix these problem areas to work nicer with the format, feel free to post and I'll get the update in place.
I'm trying to tweak stuff so that ColladaImporter will load blender-collada and xsi-collada. Its relatively easy, you did all the hard work, i just have to make it support the tiny differences in syntax. My problem is that there are lots of override data warnings, specifically from bones and some for controllers. Can you explain why those occur?
My problem is that there are lots of override data warnings, specifically from bones and some for controllers. Can you explain why those occur?
The initial purpose of that warning was to report when data is put into the resource library with a key that already exists in the library. However, this warning is appearing in our own data multiple times as well (with no dire consequences). So, I need to look into why the warning is showing up so much.
Quick question, if my bones don't have any position(are always 0,0,0) then the pose/bind matrix wasn't exported or wasn't imported correctly right?
Possibly, but it could be animations as well. If your bones are at (0,0,0) and the mesh looks normal (without animations applied, i.e. the bind pose of the mesh), then it's a problem with the bind matrix of the bones, if your mesh looks like a glob of flesh, then most likely the bind was correct but animations or something else caused the bones to go to 0,0,0 and take the mesh with them. There are a number of causes, so it's hard to pinpoint exactly.
Is it correct to think of the pose/bind matrix as the initial position of the bones?
Correct. This pose should match the pose of the initial mesh.