Custom playermodel's irises don't have limit anymore (the irises disappear)

Hi hi ! I’m making Super Sonic playermodel, for another thread:

https://image.noelshack.com/fichiers/2017/08/1488125604-sonichyper.jpg

But there is a last problem, if someone could help me please:
In hlmv, sonic’s irises don’t disappear, there is a “limit”:

https://image.noelshack.com/fichiers/2017/08/1488126115-soneye.jpg

But in Garry’s Mod the irises don’t have limit anymore:

https://image.noelshack.com/fichiers/2017/08/1488125602-sonichypersieux.jpg

Do someone know how to solve this ?

:huh:

You probably need to play around with eye pose to get it work properly.

Also try adding $MaxEyeDeflection 15 (15 is the limit in degrees. Change it to desired).

It’s weird, in hlmv $MaxEyeDefection works perfectly but in Gmod it’s worst !

https://image.noelshack.com/fichiers/2017/09/1488221824-captureasuprimer.png

https://image.noelshack.com/fichiers/2017/09/1488221831-worst.jpg

Here is my QC file:


$modelname "hypersonic.mdl"
$model "hypersonic" "hypersonic.smd" {

	eyeball "eye_right" "ValveBiped.Bip01_Head1" -2.600308 1.692691 40.178685 "eyeball_super_r" 8 4 "iris_unused" 8.58
	eyeball "eye_left" "ValveBiped.Bip01_Head1" 2.589692 1.692691 40.180476 "eyeball_super_l" 8 -4 "iris_unused" 8.58
}
	
$cdmaterials "models\ApocModels\SonicGenerations\ModernSonic\"

$texturegroup "skinfamilies"
{
	{
		"chr_supersonic_body01_dif_HD.vmt"
		"chr_supersonic_skin01_dif_HD.vmt"
		"chr_sonic_cloth01_dif_hd.vmt"
		"chr_sonic_shoes_dif_hd.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
	{
		"chr_supersonic_body02_dif_HD.vmt"
		"chr_supersonic_skin02_dif_HD.vmt"
		"chr_sonic_cloth02_dif_HD.vmt"
		"chr_sonic_shoes_dif_hd.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
	{
		"chr_supersonic_body03_dif_HD.vmt"
		"chr_supersonic_skin03_dif_HD.vmt"
		"chr_sonic_cloth03_dif_HD.vmt"
		"chr_sonic_shoes03_dif_HD.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
	{
		"chr_supersonic_body04_dif_HD.vmt"
		"chr_supersonic_skin04_dif_HD.vmt"
		"chr_sonic_cloth04_dif_HD.vmt"
		"chr_sonic_shoes04_dif_HD.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
	{
		"chr_supersonic_body05_dif_HD.vmt"
		"chr_supersonic_skin05_dif_HD.vmt"
		"chr_supersonic_cloth05_dif_HD.vmt"
		"chr_sonic_shoes05_dif_HD.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
	{
		"chr_hypersonic_body01_dif_HD.vmt"
		"chr_hypersonic_skin01_dif_HD.vmt"
		"chr_sonic_cloth01_dif_hd.vmt"
		"chr_sonic_shoes_dif_hd.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
	{
		"chr_darksonic_body01_dif_HD.vmt"
		"chr_supersonic_skin01_dif_HD.vmt"
		"chr_sonic_cloth01_dif_hd.vmt"
		"chr_darksonic_shoes_dif_HD.vmt"
		"eyeball_dark.vmt"
		"eyeball_dark.vmt"
	}
	{
		"chr_supersonic_body01_col_HD.vmt"
		"chr_sonic_body01_col_HD.vmt"
		"chr_sonic_cloth01_col_HD.vmt"
		"chr_sonic_shoes_col_HD.vmt"
		"eyeball_super_l.vmt"
		"eyeball_super_r.vmt"
	}
}

// $attachment "eyes" "ValveBiped.Bip01_Head1" 3.2 -3.5 0.12 rotate 0 -80.1 -90
$attachment "mouth" "ValveBiped.Bip01_Head1" 0.6 -5.5 0 rotate 0 -80 -90
$attachment "chest" "ValveBiped.Bip01_Spine2" 5 4 0 rotate 0 90 90
$attachment "forward" "ValveBiped.forward" 0 0 0 rotate 0 0 0
$attachment "anim_attachment_RH" "ValveBiped.Anim_Attachment_RH" 0 0 0 rotate -90 -90 0
$attachment "anim_attachment_LH" "ValveBiped.Anim_Attachment_LH" 0 0 0 rotate -90 -90 0
$attachment "anim_attachment_head" "ValveBiped.Bip01_Head1" 0 0 0 rotate -90 -90 0
$MaxEyeDeflection 12

$surfaceprop "flesh"

$contents "solid"

$hboxset "default"
$hbox 1 "ValveBiped.Bip01_Head1" -1.25 -6.5 -3.19 8.25 3.5 3.31
$hbox 4 "ValveBiped.Bip01_L_UpperArm" 0 -2.75 -2.75 12.51 1.75 2.25
$hbox 4 "ValveBiped.Bip01_L_Forearm" 0 -2.19 -2.38 13 1.81 1.62
$hbox 4 "ValveBiped.Bip01_L_Hand" 0.06 -2 -1.5 4.06 1 2.5
$hbox 5 "ValveBiped.Bip01_R_UpperArm" 0 -3 -2.25 12.39 2 2.75
$hbox 5 "ValveBiped.Bip01_R_Forearm" -0.5 -2.2 -1.55 12.5 1.8 2.45
$hbox 5 "ValveBiped.Bip01_R_Hand" 0.06 -2 -2.5 4.06 1 1.5
$hbox 6 "ValveBiped.Bip01_L_Thigh" 0 -3.75 -3.25 17.85 3.75 3.25
$hbox 6 "ValveBiped.Bip01_L_Calf" 0 -3.51 -3.28 15.64 3.49 2.72
$hbox 6 "ValveBiped.Bip01_L_Foot" -1.07 -2 -2.84 5.04 5 2.16
$hbox 6 "ValveBiped.Bip01_L_Toe0" -0.5 -3 -2.19 2.5 0 2.46
$hbox 7 "ValveBiped.Bip01_R_Thigh" 0 -3.75 -3.25 17.85 3.75 3.25
$hbox 7 "ValveBiped.Bip01_R_Calf" 0 -3.51 -2.82 15.64 3.49 3.18
$hbox 7 "ValveBiped.Bip01_R_Foot" -1.06 -2.01 -2.28 5.05 4.99 2.72
$hbox 7 "ValveBiped.Bip01_R_Toe0" -0.5 -3 -2.6 2.5 0 2.1
$hbox 3 "ValveBiped.Bip01_Pelvis" -7.5 -5.5 -6 7.5 8.5 5
$hbox 2 "ValveBiped.Bip01_Spine2" -2.5 -2.5 -7 14.5 7.5 7
$skipboneinbbox

$sequence reference "anims/reference.smd" fps 1

$animation a_proportions "anims/a_proportions.smd" subtract reference 0
$sequence proportions a_proportions predelta autoplay

$sequence "ragdoll" "anims\ragdoll.smd" {
	fps 30
	"ACT_DIERAGDOLL" 1
}

$includemodel "m_anm.mdl"

$ikchain "rhand" "ValveBiped.Bip01_R_Hand" knee 0.707 0.707 0
$ikchain "lhand" "ValveBiped.Bip01_L_Hand" knee 0.707 0.707 0
$ikchain "rfoot" "ValveBiped.Bip01_R_Foot" knee 0.707 -0.707 0
$ikchain "lfoot" "ValveBiped.Bip01_L_Foot" knee 0.707 -0.707 0

$ikautoplaylock "rfoot" 1 0.1
$ikautoplaylock "lfoot" 1 0.1

$collisionjoints "phys.smd"
{
	$mass 0
	$inertia 10
	$damping 0.01
	$rotdamping 1.5
	$rootbone "valvebiped.bip01_pelvis"

	$jointconstrain "ValveBiped.Bip01_Spine2" x limit -48 48 0
	$jointconstrain "ValveBiped.Bip01_Spine2" y limit -25 25 0
	$jointconstrain "ValveBiped.Bip01_Spine2" z limit -25 50 0

	$jointconstrain "ValveBiped.Bip01_R_UpperArm" x limit -39 39 0
	$jointconstrain "ValveBiped.Bip01_R_UpperArm" y limit -79 95 0
	$jointconstrain "ValveBiped.Bip01_R_UpperArm" z limit -93 23 0

	$jointconstrain "ValveBiped.Bip01_L_UpperArm" x limit -30 30 0
	$jointconstrain "ValveBiped.Bip01_L_UpperArm" y limit -95 84 0
	$jointconstrain "ValveBiped.Bip01_L_UpperArm" z limit -86 26 0

	$jointconstrain "ValveBiped.Bip01_L_Forearm" x limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_L_Forearm" y limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_L_Forearm" z limit -149 4 0

	$jointconstrain "ValveBiped.Bip01_L_Hand" x limit -37 37 0
	$jointconstrain "ValveBiped.Bip01_L_Hand" y limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_L_Hand" z limit -57 59 0

	$jointconstrain "ValveBiped.Bip01_R_Forearm" x limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_R_Forearm" y limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_R_Forearm" z limit -149 4 0

	$jointconstrain "ValveBiped.Bip01_R_Hand" x limit -60 60 0
	$jointconstrain "ValveBiped.Bip01_R_Hand" y limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_R_Hand" z limit -57 70 0

	$jointconstrain "ValveBiped.Bip01_R_Thigh" x limit -12 12 0
	$jointconstrain "ValveBiped.Bip01_R_Thigh" y limit -8 75 0
	$jointconstrain "ValveBiped.Bip01_R_Thigh" z limit -97 32 0

	$jointconstrain "ValveBiped.Bip01_R_Calf" x limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_R_Calf" y limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_R_Calf" z limit -12 126 0

	$jointconstrain "ValveBiped.Bip01_Head1" x limit -20 20 0
	$jointconstrain "ValveBiped.Bip01_Head1" y limit -25 25 0
	$jointconstrain "ValveBiped.Bip01_Head1" z limit -13 30 0

	$jointconstrain "ValveBiped.Bip01_L_Thigh" x limit -12 12 0
	$jointconstrain "ValveBiped.Bip01_L_Thigh" y limit -73 6 0
	$jointconstrain "ValveBiped.Bip01_L_Thigh" z limit -93 30 0

	$jointconstrain "ValveBiped.Bip01_L_Calf" x limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_L_Calf" y limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_L_Calf" z limit -8 126 0

	$jointconstrain "ValveBiped.Bip01_L_Foot" x limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_L_Foot" y limit -19 19 0
	$jointconstrain "ValveBiped.Bip01_L_Foot" z limit -15 35 0

	$jointconstrain "ValveBiped.Bip01_R_Foot" x limit 0 0 0
	$jointconstrain "ValveBiped.Bip01_R_Foot" y limit -25 6 0
	$jointconstrain "ValveBiped.Bip01_R_Foot" z limit -15 35 0
}

$collisiontext
{
	animatedfriction 
	{
		"animfrictionmin" "1.000000"
		"animfrictionmax" "400.000000"
		"animfrictiontimein" "0.500000"
		"animfrictiontimeout" "0.300000"
		"animfrictiontimehold" "0.000000"
	}
	editparams 
	{
		"rootname" "valvebiped.bip01_pelvis"
		"totalmass" "90.000000"
		"jointmerge" "valvebiped.bip01_pelvis,valvebiped.bip01"
		"jointmerge" "valvebiped.bip01_pelvis,valvebiped.bip01_spine1"
	}
}
$proceduralbones "male_07.vrd"

$bonemerge "ValveBiped.Bip01_Pelvis"
$bonemerge "ValveBiped.Bip01_Spine"
$bonemerge "ValveBiped.Bip01_Spine1"
$bonemerge "ValveBiped.Bip01_Spine2"
$bonemerge "ValveBiped.Bip01_Spine4"
$bonemerge "ValveBiped.Bip01_R_Clavicle"
$bonemerge "ValveBiped.Bip01_R_UpperArm"
$bonemerge "ValveBiped.Bip01_R_Forearm"
$bonemerge "ValveBiped.Bip01_R_Hand"
$bonemerge "ValveBiped.Anim_Attachment_RH"
$bonemerge "ValveBiped.Bip01_L_Toe0"

i dunno about deflection. your regular scale is the slider range of the updown and leftright sliders. the common factor is the origin and the resulting viewcone. so… check your eyeball origins. you probably need a modelling program to get the corrrect coordinates out. to get a visual in hlmv you could/should use


$attachment eyes ValveBiped.Bip01_Head1 0.0 -2.933 65.180 absolute
$attachment lefteye ValveBiped.Bip01_Head1 1.300 -2.933 65.180 absolute
$attachment righteye ValveBiped.Bip01_Head1 -1.300 -2.933 65.180 absolute

those models (as some other styles of models) have nasty large eyes and weird angles. barely possible angles. this borders at the precision of the iris mapping. the acceptable range of movement of this humongous eyeballs seems to be this.

the blue spot the potential origin of this mapping and this very picture’s angle. i mean, both eyes seem to look at me. visually. this is what you gotta test in hlmv.

tho… you can and probably should try that with a more in the head origin and do the ‘fish eye’ parameter since it may ‘distort’ in a different way. the parameter is this.

“eyeball_super_l” 8 -4 “iris_unused” 8.58

but i’m not used to that sort of thing. so… it’s upto you.

Woooow amaziiiing ! I will try this ! Thank you for this awesome explanation ! :jawdrop:

It’s very weird. When I change parameters in qc file it only changes the position of the eyes in the ragdoll, but not when the player is alive. I made a video:
[video]https://youtu.be/Qz_CspEI8yo[/video]
As you can see, the eyes work properly but in Gmod not at all. The blue Sonic is not mine, it’s an other playermodel. I’m trying to do the same. I decompiled the other playermodel but I can’t see any difference.

okay. this is not sfm. i think you gotta rebuild this with or just use this standard forward attachement and the bone. games don’t have viewtargets but use this ‘camera forward’ thingy. just make sure your ‘viewcones’ are correct. for this forward you better ask somebody who has gmod since i can’t guess how this works and is compatible. i don’t have a game mod right now. :glare:

I don’t know how to check my viewcomes (and where) but thank you all the same ! I really appreciate your help and I realize I’m talking to an old-master ! (1040 posts !)

So, now, if I understand, I just have to wait for another person who could help me. :cat:

https://image.noelshack.com/fichiers/2017/09/1488448434-sans-titre.png

╥﹏╥