I am modifying things in the character bones and then assigning them back to the skinnedMeshRenderer, everything works fine until we have vertex axis related needs.
SkinnedMeshRenderer[] renderers = characterInstance.GetComponentsInChildren<SkinnedMeshRenderer>();
for (int ri = 0; ri < renderers.Length; ri++)
{
Transform[] partBones = renderers[ri].bones;
//...doing some stuff here...//
renderers[ri].bones = partBones;
}
After this, it seems the axis of vertice on the skinned mesh have been changed, which can be seen in shading, e.g., when telling vertex to move along the model’s local y axis in the shader, now it becomes a movement along x(or z, don’t remember precisely).
How could this strange thing happen? Because I didn’t do anything with rotation in this process?
What are things that could possibly influence the vertice’s local axes? As I knew before, it should be only the mesh’s local coordinate, right?
But in this case, I didn’t change the mesh model space coordinate(as far as I can tell).