STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
377
IN-GAME
2,215
ONLINE
Founded
8 November, 2013
All Discussions > Help > Topic Details
Separate eye ranges
I have a model with the eyes are separated and the ranges must be different (left and right wise) yet when I compile the eyes seem to be looking to the right and barely affected by the viewtarget movements.
I've tried many rotations and even disabling the "absolute" value and set them manually and they were getting more ♥♥♥♥♥♥.
I've even followed Pte Jack's video but his example is of a combined eye mesh and i've tried something but it isin't working.
I have even gotten a model and decompiled it to see the QC file but it doesn't make sense about the eyes.
100 google searches and 9 tabs open and still can't find what I need.
I just don't know.

$CD "G:\Steam\steamapps\common\SourceFilmmaker\game\from blender\models\test\Model2" $cdmaterials "models\test\Model2\" $modelname "test\Model2\Model2.mdl" $attachment "Eyes" "bip_head" 0.000003 -3.21787 81.4759 absolute $attachment "eye_right" "bip_head" -2.05802 -3.21787 81.4759 absolute $attachment "eye_left" "bip_head" 2.05802 -3.21787 81.4759 absolute $mostlyopaque $model "Model2_eye_right" "eye_right.dmx" { eyeball "eye_right" "bip_head" -2.05802 -3.21787 81.476 "eye_right" 1 0 "NotUsed" 7 Flexcontroller "Eyes" range -25 20 "Eyes_UpDown" Flexcontroller "Eyes" range -55 20 "Eyes_RightLeft" } $model "Model2_eye_left" "eye_left.dmx" { eyeball "eye_left" "bip_head" 2.05802 -3.21787 81.4759 "eye_left" 1 0 "NotUsed" 7 Flexcontroller "Eyes" range -25 20 "Eyes_UpDown" Flexcontroller "Eyes" range -20 55 "Eyes_RightLeft" } $body "Body" "model2.dmx" $bodygroup "Suit" { blank studio "Suit.dmx" } $texturegroup "skinfamilies" { { "Body" "Eye_Sparkle" "Eye_Back" "Suit" "eye_left" "eye_right" } { "Body2" "Eye_Sparkle" "Eye_Back" "Suit" "eye_left" "eye_right" } } $Maxverts 200000 $sequence "idle" "model2.dmx" loop fps 1
< >
Showing 1-5 of 5 comments
Zappy 14 Feb, 2024 @ 1:50am 
Originally posted by Rubus Cockburnianus:
I have a model with the eyes are separated and the ranges must be different (left and right wise) -
Source doesn't support that. The best that you can do is move one eye's coordinates farther backwards into the head to make its eye movements relatively bigger/stronger than the other eye, or farther forwards towards the eye's front surface to make them smaller. (Alternatively, you could compile separate models for each eye, letting them have different slider ranges for the eye sliders.)

Originally posted by Rubus Cockburnianus:
- when I compile the eyes seem to be - barely affected by the viewtarget movements. -
Remember, the eye coordinates are supposed to be the centre of a (sometimes-"fake") eyeball/sphere, not the very front of it.
If your model has spherical eye meshes, then select one of the eyes, find the centre of it, and use that as the eye coordinates (usually just mirrored for the other eye).
If your model doesn't have spherical eye meshes, then you should create a new sphere object/shape yourself, move it to be centred on the model's eye, scale it up to an appropriate eye size, and move the sphere backwards into the head until the front of the sphere lines up with the front of the model's eyes. Then, use this sphere's centre as the eye coordinates, and delete the sphere afterwards.

Source's QC eye system rotates the eye texture around the eye coordinates - so rotating the texture around the very front of the eye mesh won't really do much, whereas rotating the texture around a point farther back in the head will move the texture more on the eye mesh.

Originally posted by Rubus Cockburnianus:
- $modelname "test\Model2\Model2.mdl" -
Unless you plan on making other Model2 models, I'd suggest changing this line to just $ModelName "test/Model2.mdl" - it doesn't really help for organisation to give each and every model its very own folder to reside in.
(It makes sense to have a "unique" folder for $CDMaterials (if the model has multiple materials/textures), but not really for $ModelName.)

Originally posted by Rubus Cockburnianus:
- $attachment "Eyes" "bip_head" 0.000003 -3.21787 81.4759 absolute -
You should probably change the X coordinate here to 0.

Originally posted by Rubus Cockburnianus:
-
eyeball "eye_right" "bip_head" -2.05802 -3.21787 81.476 "eye_right" 1 0 "NotUsed" 7
Flexcontroller "Eyes" range -25 20 "Eyes_UpDown"
Flexcontroller "Eyes" range -55 20 "Eyes_RightLeft"
-
eyeball "eye_left" "bip_head" 2.05802 -3.21787 81.4759 "eye_left" 1 0 "NotUsed" 7
Flexcontroller "Eyes" range -25 20 "Eyes_UpDown"
Flexcontroller "Eyes" range -20 55 "Eyes_RightLeft"
-
You can't have more than one flex controller/slider with the same name in a model. (Or, technically, you can, but only one of them will affect the model, and the other/the rest will do nothing.)

The "Eyes_UpDown" flex controllers are identical, so you can safely remove one of them. The "Eyes_RightLeft" flex controllers are merely mirrored compared to the other, so you might be able to get away with removing one of them and changing the other's range to go from -37.5 to +37.5, along with adjusting the Eyeball statements' "neutral angle" (the 0 before "NotUsed") and/or X coordinate to compensate.

Originally posted by Rubus Cockburnianus:
- $texturegroup "skinfamilies"
{
{ "Body" "Eye_Sparkle" "Eye_Back" "Suit" "eye_left" "eye_right" }
{ "Body2" "Eye_Sparkle" "Eye_Back" "Suit" "eye_left" "eye_right" }
} -
You can safely get rid of "Eye_Sparkle", "Eye_Back", "Suit", "eye_left", and "eye_right" here, as they're the same in both skins.
Last edited by Zappy; 14 Feb, 2024 @ 1:53am
One thing I forgot to mention is that this issue is only present in SFM, in Model Viewer and SFM's Model Viewer everything is fine the eyes are following the viewer correctly and are within their ranges. The problem appears when I am adding the model to the scene.
I followed your solution and it fixed my issue, thank you.
But I have a question about the ViewTarget position, is there a way to set where the ViewTarget default spawn position to be? Cuz when I import the model into the scene the ViewTarget spawns at stomach height.
Zappy 14 Feb, 2024 @ 9:29am 
Originally posted by Rubus Cockburnianus:
- is there a way to set where the ViewTarget default spawn position to be? -
Maybe with the $EyePosition QC command (in your case, it could be set to something like 0 -3.21787 81.4759, or 0 0 81.4759). If that doesn't help, then I think that Source Filmmaker just has a hardcoded default "viewTarget" position regardless of what you do.
The $EyePosition didn't moved the ViewTarget at all, even when I set it to a high value, but anyway, thank you for your help.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

All Discussions > Help > Topic Details