-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kemono-Body-Script.lsl
1990 lines (1705 loc) · 61.5 KB
/
Kemono-Body-Script.lsl
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
/* <-- Enlarge window so you see this on only one line for better visibility -->
Aftermarket Kemono Body Script Replacement by Xenhat Liamano @ Second Life
Original creation date: 6/06/2017 22:52:37
The latest version of this script is located at:
https://github.com/XenHat/Kemono-Body-Script/
License: https://tldrlegal.com/license/aladdin-free-public-license
*/
float g_Config_MaximumOpacity = 1.00; // 0.8 // for goo
vector g_Config_BladeColor = <1, 1, 1>;
integer g_Config_EnsureMaskingMode = 1;
/* Debugging */
// #define DEBUG_SELF_TEST
/* TODO: Remove no longer needed code toggles here */
/* End of debug defines */
/* Normal Features that should be enabled */
integer anim_count;
/* Optional features, if you need them. */
// #define SMART_DEFORM
// ============================================================================
/*-------------------------------------------------------------------------- */
/* NO USER-EDITABLE VALUES BELOW THIS LINE */
// =============================== Script begins here =========================
string g_internal_version_s = "0.5.8";
#define UPDATER_NAME "[XenLab] Enhanced Kemono Updater"
#define PROCESS_LEGS_COMMANDS
#define RESET_ON_PERMS
// #define PRINT_HEARD_COMMANDS
// #define PRINT_UNHANDLED_COMMANDS
// #define BENCHMARK
// #define PROFILE_BODY_SCRIPT
// #define DEBUG_ENTIRE_BODY_ALPHA
// #define NEW_ASSOC_LOGIC
#define HOVER_TEXT_COLOR <0.925,0.925,0.925>
#define HOVER_TEXT_ALPHA 0.75
// #define debugLogic(a)//llOwnerSay(#a + " == " + (string)a);llSetText("U: " + (string)llGetUsedMemory() + "[" + (string)llGetSPMaxMemory() + "]/" + (string)llGetMemoryLimit() + "B",HOVER_TEXT_COLOR,HOVER_TEXT_ALPHA)
// #define dSay(a)//llOwnerSay((string)a)
#define saveSettings() llSetObjectDesc(g_internal_version_s\
+ "*" + (string)human_mode\
+ "*" + (string)g_Config_BladeColor\
)
#define xlSetLinkPrimitiveParamsFast(a,b) llSetLinkPrimitiveParamsFast(a,b)
#define KM_HUD_RESET_CMD "show:neck:collar:shoulderUL:shoulderUR:shoulderLL\
:shoulderLR:chest:breast:ribs:abs:belly:pelvis:hipL:hipR\
:thighUL:thighUR:thighLL:thighLR:kneeL:kneeR:calfL:calfR\
:shinUL:shinUR:shinLL:shinLR:ankleL:ankleR:footL:footR\
:armUL:armUR:elbowL:elbowR:armLL:armLR:wristL:wristR:handL:handR"
/* TODO:
- Set Nipple Override
0 = Off : 1 = On
0 being replaced by the state number 0 ~ 1:
nipovrd:0
- Leg types toggles, see comments below
*/
#define KEMONO_COM_CH -34525475
#define API_CMD_ABS "abs"
#define API_CMD_ANKLE_L "ankleL"
#define API_CMD_ANKLE_R "ankleR"
#define API_CMD_ARM_L_L "armLL"
#define API_CMD_ARM_L_R "armLR"
#define API_CMD_ARM_U_L "armUL"
#define API_CMD_ARM_U_R "armUR"
#define API_CMD_BELLY "belly"
#define API_CMD_BREASTS "breast"
#define API_CMD_CALF_L "calfL"
#define API_CMD_CALF_R "calfR"
#define API_CMD_CHEST "chest"
#define API_CMD_COLLAR "collar"
#define API_CMD_ELBOW_L "elbowL"
#define API_CMD_ELBOW_R "elbowR"
#define API_CMD_FITTED_TORSO "Fitted Torso Old Root"
#define API_CMD_FOOT_L "footL"
#define API_CMD_FOOT_R "footR"
#define API_CMD_HIP_L "hipL"
#define API_CMD_HIP_R "hipR"
#define API_CMD_KNEE_L "kneeL"
#define API_CMD_KNEE_R "kneeR"
#define API_CMD_NIPS "nips"
#define API_CMD_PELVIS "pelvis"
#define API_CMD_RIBS "ribs"
#define API_CMD_SHIN_L_L "shinLL"
#define API_CMD_SHIN_L_R "shinLR"
#define API_CMD_SHIN_U_L "shinUL"
#define API_CMD_SHIN_U_R "shinUR"
#define API_CMD_SHOULDER_L_L "shoulderLL"
#define API_CMD_SHOULDER_L_R "shoulderLR"
#define API_CMD_SHOULDER_U_L "shoulderUL"
#define API_CMD_SHOULDER_U_R "shoulderUR"
#define API_CMD_THIGH_L_L "thighLL"
#define API_CMD_THIGH_L_R "thighLR"
#define API_CMD_THIGH_U_L "thighUL"
#define API_CMD_THIGH_U_R "thighUR"
#define API_CMD_VAG "vagoo"
#define API_CMD_VIRTUAL_BUTT "butt"
#define API_CMD_WRIST_L "wristL"
#define API_CMD_WRIST_R "wristR"
#define MESH_ARMS "arms"
#define MESH_BODY "body"
#define MESH_FITTED_TORSO "Fitted Kemono Torso"
#define MESH_FITTED_TORSO_CHEST "TorsoChest"
#define MESH_FITTED_TORSO_ETC "TorsoEtc"
#define MESH_FITTED_TORSO_HLEGS "HumanLegs"
#define MESH_FITTED_TORSO_NIP_0 "NipState0"
#define MESH_FITTED_TORSO_NIP_1 "NipState1"
#define MESH_FITTED_TORSO_NIP_A "NipAlpha"
#define MESH_HAND_LEFT "handL"
#define MESH_HAND_RIGHT "handR"
#define MESH_HIPS "hips"
#define MESH_LEG_LEFT_ANIMAL "LFleg"
#define MESH_LEG_LEFT_HUMAN "LHleg"
#define MESH_LEG_RIGHT_ANIMAL "RFleg"
#define MESH_LEG_RIGHT_HUMAN "RHleg"
#define MESH_NECK "neck"
#define MESH_PG_LAYER "PG"
#define MESH_ROOT "Kemono - Body"
#define MESH_ROOTALT "Kemono Body"
// TODO: Remove entries that have the same values
// TODO: Implement overridable faces and finish separating stock and fitted torso associations
list names_assoc = [API_CMD_ANKLE_L, API_CMD_ANKLE_R,
API_CMD_CALF_L, API_CMD_CALF_R, API_CMD_KNEE_L, API_CMD_KNEE_R,
API_CMD_SHIN_L_L, API_CMD_SHIN_L_R, API_CMD_ABS, API_CMD_ARM_L_L,
API_CMD_ARM_L_R, API_CMD_ARM_U_L, API_CMD_ARM_U_R, API_CMD_BELLY,
MESH_BODY, API_CMD_ELBOW_L, API_CMD_ELBOW_R, API_CMD_FOOT_L,
API_CMD_FOOT_R, MESH_HAND_LEFT, MESH_HAND_RIGHT, API_CMD_SHIN_U_L,
API_CMD_SHIN_U_R, API_CMD_SHOULDER_L_L, API_CMD_SHOULDER_U_R,
API_CMD_THIGH_U_R, API_CMD_WRIST_L,
API_CMD_WRIST_R];
list faces_assoc = [5, 5, 4, 4, 1, 1, 4, 4, "6,7", 7, 2, 0, 6, "2,3", 0, 4, 5,
0, 0, -1, -1, 3, 3, 3, 4, 4, 3, 1];
list faceshumanmode = [1, 1, 2, 2, 5, 5, 2, 2];
#define MESH_SK_NIPS "nips"
#define MESH_SK_VAGOO "vagoo"
// Piercings
#define MESH_DERMAL_BACK0 "Triple Back Dimple Dermals0"
#define MESH_DERMAL_BACK1 "Triple Back Dimple Dermals1"
#define MESH_DERMAL_BACK2 "Triple Back Dimple Dermals2"
#define MESH_DERMAL_HIPS0 "Triple Hip Bone Dermals0"
#define MESH_DERMAL_HIPS1 "Triple Hip Bone Dermals1"
#define MESH_DERMAL_HIPS2 "Triple Hip Bone Dermals2"
#define MESH_DERMAL_CLLR0 "Triple Collar Bone Dermals0"
#define MESH_DERMAL_CLLR1 "Triple Collar Bone Dermals1"
#define MESH_DERMAL_CLLR2 "Triple Collar Bone Dermals2"
#define MESH_BELLY_RING0 "Belly Ring"
#define MESH_NIPPLE_RING0 "Busty Nipple Rings"
// #define MESH_NIPPLE_RING1 ""
// #define MESH_NIPPLE_RING2 ""
#define MESH_NIPPLE_LOOP0 "Busty Nipple Loops"
// #define MESH_NIPPLE_LOOP1 ""
// #define MESH_NIPPLE_LOOP2 ""
#define MESH_NIPPLE_BARB0 "Busty Nipple Barbells"
// #define MESH_NIPPLE_BARB1 ""
// #define MESH_NIPPLE_BARB2 ""
#define MESH_VAGINA_CLIT0 "Clit Ring"
// #define MESH_VAGINA_CLIT1 ""
// #define MESH_VAGINA_CLIT2 ""
#define g_supported_meshes [\
"BitState0",\
"BitState1",\
"BitState2",\
"BitState3",\
"cumButtS1",\
"cumButtS2",\
"cumButtS3",\
MESH_ARMS,\
MESH_BODY,\
MESH_FITTED_TORSO,\
MESH_FITTED_TORSO_CHEST,\
MESH_FITTED_TORSO_ETC,\
MESH_FITTED_TORSO_HLEGS,\
MESH_FITTED_TORSO_NIP_0,\
MESH_FITTED_TORSO_NIP_1,\
MESH_FITTED_TORSO_NIP_A,\
MESH_HAND_LEFT,\
MESH_HAND_RIGHT,\
MESH_HIPS,\
MESH_LEG_LEFT_ANIMAL,\
MESH_LEG_LEFT_HUMAN,\
MESH_LEG_RIGHT_ANIMAL,\
MESH_LEG_RIGHT_HUMAN,\
MESH_NECK,\
MESH_PG_LAYER,\
MESH_ROOT,\
MESH_ROOTALT\
]
// These go above. Can't comment out defined list parts.
/*MESH_DERMAL_BACK0,\*/
/*MESH_DERMAL_BACK1,\*/
/*MESH_DERMAL_BACK2,\*/
/*MESH_DERMAL_HIPS0,\*/
/*MESH_DERMAL_HIPS1,\*/
/*MESH_DERMAL_HIPS2,\*/
/*MESH_DERMAL_CLLR0,\*/
/*MESH_DERMAL_CLLR1,\*/
/*MESH_DERMAL_CLLR2,\*/
/*MESH_NIPPLE_RING0,\*/
/*MESH_NIPPLE_LOOP0,\*/
/*MESH_NIPPLE_BARB0,\*/
/*MESH_VAGINA_CLIT0,\*/
/*MESH_BELLY_RING0,\*/
#define s_FittedNipsMeshNames [\
MESH_FITTED_TORSO_NIP_0,/* 0, visible: PG mesh, hidden: ALpha stage 2*/\
MESH_FITTED_TORSO_ETC,/* 1 */\
MESH_FITTED_TORSO_NIP_1, /* 2 */\
MESH_FITTED_TORSO_NIP_A /* alpha stage 1 */\
]
#define s_KFTPelvisMeshes [\
"BitState0",\
"BitState1",\
"BitState2",\
"BitState3"\
]
integer s_KFTPelvisMeshes_size = 0;
//#define s_NipplePiercingsNames [\
//MESH_NIPPLE_RING0,\
//MESH_NIPPLE_LOOP0,\
//MESH_NIPPLE_BARB0\
//]
//#define s_VaginalPiercingsNames [\
//MESH_VAGINA_CLIT0\
//]
#define FKT_PRESENT 1
#define HUMAN_LEGS 2
/* PG States */
#define KSB_PGNIPLS 4
#define KSB_PGVAGOO 8
#define KSB_HDBRSTS 16
//#define RESERVED 32
//#define RESERVED 64
//#define RESERVED 128
//#define RESERVED 256
//#define RESERVED 512
//#define RESERVED 1024
//#define RESERVED 2048
/* Flags for blade sync purposes*/
#define STARBRIGHT_FKT_HUD_BUTT 134217727
#define STARBRIGHT_FKT_HUD_NIPS 268435455
#define STARBRIGHT_FKT_HUD_VAGN 536870911
#define STARBRIGHT_FKT_HUD_NIPH 1073741824
/* Some shorthand operators are not allowed in LSL, so let's do some hackery
usage:
a=variable/set
b=bit (define, see above)
Reminder: All LSL integers are 32 Bits-wide. This means the data we have to
play with is:
0000 0000 0000 0000 0000 0000 0000 0000
ie 00000000000000000000000000000010 = 2
The maximum value we can store is:
- 31 booleans, or bits. (-1 for sign)
- 1073741824
- 10000000000000000000000000000000
The increment is by base 2, so: 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
and so on...
*/
#define bwChange(a,b,c) a=(a & (~b)) | (b * c)
#define bwClear(a,b) a=(a & (~b))
#define bwGet(a,b) a & b
#define bwSet(a,b) a=(a | b)
/* Why can't we just do "a ^= b"? It's
more succinct but it just won't compile that way. So
"a = a ^ b" (old school) will
have to do instead. Anyway, toggle using XOR..
*/
#define bwToggle(a,b) a=a ^ b
#define llGetListSize(a) ((llGetListLength(a))-1)
#define compiled_name "xenhat.kemono.body.lsl"
#define g_internal_repo_s "XenHat/"+script_name
#define script_name "Kemono-Body-Script"
/* TODO: Use a bitset if we run out of memory */
#define g_DefaultFittedButState 1
#define g_DefaultFittedNipAlpha 0
#define g_DefaultFittedNipState 1
#define g_DefaultFittedVagState 1
integer g_CurrentFittedButState = 1;
integer g_CurrentFittedNipState = 1;
integer g_CurrentFittedNipAlpha = 0;
integer g_CurrentFittedVagState = 1;
// integer g_PreviousFittedButState=1;
integer g_PreviousFittedNipState = 1;
// integer g_PreviousFittedNipAlpha=0;
// integer g_PreviousFittedVagState=1;
integer g_HasAnimPerms = FALSE;
integer g_RuntimeBodyStateSettings;
// integer g_TogglingPGMeshes=FALSE;
integer human_mode = TRUE; /* Prefer when available*/
key g_Owner_k;
key g_Last_k;
list g_LinkDB_l = [];
list g_AttmntAuthedKeys_l;
string g_LastCommand_s;
/* Overridable deform animation */
string g_AnimDeform;
string g_AnimUndeform;
#define xlStartAnimation(name) { \
llStartAnimation(name);\
}
list xlGetFacesByBladeName(string name)
{
/* TODO: Remove this function and inline handling every command by hand
to account for other mods in-place instead of this spaghetti patchwork
*/
#ifdef NEW_ASSOC_LOGIC
integer index = llListFindList(names_assoc, [name]);
if(index > -1) {
string f = llList2String(faces_assoc, index);
if(f) {
// llOwnerSay("Optimized call for " + name);
// return llParseString2List(f, [","], []);
return llCSV2List(f);
}
}
// llOwnerSay("Falling back to old method for: " + name);
#endif
if(name == API_CMD_ABS) {
return [6, 7];
}
if(name == API_CMD_ANKLE_L) {
if(human_mode) {
return [1];
}
return [5];
}
if(name == API_CMD_ANKLE_R) {
if(human_mode) {
return [1];
}
return [5];
}
if(name == API_CMD_ARM_L_L) {
return [7];
}
if(name == API_CMD_ARM_L_R) {
return [2];
}
if(name == API_CMD_ARM_U_L) {
return [0];
}
if(name == API_CMD_ARM_U_R) {
return [6];
}
if(name == API_CMD_BELLY) {
return [2, 3];
}
if(name == MESH_BODY) {
return [0];
}
if(name == API_CMD_BREASTS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [2, 3];
}
return [2, 5];
}
if(name == API_CMD_CALF_L) {
if(human_mode) {
return [4];
}
return [2];
}
if(name == API_CMD_CALF_R) {
if(human_mode) {
return [4];
}
return [2];
}
if(name == API_CMD_CHEST) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [0, 1];
}
return [0, 4];
}
if(name == API_CMD_COLLAR) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [6, 7];
}
return [1, 6];
}
if(name == API_CMD_ELBOW_L) {
return [4];
}
if(name == API_CMD_ELBOW_R) {
return [5];
}
if(name == API_CMD_FOOT_L) {
return [0];
}
if(name == API_CMD_FOOT_R) {
return [0];
}
if(name == API_CMD_HIP_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [5];
}
return [6];
}
if(name == API_CMD_HIP_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [4];
}
return [5];
}
if(name == API_CMD_KNEE_L) {
if(human_mode) {
return [5];
}
return [1];
}
if(name == API_CMD_KNEE_R) {
if(human_mode) {
return [5];
}
return [1];
}
if(name == MESH_HAND_LEFT) {
return [-1];
}
if(name == MESH_HAND_RIGHT) {
return [-1];
}
if(name == MESH_NECK) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [0, 1];
}
return [2, 5];
}
if(name == MESH_SK_NIPS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT))
/* Note: Before changing this again, create a different way of
handling the request that doesn't match.
This is configured properly for the whole Fitted Torso chest mesh
*/
{
return [0, 1];
}
return [2, 3];
}
if(name == API_CMD_PELVIS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [0, 1, 2, 3];
}
return [0, 1];
}
if(name == API_CMD_RIBS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [4, 5];
}
return [1, 3];
}
if(name == API_CMD_SHIN_L_L) {
if(human_mode) {
return [2];
}
return [4];
}
if(name == API_CMD_SHIN_L_R) {
if(human_mode) {
return [2];
}
return [4];
}
if(name == API_CMD_SHIN_U_L) {
return [3];
}
if(name == API_CMD_SHIN_U_R) {
return [3];
}
if(name == API_CMD_SHOULDER_L_L) {
return [3];
}
if(name == API_CMD_SHOULDER_L_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [2];
}
return [0];
}
if(name == API_CMD_SHOULDER_U_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [5];
}
return [7];
}
if(name == API_CMD_SHOULDER_U_R) {
return [4];
}
if(name == API_CMD_THIGH_L_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
if(human_mode) {
return [1];
}
return [7];
}
return [6];
}
if(name == API_CMD_THIGH_L_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
if(human_mode) {
return [0];
}
return [6];
}
return [6];
}
if(name == API_CMD_THIGH_U_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [5];
}
return [7];
}
if(name == API_CMD_THIGH_U_R) {
return [4];
}
if(name == API_CMD_VAG) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
/* Reminder: On the Fitted Torso, this is the upper hip mesh half.
The bottom hip mesh half is controlled independently using
setbutt
*/
// if(g_TogglingPGMeshes)
// return [0,1,2,3,4,5];
return [0, 1];
}
return [0, 1];
}
if(name == API_CMD_VIRTUAL_BUTT) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
/* Reminder: On the Fitted Torso, this is the upper hip mesh half.
The bottom hip mesh half is controlled independently using
setbutt
*/
//if(g_TogglingPGMeshes)
// return [0,1,2,3,4,5];
return [2, 3, 4, 5];
}
return [];
}
if(name == API_CMD_WRIST_L) {
return [3];
}
if(name == API_CMD_WRIST_R) {
return [1];
}
return [];
}
/* This function is like a "translator", it returns
the specialized mesh name when a generic one is provided.
i.e. When using the fitted torso. API_CMD_BREASTS => MESH_FITTED_TORSO_CHEST
This is where the "Compatibility" and "Support" magic happens, for the
most part.
I don't particularly like having a mandatory function call for this
but I can't think of a better way to handle it right now.
*/
list xlBladeNameToPrimNames(string name)
{
/* TODO Can't we return the link number directly (using less than 512 bytes
of code!) without an additional function call?
*/
if(name == API_CMD_ARM_L_L) {
return [MESH_ARMS];
} else if(name == API_CMD_ARM_L_R) {
return [MESH_ARMS];
} else if(name == API_CMD_ARM_U_L) {
return [MESH_ARMS];
} else if(name == API_CMD_ARM_U_R) {
return [MESH_ARMS];
} else if(name == API_CMD_ELBOW_L) {
return [MESH_ARMS];
} else if(name == API_CMD_ELBOW_R) {
return [MESH_ARMS];
} else if(name == API_CMD_WRIST_L) {
return [MESH_ARMS];
} else if(name == API_CMD_WRIST_R) {
return [MESH_ARMS];
} else if(name == API_CMD_RIBS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_CHEST];
}
return [MESH_BODY];
} else if(name == API_CMD_ABS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_CHEST];
}
return [MESH_BODY];
} else if(name == MESH_BODY) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_CHEST];
}
return [MESH_BODY];
} else if(name == API_CMD_BREASTS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_CHEST];
}
return [MESH_BODY];
} else if(name == API_CMD_CHEST) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_CHEST];
}
return [MESH_BODY];
} else if(name == API_CMD_COLLAR) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO];
}
return [MESH_NECK];
} else if(name == MESH_HAND_LEFT) {
return [MESH_HAND_LEFT];
} else if(name == MESH_HAND_RIGHT) {
return [MESH_HAND_RIGHT];
} else if(name == API_CMD_HIP_L || name == API_CMD_HIP_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [llList2String(s_KFTPelvisMeshes, g_CurrentFittedVagState)];
}
return [MESH_HIPS];
} else if(name == MESH_NECK) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO];
}
return [MESH_NECK];
} else if(name == API_CMD_PELVIS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [llList2String(s_KFTPelvisMeshes, g_CurrentFittedVagState)];
}
return [MESH_HIPS];
} else if(name == API_CMD_KNEE_R) {
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_FOOT_R) {
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_ANKLE_R) {
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_SHIN_U_R) {
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_CALF_R) {
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_SHIN_L_R) {
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_CALF_L) {
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
} else if(name == API_CMD_ANKLE_L) {
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
} else if(name == API_CMD_FOOT_L) {
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
} else if(name == API_CMD_KNEE_L) {
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
} else if(name == API_CMD_SHIN_L_L) {
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
} else if(name == API_CMD_SHIN_U_L) {
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
} else if(name == API_CMD_SHOULDER_L_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO];
}
return [MESH_NECK];
} else if(name == API_CMD_SHOULDER_L_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO];
}
return [MESH_NECK];
} else if(name == API_CMD_SHOULDER_U_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO];
}
return [MESH_NECK];
} else if(name == API_CMD_SHOULDER_U_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO];
}
return [MESH_NECK];
} else if(name == API_CMD_THIGH_U_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_ETC];
}
return [MESH_HIPS];
} else if(name == API_CMD_THIGH_U_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_ETC];
}
return [MESH_HIPS];
} else if(name == API_CMD_BELLY) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_ETC];
}
return [MESH_HIPS];
} else if(name == MESH_SK_NIPS) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
if(1 == g_CurrentFittedNipAlpha) {
/* nip alpha stage 1 */
return [MESH_FITTED_TORSO_NIP_A];
} else if(2 == g_CurrentFittedNipAlpha) {
/* nip alpha stage 2 */
return [MESH_FITTED_TORSO_NIP_0];
} else {
return [llList2String(s_FittedNipsMeshNames,
g_CurrentFittedNipState)];
}
}
return [MESH_PG_LAYER];
} else if(name == MESH_FITTED_TORSO_NIP_A) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
return [MESH_FITTED_TORSO_NIP_A];
}
return [MESH_PG_LAYER];
} else if(name == API_CMD_VAG) {
/* TODO: Handle showing the right PG layer. Currently disabled */
//if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
// //if(g_TogglingPGMeshes)
// // return [llList2String(s_KFTPelvisMeshes,0)];
// return [llList2String(s_KFTPelvisMeshes, g_CurrentFittedVagState)];
//}
return [MESH_PG_LAYER];
} else if(name == API_CMD_THIGH_L_R) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
if(human_mode) {
return [MESH_FITTED_TORSO_HLEGS];
}
return [MESH_FITTED_TORSO_ETC];
}
if(human_mode) {
return [MESH_LEG_RIGHT_HUMAN];
}
return [MESH_LEG_RIGHT_ANIMAL];
} else if(name == API_CMD_THIGH_L_L) {
if(bwGet(g_RuntimeBodyStateSettings, FKT_PRESENT)) {
if(human_mode) {
return [MESH_FITTED_TORSO_HLEGS];
}
return [MESH_FITTED_TORSO_ETC];
}
if(human_mode) {
return [MESH_LEG_LEFT_HUMAN];
}
return [MESH_LEG_LEFT_ANIMAL];
}
return [name];
}
/* Stock Fitted Torso script:
setnip0==NipState0
setnip1==TorsoEtc[0,1]
setnip2==NipState1
NipAlpha==????
*/
/* Note: The Starbright stock behavior is the following:
Show PG layer when hiding nipples
Forcefully set the current genital state to Adult, idle on PG disable
*/
xlProcessCommandWrapper()
{
if(g_LastCommand_s == KM_HUD_RESET_CMD) {
reset();
} else if(g_LastCommand_s == "resetA") {
reset();
} else if(g_LastCommand_s == "resetB") {
g_AttmntAuthedKeys_l = [];
reset();
} else if(g_LastCommand_s == "Hlegs") {
#ifdef PROCESS_LEGS_COMMANDS
// if(!human_mode) {
human_mode = FALSE;
g_LastCommand_s =
"hide:thighLL:thighLR:kneeL:kneeR:calfL:calfR:shinUL:shinUR:shinLL:shinLR:ankleL:ankleR:footL:footR";
xlProcessCommand(TRUE);
// }
human_mode = TRUE;
g_LastCommand_s =
"show:thighLL:thighLR:kneeL:kneeR:calfL:calfR:shinUL:shinUR:shinLL:shinLR:ankleL:ankleR:footL:footR";
xlProcessCommand(TRUE);
#endif
saveSettings();
} else if(g_LastCommand_s == "Flegs") {
#ifdef PROCESS_LEGS_COMMANDS
// if(human_mode) {
human_mode = TRUE;
g_LastCommand_s =
"hide:thighLL:thighLR:kneeL:kneeR:calfL:calfR:shinUL:shinUR:shinLL:shinLR:ankleL:ankleR:footL:footR";
xlProcessCommand(TRUE);
// }
human_mode = FALSE;
g_LastCommand_s =
"show:thighLL:thighLR:kneeL:kneeR:calfL:calfR:shinUL:shinUR:shinLL:shinLR:ankleL:ankleR:footL:footR";
xlProcessCommand(TRUE);
#endif
saveSettings();
}
/* TODO: FIXME: Kind of brutal, should probably store the last hand anim or something.*/
/* TODO: move all this below inside the command processor */
else if(g_LastCommand_s == "Rhand:1") {
if(g_HasAnimPerms) {
xlStartAnimation("Kem-hand-R-relax");
llStopAnimation("Kem-hand-R-fist");
llStopAnimation("Kem-hand-R-hold");
llStopAnimation("Kem-hand-R-horns");
llStopAnimation("Kem-hand-R-point");
}
return;
} else if(g_LastCommand_s == "Rhand:2") {
if(g_HasAnimPerms) {
xlStartAnimation("Kem-hand-R-hold");
llStopAnimation("Kem-hand-R-fist");
llStopAnimation("Kem-hand-R-horns");
llStopAnimation("Kem-hand-R-point");
llStopAnimation("Kem-hand-R-relax");
}
return;
} else if(g_LastCommand_s == "Rhand:3") {
if(g_HasAnimPerms) {
xlStartAnimation("Kem-hand-R-fist");