TransformPoint takes a point in local space and converts it to world space based on the used transform's position, rotation, and scale. I'd only expect it to return the same point as was passed in if the transform was the identity, meaning the position is at (0,0,0) and there is no rotation or scale.
Given that, if MainObject.transform is not the identity and MainObject.sharedMesh.vertices is returning vertices in local space I'd expect your code to mostly work. Note that to "bake" a transform you'd need to also reset it to the identity after transforming the vertices or you'd essentially be transforming them twice.
↧