builder icon indicating copy to clipboard operation
builder copied to clipboard

Enforce standard node naming and animation baking in wearables

Open cazala opened this issue 1 year ago • 1 comments

Problem We've identified two issues affecting emote playback in wearables:

  1. Non-standard node naming:

    • Some wearables use non-standard names for skeleton nodes (e.g., "Armature.001" instead of "Armature")
    • This breaks compatibility with emotes that expect standard node names
    • While we've patched the preview to handle numeric suffixes, other naming variations could still cause issues
  2. Animation dependency on skeleton hierarchy:

    • Some emotes (like the DAO Pony emote) use a mixed animation approach:
      • Main motion is applied to the Armature node
      • Short positioning animations are applied to individual bones
    • This approach relies on proper skeleton hierarchy for bone inheritance
    • If the Armature node isn't found or properly named, the entire animation fails

Solution The Wearable Editor should automatically validate these issues before allowing wearable publication:

  1. Node Name Validation:

    • Scan the GLB file's node hierarchy
    • Check for standard DCL node naming convention
    • Flag any deviations from the standard naming (e.g., "Armature.001", "Avatar_Head.001")
    • Prevent users from publishing such GLB and show them the faulty names of the nodes.
  2. Animation Baking Validation:

    • Analyze animation data in the GLB
    • Detect if animations are properly baked to all relevant bones
    • Flag animations that only target the Armature without full bone baking
    • Warn users that this approach of animation could not work on legacy emotes that don't have a propery skeleton hierarchy, encourage them to bake animations in all bones.

Implementation Path

  1. GLB Inspection:

    • Use existing GLB parsing libraries (like @babylonjs/core) to load and inspect models
    • Create a validation module that:
      • Lists all nodes in the hierarchy
      • Identifies standard DCL node names vs non-standard ones
      • Maps animation targets and their keyframes
  2. Validation Rules:

    • Define a list of standard DCL node names
    • Create rules for valid node naming patterns
    • Define requirements for animation baking coverage
  3. UI Integration:

    • Add validation step in the import provess
    • Show clear error messages for naming issues
    • Show warning messages for animation issues
  4. Documentation:

    • Update wearable creation guidelines
    • Document standard node naming requirements
    • Explain animation baking best practices

This enhancement will improve wearable compatibility and reduce animation issues in the platform. It can be tested using the BabylonJS Sandbox (https://sandbox.babylonjs.com) to verify proper node naming and animation baking.

Related

  • Preview fix PR: https://github.com/decentraland/wearable-preview/pull/119

cazala avatar Jan 10 '25 15:01 cazala

These are the name conventions for the skeleton of the wearables:

Root

  • Armature

Base Structure

  • Avatar_Hips
  • Avatar_Spine
  • Avatar_Spine1
  • Avatar_Spine2

Head

  • Avatar_Neck
  • Avatar_Head

Left Arm

  • Avatar_LeftShoulder
  • Avatar_LeftArm
  • Avatar_LeftForeArm
  • Avatar_LeftHand

Left Hand Fingers

  • Avatar_LeftHandThumb1
  • Avatar_LeftHandThumb2
  • Avatar_LeftHandThumb3
  • Avatar_LeftHandThumb4
  • Avatar_LeftHandIndex1
  • Avatar_LeftHandIndex2
  • Avatar_LeftHandIndex3
  • Avatar_LeftHandIndex4
  • Avatar_LeftHandMiddle1
  • Avatar_LeftHandMiddle2
  • Avatar_LeftHandMiddle3
  • Avatar_LeftHandMiddle4
  • Avatar_LeftHandRing1
  • Avatar_LeftHandRing2
  • Avatar_LeftHandRing3
  • Avatar_LeftHandRing4
  • Avatar_LeftHandPinky1
  • Avatar_LeftHandPinky2
  • Avatar_LeftHandPinky3
  • Avatar_LeftHandPinky4

Right Arm

  • Avatar_RightShoulder
  • Avatar_RightArm
  • Avatar_RightForeArm
  • Avatar_RightHand

Right Hand Fingers

  • Avatar_RightHandThumb1
  • Avatar_RightHandThumb2
  • Avatar_RightHandThumb3
  • Avatar_RightHandThumb4
  • Avatar_RightHandIndex1
  • Avatar_RightHandIndex2
  • Avatar_RightHandIndex3
  • Avatar_RightHandIndex4
  • Avatar_RightHandMiddle1
  • Avatar_RightHandMiddle2
  • Avatar_RightHandMiddle3
  • Avatar_RightHandMiddle4
  • Avatar_RightHandRing1
  • Avatar_RightHandRing2
  • Avatar_RightHandRing3
  • Avatar_RightHandRing4
  • Avatar_RightHandPinky1
  • Avatar_RightHandPinky2
  • Avatar_RightHandPinky3
  • Avatar_RightHandPinky4

Legs

  • Avatar_LeftUpLeg
  • Avatar_LeftLeg
  • Avatar_LeftFoot
  • Avatar_LeftToeBase
  • Avatar_RightUpLeg
  • Avatar_RightLeg
  • Avatar_RightFoot
  • Avatar_RightToeBase

cazala avatar Jan 13 '25 14:01 cazala