Closed angavrilov closed 5 years ago
Thanks! I'll take a look.
I've been working on import_valkyria recently to add VC4 support. I intended to revisit the bone calculations and normal vectors as well, but I hadn't gotten to them yet, so this is great timing!
Basically it seems the most straightforward way of interpreting xform data works: convert it all to 4x4 matrices, multiply parent chains, and use the resulting matrix to place objects. It seems you were already doing it for location and rotation, but many environment objects depend on scale and it broke down. Also, the 0 bone was for some reason excluded for parenting, which broke trees and the mill tower.
That makes sense! Not sure why I ignored scale.
Thanks again for the pull request!
From the code it seems you may have been trying to "naturally" place the objects via transforms of bones themselves, and rest pose has no scale. I changed it to just compute the correct matrix in python and force objects to have that transformation no matter how the bone itself is placed.