I’m trying to find the bbox of a skinned mesh, but it’s giving weird results.
Bbox is not correctly calculated:
So I went thru the mesh, debugged it with it’s children… and all the inner bboxes looked like this:
There is no bbox calculation that counts for the head. I traversed thru all the children, looked for the mesh that corresponds to the head and computed it’s bounding box.
And voila, it looked like this:
This small blue cube is the
bbox calculation resulted from the head of the avatar.
What is it doing down there? Why does it get that calculation?
I went deeper into the problem, and I found that the head is children of the Armature, and… the Armature has a scale of
(0.25, 0.25, 0.25)
But, why doesn’t the computation takes that into consideration?
I can scale other types of objects, and the scale wouldn’t make the calculations go nuts.
Seems to only happen when it’s a parent of bones, and this same parent has Skinned meshes as children?
Has anyone encountered with this before?
I tried also to search for
Armatures, scale them to
(1,1,1), compute the
bbox (which is the way I’ve seen it working), and return Armatures to their original scale… but now I see I’m getting the t-pose of the avatar, you can clearly see the arms opened:
Any ideas to achieve a good
bbox for skinned meshes?