private void FixSkirtFk() { var ocic = ChaControl.GetOCIChar(); //ocic.female.UpdateBustSoftnessAndGravity(); var active = ocic.oiCharInfo.activeFK[6]; ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, false, ocic.oiCharInfo.enableFK); ocic.fkCtrl.ResetUsedBone(ocic); ocic.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocic.charInfo.objClothes); ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, active, ocic.oiCharInfo.enableFK); }
private void FixSkirtFk() { var ocic = ChaControl.GetOCIChar(); //ocic.female.UpdateBustSoftnessAndGravity(); var active = ocic.oiCharInfo.activeFK[6]; ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, false, ocic.oiCharInfo.enableFK); Traverse.Create(ocic.fkCtrl).Method("ResetUsedBone", new[] { typeof(OCIChar) }).GetValue(ocic); ocic.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocic.charInfo.objClothes); ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, active, ocic.oiCharInfo.enableFK); }
private static void UpdateBustAndSkirt(OCICharMale __instance) { if (__instance.charInfo.fileParam.sex == 0) { return; } __instance.charInfo.UpdateBustSoftnessAndGravity(); __instance.skirtDynamic = AddObjectFemale.GetSkirtDynamic(__instance.charInfo.objClothes); __instance.ActiveFK(OIBoneInfo.BoneGroup.Skirt, __instance.oiCharInfo.activeFK[6], __instance.oiCharInfo.enableFK); }
//按鈕邏輯 internal static void OnButtonClick(CharaList __instance, int sex) { CharaFileSort charaFileSort = __instance.GetField("charaFileSort") as CharaFileSort; ChaFileControl chaFileControl = new ChaFileControl(); string fullPath = chaFileControl.ConvertCharaFilePath(charaFileSort.selectPath, (byte)sex, false); chaFileControl = null; OCIChar[] array = (from v in Singleton <GuideObjectManager> .Instance.selectObjectKey select Studio.Studio.GetCtrlInfo(v) as OCIChar into v where v != null select v).ToArray(); foreach (OCIChar ocichar in array) { ChaControl chaCtrl = ocichar.charInfo; foreach (OCIChar.BoneInfo boneInfo in (from v in ocichar.listBones where v.boneGroup == OIBoneInfo.BoneGroup.Hair select v).ToList <OCIChar.BoneInfo>()) { Singleton <GuideObjectManager> .Instance.Delete(boneInfo.guideObject, true); } ocichar.listBones = (from v in ocichar.listBones where v.boneGroup != OIBoneInfo.BoneGroup.Hair select v).ToList <OCIChar.BoneInfo>(); int[] array2 = (from b in ocichar.oiCharInfo.bones where b.Value.@group == OIBoneInfo.BoneGroup.Hair select b.Key).ToArray <int>(); for (int j = 0; j < array2.Length; j++) { ocichar.oiCharInfo.bones.Remove(array2[j]); } ocichar.hairDynamic = null; ocichar.skirtDynamic = null; string oldName = ocichar.charInfo.chaFile.parameter.fullname; //用這種方式初始化不會觸發其他鉤子 ChaControl tmpCtrl = new ChaControl(); tmpCtrl.SetProperty("chaFile", new ChaFileControl()); if (null != MoreAccessories) { CopyAllMoreAccessoriesData(ocichar.charInfo, tmpCtrl); } //Main Load Control if (chaCtrl.chaFile.LoadFileLimited(fullPath, (byte)sex, true, true, true, true, false) || !LoadExtendedData(ocichar, charaFileSort.selectPath, (byte)sex) || !UpdateTreeNodeObjectName(ocichar)) { Logger.LogError("Load Body FAILED"); } else { if (null != MoreAccessories) { CopyAllMoreAccessoriesData(tmpCtrl, ocichar.charInfo); } } GameObject.Destroy(tmpCtrl); ocichar.charInfo.AssignCoordinate((ChaFileDefine.CoordinateType)ocichar.charInfo.fileStatus.coordinateType); chaCtrl.Reload(false, false, false, false); AddObjectAssist.InitHairBone(ocichar, Singleton <Info> .Instance.dicBoneInfo); ocichar.hairDynamic = AddObjectFemale.GetHairDynamic(ocichar.charInfo.objHair); ocichar.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocichar.charInfo.objClothes); ocichar.InitFK(null); foreach (var tmp in FKCtrl.parts.Select((OIBoneInfo.BoneGroup p, int i2) => new { p, i2 })) { ocichar.ActiveFK(tmp.p, ocichar.oiCharInfo.activeFK[tmp.i2], ocichar.oiCharInfo.activeFK[tmp.i2]); } ocichar.ActiveKinematicMode(OICharInfo.KinematicMode.FK, ocichar.oiCharInfo.enableFK, true); ocichar.UpdateFKColor(new OIBoneInfo.BoneGroup[] { OIBoneInfo.BoneGroup.Hair }); ocichar.ChangeEyesOpen(ocichar.charFileStatus.eyesOpenMax); ocichar.ChangeBlink(ocichar.charFileStatus.eyesBlink); ocichar.ChangeMouthOpen(ocichar.oiCharInfo.mouthOpen); Logger.LogInfo($"Load Body: {oldName} -> {ocichar.charInfo.chaFile.parameter.fullname}"); } }