public ActiveHairSim(string optionName, HairSimControl hairSim) { this.optionName = optionName; this.hairSim = hairSim; usePaintedRigidity = hairSim.GetBoolParamValue("usePaintedRigidity"); drag = hairSim.GetFloatParamValue("drag"); gravityMultiplier = hairSim.GetFloatParamValue("gravityMultiplier"); mainRigidity = hairSim.GetFloatParamValue("mainRigidity"); tipRigidity = hairSim.GetFloatParamValue("tipRigidity"); cling = hairSim.GetFloatParamValue("cling"); mainRigidityStorable = hairSim.GetFloatJSONParam("mainRigidity"); tipRigidityStorable = hairSim.GetFloatJSONParam("tipRigidity"); clingStorable = hairSim.GetFloatJSONParam("cling"); InitStorables(); }
private void RefreshHairOptions() { foreach (DAZHairGroup hair in hairItems) { string uid = hair.uid; if (hair.active && hair.name == "CustomHairItem" && !activeHairSims.ContainsKey(uid)) { //Log.Message($"Adding option for {uid}"); HairSimControl hairSim = hair.GetComponentInChildren <HairSimControl>(); if (hairSim != null) { ActiveHairSim activeHairSim = new ActiveHairSim($"{hair.creatorName} | {hair.displayName}", hairSim); activeHairSims.Add(uid, activeHairSim); activeHairSim.LetLoose(); } } else if (!hair.active && activeHairSims.ContainsKey(uid)) { //Log.Message($"Removing option for {uid} and restoring original physics"); activeHairSims[uid].RestoreOriginalPhysics(); activeHairSims.Remove(uid); } } }