void ChangeAll() { List <ChaControl> charList = new List <ChaControl>(); charList = Studio.Studio.Instance.dicInfo.Values.OfType <Studio.OCIChar>().Select(x => x.charInfo).ToList(); foreach (ChaControl chaCtrl in charList) { ChaFileCustom chaFileCustom = chaCtrl.chaFile.custom; chaFileCustom.body.shapeValueBody[4] = 1.000f; //胸大小 chaFileCustom.body.shapeValueBody[5] = 0.008f; //胸上下位置 chaFileCustom.body.shapeValueBody[6] = 0.733f; //胸左右開 chaFileCustom.body.shapeValueBody[7] = 0.696f; //胸左右位置 chaFileCustom.body.shapeValueBody[8] = 0.486f; //胸上下角度 chaFileCustom.body.shapeValueBody[9] = 0.303f; //胸尖 chaFileCustom.body.shapeValueBody[10] = 1.000f; //胸形狀 chaFileCustom.body.bustSoftness = 1.100f; //胸柔 chaFileCustom.body.bustWeight = 0.260f; //胸重 chaFileCustom.body.shapeValueBody[11] = 0.016f; //乳輪膨 chaFileCustom.body.shapeValueBody[12] = 0.506f; //乳首太 chaFileCustom.body.shapeValueBody[13] = 0.620f; //乳首立 chaFileCustom.body.areolaSize = 1.022f; //乳輪大 chaFileCustom.body.skinMainColor = new Color(0.72f, 0.61f, 0.54f, 1f); //膚色 chaFileCustom.body.skinSubColor = new Color(0.44f, 0.38f, 0.29f, 1f); //次膚色 chaFileCustom.body.skinGlossPower = 0.203f; //皮膚高光 chaFileCustom.body.nipColor = new Color(0.52f, 0.45f, 0.44f, 0.69f); //乳首色 chaFileCustom.body.nipGlossPower = 0.210f; //乳首高光 chaCtrl.Reload(true, true, true); } }
/// <summary> /// 替換角色 /// </summary> /// <param name="chaCtrl">目標chara</param> /// <param name="changeFace">是否替換臉部</param> /// <param name="changeBody">是否替換身體</param> public static void ChangeChara(ChaControl chaCtrl, bool changeFace = true, bool changeBody = true, bool disableDoubleChange = true) { if (Hooks.BlockChanging || null == chaCtrl || null == chaCtrl.chaFile) { return; } FBIOpenUp.SetCharaPath(null, null); if (chaCtrl.chaFile.parameter.sex != SampleChara.chaFile.parameter.sex) { Logger.LogWarning($"Skip changes that differ from Sample Chara's gender: {chaCtrl.fileParam.fullname}"); return; } List <float> originalShapeValueFace; List <float> originalShapeValueBody; ChaFileCustom chaFileCustom = chaCtrl.chaFile.custom; originalShapeValueFace = chaFileCustom.face.shapeValueFace.ToList(); originalShapeValueBody = chaFileCustom.body.shapeValueBody.ToList(); //如果角色第一次替換,紀錄其原始數據至dict //如果在dict內有找到替換紀錄,以其原始數據來做替換 //(不block掉是因為,即使在單次Loading Chara內,此function也會被trigger不止一次) if (chaFileCustomDict.TryGetValue(chaFileCustom, out List <float>[] chaFileCustomStored))
public static void LoadCharaFilePostfix() { if (blockLoadFlag) { //Restore ChaFileCustom chaFileCustom = tmpChaCtrl.chaFile.custom; if (originalShapeValueBody.Count == chaFileCustom.body.shapeValueBody.Length) { for (int i = 0; i < originalShapeValueBody.Count; i++) { chaFileCustom.body.shapeValueBody[i] = originalShapeValueBody[i]; } } else { Logger.LogError("Sample data is not match to target data!"); } originalShapeValueBody.Clear(); Logger.LogDebug($"Restore body: {tmpChaCtrl.chaFile.parameter.fullname}"); } }
public static void LoadBytesPostHook(ChaFileCustom __instance) { lastLoadedInstance = __instance; }