跳到正文
FunCoding

skeleton

Edit skeleton bone transforms/hierarchy, retargeting modes, curve metadata, blend profiles, bone constraints, and learn constraints from animations (VibeUE SkeletonService). Socket CRUD, bone enumeration, physics-asset, and material/LOD inspection are owned by the engine SkeletalMeshTools. Use when the user asks to add/transform bones, set retargeting, manage blend profiles or curves, or set bone constraints. For animation bone edits, also load animation-editing.

Star
847
分类
科研
许可证
MIT
最近提交
2026年12月2日

Skills/skeleton/SKILL.md

在 GitHub 上查看

🧠 Brains complement: IF an unreal-engine-skills-manager tool (external MCP) exists in this session, call it with {action: "load", skill: "animation-system"} for UE domain knowledge on this topic — correct APIs, architecture, best practices — and treat it as the rubric for any review / "best practices" question. If no such tool is available (e.g. running under Claude Code or Codex without that MCP), skip this line entirely and proceed with this skill alone — do NOT attempt the call.

Skeleton & Skeletal Mesh Skill

Architecture (read first): VibeUE extends Unreal's native MCP endpoint. Socket CRUD, bone enumeration, physics-asset assignment, and material/LOD/morph inspection are owned by the engine toolset EditorToolset.SkeletalMeshToolset (called via call_tool). VibeUE's SkeletonService was trimmed to what the engine doesn't cover: bone transform/hierarchy editing, retargeting config, curve metadata, blend profiles, bone constraints, and learn-from-animations.

Loading skills: skills load through the engine's AgentSkillToolset (ListSkills/GetSkills) — there is no vibeue-skills-manager tool. Run VibeUE services with execute_python (unreal.SkeletonService.<method>()); reach engine tools with call_tool (discover with list_toolsets / describe_toolset).

Related Skills:

  • animsequence / animation-editing - For editing animations with constraint validation (uses skeleton profiles) and keyframes
  • animation-blueprint - For AnimBP state machines and navigation

Use this skill when: Editing bone transforms/hierarchy, retargeting modes, blend profiles, curve metadata, or bone constraints. For sockets / bone listing / physics asset / materials / LODs, use engine SkeletalMeshTools (see below).

Sockets, bone enumeration, inspection → engine SkeletalMeshTools

These moved to the engine. Check a tool's parameters with get_symbol("EditorToolset.SkeletalMeshToolset.<Tool>") (cheaper than describe_toolset). Tool names are PascalCase and arguments are camelCase (socketName, boneName, lodIndex). Over MCP the mesh argument is a {"refPath": "<SkeletalMesh object path>"} object; inside execute_python pass the loaded asset itself.

TaskEngine tool (EditorToolset.SkeletalMeshToolset.*)
List socketsGetSocketNames
Add / remove / rename socketAddSocket, RemoveSocket, RenameSocket
Get / set socket transform, get socket boneGetSocketTransform, SetSocketTransform (translation, rotation, scale, each optional), GetSocketBone
List bones / parent / childrenGetBoneNames, GetBoneParent, GetBoneChildren
Material slots / get / setGetMaterialSlots, GetMaterial, SetMaterial
Physics asset get / assignGetPhysicsAsset, AssignPhysicsAsset
LODs / vertices / sections / boundsGetLodCount, GetVertexCount, GetSectionCount (lodIndex, default 0), GetBounds. In plain Python: unreal.SkeletalMeshEditorSubsystem.get_lod_count(mesh). mesh.lod_info and mesh.get_lod_num() do not exist
Morph target namesGetMorphTargetNames
# Example (execute_python script): add a socket on the hand_r bone, offset it, list sockets
import unreal
TS = "EditorToolset.SkeletalMeshToolset"
mesh = unreal.load_asset("/Game/Characters/SKM_Mannequin")
await call_tool(TS + ".AddSocket", mesh=mesh, socketName="Weapon_R", boneName="hand_r")
await call_tool(TS + ".SetSocketTransform", mesh=mesh, socketName="Weapon_R",
                translation=unreal.Vector(10, 0, 0), rotation=unreal.Rotator(roll=0, pitch=0, yaw=90))
await call_tool(TS + ".GetSocketNames", mesh=mesh)          # final expression = the reply

Note: the engine AddSocket always adds the socket to the skeletal mesh. VibeUE's old bAddToSkeleton (skeleton-wide socket) flag is gone — to share a socket across all meshes on a skeleton, add it on each mesh, or add it on the skeleton via unreal.* directly.

Critical Rules

⚠️ Bone Modification Requires Commit

Bone modifications (add, remove, rename, transform) use a transaction system — reparenting is not reliable, see the warning below. Changes are NOT applied until you call commit_bone_changes():

import unreal

# Make bone changes
unreal.SkeletonService.add_bone("/Game/SKM_Character", "twist_arm_l", "upperarm_l", unreal.Transform())
unreal.SkeletonService.add_bone("/Game/SKM_Character", "twist_arm_r", "upperarm_r", unreal.Transform())

# ⚠️ CRITICAL: Commit changes!
unreal.SkeletonService.commit_bone_changes("/Game/SKM_Character")

Forgetting to commit = changes are lost!

⚠️ Do NOT reparent bones via SkeletonModifier (known-broken, UE 5.7). Changing a bone's parent and calling commit_bone_changes() fails with a hierarchy-mismatch validation error and can leave the commit stalled (the call may not return cleanly). Add/remove/rename/transform are safe; reparenting is not. If a user needs a different hierarchy, add a new bone at the desired parent and remove the old one rather than reparenting in place.

Sockets are now an engine operation

Socket CRUD is on EditorToolset.SkeletalMeshToolset (see the table at the top). The engine AddSocket attaches to the skeletal mesh; set its offset with SetSocketTransform. There is no bAddToSkeleton flag.

Skeleton vs SkeletalMesh Paths

  • Skeleton operations (retargeting, curves, blend profiles, constraints) use SK_ assets → VibeUE SkeletonService
  • SkeletalMesh bone transform/hierarchy edits use SKM_ assets → VibeUE SkeletonService
  • SkeletalMesh sockets / bone listing / inspection use SKM_ assets → engine SkeletalMeshTools
# Skeleton operations (VibeUE) - use SK_ path
unreal.SkeletonService.get_skeleton_info("/Game/Characters/SK_Mannequin")
unreal.SkeletonService.set_bone_retargeting_mode("/Game/Characters/SK_Mannequin", "pelvis", "Skeleton")

# Sockets / bone listing (engine) - use SKM_ path via call_tool, e.g.:
# await call_tool("EditorToolset.SkeletalMeshToolset.GetSocketNames",
#                 mesh=unreal.load_asset("/Game/Characters/SKM_Mannequin"))

Retargeting Mode Reference

ModeDescriptionUse For
AnimationUse animation data directlyMost bones (default)
SkeletonUse skeleton's reference poseRoot, pelvis, IK targets
AnimationScaledScale animation by skeleton sizeHeight-scaled characters
OrientAndScaleMatch orientation and scaleHelper/utility bones

Skeleton Profiles & Constraints

For animation editing with constraint validation, use the skeleton profile methods:

import unreal

# Create/refresh skeleton profile with hierarchy and constraints
profile = unreal.SkeletonService.create_skeleton_profile("/Game/SK_Mannequin")
print(f"Skeleton has {profile.bone_count} bones")

# Learn constraints from existing animations
constraints = unreal.SkeletonService.learn_from_animations("/Game/SK_Mannequin", 50, 10)
print(f"Learned from {constraints.animation_count} animations")

# Set manual bone constraints (e.g., elbow as hinge)
unreal.SkeletonService.set_bone_constraints(
    "/Game/SK_Mannequin",
    "lowerarm_r",
    unreal.Rotator(0, 0, 0),     # Min rotation
    unreal.Rotator(0, 145, 0),   # Max rotation
    True,  # Is hinge joint
    1      # Pitch axis (Y)
)

# Validate a rotation against constraints
result = unreal.SkeletonService.validate_bone_rotation(
    "/Game/SK_Mannequin",
    "upperarm_r",
    unreal.Rotator(0, 180, 0),  # Test rotation
    True  # Use learned constraints
)
if not result.is_valid:
    print(f"Clamped to: {result.clamped_rotation}")

See the animsequence skill for complete preview→validate→bake workflow.

Workflows

List All Bones (engine SkeletalMeshTools)

Bone enumeration moved to the engine. Use GetBoneNames (hierarchy order, root first) and walk parent/children with GetBoneParent / GetBoneChildren:

import unreal
TS = "EditorToolset.SkeletalMeshToolset"
mesh = unreal.load_asset("/Game/Characters/SKM_Mannequin")
names = await call_tool(TS + ".GetBoneNames", mesh=mesh)
children = {}
for n in names[:10]:
    children[n] = await call_tool(TS + ".GetBoneChildren", mesh=mesh, boneName=n)
children

For a richer hierarchy with transforms/depth/retarget mode, VibeUE's create_skeleton_profile(skeleton_path) returns bone_hierarchy (Array[BoneNodeInfo]) — see below.

Add Twist Bones for Better Skinning

import unreal

mesh_path = "/Game/Characters/SKM_Character"

# Add forearm twist bones
unreal.SkeletonService.add_bone(
    mesh_path,
    "lowerarm_twist_01_l",
    "lowerarm_l",
    unreal.Transform(location=[12.0, 0.0, 0.0])
)

unreal.SkeletonService.add_bone(
    mesh_path,
    "lowerarm_twist_01_r",
    "lowerarm_r",
    unreal.Transform(location=[12.0, 0.0, 0.0])
)

# Add upperarm twist bones
unreal.SkeletonService.add_bone(
    mesh_path,
    "upperarm_twist_01_l",
    "upperarm_l",
    unreal.Transform(location=[15.0, 0.0, 0.0])
)

unreal.SkeletonService.add_bone(
    mesh_path,
    "upperarm_twist_01_r",
    "upperarm_r",
    unreal.Transform(location=[15.0, 0.0, 0.0])
)

# CRITICAL: Commit the changes
unreal.SkeletonService.commit_bone_changes(mesh_path)
unreal.EditorAssetLibrary.save_asset(mesh_path)

Set Up Weapon Sockets (engine SkeletalMeshTools)

Socket CRUD is on the engine toolset. Add the socket, then set its offset transform:

import unreal
mesh = unreal.load_asset("/Game/Characters/SKM_Character")
TS = "EditorToolset.SkeletalMeshToolset"

await call_tool(TS + ".AddSocket", mesh=mesh, socketName="Weapon_R", boneName="hand_r")
await call_tool(TS + ".SetSocketTransform", mesh=mesh, socketName="Weapon_R",
                translation=unreal.Vector(10, 0, 0), rotation=unreal.Rotator(roll=0, pitch=0, yaw=90))

await call_tool(TS + ".AddSocket", mesh=mesh, socketName="Holster_Back", boneName="spine_03")
await call_tool(TS + ".SetSocketTransform", mesh=mesh, socketName="Holster_Back",
                translation=unreal.Vector(0, -20, 0), rotation=unreal.Rotator(roll=90, pitch=0, yaw=0))

Configure Retargeting for Animation Sharing

import unreal

skeleton_path = "/Game/Characters/SK_Character"

# Root and pelvis should use Skeleton mode
for bone in ["root", "pelvis"]:
    unreal.SkeletonService.set_bone_retargeting_mode(skeleton_path, bone, "Skeleton")

# IK bones should use Animation mode
for bone in ["ik_foot_l", "ik_foot_r", "ik_hand_l", "ik_hand_r"]:
    unreal.SkeletonService.set_bone_retargeting_mode(skeleton_path, bone, "Animation")

# Add a compatible skeleton for sharing animations.
# SkeletonService no longer wraps this — `USkeleton::AddCompatibleSkeleton` is BlueprintCallable,
# so call it on the loaded skeleton directly.
unreal.load_asset(skeleton_path).add_compatible_skeleton(
    unreal.load_asset("/Game/Mannequins/SK_Mannequin")
)

unreal.EditorAssetLibrary.save_asset(skeleton_path)

Create Upper Body Blend Profile

import unreal

skeleton_path = "/Game/Characters/SK_Character"

# Create the blend profile
unreal.SkeletonService.create_blend_profile(skeleton_path, "UpperBody")

# Set lower body to 0 (no blend)
lower_body_bones = ["pelvis", "thigh_l", "thigh_r", "calf_l", "calf_r", "foot_l", "foot_r"]
for bone in lower_body_bones:
    unreal.SkeletonService.set_blend_profile_bone(skeleton_path, "UpperBody", bone, 0.0)

# Set upper body to 1 (full blend)
upper_body_bones = ["spine_01", "spine_02", "spine_03", "clavicle_l", "clavicle_r"]
for bone in upper_body_bones:
    unreal.SkeletonService.set_blend_profile_bone(skeleton_path, "UpperBody", bone, 1.0)

unreal.EditorAssetLibrary.save_asset(skeleton_path)

Set Up Morph Target Curves

import unreal

skeleton_path = "/Game/Characters/SK_Character"

# Add facial expression curves
facial_curves = ["BrowsUp", "BrowsDown", "EyesClosed", "Smile", "Frown"]
for curve in facial_curves:
    unreal.SkeletonService.add_curve_meta_data(skeleton_path, curve)
    unreal.SkeletonService.set_curve_morph_target(skeleton_path, curve, True)

# Add material parameter curves
material_curves = ["EyeGlow", "SkinWetness", "BlushAmount"]
for curve in material_curves:
    unreal.SkeletonService.add_curve_meta_data(skeleton_path, curve)
    unreal.SkeletonService.set_curve_material(skeleton_path, curve, True)

unreal.EditorAssetLibrary.save_asset(skeleton_path)

Find Bones by Pattern (filter engine bone list)

There is no find_bones — get the full list from the engine GetBoneNames and filter in Python:

names = await call_tool("EditorToolset.SkeletalMeshToolset.GetBoneNames",
                        mesh={"refPath": "/Game/Characters/SKM_Mannequin.SKM_Mannequin"})
hand_bones  = [n for n in names if "hand"  in n.lower()]
twist_bones = [n for n in names if "twist" in n.lower()]
ik_bones    = [n for n in names if n.lower().startswith("ik_")]

Get Full Skeleton Info

import unreal

skeleton_path = "/Game/Characters/SK_Mannequin"

info = unreal.SkeletonService.get_skeleton_info(skeleton_path)
print(f"Skeleton: {info.skeleton_name}")
print(f"  Bones: {info.bone_count}")
print(f"  Compatible Skeletons: {info.compatible_skeleton_count}")
print(f"  Curve Metadata: {info.curve_meta_data_count}")
print(f"  Blend Profiles: {info.blend_profile_count}")
if info.blend_profile_names:
    print(f"    Profiles: {', '.join(info.blend_profile_names)}")

Data Structures

Python Naming Convention: C++ types like FBoneNodeInfo are exposed as BoneNodeInfo in Python (no F prefix).

BoneNodeInfo

PropertyTypeDescription
bone_namestringName of the bone
bone_indexintIndex in hierarchy
parent_bone_namestringParent bone (empty = root)
parent_bone_indexintParent index (-1 = root)
child_countintNumber of direct children
depthintDepth in hierarchy (0 = root)
local_transformTransformTransform relative to parent
global_transformTransformWorld-space transform
retargeting_modestringTranslation retarget mode
childrenarray[string]Names of child bones

SkeletonAssetInfo

PropertyTypeDescription
skeleton_pathstringAsset path
skeleton_namestringDisplay name
bone_countintNumber of bones
compatible_skeleton_countintCompatible skeletons
curve_meta_data_countintCurve metadata entries
blend_profile_countintBlend profiles
blend_profile_namesarray[string]Profile names
preview_forward_axisstringForward axis setting

SkeletalMeshData

PropertyTypeDescription
mesh_pathstringAsset path
mesh_namestringDisplay name
skeleton_pathstringAssociated skeleton
bone_countintNumber of bones
lod_countintLOD levels
socket_countintNumber of sockets
morph_target_countintMorph targets
material_countintMaterials
physics_asset_pathstringPhysics asset
post_process_anim_bp_pathstringPost-process AnimBP

Common Mistakes

❌ WRONG: Forgetting to commit bone changes

unreal.SkeletonService.add_bone(path, "new_bone", "parent", transform)
# Bone is NOT added yet - changes lost!

✅ RIGHT: Always commit bone changes

unreal.SkeletonService.add_bone(path, "new_bone", "parent", transform)
unreal.SkeletonService.commit_bone_changes(path)  # NOW it's applied

❌ WRONG: Calling SkeletonService.add_socket(...) — removed

That method was cut — sockets are now engine SkeletalMeshTools:

# WRONG: unreal.SkeletonService.add_socket(...)               # no longer exists
# RIGHT: await call_tool("EditorToolset.SkeletalMeshToolset.AddSocket",
#                        mesh=unreal.load_asset("/Game/SKM_Character"), socketName="S", boneName="hand_r")

❌ WRONG: Not saving after VibeUE modifications

unreal.SkeletonService.set_bone_retargeting_mode(path, "pelvis", "Skeleton")
# Changes in memory only - lost on editor close!

✅ RIGHT: Save after modifications

unreal.SkeletonService.set_bone_retargeting_mode(path, "pelvis", "Skeleton")
unreal.EditorAssetLibrary.save_asset(path)
  • Engine SkeletalMeshTools (via call_tool) — sockets, bone enumeration, physics asset, materials, LODs, morph targets.
  • animation-editing / animsequence — bone-rotation editing on animations using skeleton profiles.
  • Retargeting clips onto another skeleton (writes new AnimSequences) is the engine's IK Rig + IK Retargeter, not SkeletonService (which only sets per-bone translation retargeting modes): see retarget-recipe.md.

Reference pages

Open these with the paths below; UE rewrites them to absolute paths when it serves this skill.

相似的 Skill

graphify

GRGraphify-Labs/graphify156k近 7 天新增 2,124 个 star

wiki-query

PApaperclipai/paperclip119k近 7 天新增 1,727 个 star

官方

clinical-case-report

NEnexu-io/open-design111k近 7 天新增 1,079 个 star

style-sampling

HEheygen-com/hyperframes94k近 7 天新增 3,834 个 star

academic-paper-review

BYbytedance/deer-flow86k近 7 天新增 245 个 star

systematic-literature-review

BYbytedance/deer-flow86k近 7 天新增 245 个 star