Add custom head, live character shader control, and live stage control. (#88)

* Bug fix, improved UI layout and live vocals

* Bug Fixes, New Live Compatibility

* Android build support

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml

* Fix issues with the new version of the game

* bug fix

* add config button

* Improve performance

* Sync fork

* bug fix, new uma compatibility

* Add /UserSettings to gitignore

* bug fix, add live characher shader control

* fix compilation errors

* fix compilation errors 2

* fix the live lighting calculation logic

* bug fix, add editor layout settings to gitignore

* bug fix, add editor layout settings to gitignore

* Add time scale keys for live

* live camera bug fix

* add live stage control, optimize live performance

* fix build error

* add uma head custom
This commit is contained in:
CroakFang
2025-07-11 23:23:57 +08:00
committed by GitHub
parent a42ea93ffd
commit 204752d7d6
45 changed files with 2140 additions and 1339 deletions
@@ -242,24 +242,44 @@ namespace RootMotion.Dynamics {
// Returns the Muscle.Group of the specified bone Transform (only if using the Humanoid rig)
private static Muscle.Group FindGroup(Animator animator, Transform t) {
if (!animator.isHuman) return Muscle.Group.Hips;
if (t == animator.GetBoneTransform(HumanBodyBones.Chest)) return Muscle.Group.Spine;
if (t == animator.GetBoneTransform(HumanBodyBones.Head)) return Muscle.Group.Head;
if (t == animator.GetBoneTransform(HumanBodyBones.Hips)) return Muscle.Group.Hips;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftFoot)) return Muscle.Group.Foot;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftHand)) return Muscle.Group.Hand;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftLowerArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftLowerLeg)) return Muscle.Group.Leg;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftUpperArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftUpperLeg)) return Muscle.Group.Leg;
if (t == animator.GetBoneTransform(HumanBodyBones.RightFoot)) return Muscle.Group.Foot;
if (t == animator.GetBoneTransform(HumanBodyBones.RightHand)) return Muscle.Group.Hand;
if (t == animator.GetBoneTransform(HumanBodyBones.RightLowerArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.RightLowerLeg)) return Muscle.Group.Leg;
if (t == animator.GetBoneTransform(HumanBodyBones.RightUpperArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.RightUpperLeg)) return Muscle.Group.Leg;
return Muscle.Group.Spine;
}
if (animator.isHuman) {
if (t == animator.GetBoneTransform(HumanBodyBones.Chest)) return Muscle.Group.Spine;
if (t == animator.GetBoneTransform(HumanBodyBones.Head)) return Muscle.Group.Head;
if (t == animator.GetBoneTransform(HumanBodyBones.Hips)) return Muscle.Group.Hips;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftFoot)) return Muscle.Group.Foot;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftHand)) return Muscle.Group.Hand;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftLowerArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftLowerLeg)) return Muscle.Group.Leg;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftUpperArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.LeftUpperLeg)) return Muscle.Group.Leg;
if (t == animator.GetBoneTransform(HumanBodyBones.RightFoot)) return Muscle.Group.Foot;
if (t == animator.GetBoneTransform(HumanBodyBones.RightHand)) return Muscle.Group.Hand;
if (t == animator.GetBoneTransform(HumanBodyBones.RightLowerArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.RightLowerLeg)) return Muscle.Group.Leg;
if (t == animator.GetBoneTransform(HumanBodyBones.RightUpperArm)) return Muscle.Group.Arm;
if (t == animator.GetBoneTransform(HumanBodyBones.RightUpperLeg)) return Muscle.Group.Leg;
}
else
{
if (t.name.Equals("Hip")) return Muscle.Group.Hips;
if (t.name.Equals("Spine")) return Muscle.Group.Spine;
if (t.name.Equals("Chest")) return Muscle.Group.Spine;
if (t.name.Equals("Head")) return Muscle.Group.Head;
if (t.name.Equals("Arm_L")) return Muscle.Group.Arm;
if (t.name.Equals("Elbow_L")) return Muscle.Group.Arm;
if (t.name.Equals("Wrist_L")) return Muscle.Group.Hand;
if (t.name.Equals("Arm_R")) return Muscle.Group.Arm;
if (t.name.Equals("Elbow_R")) return Muscle.Group.Arm;
if (t.name.Equals("Wrist_R")) return Muscle.Group.Hand;
if (t.name.Equals("Thigh_L")) return Muscle.Group.Leg;
if (t.name.Equals("Knee_L")) return Muscle.Group.Leg;
if (t.name.Equals("Ankle_L")) return Muscle.Group.Foot;
if (t.name.Equals("Thigh_R")) return Muscle.Group.Leg;
if (t.name.Equals("Knee_R")) return Muscle.Group.Leg;
if (t.name.Equals("Ankle_R")) return Muscle.Group.Foot;
}
return Muscle.Group.Spine;
}
// Removes all bones that don't have a Rigidbody or a Collider attached because they are not part of the simulation
private void RemoveUnnecessaryBones() {
@@ -211,36 +211,44 @@ namespace RootMotion.Dynamics {
public static BipedRagdollReferences FromAvatar(Animator animator) {
BipedRagdollReferences r = new BipedRagdollReferences();
if (!animator.isHuman) {
List<Transform> list = new List<Transform>(animator.gameObject.GetComponentsInChildren<Transform>());
list.Find(t => t.name.Equals("Position"));
if (!animator.isHuman)
{
Dictionary<string, Transform> transformDict = new Dictionary<string, Transform>();
foreach (Transform t in animator.gameObject.GetComponentsInChildren<Transform>())
{
if(!transformDict.ContainsKey(t.name))
{
transformDict[t.name] = t;
}
}
r.root = list.Find(t => t.name.Equals("Position"));
r.root = transformDict.ContainsKey("Position") ? transformDict["Position"] : null;
r.hips = list.Find(t => t.name.Equals("Hip"));
r.spine = list.Find(t => t.name.Equals("Spine"));
r.chest = list.Find(t => t.name.Equals("Chest"));
r.head = list.Find(t => t.name.Equals("Head"));
r.hips = transformDict.ContainsKey("Hip") ? transformDict["Hip"] : null;
r.spine = transformDict.ContainsKey("Spine") ? transformDict["Spine"] : null;
r.chest = transformDict.ContainsKey("Chest") ? transformDict["Chest"] : null;
r.head = transformDict.ContainsKey("Head") ? transformDict["Head"] : null;
r.leftUpperArm = list.Find(t => t.name.Equals("Arm_L"));
r.leftLowerArm = list.Find(t => t.name.Equals("Elbow_L"));
r.leftHand = list.Find(t => t.name.Equals("Wrist_L"));
r.leftUpperArm = transformDict.ContainsKey("Arm_L") ? transformDict["Arm_L"] : null;
r.leftLowerArm = transformDict.ContainsKey("Elbow_L") ? transformDict["Elbow_L"] : null;
r.leftHand = transformDict.ContainsKey("Wrist_L") ? transformDict["Wrist_L"] : null;
r.rightUpperArm = list.Find(t => t.name.Equals("Arm_R"));
r.rightLowerArm = list.Find(t => t.name.Equals("Elbow_R"));
r.rightHand = list.Find(t => t.name.Equals("Wrist_R"));
r.rightUpperArm = transformDict.ContainsKey("Arm_R") ? transformDict["Arm_R"] : null;
r.rightLowerArm = transformDict.ContainsKey("Elbow_R") ? transformDict["Elbow_R"] : null;
r.rightHand = transformDict.ContainsKey("Wrist_R") ? transformDict["Wrist_R"] : null;
r.leftUpperLeg = list.Find(t => t.name.Equals("Thigh_L"));
r.leftLowerLeg = list.Find(t => t.name.Equals("Knee_L"));
r.leftFoot = list.Find(t => t.name.Equals("Ankle_L"));
r.leftUpperLeg = transformDict.ContainsKey("Thigh_L") ? transformDict["Thigh_L"] : null;
r.leftLowerLeg = transformDict.ContainsKey("Knee_L") ? transformDict["Knee_L"] : null;
r.leftFoot = transformDict.ContainsKey("Ankle_L") ? transformDict["Ankle_L"] : null;
r.rightUpperLeg = list.Find(t => t.name.Equals("Thigh_R"));
r.rightLowerLeg = list.Find(t => t.name.Equals("Knee_R"));
r.rightFoot = list.Find(t => t.name.Equals("Ankle_R"));
return r;
}
r.rightUpperLeg = transformDict.ContainsKey("Thigh_R") ? transformDict["Thigh_R"] : null;
r.rightLowerLeg = transformDict.ContainsKey("Knee_R") ? transformDict["Knee_R"] : null;
r.rightFoot = transformDict.ContainsKey("Ankle_R") ? transformDict["Ankle_R"] : null;
r.root = animator.transform;
return r;
}
r.root = animator.transform;
r.hips = animator.GetBoneTransform(HumanBodyBones.Hips);
r.spine = animator.GetBoneTransform(HumanBodyBones.Spine);