Cannot deform mesh with automatic weights during rigify process. Tried all solutions So this is my first time messing with blender, and models in general. I ripped a model as a temporary placeholder for my first game project in UE4. The likely cause of my problem is that it has a non-standard pose.

Im trying to add bones using rigify, and that has gone well enough but when I try to parent the metarig to the mesh with auomatic weights it gives me an error: "Bone heat weighting, cannot find solution for one or more bones."

I've tried goolging for solutions but neither of them work:
set subsurf to on.

set X axis mirroring to on (tried on all possible entries of the scene list).

set a decimate modifier.

resetting rotation values.

remove doubles.

So I'd like someone to open up the file and see what the problem is because I think i've reached the point where I'm in over my head.

EDIT I figured there was an upload file option but I can't seem to find it. I've uploaded my file to dropbox instead:
https://dl.dropboxusercontent.com/u/28736905/Pizzabella%20v1.42%20-%20metarig%20rotation%20reset%20in%20pose%20mode%20with%20ALT%2BG%20and%20ALT%2BR.blend
Your model has lots of issues:

select the mesh in object mode
in the modifier stack remove the armature modifier;
R Z 90 (rotate the model by 90 degrees around the Z axes);
Ctrl A Apply rotation and scale;
Select the MetaRig and M move it to a different layer.
In edit mode A select all and remove doubles 0.1 mm (I removed something like 30.000 doubles).
Back to object mode select the mesh, select the rig Ctrl P, choose the "With empty groups" option and go with manual weighting: paint weight or assign weights via the properties panel, vertex section, vertex groups tab.

The automatic weighting is a simple shortcut for simple meshes: they must be manifold, joined, without holes and seams; your mesh is maden of multiple spare parts and is far more complicated than what is manageable by the automatic algorithm.