-
Notifications
You must be signed in to change notification settings - Fork 119
/
additional_assemble_script.py
1231 lines (1107 loc) · 72.2 KB
/
additional_assemble_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from sys import stderr
from maya import cmds, mel
def both_guis_loaded():
return gui_loaded() and analog_gui_loaded()
def gui_loaded():
return cmds_exists("CTRL_expressions")
def analog_gui_loaded():
return cmds_exists("GRP_C_eyesAim")
def run_after_assemble(head_group, head_rig_group, params):
if analog_gui_loaded():
adjust_aim_control()
if gui_loaded():
connect_expressions()
if analog_gui_loaded():
eyes_setup()
clean_up(head_group, head_rig_group)
if gui_loaded():
connect_neck_correctives()
if both_guis_loaded():
connect_follow_head()
print("Rig assemble finished")
# ****************************************************************************************************
def adjust_aim_control():
"""
This method would properly position aim controls based on the position of eye joints for specific characters.
"""
if not (
cmds_exists("FACIAL_C_FacialRoot")
and cmds_exists("FACIAL_L_Eye")
and cmds_exists("FACIAL_R_Eye")
):
return
facial_root_jnt = cmds_xform("FACIAL_C_FacialRoot", query=True, worldSpace=True, translation=True)
eye_jnt_left = cmds_xform("FACIAL_L_Eye", query=True, worldSpace=True, translation=True)
eye_jnt_right = cmds_xform("FACIAL_R_Eye", query=True, worldSpace=True, translation=True)
cmds_xform("LOC_C_eyeDriver", worldSpace=True, absolute=True, translation=facial_root_jnt)
cmds_xform("LOC_L_eyeDriver", worldSpace=True, absolute=True, translation=eye_jnt_left)
cmds_xform("LOC_R_eyeDriver", worldSpace=True, absolute=True, translation=eye_jnt_right)
cmds_xform("LOC_L_eyeAimUp", worldSpace=True, absolute=True, translation=eye_jnt_left)
cmds_set_attr("LOC_L_eyeAimUp.ty", 10.0)
cmds_xform("LOC_R_eyeAimUp", worldSpace=True, absolute=True, translation=eye_jnt_right)
cmds_set_attr("LOC_R_eyeAimUp.ty", 10.0)
cmds_space_locator(name="LOC_temp", absolute=True, position=[0.0, 0.0, 0.0])
root_orientation = cmds_xform(
"LOC_C_eyeDriver", query=True, worldSpace=True, rotation=True
)
cmds_xform("LOC_temp", worldSpace=True, absolute=True, rotation=root_orientation)
cmds_parent("GRP_L_eyeAim", "LOC_temp")
cmds_xform("GRP_L_eyeAim", worldSpace=True, absolute=True, translation=eye_jnt_left)
cmds_set_attr("GRP_L_eyeAim.tz", 30.0)
cmds_parent("GRP_R_eyeAim", "LOC_temp")
cmds_xform("GRP_R_eyeAim", worldSpace=True, absolute=True, translation=eye_jnt_right)
cmds_set_attr("GRP_R_eyeAim.tz", 30.0)
cmds_parent("GRP_C_eyesAim", "LOC_temp")
cmds_set_attr("GRP_C_eyesAim.tx", 0.0)
ty_grp_eye_aim_l = cmds_get_attr("GRP_L_eyeAim.ty")
ty_grp_eye_aim_r = cmds_get_attr("GRP_R_eyeAim.ty")
ty_grp_eye_aim_c = (ty_grp_eye_aim_l + ty_grp_eye_aim_r) / 2
cmds_set_attr("GRP_C_eyesAim.ty", ty_grp_eye_aim_c)
cmds_set_attr("GRP_C_eyesAim.tz", 30.0)
cmds_parent("GRP_L_eyeAim", "CTRL_C_eyesAim")
cmds_parent("GRP_R_eyeAim", "CTRL_C_eyesAim")
cmds_parent("GRP_C_eyesAim", world=True)
cmds_delete("LOC_temp")
cmds_parent("GRP_convergenceGUI", "CTRL_C_eyesAim")
cmds_set_attr("GRP_convergenceGUI.tx", 0.4)
cmds_set_attr("GRP_convergenceGUI.ty", 0.0)
cmds_set_attr("GRP_convergenceGUI.tz", 0.0)
# ****************************************************************************************************
def connect_expression(driverCtrl, driverAttr, minVal, maxVal, driverKey1, driverKey2, expCtrl, expAttr, expKey1,
expKey2):
"""
Connects one GUI control with raw control.
"""
# create driver attribute if dont exists
if not cmds_exists(f"{driverCtrl}.{driverAttr}"):
cmds_set_attr(driverCtrl, longName=driverAttr, keyable=True, attributeType="float", minValue=minVal,
maxValue=maxVal, dv=0.0)
# connect CTRL driver with driven expression
cmds_set_driven_keyframe(f"{expCtrl}.{expAttr}", itt="linear", ott="linear",
currentDriver=f"{driverCtrl}.{driverAttr}", driverValue=driverKey1, value=expKey1)
cmds_set_driven_keyframe(f"{expCtrl}.{expAttr}", itt="linear", ott="linear",
currentDriver=f"{driverCtrl}.{driverAttr}", driverValue=driverKey2, value=expKey2)
# ****************************************************************************************************
def connect_expressions():
"""
This method would connect GUI with raw controls. Raw controls are driven by rig logic while the user
manipulates GUI controls.
"""
# brows down
connect_expression("CTRL_L_brow_down", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browDownL", 0.0, 1.0)
connect_expression("CTRL_R_brow_down", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browDownR", 0.0, 1.0)
# brows lateral
connect_expression("CTRL_L_brow_lateral", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browLateralL", 0.0, 1.0)
connect_expression("CTRL_R_brow_lateral", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browLateralR", 0.0, 1.0)
# brows raise
connect_expression("CTRL_L_brow_raiseIn", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browRaiseInL", 0.0, 1.0)
connect_expression("CTRL_R_brow_raiseIn", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browRaiseInR", 0.0, 1.0)
connect_expression("CTRL_L_brow_raiseOut", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browRaiseOuterL", 0.0,
1.0)
connect_expression("CTRL_R_brow_raiseOut", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "browRaiseOuterR", 0.0,
1.0)
# ears up
connect_expression("CTRL_L_ear_up", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "earUpL", 0.0, 1.0)
connect_expression("CTRL_R_ear_up", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "earUpR", 0.0, 1.0)
# eyes widen/blink
connect_expression("CTRL_L_eye_blink", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeBlinkL", 0.0, 1.0)
connect_expression("CTRL_R_eye_blink", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeBlinkR", 0.0, 1.0)
connect_expression("CTRL_L_eye_blink", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyeWidenL", 0.0, 1.0)
connect_expression("CTRL_R_eye_blink", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyeWidenR", 0.0, 1.0)
# lid press
connect_expression("CTRL_L_eye_lidPress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeLidPressL", 0.0, 1.0)
connect_expression("CTRL_R_eye_lidPress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeLidPressR", 0.0, 1.0)
# eyes squint inner
connect_expression("CTRL_L_eye_squintInner", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeSquintInnerL", 0.0,
1.0)
connect_expression("CTRL_R_eye_squintInner", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeSquintInnerR", 0.0,
1.0)
# eyes cheek raise
connect_expression("CTRL_L_eye_cheekRaise", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeCheekRaiseL", 0.0,
1.0)
connect_expression("CTRL_R_eye_cheekRaise", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeCheekRaiseR", 0.0,
1.0)
# face scrunch
connect_expression("CTRL_L_eye_faceScrunch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeFaceScrunchL", 0.0,
1.0)
connect_expression("CTRL_R_eye_faceScrunch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeFaceScrunchR", 0.0,
1.0)
# eyelids up/down (and eyes relax)
connect_expression("CTRL_L_eye_eyelidU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyeUpperLidUpL", 0.0, 1.0)
connect_expression("CTRL_R_eye_eyelidU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyeUpperLidUpR", 0.0, 1.0)
connect_expression("CTRL_L_eye_eyelidU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeRelaxL", 0.0, 1.0)
connect_expression("CTRL_R_eye_eyelidU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeRelaxR", 0.0, 1.0)
connect_expression("CTRL_L_eye_eyelidD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyeLowerLidDownL", 0.0,
1.0)
connect_expression("CTRL_R_eye_eyelidD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyeLowerLidDownR", 0.0,
1.0)
connect_expression("CTRL_L_eye_eyelidD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeLowerLidUpL", 0.0, 1.0)
connect_expression("CTRL_R_eye_eyelidD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyeLowerLidUpR", 0.0, 1.0)
if analog_gui_loaded():
# eyes look up/down/left/right
connect_expression("LOC_L_eyeDriver", "rx", -30.0, 40.0, 0.0, -30.0, "CTRL_expressions", "eyeLookUpL", 0.0, 1.0)
connect_expression("LOC_R_eyeDriver", "rx", -30.0, 40.0, 0.0, -30.0, "CTRL_expressions", "eyeLookUpR", 0.0, 1.0)
connect_expression("LOC_L_eyeDriver", "rx", -30.0, 40.0, 0.0, 40.0, "CTRL_expressions", "eyeLookDownL", 0.0, 1.0)
connect_expression("LOC_R_eyeDriver", "rx", -30.0, 40.0, 0.0, 40.0, "CTRL_expressions", "eyeLookDownR", 0.0, 1.0)
connect_expression("LOC_L_eyeDriver", "ry", -40.0, 40.0, 0.0, 40.0, "CTRL_expressions", "eyeLookLeftL", 0.0, 1.0)
connect_expression("LOC_R_eyeDriver", "ry", -40.0, 40.0, 0.0, 40.0, "CTRL_expressions", "eyeLookLeftR", 0.0, 1.0)
connect_expression("LOC_L_eyeDriver", "ry", -40.0, 40.0, 0.0, -40.0, "CTRL_expressions", "eyeLookRightL", 0.0, 1.0)
connect_expression("LOC_R_eyeDriver", "ry", -40.0, 40.0, 0.0, -40.0, "CTRL_expressions", "eyeLookRightR", 0.0, 1.0)
# pupils wide/narrow
connect_expression("CTRL_L_eye_pupil", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyePupilWideL", 0.0, 1.0)
connect_expression("CTRL_R_eye_pupil", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyePupilWideR", 0.0, 1.0)
connect_expression("CTRL_L_eye_pupil", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyePupilNarrowL", 0.0, 1.0)
connect_expression("CTRL_R_eye_pupil", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyePupilNarrowR", 0.0, 1.0)
# eyes parallel
connect_expression("CTRL_C_eye_parallelLook", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"eyeParallelLookDirection", 0.0, 1.0)
# eyelashes tweakers
connect_expression("CTRL_L_eyelashes_tweakerIn", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyelashesDownINL",
0.0, 1.0)
connect_expression("CTRL_R_eyelashes_tweakerIn", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "eyelashesDownINR",
0.0, 1.0)
connect_expression("CTRL_L_eyelashes_tweakerOut", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"eyelashesDownOUTL",
0.0, 1.0)
connect_expression("CTRL_R_eyelashes_tweakerOut", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"eyelashesDownOUTR",
0.0, 1.0)
connect_expression("CTRL_L_eyelashes_tweakerIn", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyelashesUpINL",
0.0, 1.0)
connect_expression("CTRL_R_eyelashes_tweakerIn", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyelashesUpINR",
0.0, 1.0)
connect_expression("CTRL_L_eyelashes_tweakerOut", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyelashesUpOUTL",
0.0, 1.0)
connect_expression("CTRL_R_eyelashes_tweakerOut", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "eyelashesUpOUTR",
0.0, 1.0)
# nose wrinkle/depress/dilate/compress
connect_expression("CTRL_L_nose", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "noseWrinkleL", 0.0, 1.0)
connect_expression("CTRL_R_nose", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "noseWrinkleR", 0.0, 1.0)
connect_expression("CTRL_L_nose", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "noseNostrilDepressL", 0.0, 1.0)
connect_expression("CTRL_R_nose", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "noseNostrilDepressR", 0.0, 1.0)
connect_expression("CTRL_L_nose", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "noseNostrilDilateL", 0.0, 1.0)
connect_expression("CTRL_R_nose", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "noseNostrilDilateR", 0.0, 1.0)
connect_expression("CTRL_L_nose", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "noseNostrilCompressL", 0.0, 1.0)
connect_expression("CTRL_R_nose", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "noseNostrilCompressR", 0.0, 1.0)
# nose wrinkle upper
connect_expression("CTRL_L_nose_wrinkleUpper", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "noseWrinkleUpperL",
0.0, 1.0)
connect_expression("CTRL_R_nose_wrinkleUpper", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "noseWrinkleUpperR",
0.0, 1.0)
# nasolabial deepener
connect_expression("CTRL_L_nose_nasolabialDeepen", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"noseNasolabialDeepenL", 0.0, 1.0)
connect_expression("CTRL_R_nose_nasolabialDeepen", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"noseNasolabialDeepenR", 0.0, 1.0)
# cheek suck/blow
connect_expression("CTRL_L_mouth_suckBlow", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCheekBlowL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_suckBlow", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCheekBlowR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_suckBlow", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthCheekSuckL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_suckBlow", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthCheekSuckR", 0.0,
1.0)
# lips blow
connect_expression("CTRL_L_mouth_lipsBlow", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsBlowL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_lipsBlow", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsBlowR", 0.0,
1.0)
# mouth up/down/left/right
connect_expression("CTRL_C_mouth", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthUp", 0.0, 1.0)
connect_expression("CTRL_C_mouth", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthDown", 0.0, 1.0)
connect_expression("CTRL_C_mouth", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLeft", 0.0, 1.0)
connect_expression("CTRL_C_mouth", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthRight", 0.0, 1.0)
# upper lip raise
connect_expression("CTRL_L_mouth_upperLipRaise", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthUpperLipRaiseL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_upperLipRaise", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthUpperLipRaiseR",
0.0, 1.0)
# lower lip depress
connect_expression("CTRL_L_mouth_lowerLipDepress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLowerLipDepressL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_lowerLipDepress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLowerLipDepressR", 0.0, 1.0)
# corner pull
connect_expression("CTRL_L_mouth_cornerPull", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCornerPullL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_cornerPull", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCornerPullR", 0.0,
1.0)
# mouth stretch
connect_expression("CTRL_L_mouth_stretch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStretchL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_stretch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStretchR", 0.0, 1.0)
# mouth stretch lips close
connect_expression("CTRL_L_mouth_stretchLipsClose", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthStretchLipsCloseL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_stretchLipsClose", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthStretchLipsCloseR", 0.0, 1.0)
# dimpler
connect_expression("CTRL_L_mouth_dimple", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthDimpleL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_dimple", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthDimpleR", 0.0, 1.0)
# corner depress
connect_expression("CTRL_L_mouth_cornerDepress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthCornerDepressL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_cornerDepress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthCornerDepressR",
0.0, 1.0)
# mouth press
connect_expression("CTRL_L_mouth_pressU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthPressUL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_pressU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthPressUR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_pressD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthPressDL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_pressD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthPressDR", 0.0, 1.0)
# purse
connect_expression("CTRL_L_mouth_purseU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPurseUL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_purseU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPurseUR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_purseD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPurseDL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_purseD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPurseDR", 0.0,
1.0)
# lips towards
connect_expression("CTRL_L_mouth_towardsU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTowardsUL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_towardsU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTowardsUR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_towardsD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTowardsDL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_towardsD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTowardsDR", 0.0,
1.0)
# funnel
connect_expression("CTRL_L_mouth_funnelU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthFunnelUL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_funnelU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthFunnelUR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_funnelD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthFunnelDL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_funnelD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthFunnelDR", 0.0, 1.0)
# lips together
connect_expression("CTRL_L_mouth_lipsTogetherU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsTogetherUL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsTogetherU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsTogetherUR",
0.0, 1.0)
connect_expression("CTRL_L_mouth_lipsTogetherD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsTogetherDL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsTogetherD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsTogetherDR",
0.0, 1.0)
# upper lip bite
connect_expression("CTRL_L_mouth_lipBiteU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthUpperLipBiteL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_lipBiteU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthUpperLipBiteR", 0.0,
1.0)
# lower lip bite
connect_expression("CTRL_L_mouth_lipBiteD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLowerLipBiteL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_lipBiteD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLowerLipBiteR", 0.0,
1.0)
# lips tighten
connect_expression("CTRL_L_mouth_tightenU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTightenUL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_tightenU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTightenUR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_tightenD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTightenDL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_tightenD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsTightenDR", 0.0,
1.0)
# lips press
connect_expression("CTRL_L_mouth_lipsPressU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPressL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_lipsPressU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPressR", 0.0,
1.0)
# sharp corner pull
connect_expression("CTRL_L_mouth_sharpCornerPull", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthSharpCornerPullL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_sharpCornerPull", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthSharpCornerPullR", 0.0, 1.0)
# mouth sticky
connect_expression("CTRL_C_mouth_stickyU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyUC", 0.0, 1.0)
connect_expression("CTRL_L_mouth_stickyInnerU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyUINL",
0.0,
1.0)
connect_expression("CTRL_R_mouth_stickyInnerU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyUINR",
0.0,
1.0)
connect_expression("CTRL_L_mouth_stickyOuterU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyUOUTL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_stickyOuterU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyUOUTR",
0.0, 1.0)
connect_expression("CTRL_C_mouth_stickyD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyDC", 0.0, 1.0)
connect_expression("CTRL_L_mouth_stickyInnerD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyDINL",
0.0,
1.0)
connect_expression("CTRL_R_mouth_stickyInnerD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyDINR",
0.0,
1.0)
connect_expression("CTRL_L_mouth_stickyOuterD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyDOUTL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_stickyOuterD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthStickyDOUTR",
0.0, 1.0)
# sticky lips
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh1", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=0, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh1", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=0.33, value=1)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh1", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=0.66, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh2", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=0.33, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh2", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=0.66, value=1)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh2", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=1, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh3", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=0.66, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyLPh3", itt="linear", ott="linear",
currentDriver="CTRL_L_mouth_lipSticky.ty", driverValue=1, value=1)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh1", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=0, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh1", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=0.33, value=1)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh1", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=0.66, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh2", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=0.33, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh2", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=0.66, value=1)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh2", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=1, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh3", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=0.66, value=0)
cmds_set_driven_keyframe("CTRL_expressions.mouthLipsStickyRPh3", itt="linear", ott="linear",
currentDriver="CTRL_R_mouth_lipSticky.ty", driverValue=1, value=1)
# lips push/pull
connect_expression("CTRL_L_mouth_pushPullU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPushUL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_pushPullU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPushUR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_pushPullD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPushDL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_pushPullD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsPushDR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_pushPullU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsPullUL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_pushPullU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsPullUR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_pushPullD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsPullDL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_pushPullD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsPullDR", 0.0,
1.0)
# lips thin/thick
connect_expression("CTRL_L_mouth_thicknessU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsThinUL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_thicknessU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsThinUR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_thicknessD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsThinDL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_thicknessD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLipsThinDR", 0.0,
1.0)
connect_expression("CTRL_L_mouth_thicknessU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsThickUL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_thicknessU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsThickUR",
0.0, 1.0)
connect_expression("CTRL_L_mouth_thicknessD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsThickDL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_thicknessD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthLipsThickDR",
0.0, 1.0)
# lips thin/thick inward
connect_expression("CTRL_L_mouth_thicknessInwardU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsThinInwardUL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_thicknessInwardU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsThinInwardUR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_thicknessInwardD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsThinInwardDL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_thicknessInwardD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLipsThinInwardDR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_thicknessInwardU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLipsThickInwardUL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_thicknessInwardU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLipsThickInwardUR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_thicknessInwardD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLipsThickInwardDL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_thicknessInwardD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLipsThickInwardDR", 0.0, 1.0)
# corner sharpen
connect_expression("CTRL_L_mouth_cornerSharpnessU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthCornerSharpenUL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_cornerSharpnessU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthCornerSharpenUR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_cornerSharpnessD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthCornerSharpenDL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_cornerSharpnessD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthCornerSharpenDR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_cornerSharpnessU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthCornerRounderUL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_cornerSharpnessU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthCornerRounderUR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_cornerSharpnessD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthCornerRounderDL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_cornerSharpnessD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthCornerRounderDR", 0.0, 1.0)
# lips towards
connect_expression("CTRL_L_mouth_lipsTowardsTeethU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthUpperLipTowardsTeethL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsTowardsTeethU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthUpperLipTowardsTeethR", 0.0, 1.0)
connect_expression("CTRL_L_mouth_lipsTowardsTeethD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLowerLipTowardsTeethL", 0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsTowardsTeethD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLowerLipTowardsTeethR", 0.0, 1.0)
# lips shift
connect_expression("CTRL_C_mouth_lipShiftU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthUpperLipShiftLeft",
0.0, 1.0)
connect_expression("CTRL_C_mouth_lipShiftU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthUpperLipShiftRight", 0.0, 1.0)
connect_expression("CTRL_C_mouth_lipShiftD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"mouthLowerLipShiftLeft",
0.0, 1.0)
connect_expression("CTRL_C_mouth_lipShiftD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLowerLipShiftRight", 0.0, 1.0)
# lips roll
connect_expression("CTRL_L_mouth_lipsRollU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthUpperLipRollInL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsRollU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthUpperLipRollInR",
0.0, 1.0)
connect_expression("CTRL_L_mouth_lipsRollD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLowerLipRollInL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsRollD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthLowerLipRollInR",
0.0, 1.0)
connect_expression("CTRL_L_mouth_lipsRollU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthUpperLipRollOutL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsRollU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthUpperLipRollOutR",
0.0, 1.0)
connect_expression("CTRL_L_mouth_lipsRollD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLowerLipRollOutL",
0.0, 1.0)
connect_expression("CTRL_R_mouth_lipsRollD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"mouthLowerLipRollOutR",
0.0, 1.0)
# corners
connect_expression("CTRL_L_mouth_corner", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCornerUpL", 0.0, 1.0)
connect_expression("CTRL_L_mouth_corner", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthCornerDownL", 0.0,
1.0)
connect_expression("CTRL_L_mouth_corner", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCornerWideL", 0.0,
1.0)
connect_expression("CTRL_L_mouth_corner", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthCornerNarrowL", 0.0,
1.0)
connect_expression("CTRL_R_mouth_corner", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCornerUpR", 0.0, 1.0)
connect_expression("CTRL_R_mouth_corner", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthCornerDownR", 0.0,
1.0)
connect_expression("CTRL_R_mouth_corner", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "mouthCornerWideR", 0.0,
1.0)
connect_expression("CTRL_R_mouth_corner", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "mouthCornerNarrowR", 0.0,
1.0)
# tongue move up/down/left/right
connect_expression("CTRL_C_tongue_move", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueUp", 0.0, 1.0)
connect_expression("CTRL_C_tongue_move", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueDown", 0.0, 1.0)
connect_expression("CTRL_C_tongue_move", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueLeft", 0.0, 1.0)
connect_expression("CTRL_C_tongue_move", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueRight", 0.0, 1.0)
# tongue in/out
connect_expression("CTRL_C_tongue_inOut", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueIn", 0.0, 1.0)
connect_expression("CTRL_C_tongue_inOut", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueOut", 0.0, 1.0)
# tongue bend up/down and twist left/right
connect_expression("CTRL_C_tongue_bendTwist", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueBendUp", 0.0,
1.0)
connect_expression("CTRL_C_tongue_bendTwist", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueBendDown", 0.0,
1.0)
connect_expression("CTRL_C_tongue_bendTwist", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueTwistLeft", 0.0,
1.0)
connect_expression("CTRL_C_tongue_bendTwist", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueTwistRight",
0.0, 1.0)
# tongue tip move up/down/left/right
connect_expression("CTRL_C_tongue_tipMove", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueTipUp", 0.0, 1.0)
connect_expression("CTRL_C_tongue_tipMove", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueTipDown", 0.0,
1.0)
connect_expression("CTRL_C_tongue_tipMove", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueTipLeft", 0.0, 1.0)
connect_expression("CTRL_C_tongue_tipMove", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueTipRight", 0.0,
1.0)
# tongue wide/narrow
connect_expression("CTRL_C_tongue_wideNarrow", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueWide", 0.0, 1.0)
connect_expression("CTRL_C_tongue_wideNarrow", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueNarrow", 0.0,
1.0)
# tongue press
connect_expression("CTRL_C_tongue_press", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tonguePress", 0.0, 1.0)
# tongue roll
connect_expression("CTRL_C_tongue_roll", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueRoll", 0.0, 1.0)
# tongue thick/thin
connect_expression("CTRL_C_tongue_thickThin", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "tongueThick", 0.0, 1.0)
connect_expression("CTRL_C_tongue_thickThin", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "tongueThin", 0.0, 1.0)
# jaw open
connect_expression("CTRL_C_jaw", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawOpen", 0.0, 1.0)
# jaw left/right
connect_expression("CTRL_C_jaw", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "jawLeft", 0.0, 1.0)
connect_expression("CTRL_C_jaw", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawRight", 0.0, 1.0)
# jaw back/fwd
connect_expression("CTRL_C_jaw_fwdBack", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "jawFwd", 0.0, 1.0)
connect_expression("CTRL_C_jaw_fwdBack", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawBack", 0.0, 1.0)
# jaw clench
connect_expression("CTRL_L_jaw_clench", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawClenchL", 0.0, 1.0)
connect_expression("CTRL_R_jaw_clench", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawClenchR", 0.0, 1.0)
# chin raise
connect_expression("CTRL_L_jaw_ChinRaiseU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawChinRaiseUL", 0.0,
1.0)
connect_expression("CTRL_R_jaw_ChinRaiseU", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawChinRaiseUR", 0.0,
1.0)
connect_expression("CTRL_L_jaw_ChinRaiseD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawChinRaiseDL", 0.0,
1.0)
connect_expression("CTRL_R_jaw_ChinRaiseD", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawChinRaiseDR", 0.0,
1.0)
# chin compress
connect_expression("CTRL_L_jaw_chinCompress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawChinCompressL", 0.0,
1.0)
connect_expression("CTRL_R_jaw_chinCompress", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawChinCompressR", 0.0,
1.0)
# jaw open extreme
connect_expression("CTRL_C_jaw_openExtreme", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "jawOpenExtreme", 0.0,
1.0)
# neck stretch
connect_expression("CTRL_L_neck_stretch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "neckStretchL", 0.0, 1.0)
connect_expression("CTRL_R_neck_stretch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "neckStretchR", 0.0, 1.0)
# swallow
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh1", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh1", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.2, value=1)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh1", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.4, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh2", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.2, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh2", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.4, value=1)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh2", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.6, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh3", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.4, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh3", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.6, value=1)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh3", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.8, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh4", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.6, value=0)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh4", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=0.8, value=1)
cmds_set_driven_keyframe("CTRL_expressions.neckSwallowPh4", itt="linear", ott="linear",
currentDriver="CTRL_C_neck_swallow.ty", driverValue=1, value=0)
# mastoid contract
connect_expression("CTRL_L_neck_mastoidContract", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"neckMastoidContractL", 0.0, 1.0)
connect_expression("CTRL_R_neck_mastoidContract", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"neckMastoidContractR", 0.0, 1.0)
# throat down/up
connect_expression("CTRL_neck_throatUpDown", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "neckThroatDown", 0.0,
1.0)
connect_expression("CTRL_neck_throatUpDown", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "neckThroatUp", 0.0,
1.0)
# digastric down/up
connect_expression("CTRL_neck_digastricUpDown", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "neckDigastricDown",
0.0, 1.0)
connect_expression("CTRL_neck_digastricUpDown", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "neckDigastricUp",
0.0, 1.0)
# exhale/inhale
connect_expression("CTRL_neck_throatExhaleInhale", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions",
"neckThroatExhale", 0.0, 1.0)
connect_expression("CTRL_neck_throatExhaleInhale", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions",
"neckThroatInhale",
0.0, 1.0)
# upper teeth
connect_expression("CTRL_C_teethU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "teethUpU", 0.0, 1.0)
connect_expression("CTRL_C_teethU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "teethDownU", 0.0, 1.0)
connect_expression("CTRL_C_teethU", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "teethLeftU", 0.0, 1.0)
connect_expression("CTRL_C_teethU", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "teethRightU", 0.0, 1.0)
connect_expression("CTRL_C_teeth_fwdBackU", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "teethBackU", 0.0, 1.0)
connect_expression("CTRL_C_teeth_fwdBackU", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "teethFwdU", 0.0, 1.0)
# lower teeth
connect_expression("CTRL_C_teethD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "teethUpD", 0.0, 1.0)
connect_expression("CTRL_C_teethD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "teethDownD", 0.0, 1.0)
connect_expression("CTRL_C_teethD", "tx", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "teethLeftD", 0.0, 1.0)
connect_expression("CTRL_C_teethD", "tx", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "teethRightD", 0.0, 1.0)
connect_expression("CTRL_C_teeth_fwdBackD", "ty", -1.0, 1.0, 0.0, 1.0, "CTRL_expressions", "teethBackD", 0.0, 1.0)
connect_expression("CTRL_C_teeth_fwdBackD", "ty", -1.0, 1.0, 0.0, -1.0, "CTRL_expressions", "teethFwdD", 0.0, 1.0)
# look at switch
cmds_add_attr("CTRL_expressions", longName="lookAtSwitch", attributeType="float", defaultValue=0.0, minValue=0.0,
maxValue=1.0, keyable=1)
connect_expression("CTRL_lookAtSwitch", "ty", 0.0, 1.0, 0.0, 1.0, "CTRL_expressions", "lookAtSwitch", 0.0, 1.0)
# ****************************************************************************************************
def eyes_setup():
"""
This method would create proper eys setup meaning that it would connect GUI controls
with raw controls for look expressions.
"""
jntEyeL = "FACIAL_L_Eye"
locEyeL = "LOC_L_eyeDriver"
locUIEyeL = "LOC_L_eyeUIDriver"
locAimEyeL = "LOC_L_eyeAimDriver"
locAimUpL = "LOC_L_eyeAimUp"
offGrpEyeL = "GRP_L_eyeAim"
ctrlEyeL = "CTRL_L_eyeAim"
ctrlUIEyeL = "CTRL_L_eye"
jntEyeR = "FACIAL_R_Eye"
locEyeR = "LOC_R_eyeDriver"
locUIEyeR = "LOC_R_eyeUIDriver"
locAimEyeR = "LOC_R_eyeAimDriver"
locAimUpR = "LOC_R_eyeAimUp"
offGrpEyeR = "GRP_R_eyeAim"
ctrlEyeR = "CTRL_R_eyeAim"
ctrlUIEyeR = "CTRL_R_eye"
ctrlUIEyeC = "CTRL_C_eye"
attrAimAt = "CTRL_expressions.lookAtSwitch"
offGrp = "GRP_C_eyesAim"
locEyeRoot = "LOC_C_eyeDriver"
eye_setup(jntEyeL, locEyeL, locUIEyeL, locAimEyeL, ctrlEyeL, ctrlUIEyeL, attrAimAt, ctrlUIEyeC, locEyeRoot,
locAimUpL)
eye_setup(jntEyeR, locEyeR, locUIEyeR, locAimEyeR, ctrlEyeR, ctrlUIEyeR, attrAimAt, ctrlUIEyeC, locEyeRoot,
locAimUpR)
# create visibility switch
cmds_set_driven_keyframe(f"{offGrp}.visibility", itt="linear", ott="linear", currentDriver=attrAimAt,
driverValue=0,
value=0)
cmds_set_driven_keyframe(f"{offGrp}.visibility", itt="linear", ott="linear", currentDriver=attrAimAt,
driverValue=1,
value=1)
# connect convergence attribute
current_tzl = cmds_get_attr(f"{offGrpEyeL}.tz")
current_tzr = cmds_get_attr(f"{offGrpEyeR}.tz")
cmds_set_driven_keyframe(f"{offGrpEyeL}.tz", itt="linear", ott="linear",
currentDriver="CTRL_convergenceSwitch.ty", driverValue=0, value=current_tzl)
cmds_set_driven_keyframe(f"{offGrpEyeL}.tz", itt="linear", ott="linear",
currentDriver="CTRL_convergenceSwitch.ty", driverValue=1, value=0)
cmds_set_driven_keyframe(f"{offGrpEyeR}.tz", itt="linear", ott="linear",
currentDriver="CTRL_convergenceSwitch.ty", driverValue=0, value=current_tzr)
cmds_set_driven_keyframe(f"{offGrpEyeR}.tz", itt="linear", ott="linear",
currentDriver="CTRL_convergenceSwitch.ty", driverValue=1, value=0)
# look direction splines
cmds_curve(degree=1, point=([0, 0, 0], [0, 0, 0]), knot=(0, 1), name="L_lookDirection")
cmds_set_attr("L_lookDirection.overrideEnabled", 1)
cmds_set_attr("L_lookDirection.overrideColor", 1)
cmds_set_attr("L_lookDirection.overrideDisplayType", 2)
cmds_curve(degree=1, point=([0, 0, 0], [0, 0, 0]), knot=(0, 1), name="R_lookDirection")
cmds_set_attr("R_lookDirection.overrideEnabled", 1)
cmds_set_attr("R_lookDirection.overrideColor", 1)
cmds_set_attr("R_lookDirection.overrideDisplayType", 2)
cmds_select("L_lookDirection.cv[0]", r=True)
cmds_cluster(name="L_lookDirStart")
cmds_set_attr("L_lookDirStartHandle.visibility", 0)
cmds_select("L_lookDirection.cv[1]", r=True)
cmds_cluster(name="L_lookDirEnd")
cmds_set_attr("L_lookDirEndHandle.visibility", 0)
cmds_select("R_lookDirection.cv[0]", r=True)
cmds_cluster(name="R_lookDirStart")
cmds_set_attr("R_lookDirStartHandle.visibility", 0)
cmds_select("R_lookDirection.cv[1]", r=True)
cmds_cluster(name="R_lookDirEnd")
cmds_set_attr("R_lookDirEndHandle.visibility", 0)
if cmds_exists(jntEyeL):
cmds_point_constraint(jntEyeL, "L_lookDirStartHandle")
cmds_point_constraint(ctrlEyeL, "L_lookDirEndHandle")
if cmds_exists(jntEyeR):
cmds_point_constraint(jntEyeR, "R_lookDirStartHandle")
cmds_point_constraint(ctrlEyeR, "R_lookDirEndHandle")
# create look direction splines visibility switch
cmds_set_driven_keyframe("L_lookDirection.visibility", itt="linear", ott="linear", currentDriver=attrAimAt,
driverValue=0, value=0)
cmds_set_driven_keyframe("L_lookDirection.visibility", itt="linear", ott="linear", currentDriver=attrAimAt,
driverValue=1, value=1)
cmds_set_driven_keyframe("R_lookDirection.visibility", itt="linear", ott="linear", currentDriver=attrAimAt,
driverValue=0, value=0)
cmds_set_driven_keyframe("R_lookDirection.visibility", itt="linear", ott="linear", currentDriver=attrAimAt,
driverValue=1, value=1)
# ****************************************************************************************************
def eye_setup(jnt_eye, loc_eye, loc_ui_eye, loc_aim_eye, ctrl_eye, ctrl_ui_eye, attr_aim_at, ctrl_ui_eye_c,
loc_eye_root, loc_aim_up):
"""
Setup for one eye.
"""
if cmds_exists(jnt_eye):
jnt_pos = cmds_xform(jnt_eye, query=True, worldSpace=True, translation=True)
# position and create locators
cmds_xform(loc_eye, worldSpace=True, absolute=True, translation=jnt_pos)
cmds_space_locator(name=loc_ui_eye)
cmds_xform(loc_ui_eye, worldSpace=True, absolute=True, translation=jnt_pos)
cmds_set_attr(f"{loc_ui_eye}.visibility", 0)
cmds_set_attr(f"{loc_ui_eye}.rx", 0.0)
cmds_set_attr(f"{loc_ui_eye}.ry", 0.0)
cmds_set_attr(f"{loc_ui_eye}.rz", 0.0)
cmds_parent(loc_ui_eye, loc_eye_root)
cmds_space_locator(name=loc_aim_eye)
if cmds_exists(jnt_eye):
cmds_xform(loc_aim_eye, worldSpace=True, absolute=True, translation=jnt_pos)
cmds_set_attr(f"{loc_aim_eye}.visibility", 0)
cmds_parent(loc_aim_eye, loc_eye_root)
cmds_set_attr(f"{loc_aim_eye}.rx", 0.0)
cmds_set_attr(f"{loc_aim_eye}.ry", 0.0)
cmds_set_attr(f"{loc_aim_eye}.rz", 0.0)
# connect aim loc
cmds_aim_constraint(ctrl_eye, loc_aim_eye, mo=True, weight=1, aimVector=[0, 0, 1], upVector=[0, 1, 0],
worldUpType="object", worldUpObject=loc_aim_up)
orient_list = cmds_orient_constraint(loc_aim_eye, loc_eye)
orient_aim_con = ""
if orient_list and len(orient_list) > 0:
orient_aim_con = orient_list[0]
if cmds_exists(loc_ui_eye):
# connect ui loc to L/R control
cmds_set_driven_keyframe(f"{loc_ui_eye}.ry", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye}.tx",
driverValue=0, value=0)
cmds_set_driven_keyframe(f"{loc_ui_eye}.ry", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye}.tx",
driverValue=1, value=40)
cmds_set_driven_keyframe(f"{loc_ui_eye}.ry", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye}.tx",
driverValue=-1, value=-40)
cmds_set_driven_keyframe(f"{loc_ui_eye}.rx", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye}.ty",
driverValue=0, value=0)
cmds_set_driven_keyframe(f"{loc_ui_eye}.rx", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye}.ty",
driverValue=1, value=-30)
cmds_set_driven_keyframe(f"{loc_ui_eye}.rx", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye}.ty",
driverValue=-1, value=40)
# connect ui loc to C control
cmds_set_driven_keyframe(f"{loc_ui_eye}.ry", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye_c}.tx",
driverValue=0, value=0)
cmds_set_driven_keyframe(f"{loc_ui_eye}.ry", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye_c}.tx",
driverValue=1, value=40)
cmds_set_driven_keyframe(f"{loc_ui_eye}.ry", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye_c}.tx",
driverValue=-1, value=-40)
cmds_set_driven_keyframe(f"{loc_ui_eye}.rx", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye_c}.ty",
driverValue=0, value=0)
cmds_set_driven_keyframe(f"{loc_ui_eye}.rx", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye_c}.ty",
driverValue=1, value=-30)
cmds_set_driven_keyframe(f"{loc_ui_eye}.rx", itt="linear", ott="linear", currentDriver=f"{ctrl_ui_eye_c}.ty",
driverValue=-1, value=40)
constraint_list = cmds_orient_constraint(loc_ui_eye, loc_eye)
orient_ui_con = ""
if constraint_list and len(constraint_list) > 0:
orient_ui_con = constraint_list[0]
# create aim at switch
cmds_set_driven_keyframe(f"{orient_aim_con}.{loc_aim_eye}W0", itt="linear", ott="linear",
currentDriver=attr_aim_at,
driverValue=0, value=0)
cmds_set_driven_keyframe(f"{orient_aim_con}.{loc_aim_eye}W0", itt="linear", ott="linear",
currentDriver=attr_aim_at,
driverValue=1, value=1)
cmds_set_driven_keyframe(f"{orient_ui_con}.{loc_ui_eye}W1", itt="linear", ott="linear",
currentDriver=attr_aim_at,
driverValue=0, value=1)
cmds_set_driven_keyframe(f"{orient_ui_con}.{loc_ui_eye}W1", itt="linear", ott="linear",
currentDriver=attr_aim_at,
driverValue=1, value=0)
# ****************************************************************************************************
def clean_up(head_group, head_rig_group):
"""
This method is responsible for hierarchical organization of objects in the scene.
"""
# deleting layers
layers = ["sculpted_layer", "corrective_layer", "joints_layer",
"head_mesh_layer", "teeth_mesh_layer", "saliva_mesh_layer", "eyeLeft_mesh_layer", "eyeRight_mesh_layer",
"eyeshell_mesh_layer", "eyelashes_mesh_layer", "eyeEdge_mesh_layer", "cartilage_mesh_layer",
"headMatchPass1_mesh_layer", "headMatchPass2_mesh_layer", "headMatchPass3_mesh_layer",
"head_lod1_mesh_layer", "teeth_lod1_mesh_layer", "saliva_lod1_mesh_layer", "eyeLeft_lod1_mesh_layer",
"eyeRight_lod1_mesh_layer", "eyeshell_lod1_mesh_layer", "eyelashes_lod1_mesh_layer",
"eyeEdge_lod1_mesh_layer", "cartilage_lod1_mesh_layer",
"head_lod2_mesh_layer", "teeth_lod2_mesh_layer", "saliva_lod2_mesh_layer", "eyeLeft_lod2_mesh_layer",
"eyeRight_lod2_mesh_layer", "eyeshell_lod2_mesh_layer", "eyelashes_lod2_mesh_layer",
"eyeEdge_lod2_mesh_layer",
"head_lod3_mesh_layer", "teeth_lod3_mesh_layer", "eyeLeft_lod3_mesh_layer", "eyeRight_lod3_mesh_layer",
"eyeshell_lod3_mesh_layer", "eyelashes_lod3_mesh_layer", "eyeEdge_lod3_mesh_layer",
"head_lod4_mesh_layer", "teeth_lod4_mesh_layer", "eyeLeft_lod4_mesh_layer", "eyeRight_lod4_mesh_layer",
"eyeshell_lod4_mesh_layer",
"head_lod5_mesh_layer", "teeth_lod5_mesh_layer", "eyeLeft_lod5_mesh_layer", "eyeRight_lod5_mesh_layer",
"head_lod6_mesh_layer", "teeth_lod6_mesh_layer", "eyeLeft_lod6_mesh_layer", "eyeRight_lod6_mesh_layer",
"head_lod7_mesh_layer", "teeth_lod7_mesh_layer", "eyeLeft_lod7_mesh_layer", "eyeRight_lod7_mesh_layer"]
for layer in layers:
if cmds_exists(layer):
cmds_delete(layer)
if cmds_exists(head_rig_group):
cmds_group(parent=head_rig_group, empty=True, name="headRigging_grp")
cmds_group(parent=head_rig_group, empty=True, name="headGui_grp")
cmds_group(parent=head_group, empty=True, name="morphs_grp")
cmds_set_attr("morphs_grp.visibility", 0)
if cmds.ls("corrective_*"):
cmds_parent("corrective_*", "morphs_grp")
cmds_delete("morphs_grp")
if cmds_exists("headRigging_grp"):
cmds_group(parent="headRigging_grp", empty=True, name="eyesSetup_grp")
if both_guis_loaded() and cmds_exists("headGui_grp"):
cmds_parent("GRP_C_eyesAim", "headGui_grp") # eyes aim GUI
cmds_parent("GRP_faceGUI", "headGui_grp") # 2D GUI
# look direction clusters and splines
look_dir_cmds = cmds.ls("*lookDir*")
for cmd in look_dir_cmds:
obj_type = cmds_object_type(cmd).strip()
if obj_type not in ("clusterHandle", "cluster", "animCurveUU"):
cmds_parent(cmd, "eyesSetup_grp")
cmds_parent("LOC_C_eyeDriver", "eyesSetup_grp") # eyes setup
if cmds_exists("FACIAL_C_FacialRoot"):
cmds_parent_constraint(
["FACIAL_C_FacialRoot", "LOC_C_eyeDriver"], maintainOffset=True
)
cmds_delete("gui")
cmds_delete("analog_gui")
for lod in range(10):
layer_name = f"head_lod{lod}_layer.visibility"
if cmds_exists(layer_name):
cmds_set_attr(layer_name, 0)
if cmds_exists("head_lod0_layer.visibility"):
cmds_set_attr("head_lod0_layer.visibility", 1)
if gui_loaded():
# CTRL_expressions visibility
cmds_set_attr("CTRL_expressions.visibility", keyable=True, lock=False)
cmds_set_attr("CTRL_expressions.visibility", 0)
cmds_set_attr(
"CTRL_expressions.visibility", lock=True, keyable=False, channelBox=False
)
# deleting body joints animation
body_joints = ["spine_04", "spine_05", "clavicle_l", "upperarm_l", "upperarm_correctiveRoot_l", "upperarm_out_l",
"upperarm_fwd_l", "upperarm_in_l", "upperarm_bck_l", "clavicle_out_l", "clavicle_scap_l",
"clavicle_r", "upperarm_r", "upperarm_correctiveRoot_r", "upperarm_out_r", "upperarm_fwd_r",
"upperarm_in_r", "upperarm_bck_r", "clavicle_out_r", "clavicle_scap_r", "clavicle_pec_l",
"clavicle_pec_r", "spine_04_latissimus_l", "spine_04_latissimus_r", "neck_01", "neck_02", "head"]
mel_eval("source channelBoxCommand.mel;")
for joint in body_joints:
if cmds_exists(joint):
mel_eval(f'CBdeleteConnection ("{joint}.sx");')
mel_eval(f'CBdeleteConnection ("{joint}.sy");')
mel_eval(f'CBdeleteConnection ("{joint}.sz");')
mel_eval(f'CBdeleteConnection ("{joint}.tx");')
mel_eval(f'CBdeleteConnection ("{joint}.ty");')
mel_eval(f'CBdeleteConnection ("{joint}.tz");')
mel_eval(f'CBdeleteConnection ("{joint}.rx");')
mel_eval(f'CBdeleteConnection ("{joint}.ry");')
mel_eval(f'CBdeleteConnection ("{joint}.rz");')
# far and near clip plane
cmds_set_attr("perspShape.nearClipPlane", 5)
cmds_set_attr("perspShape.farClipPlane", 5000)
# ****************************************************************************************************
def rename_skin_clusters():
cmds_rename("head_mesh_skinCluster", "head_lod0_mesh_skinCluster")
cmds_rename("teeth_mesh_skinCluster", "teeth_lod0_mesh_skinCluster")
cmds_rename("saliva_mesh_skinCluster", "saliva_lod0_mesh_skinCluster")
cmds_rename("eyeLeft_mesh_skinCluster", "eyeLeft_lod0_mesh_skinCluster")
cmds_rename("eyeRight_mesh_skinCluster", "eyeRight_lod0_mesh_skinCluster")
cmds_rename("eyeshell_mesh_skinCluster", "eyeshell_lod0_mesh_skinCluster")
cmds_rename("eyelashes_mesh_skinCluster", "eyelashes_lod0_mesh_skinCluster")
cmds_rename("eyeEdge_mesh_skinCluster", "eyeEdge_lod0_mesh_skinCluster")
cmds_rename("cartilage_mesh_skinCluster", "cartilage_lod0_mesh_skinCluster")
# ****************************************************************************************************
def connect_neck_correctives():
"""
This method is used for neck setup. Neck deformations are not only coming from the GUI but also
from movement of the body. It will connect neck joint rotations with raw controls for corrective blendshapes
for neck turn expressions.
"""
# connect joint matrices with setup
cmds_connect_attr("head.matrix", "head_RBFdecomposeMatrix.inputMatrix")
cmds_connect_attr("neck_02.matrix", "neck_02_RBFdecomposeMatrix.inputMatrix")
cmds_connect_attr("neck_01.matrix", "neck_01_RBFdecomposeMatrix.inputMatrix")
# connect joints rotations (without JO) with setup
cmds_connect_attr("head.rx", "head_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dx")
cmds_connect_attr("head.ry", "head_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dy")
cmds_connect_attr("head.rz", "head_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dz")
cmds_connect_attr("neck_02.rx", "neck_02_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dx")
cmds_connect_attr("neck_02.ry", "neck_02_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dy")
cmds_connect_attr("neck_02.rz", "neck_02_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dz")
cmds_connect_attr("neck_01.rx", "neck_01_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dx")
cmds_connect_attr("neck_01.ry", "neck_01_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dy")
cmds_connect_attr("neck_01.rz", "neck_01_rotateOffsetFromNeutral_RBFdiff.input3D[0].input3Dz")
# updating values for zero outing
head_tx = cmds_get_attr("head.tx")
cmds_set_attr("head_translateOffsetFromNeutral_RBFdiff.input3D[1].input3Dx", head_tx)
head_ty = cmds_get_attr("head.ty")
cmds_set_attr("head_translateOffsetFromNeutral_RBFdiff.input3D[1].input3Dy", head_ty)
head_tz = cmds_get_attr("head.tz")
cmds_set_attr("head_translateOffsetFromNeutral_RBFdiff.input3D[1].input3Dz", head_tz)
head_rx = cmds_get_attr("head.rx")
cmds_set_attr("head_rotateOffsetFromNeutral_RBFdiff.input3D[1].input3Dx", head_rx)
head_ry = cmds_get_attr("head.ry")
cmds_set_attr("head_rotateOffsetFromNeutral_RBFdiff.input3D[1].input3Dy", head_ry)
head_rz = cmds_get_attr("head.rz")
cmds_set_attr("head_rotateOffsetFromNeutral_RBFdiff.input3D[1].input3Dz", head_rz)
neck_02_tx = cmds_get_attr("neck_02.tx")
cmds_set_attr("neck_02_translateOffsetFromNeutral_RBFdiff.input3D[1].input3Dx", neck_02_tx)
neck_02_ty = cmds_get_attr("neck_02.ty")
cmds_set_attr("neck_02_translateOffsetFromNeutral_RBFdiff.input3D[1].input3Dy", neck_02_ty)
neck_02_tz = cmds_get_attr("neck_02.tz")