I need to rotate the matrix_world of an object through a quaternion q without changing its actual rotation (i.e. rotation in world space). How to do that through a script?
Edit:
Let's say if I rotate the matrix_world by the angle specified by quaternion, then naturally the object will also get rotated in the world space. But I want to undo this object rotation and keep matrix_world rotation. Doing this with translation is straightforward. I would just move all the vertices be the negative Vector and shift the location of the object by positive Vector. So I get translated matrix_world but the object remains at the same place in world space. How do I achieve this with rotation?