Incorrect TF2 World Model Positions

I’ve been remaking a lot of the TF2 weapons for lua experience, but I’ve come across an unfortunate bug that causes TF2 weapon’s world view models to originate at the crotch. While I don’t plan on using them for anything, it would be nice to know if anyone has a fix for use in the future.

You can fix that using weapon:SetRenderPos/Angles in world model draw hook of SWEP, but it isn’t perfect.

This is happening because TF2 uses different bone names for hands/arms and thus bonemerging fails.

[editline]6th October 2013[/editline]

You can only properly fix it if you recompile the model.

Thanks! It may not be perfect, but it’s certainly better than a cannon penis.

function SWEP:DrawWorldModel()
	self:SetRenderAngles( self.Owner:EyeAngles())
	self:SetRenderOrigin( self.Owner:GetBonePosition( self.Owner:LookupBone("ValveBiped.Bip01_R_Hand") ) )