Garry's Mod - bodygroups and collision models are rotated

I’ve been trying to compile the AK-107 rifle model from Arma 2, for Garry’s Mod, with bodygroup support. so far, I am partly successful in doing that.
the problem I am experiencing now, is that bodygroup models and the collision model are rotated, by 90 degrees, in arbitrary directions, in the compiled model.

screenshot of the collision model visualized inside the game:

http://i.imgur.com/feLYrgK.png[/t]
while visualized in the 3D editor I use:
[t]http://i.imgur.com/rs4VUWI.png[/t]

screenshots of the bodygroups inside the game:
[t]http://i.imgur.com/kXlWdMW.png[/t][t]http://i.imgur.com/beXRnK5.png[/t]
in the editor:
[t]http://i.imgur.com/YMIchXR.png

contents of the QC file I use for compiling:


$scale 1
$modelname "a2_weapons/ak107/ak107.mdl"
$body ak107 "ak107.smd"
$surfaceprop "weapon"
$cdmaterials "models/a2_weapons/ak"
$sequence idle "ak107" activity ACT_IDLE -1.0 loop fps 30
$bodygroup "optics"
{
	blank
	studio "kobra.smd"
	studio "pso.smd"
}
$collisionmodel "ak107_collision.smd"
{
	$mass 2.5
}

I will appreciate any tips that will help me fix these issues.

have you tried parenting your collision models and bodygroups to the base ak mesh?

are your smds rigged to a bone?

it turns out all I needed to do was apply skin modifiers for the collision model and optics.