Skip to content

Commit

Permalink
Add tracker streamer to stream avatar to trackers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolmnixon committed Sep 15, 2024
1 parent fce576e commit e60e6fc
Show file tree
Hide file tree
Showing 6 changed files with 821 additions and 122 deletions.
3 changes: 3 additions & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# 0.2.0
- Added streamer to stream avatar to XR trackers

# 0.1.0
- Initial Revision
120 changes: 2 additions & 118 deletions addons/godot_animation_recorder/animation/animation_recorder.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,121 +8,6 @@ extends Node
## an avatar and inspecting the bones and facial blend-shapes.


# Names of Godot Humanoid Bones
const _BONES_GODOT_HUMANOID : Array[String] = [
"Root",
"Hips",
"Spine",
"Chest",
"UpperChest",
"Neck",
"Head",
"LeftEye",
"RightEye",
"LeftShoulder",
"LeftUpperArm",
"LeftLowerArm",
"LeftHand",
"LeftThumbMetacarpal",
"LeftThumbProximal",
"LeftThumbDistal",
"LeftIndexProximal",
"LeftIndexIntermediate",
"LeftIndexDistal",
"LeftMiddleProximal",
"LeftMiddleIntermediate",
"LeftMiddleDistal",
"LeftRingProximal",
"LeftRingIntermediate",
"LeftRingDistal",
"LeftLittleProximal",
"LeftLittleIntermediate",
"LeftLittleDistal",
"RightShoulder",
"RightUpperArm",
"RightLowerArm",
"RightHand",
"RightThumbMetacarpal",
"RightThumbProximal",
"RightThumbDistal",
"RightIndexProximal",
"RightIndexIntermediate",
"RightIndexDistal",
"RightMiddleProximal",
"RightMiddleIntermediate",
"RightMiddleDistal",
"RightRingProximal",
"RightRingIntermediate",
"RightRingDistal",
"RightLittleProximal",
"RightLittleIntermediate",
"RightLittleDistal",
"LeftUpperLeg",
"LeftLowerLeg",
"LeftFoot",
"LeftToes",
"RightUpperLeg",
"RightLowerLeg",
"RightFoot",
"RightToes"
]

# Names of 52 blend-shapes (lowercase and no separators)
const _FACE_52_BLENDSHAPES : Array[String] = [
"browinnerup",
"browdownleft",
"browdownright",
"browouterupleft",
"browouterupright",
"eyelookupleft",
"eyelookupright",
"eyelookdownleft",
"eyelookdownright",
"eyelookinleft",
"eyelookinright",
"eyelookoutleft",
"eyelookoutright",
"eyeblinkleft",
"eyeblinkright",
"eyesquintleft",
"eyesquintright",
"eyewideleft",
"eyewideright",
"cheekpuff",
"cheeksquintleft",
"cheeksquintright",
"nosesneerleft",
"nosesneerright",
"jawopen",
"jawforward",
"jawleft",
"jawright",
"mouthfunnel",
"mouthpucker",
"mouthleft",
"mouthright",
"mouthrollupper",
"mouthrolllower",
"mouthshrugupper",
"mouthshruglower",
"mouthclose",
"mouthsmileleft",
"mouthsmileright",
"mouthfrownleft",
"mouthfrownright",
"mouthdimpleleft",
"mouthdimpleright",
"mouthupperupleft",
"mouthupperupright",
"mouthlowerdownleft",
"mouthlowerdownright",
"mouthpressleft",
"mouthpressright",
"mouthstretchleft",
"mouthstretchright"
]


## Skeleton node
@export var skeleton : Skeleton3D

Expand Down Expand Up @@ -249,7 +134,7 @@ func _populate_skeleton_tracks() -> void:
var path := NodePath("%GeneralSkeleton:" + bone_name)

# Skip if only humanoid bones and this isn't a humanoid bone
if only_godot_humanoid_bones and not _BONES_GODOT_HUMANOID.has(bone_name):
if only_godot_humanoid_bones and not GodotXRBodyData.is_body_bone(bone_name):
continue

# Add position tracks for root bones and hips
Expand Down Expand Up @@ -278,8 +163,7 @@ func _populate_face_tracks() -> void:
var path := NodePath(String(node_path) + ":" + blend_name)

# Skip if only 52 blend-shapes and this isn't a 52 blend-shape
var lower_name := blend_name.to_lower().replace("_", "");
if only_52_blendshapes and not _FACE_52_BLENDSHAPES.has(lower_name):
if only_52_blendshapes and not GodotXRBodyData.is_face_blend_52(blend_name):
continue

# Add the blend-shape track
Expand Down
Loading

0 comments on commit e60e6fc

Please sign in to comment.