FBX IO: fix handling or rigged meshes transformations.

We have to convert them to global space on export, and back into local space on import...

Issue raised by jrestemeier (Jens Restemeier) in D607, thanks!
FBX IO: Fix camera's correction matrix (based on file from T40729).
FBX import: add basic support for animation.

Only objects and bones loc/rot/scale, and shapekeys' value, for now.

*IMPORTANT* note: we currently assume all FBX anim curves are linearly interpolated.
This means unless you exported your animation in 'baked' mode, you should expect
bad results!

Supporting advanced FBX's interpolations (Bézier-like) is on TODO, but no serious ETA yet.
Merge remote-tracking branch 'hm-blender/master'

* hm-blender/master:
  FBX import: add basic support for animation.
  FBX IO: Fix camera's correction matrix (based on file from T40729).
  FBX IO: fix handling or rigged meshes transformations.
FBX import: Minor optimization.
Merge remote-tracking branch 'hm-blender/master'

* hm-blender/master:
  FBX import: Minor optimization.
Fix T40949: Importing STL file fails and produces a python error - Mac.

Replace usage of mmap by mere open(). It's not significatively slower (perhaps 2% or 3%),
and seems more reliable.

Based on patch by paddy10663 (Patrick Taylor), with own edits and optimizations.
Create a preview directory for procedural textures to avoid creating it by hand on fresh installs.
FBX: reformat props.

This is style/convention all over for addons.
Better not to re-format large blocks of code without checking with authors.
FBX: abbreviate custom_properties -> custom_props
FBX import: do not fail on missing/unreadable image file.
Fix T41245: FBX import error.

You can't swich hidden objects to Edit mode... :/
Fix T41238: FBX exporter corrupts model's pose.

We have to store and restore pbones' matrices as well when baking animations...
Merge remote-tracking branch 'hm-blender/master'

* hm-blender/master:
  FBX: abbreviate custom_properties -> custom_props
  FBX: reformat props.
  Create a preview directory for procedural textures to avoid creating it by hand on fresh installs.
  Fix T40949: Importing STL file fails and produces a python error - Mac.
FBX Import: Fix cornercase where some files only have one weight in case it's the same for all vertices...

Issue found by jrestemeier (Jens Restemeier), thanks!
Revert "FBX import: do not fail on missing/unreadable image file."

This reverts commit 21a8a5824dde50f060716047a12c748b4413b04d.

Fiw was done at a lower level (bpy.path.resolve_ncase()).
Reverse the winding order of faces when exporting to a left-handed system.
Removed trailing whitespace.
Cleanup: pep8 (to some extent :/ )
FBX IO Cleanup: add a global settings namedtuple to importer too, and rename those used by exporter.

With some minor edits by mont29 (Bastien Montagne).