FixBlenderImportRotation

Author: Benjamin Schaaf

Description
This script modifies the mesh and object data before and imported blender file is saved to disk. This get's rid of all the problems caused by blenders forward axis to be X rather than Unity's Z. Instead of all the objects in the object to be rotated by x-90 degrees, the mesh data is properly rotated, meaning transform.forward is the real forward axis, and lookAt actually works!

Usage
The script needs to be placed in a folder called Editor. It will run automatically when a blender asset is imported, so if blender files already exist, they should be reimported for the fix to take place.

Note that this will not change any prefab rotations, so you might have to go through your prefabs and subtract x-90 degrees from their rotation.

Code
Some optimisations could probably be done, but this won't run during runtime anyway (or even be built for that matter), so who really cares?