Messed Up View Model for Custom Karambit

So I decided to start making some custom textures for the Karambit in this addon: http://steamcommunity.com/sharedfiles/filedetails/?id=506283460
but for some reason the view model is completely to the left and I can only see a little bit of the animation going on. The animation are there and you can see the/hear them, but they are completely to the side. This video shows the problem


Here is what I’ve done:
I’ve decompiled the model and remade the .qc file and all the other files.
I’ve edited the lua for the knife and also I’ve made sure to have the base knife in my addon.
I’m not going to post any code on here because there is so many places where stuff could have gone wrong, but if you need to see a certain file just comment and I’ll reply with the code you asked to see.

Also I have a side problem. Even if there is 5 separate weapons and I’ve made sure they should have their own texture, but they still have all the same texture. You can see this in the second part of the video.
Thanks for the help!
Lots of Love <3
Doodle

If SWEP.ViewModelFlip is true, turn it to false, if its false turn SWEP.ViewModelFlip to true

For the texture, The models should have DIFFERENT MATERIAL NAMES

ah, I had the same issue with decompiling some CS:S viewmodels. You’ll want to have


$origin 0 0 0 -90 0 0

in your QC file, it’s rotated 90 degrees to the left it seems.

Thanks for the answer, but after having added it in, an error happens when I compile the viewmodel. This is the .qc file:


 
$ModelName "weapons\v_csgo_karambitdoodle.mdl"

$BodyGroup "studio"
{
	studio "v_csgo_karambitdoodle_reference.smd"
}


$SurfaceProp "default"

$Contents "solid"

$MaxEyeDeflection 90

$CDMaterials "models\csgo_knife\"
$CDMaterials "models\weapons\v_models\knife_butterfly\"

$TextureGroup "skinfamilies"
{
	{ "karam"            }
	{ "karam_goldrose"        }
	{ "karam_typhoon"         }
	{ "karam_silkspectrum"    }
	{ "karam_fundoll"         }
	{ "karam_nebula"          }
}

$Attachment "v_weapon.stattrack" "v_weapon.stattrack" 0 0 0 rotate 0 0 0
$Attachment "v_weapon.uid" "v_weapon.uid" 0 0 0 rotate 0 0 0

$CBox 0 0 0 0 0 0

$BBox -16.205 -16.968 -20.34 34.506 28.186 10.025

$BoneMerge "v_weapon.Bip01_L_Forearm"
$BoneMerge "v_weapon.Bip01_L_Hand"
$BoneMerge "v_weapon.Bip01_L_Finger0"
$BoneMerge "v_weapon.Bip01_L_Finger01"
$BoneMerge "v_weapon.Bip01_L_Finger02"
$BoneMerge "ValveBiped.Bip01_L_Finger02"
$BoneMerge "ValveBiped.Bip01_L_Finger01"
$BoneMerge "ValveBiped.Bip01_L_Finger0"
$BoneMerge "v_weapon.Bip01_L_Finger1"
$BoneMerge "v_weapon.Bip01_L_Finger11"
$BoneMerge "v_weapon.Bip01_L_Finger12"
$BoneMerge "ValveBiped.Bip01_L_Finger12"
$BoneMerge "ValveBiped.Bip01_L_Finger11"
$BoneMerge "ValveBiped.Bip01_L_Finger1"
$BoneMerge "v_weapon.Bip01_L_Finger2"
$BoneMerge "v_weapon.Bip01_L_Finger21"
$BoneMerge "v_weapon.Bip01_L_Finger22"
$BoneMerge "ValveBiped.Bip01_L_Finger22"
$BoneMerge "ValveBiped.Bip01_L_Finger21"
$BoneMerge "ValveBiped.Bip01_L_Finger2"
$BoneMerge "v_weapon.Bip01_L_Finger3"
$BoneMerge "v_weapon.Bip01_L_Finger31"
$BoneMerge "v_weapon.Bip01_L_Finger32"
$BoneMerge "ValveBiped.Bip01_L_Finger32"
$BoneMerge "ValveBiped.Bip01_L_Finger31"
$BoneMerge "ValveBiped.Bip01_L_Finger3"
$BoneMerge "v_weapon.Bip01_L_Finger4"
$BoneMerge "v_weapon.Bip01_L_Finger41"
$BoneMerge "v_weapon.Bip01_L_Finger42"
$BoneMerge "ValveBiped.Bip01_L_Finger42"
$BoneMerge "ValveBiped.Bip01_L_Finger41"
$BoneMerge "ValveBiped.Bip01_L_Finger4"
$BoneMerge "ValveBiped.Bip01_L_Hand"
$BoneMerge "ValveBiped.Bip01_L_Clavicle"
$BoneMerge "ValveBiped.Bip01_L_UpperArm"
$BoneMerge "ValveBiped.Bip01_L_Forearm"
$BoneMerge "v_weapon.Bip01_L_ForeTwist"
$BoneMerge "v_weapon.Bip01_R_Forearm"
$BoneMerge "v_weapon.Bip01_R_Hand"
$BoneMerge "v_weapon.Bip01_R_Finger0"
$BoneMerge "v_weapon.Bip01_R_Finger01"
$BoneMerge "v_weapon.Bip01_R_Finger02"
$BoneMerge "ValveBiped.Bip01_R_Finger02"
$BoneMerge "ValveBiped.Bip01_R_Finger01"
$BoneMerge "ValveBiped.Bip01_R_Finger0"
$BoneMerge "v_weapon.Bip01_R_Finger1"
$BoneMerge "v_weapon.Bip01_R_Finger11"
$BoneMerge "v_weapon.Bip01_R_Finger12"
$BoneMerge "ValveBiped.Bip01_R_Finger12"
$BoneMerge "ValveBiped.Bip01_R_Finger11"
$BoneMerge "ValveBiped.Bip01_R_Finger1"
$BoneMerge "v_weapon.Bip01_R_Finger2"
$BoneMerge "v_weapon.Bip01_R_Finger21"
$BoneMerge "v_weapon.Bip01_R_Finger22"
$BoneMerge "ValveBiped.Bip01_R_Finger22"
$BoneMerge "ValveBiped.Bip01_R_Finger21"
$BoneMerge "ValveBiped.Bip01_R_Finger2"
$BoneMerge "v_weapon.Bip01_R_Finger3"
$BoneMerge "v_weapon.Bip01_R_Finger31"
$BoneMerge "v_weapon.Bip01_R_Finger32"
$BoneMerge "ValveBiped.Bip01_R_Finger32"
$BoneMerge "ValveBiped.Bip01_R_Finger31"
$BoneMerge "ValveBiped.Bip01_R_Finger3"
$BoneMerge "v_weapon.Bip01_R_Finger4"
$BoneMerge "v_weapon.Bip01_R_Finger41"
$BoneMerge "v_weapon.Bip01_R_Finger42"
$BoneMerge "ValveBiped.Bip01_R_Finger42"
$BoneMerge "ValveBiped.Bip01_R_Finger41"
$BoneMerge "ValveBiped.Bip01_R_Finger4"
$BoneMerge "ValveBiped.Bip01_R_Hand"
$BoneMerge "ValveBiped.Bip01_R_Clavicle"
$BoneMerge "ValveBiped.Bip01_R_UpperArm"
$BoneMerge "ValveBiped.Bip01_R_Forearm"
$BoneMerge "v_weapon.Bip01_R_ForeTwist"
$BoneMerge "ValveBiped.Bip01_Spine4"
$BoneMerge "ValveBiped.Bip01_Neck1"
$BoneMerge "ValveBiped.Bip01_Head1"
$BoneMerge "v_weapon"
$BoneMerge "v_weapon.knife"
$BoneMerge "v_weapon.stattrack"
$BoneMerge "v_weapon.uid"


$SectionFrames 30 145

$Sequence "draw" {
	"v_csgo_karambit_anims\draw.smd"
	activity "ACT_VM_DRAW" 1
	{ event 5004 0 "csgo_knife.Deploy" }
	fadein 0.2
	fadeout 0.4
	fps 30
}

$Sequence "idle1" {
	"v_csgo_karambit_anims\idle1.smd"
	activity "ACT_VM_IDLE" 3
	fadein 0.4
	fadeout 0.4
	fps 30
}

$Sequence "idle2" {
	"v_csgo_karambit_anims\idle2.smd"
	activity "ACT_VM_IDLE" 1
	fadein 0.4
	fadeout 0.4
	fps 30
}

$Sequence "light_miss1" {
	"v_csgo_karambit_anims\light_miss1.smd"
	activity "ACT_VM_MISSCENTER" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "light_miss2" {
	"v_csgo_karambit_anims\light_miss2.smd"
	activity "ACT_VM_MISSCENTER" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "light_hit1" {
	"v_csgo_karambit_anims\light_hit1.smd"
	activity "ACT_VM_HITCENTER" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "light_hit2" {
	"v_csgo_karambit_anims\light_hit2.smd"
	activity "ACT_VM_HITCENTER" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "light_backstab" {
	"v_csgo_karambit_anims\light_backstab.smd"
	activity "ACT_VM_SWINGHIT" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "light_backstab2" {
	"v_csgo_karambit_anims\light_backstab2.smd"
	activity "ACT_VM_SWINGHIT" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "heavy_miss1" {
	"v_csgo_karambit_anims\heavy_miss1.smd"
	activity "ACT_VM_MISSCENTER2" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "heavy_hit1" {
	"v_csgo_karambit_anims\heavy_hit1.smd"
	activity "ACT_VM_HITCENTER2" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "heavy_backstab" {
	"v_csgo_karambit_anims\heavy_backstab.smd"
	activity "ACT_VM_SWINGHARD" 1
	fadein 0.2
	fadeout 0.2
	snap
	fps 30
}

$Sequence "lookat01" {
	"v_csgo_karambit_anims\lookat01.smd"
	activity "ACT_VM_IDLE_LOWERED" 1
	{ event AE_CL_SET_STATTRAK_GLOW 0 "1" }
	{ event AE_CL_SET_STATTRAK_GLOW 104 "0" }
	{ event AE_BEGIN_TAUNT_LOOP 103 "0.3655172" }
	{ event 5004 2 "csgo_Weapon.WeaponMove1" }
	{ event 5004 11 "csgo_Weapon.WeaponMove2" }
	{ event 5004 109 "csgo_Weapon.WeaponMove3" }
	fadein 0.3
	fadeout 0.3
	fps 30
}

$origin 0 0 0 -90 0 0 

[editline]27th February 2017[/editline]

Changing that only fliped the knife but not the position of the animation :confused:

I’m pretty sure $origin should be placed as one of the first lines in your QC code, just like $scale. Try that see if it works.

Still getting a damn compiling error :confused:
this is the error:


 ERROR: c:\users\aidan\desktop\gmod models\decompiled\v_csgo_karambitdoodle.qc(19): - bad command 0
    ERROR: Aborted Processing on 'weapons\v_csgo_karambitdoodle.mdl'