[L4D2] Need help with Facial flex problem

This is my first Thread, and I come with some noobly question.

I making custom l4d2 survivors (by ported model from another game), I do everything almost work fine except facial animation and I already post it on workshop.

http://steamcommunity.com/sharedfiles/filedetails/?id=233569201

After seeking the way to making facial flex by decompile Zoey model for explore shape key in .vta file and made facial flexes for my custom model like the way Zoey flexes does like this

frame01 frame02 frame03 frame04 AU42
AU1 AU2 AU4 AU12 AU15
AU17 AU10 AU17D AU16 AU6
AU9 AU25 AU22 AU20 AU32
AU24 AU18 AU38 AU31 AU26
AU27 AU26Z AU27Z AD30L AD30R
AU1AU2 AU1AU4 AU2AU4 AU12AU25 AU6Z
AU18Z AU22Z AU13 AD96L AD96R
old-cheekRaiser, tempWrinkler, upper_right, upper_right, lower_right
lower_right, upper_left, upper_left, lower_left, lower_left

after I made 50 facial shape key, I use qc command which I also copy from decompile qc code from Zoey model like this


// QC File generated by the Wall Worm Model Tools Version 1.9861
// Get the latest version and notes at:
// http://dev.wallworm.com 

$scale 1
$modelname	"Custom\Elizabethstudent_1pristine_rig.mdl"

$model ElizabethStudent_1Pristine_RIG "ElizabethStudent_1Pristine_RIG.smd" {

	eyeball "eye_right" "ValveBiped.Bip01_Head1" -1.27 3.28 61.70 "Elizabeth_Eye_R" 1 4 "iris_unused" 0.63
	eyeball "eye_left" "ValveBiped.Bip01_Head1" 1.27 3.28 61.70 "Elizabeth_Eye_L" 1 -4 "iris_unused" 0.63

	eyelid upper_right "Liz1.vta" lowerer 43 -0.13 neutral 0 0.09 raiser 44 0.17 split 0.1 eyeball "eye_right"
	eyelid lower_right "Liz1.vta" lowerer 45 -0.39 neutral 0 -0.34 raiser 46 -0.16 split 0.1 eyeball "eye_right"
	eyelid upper_left "Liz1.vta" lowerer 47 -0.13 neutral 0 0.09 raiser 48 0.17 split -0.1 eyeball "eye_left"
	eyelid lower_left "Liz1.vta" lowerer 49 -0.39 neutral 0 -0.34 raiser 50 -0.16 split -0.1 eyeball "eye_left"

	mouth 0 "mouth" "ValveBiped.Bip01_Head1" 0 1 0

	flexfile "Liz1.vta" 
	{
		defaultflex frame 0
		flex "frame01" frame 1
		flex "frame02" frame 2
		flex "frame03" frame 3
		flex "frame04" frame 4
		flex "AU42" frame 5
		flexpair "AU1" 1 frame 6
		flexpair "AU2" 1 frame 7
		flexpair "AU4" 1 frame 8
		flexpair "AU12" 1 frame 9
		flexpair "AU15" 1 frame 10
		flexpair "AU17" 1 frame 11
		flexpair "AU10" 1 frame 12
		flexpair "AU17D" 1 frame 13
		flexpair "AU16" 1 frame 14
		flexpair "AU6" 1 frame 15
		flexpair "AU9" 1 frame 16
		flexpair "AU25" 1 frame 17
		flexpair "AU22" 1 frame 18
		flexpair "AU20" 1 frame 19
		flex "AU32" frame 20
		flex "AU24" frame 21
		flexpair "AU18" 1 frame 22
		flex "AU38" frame 23
		flex "AU31" frame 24
		flexpair "AU26" 1 frame 25
		flexpair "AU27" 1 frame 26
		flexpair "AU26Z" 1 frame 27
		flexpair "AU27Z" 1 frame 28
		flex "AD30L" frame 29
		flex "AD30R" frame 30
		flexpair "AU1AU2" 1 frame 31
		flexpair "AU1AU4" 1 frame 32
		flexpair "AU2AU4" 1 frame 33
		flexpair "AU12AU25" 1 frame 34
		flexpair "AU6Z" 1 frame 35
		flexpair "AU18Z" 1 frame 36
		flexpair "AU22Z" 1 frame 37
		flexpair "AU13" 1 frame 38
		flex "AD96L" frame 39
		flex "AD96R" frame 40
		flex "old-cheekRaiser" frame 41
		flex "tempWrinkler" frame 42
		// Already in eyelid lines: flex "upper_right" frame 43
		// Already in eyelid lines: flex "upper_right" frame 44
		// Already in eyelid lines: flex "lower_right" frame 45
		// Already in eyelid lines: flex "lower_right" frame 46
		// Already in eyelid lines: flex "upper_left" frame 47
		// Already in eyelid lines: flex "upper_left" frame 48
		// Already in eyelid lines: flex "lower_left" frame 49
		// Already in eyelid lines: flex "lower_left" frame 50
	}

	flexcontroller eyelid range 0 1 right_lid_raiser
	flexcontroller eyelid range 0 1 left_lid_raiser
	flexcontroller eyelid range 0 1 right_lid_tightener
	flexcontroller eyelid range 0 1 left_lid_tightener
	flexcontroller eyelid range 0 1 right_lid_droop
	flexcontroller eyelid range 0 1 left_lid_droop
	flexcontroller eyelid range 0 1 right_lid_closer
	flexcontroller eyelid range 0 1 left_lid_closer
	flexcontroller eyelid range 0 1 half_closed
	flexcontroller eyelid range 0 1 blink
	flexcontroller brow range 0 1 right_inner_raiser
	flexcontroller brow range 0 1 left_inner_raiser
	flexcontroller brow range 0 1 right_outer_raiser
	flexcontroller brow range 0 1 left_outer_raiser
	flexcontroller brow range 0 1 right_lowerer
	flexcontroller brow range 0 1 left_lowerer
	flexcontroller nose range 0 1 right_cheek_raiser
	flexcontroller nose range 0 1 left_cheek_raiser
	flexcontroller nose range 0 1 right_wrinkler
	flexcontroller nose range 0 1 left_wrinkler
	flexcontroller nose range 0 1 dilator
	flexcontroller mouth range 0 1 right_upper_raiser
	flexcontroller mouth range 0 1 left_upper_raiser
	flexcontroller mouth range 0 1 right_corner_puller
	flexcontroller mouth range 0 1 left_corner_puller
	flexcontroller mouth range 0 1 right_corner_depressor
	flexcontroller mouth range 0 1 left_corner_depressor
	flexcontroller mouth range 0 1 chin_raiser
	flexcontroller phoneme range 0 1 right_part
	flexcontroller phoneme range 0 1 left_part
	flexcontroller phoneme range 0 1 right_puckerer
	flexcontroller phoneme range 0 1 left_puckerer
	flexcontroller phoneme range 0 2 right_funneler
	flexcontroller phoneme range 0 2 left_funneler
	flexcontroller phoneme range 0 1 right_stretcher
	flexcontroller phoneme range 0 1 left_stretcher
	flexcontroller phoneme range 0 1 bite
	flexcontroller phoneme range 0 1 presser
	flexcontroller phoneme range 0 1 tightener
	flexcontroller phoneme range 0 1 jaw_clencher
	flexcontroller phoneme range 0 2 jaw_drop
	flexcontroller phoneme range 0 1 right_mouth_drop
	flexcontroller phoneme range 0 1 left_mouth_drop
	flexcontroller mouth range 0 1 right_cheek_puffer
	flexcontroller mouth range 0 1 left_cheek_puffer
	flexcontroller mouth range -1 1 mouth_sideways
	flexcontroller mouth range -1 1 jaw_sideways
	flexcontroller mouth range 0 1 lower_lip
	flexcontroller eyes range -30 30 eyes_updown
	flexcontroller eyes range -30 30 eyes_rightleft

	localvar biter
	localvar AU1AU2AU4R
	localvar AU1AU2AU4L
	localvar right_open
	localvar left_open
	localvar right_lip_suppressor
	localvar left_lip_suppressor
	localvar lower_lip_active
	localvar right_scaled_part
	localvar left_scaled_part
	localvar right_raiser_suppressor
	localvar left_raiser_suppressor
	localvar right_depressor_suppressor
	localvar left_depressor_suppressor
	localvar right_corner_suppressor
	localvar left_corner_suppressor
	localvar right_drop_suppressor
	localvar left_drop_suppressor
	localvar right_drop
	localvar left_drop
	localvar right_au_open
	localvar left_au_open
	localvar jaw_overage
	localvar jaw_underage
	localvar jaw_blend
	%biter = bite
	%upper_right_raiser = right_lid_raiser * (1 - right_lid_droop * 0.8) * (1 - right_lid_closer) * (1 - blink)
	%upper_right_neutral = (1 - right_lid_droop * 0.8) * (1 - right_lid_raiser) * (1 - right_lid_closer) * (1 - blink)
	%upper_right_lowerer = right_lid_closer + blink * (1 - right_lid_closer)
	%upper_left_raiser = left_lid_raiser * (1 - left_lid_droop * 0.8) * (1 - left_lid_closer) * (1 - blink)
	%upper_left_neutral = (1 - left_lid_droop * 0.8) * (1 - left_lid_raiser) * (1 - left_lid_closer) * (1 - blink)
	%upper_left_lowerer = left_lid_closer + blink * (1 - left_lid_closer)
	%lower_right_raiser = right_lid_closer
	%lower_right_neutral = (1 - right_lid_closer) * (1 - right_lid_tightener * 0.5) * (1 - right_cheek_raiser * 0.25)
	%lower_right_lowerer = 0
	%lower_left_raiser = left_lid_closer
	%lower_left_neutral = (1 - left_lid_closer) * (1 - left_lid_tightener * 0.5) * (1 - left_cheek_raiser * 0.25)
	%lower_left_lowerer = 0
	%AU1R = right_inner_raiser * (1 - right_outer_raiser) * (1 - right_lowerer)
	%AU1L = left_inner_raiser * (1 - left_outer_raiser) * (1 - left_lowerer)
	%AU2R = right_outer_raiser * (1 - right_inner_raiser) * (1 - right_lowerer)
	%AU2L = left_outer_raiser * (1 - left_inner_raiser) * (1 - left_lowerer)
	%AU4R = right_lowerer * (1 - right_inner_raiser) * (1 - right_outer_raiser)
	%AU4L = left_lowerer * (1 - left_inner_raiser) * (1 - left_outer_raiser)
	%AU1AU2AU4R = right_inner_raiser * right_outer_raiser * right_lowerer
	%AU1AU2AU4L = left_inner_raiser * left_outer_raiser * left_lowerer
	%AU1AU2R = right_inner_raiser * right_outer_raiser * (1 - right_lowerer) + %AU1AU2AU4R / 2
	%AU1AU2L = left_inner_raiser * left_outer_raiser * (1 - left_lowerer) + %AU1AU2AU4L / 2
	%AU1AU4R = right_inner_raiser * (1 - right_outer_raiser) * right_lowerer + %AU1AU2AU4R / 2
	%AU1AU4L = left_inner_raiser * (1 - left_outer_raiser) * left_lowerer + %AU1AU2AU4L / 2
	%AU2AU4R = right_outer_raiser * (1 - right_inner_raiser) * right_lowerer + %AU1AU2AU4R / 2
	%AU2AU4L = left_outer_raiser * (1 - left_inner_raiser) * left_lowerer + %AU1AU2AU4L / 2
	%AU38 = dilator
	%lower_lip_active = lower_lip * (1 -  min((jaw_drop / 2), 1))
	%right_open = right_part + right_puckerer + right_funneler + right_upper_raiser * 0.5 + %lower_lip_active
	%left_open = left_part + left_puckerer + left_funneler + left_upper_raiser * 0.5 + %lower_lip_active
	%right_lip_suppressor = (1 - presser) * (1 - %biter)
	%left_lip_suppressor = (1 - presser) * (1 - %biter)
	%AU6R = right_cheek_raiser
	%AU6L = left_cheek_raiser
	%right_scaled_part = right_part * (1 - right_puckerer * (1 / 2 - right_funneler * 1 / 6) - right_funneler * 1 / 4) * %right_lip_suppressor
	%left_scaled_part = left_part * (1 - left_puckerer * (1 / 2 - left_funneler * 1 / 6) - left_funneler * 1 / 4) * %left_lip_suppressor
	%AU25R = %right_scaled_part * (1 - right_corner_puller)
	%AU25L = %left_scaled_part * (1 - left_corner_puller)
	%AU12AU25R = %right_scaled_part * right_corner_puller
	%AU12AU25L = %left_scaled_part * left_corner_puller
	%AU18R = right_puckerer * (1 - right_part * (1 / 2 - right_funneler * 1 / 6) - right_funneler * 1 / 4) * %right_lip_suppressor
	%AU18L = left_puckerer * (1 - left_part * (1 / 2 - left_funneler * 1 / 6) - left_funneler * 1 / 4) * %left_lip_suppressor
	%AU22R = right_funneler * (1 - right_part * (1 / 2 - right_puckerer * 1 / 3) - right_puckerer * 1 / 2) * %right_lip_suppressor
	%AU22L = left_funneler * (1 - left_part * (1 / 2 - left_puckerer * 1 / 3) - left_puckerer * 1 / 2) * %left_lip_suppressor
	%right_raiser_suppressor = (1 - 0.3 * %AU22R) * (1 - 0.5 * %AU18R) * (1 - presser) * (1 - %biter) * (1 - right_corner_puller) * (1 - 0.5 * jaw_drop)
	%left_raiser_suppressor = (1 - 0.3 * %AU22L) * (1 - 0.5 * %AU18L) * (1 - presser) * (1 - %biter) * (1 - left_corner_puller) * (1 - 0.5 * jaw_drop)
	%AU9R = right_wrinkler * %right_raiser_suppressor * (1 - right_upper_raiser)
	%AU9L = left_wrinkler * %left_raiser_suppressor * (1 - left_upper_raiser)
	%AU10R = right_upper_raiser * %right_raiser_suppressor
	%AU10L = left_upper_raiser * %left_raiser_suppressor
	%AU25R = %AU25R * (1 - %AU10R) * (1 - %AU9R)
	%AU25L = %AU25L * (1 - %AU10L) * (1 - %AU9L)
	%AU17R = chin_raiser * (1 - jaw_drop * 0.5) * (1 - %biter) *  max(0, (1 - 2 * (%AU25R + %AU12AU25R + %AU18R + %AU22R + %AU10R)))
	%AU17L = chin_raiser * (1 - jaw_drop * 0.5) * (1 - %biter) *  max(0, (1 - 2 * (%AU25L + %AU12AU25L + %AU18L + %AU22L + %AU10L)))
	%right_depressor_suppressor = 1 / (%AU18R * 0.8 + %AU22R * 0.8 + %AU17R + %biter + right_corner_puller + right_stretcher + right_corner_depressor)
	%left_depressor_suppressor = 1 / (%AU18L * 0.8 + %AU22L * 0.8 + %AU17L + %biter + left_corner_puller + left_stretcher + left_corner_depressor)
	%AU15R = right_corner_depressor * right_corner_depressor * %right_depressor_suppressor
	%AU15L = left_corner_depressor * left_corner_depressor * %left_depressor_suppressor
	%right_corner_suppressor = 1 / (%AU18R * 0.8 + %AU22R * 0.8 + %AU17R + %biter + right_corner_puller + right_stretcher + right_corner_depressor) * (1 - jaw_drop * 0.25)
	%left_corner_suppressor = 1 / (%AU18L * 0.8 + %AU22L * 0.8 + %AU17L + %biter + left_corner_puller + left_stretcher + left_corner_depressor) * (1 - jaw_drop * 0.25)
	%AU12R = right_corner_puller * right_corner_puller * %right_corner_suppressor * (1 - right_part)
	%AU12L = left_corner_puller * left_corner_puller * %left_corner_suppressor * (1 - left_part)
	%AU20R = right_stretcher * right_stretcher * %right_corner_suppressor
	%AU20L = left_stretcher * left_stretcher * %left_corner_suppressor
	%right_drop_suppressor = 1 / (0.5 * %right_open + right_mouth_drop) * (1 - presser) * (1 - %biter)
	%left_drop_suppressor = 1 / (0.5 * %left_open + left_mouth_drop) * (1 - presser) * (1 - %biter)
	%right_drop = right_mouth_drop * right_mouth_drop * %right_drop_suppressor
	%left_drop = left_mouth_drop * left_mouth_drop * %left_drop_suppressor
	%right_au_open =  min((%AU18R + %AU25R + %AU12AU25R + 0.5 * %AU22R + %AU20R + %AU12R), 1)
	%left_au_open =  min((%AU18L + %AU25L + %AU12AU25L + 0.5 * %AU22L + %AU20L + %AU12L), 1)
	%AU32 = bite
	%AU24 = presser + (1 - presser) * tightener
	%AU31 = jaw_clencher * jaw_clencher / (jaw_clencher +  min(jaw_drop, 1))
	%AD96L =  max(-mouth_sideways, 0) * (1 - 0.5 * %right_au_open) * (1 - %right_drop * jaw_drop * 0.25) * (1 - 0.5 * %biter)
	%AD96R =  max(mouth_sideways, 0) * (1 - 0.5 * %left_au_open) * (1 - %right_drop * jaw_drop * 0.25) * (1 - 0.5 * %biter)
	%AD30L =  max(-jaw_sideways, 0)
	%AD30R =  max(jaw_sideways, 0)
	%jaw_overage =  max(0, ((jaw_drop - 1) * (1 - presser) * (1 - %biter) * (1 - 0.5 *  max(%right_au_open, %left_au_open))))
	%jaw_underage =  min(jaw_drop, 1) - %jaw_overage
	%jaw_blend = jaw_drop / (jaw_clencher + jaw_drop)
	%AU26R = %jaw_underage * (1 - %right_drop) * %jaw_blend
	%AU26L = %jaw_underage * (1 - %left_drop) * %jaw_blend
	%AU27R = %jaw_underage * %right_drop * %jaw_blend
	%AU27L = %jaw_underage * %left_drop * %jaw_blend
	%AU26ZR = %jaw_overage * (1 - %right_drop) * %jaw_blend
	%AU26ZL = %jaw_overage * (1 - %left_drop) * %jaw_blend
	%AU27ZR = %jaw_overage * %right_drop * %jaw_blend
	%AU27ZL = %jaw_overage * %left_drop * %jaw_blend
	%AU22ZR =  max(0, (%AU22R - 1))
	%AU22ZL =  max(0, (%AU22L - 1))
	%AU22R =  min(%AU22R, 1) - %AU22ZR
	%AU22L =  min(%AU22L, 1) - %AU22ZL
	%AU16L = %lower_lip_active * %left_lip_suppressor * (1 - %left_au_open)
	%AU16R = %lower_lip_active * %right_lip_suppressor * (1 - %right_au_open)
	%mouth = %AU27R * 0.5 + %AU27L * 0.5 + %AU27ZR * 0.5 + %AU27ZL * 0.5 + %AU26ZR * 0.35 + %AU26ZL * 0.35 + %AU22R * 0.35 + %AU22L * 0.35 + %AU18R * 0.25 + %AU18L * 0.25 + %AU25R * 0.35 + %AU25L * 0.35 + %AU32 * 0.5 + %AU12AU25R * 0.5 + %AU12AU25L * 0.5 + %AU16L * 0.3 + %AU16R * 0.3 + %AU10R * 0.5 + %AU10L * 0.5
	%AU13R = right_cheek_puffer *  max(0, (1 - %mouth * 3))
	%AU13L = left_cheek_puffer *  max(0, (1 - %mouth * 3))
}

and then I compile without error in compile process

https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-frc3/t31.0-8/10338586_640949352665912_1333670329787329156_o.jpg

but the result was horrible because most of slide control won’t work, it’s nothing happen when I try slide it, and some slide control flex go into wrong direction like this

https://scontent-a-sin.xx.fbcdn.net/hphotos-frc3/t31.0-8/10269138_640949412665906_6719172844034059102_o.jpg

Totally not look “blink” at all

https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-prn2/t31.0-8/10348943_640950179332496_7516587251523326138_o.jpg

Nose dilator become lips pucker

https://scontent-a-sin.xx.fbcdn.net/hphotos-frc3/t31.0-8/10380562_640950432665804_5525978925607240546_o.jpg

Lip bite become lip presser

https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-frc3/t31.0-8/10355517_640950502665797_8364551961686783075_o.jpg

but lip presser become lip bite ???

and many problem …

So I guess it must be problem about facial flex qc command which I copied entirely from Zoey qc command without edit it, or it maybe my facial flex shape key problem,

As I said this is my noobly question because I really don’t understand qc command about how it control facial flex, so I need your help for guide me about how to correct qc code or something else that can make facial animation work properly.

Thank You.

But moreover, I create 50 flexes but when I compile it said 55 flexes in command process, don’t know why is something wrong or not.


bones        32084 bytes (110)
animations    2260 bytes (2 anims) (3 frames) [0:00]
sequences   198048 bytes (930 seq)
ik/pose      12636 bytes
eyeballs       344 bytes (2 eyeballs)
**flexes      603312 bytes (55 flexes)**
textures      1164 bytes
keyvalues        0 bytes
bone transforms    15224 bytes

I’m thinking you might have missed or omitted a flex early on. Make sure your base shapes are in the correct order, if one is missing, all of the flexes will be misplaced.

Also for future reference, everything past shape 40 is defunct and unused in the compilation process. That should save you some time.

Thank you for advice, I really missed a flex as you said by put some flex in wrong frame and cause all of the flexes misplaced.

After I fix it, some flexes seem to correct.

“chin_raiser” now correct

https://scontent-a-sin.xx.fbcdn.net/hphotos-prn2/t31.0-8/10256790_642760739151440_194600206587177737_o.jpg

“bite” work

https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-prn1/t31.0-8/10379633_642760839151430_3479279162984491273_o.jpg

“presser” and “tightener” work

https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-prn1/t31.0-8/10257593_642760882484759_3742799160988575581_o.jpg

“jaw_drop” work

https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-ash3/t31.0-8/1912443_642760885818092_9031352146410646188_o.jpg

“mouth_sideways” work

https://scontent-a-sin.xx.fbcdn.net/hphotos-prn2/t31.0-8/10293752_642761102484737_3463469335201105728_o.jpg

https://scontent-a-sin.xx.fbcdn.net/hphotos-prn2/l/t31.0-8/10296012_642903772470470_8748814497236462331_o.jpg

But some still not work properly such as.

Flex control “left_lid_tightener” work.

https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-frc3/t31.0-8/10256701_642768819150632_4629321708479290446_o.jpg

But flex control “right_lid_tightener” won’t work

https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-prn1/t31.0-8/10371279_642760579151456_8603572425276568843_o.jpg

“blink” supposed to close both eyes but now only close left eye.

https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-ash4/t31.0-8/1795272_642760575818123_7593830299177620328_o.jpg

“left_lowerer” should lower left brow only but it lower both side of brow.

https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn1/t31.0-8/1956895_642760725818108_4074393697524968490_o.jpg

While “right_lowerer” do nothing.

https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash4/t31.0-8/10329710_642760742484773_3804097198386119238_o.jpg

And every “flexpair” which have right and left also have the same problem as above, when I drag flex control on left side, it moving both side but when I drag flex control on right side, nothing happen andI don’t know the cause of this issue.

And eyeball control also not moving either, I don’t know what cause this problem, it was qc eye wrong or something?

I will try to remove some unused flex as you said, I try decompiled some L4D2 custom model and I found some model only have 39 flexes.

Swap

to

.

Ftfy.

it might just be me, but it looks like the alpha channel in the eye texture is inverted, might just be me though, or HLMV

[editline]22nd May 2014[/editline]

i havent worked with source in awhile, atleast eyes.
ive been working with goldsource a lot more recently

[editline]22nd May 2014[/editline]

na, its fine, im just stupid