decentraland / unity-renderer

Unity implementation of Decentraland Client
https://play.decentraland.org
Apache License 2.0
137 stars 93 forks source link

feat: add more avatar attach points #6198

Closed AlejandroAlvarezMelucciDCL closed 4 months ago

AlejandroAlvarezMelucciDCL commented 4 months ago

What does this PR change?

Adds more avatar attach points How it looks like in a test scene: image

How it looks like in unity-renderer (we don't interact with this directly):

private static readonly Dictionary<AvatarAnchorPointIds, string> boneMapping = new ()
{
    { AvatarAnchorPointIds.LeftHand, "Avatar_LeftHand" },
    { AvatarAnchorPointIds.RightHand, "Avatar_RightHand" },
    { AvatarAnchorPointIds.Head, "Avatar_Head" },
    { AvatarAnchorPointIds.Neck, "Avatar_Neck" },
    { AvatarAnchorPointIds.Spine, "Avatar_Spine" },
    { AvatarAnchorPointIds.Spine1, "Avatar_Spine1" },
    { AvatarAnchorPointIds.Spine2, "Avatar_Spine2" },
    { AvatarAnchorPointIds.Hip, "Avatar_Hip" },
    { AvatarAnchorPointIds.LeftShoulder, "Avatar_LeftShoulder" },
    { AvatarAnchorPointIds.LeftArm, "Avatar_LeftArm" },
    { AvatarAnchorPointIds.LeftForearm, "Avatar_LeftForearm" },
    { AvatarAnchorPointIds.LeftHandIndex, "Avatar_LeftHandIndex" },
    { AvatarAnchorPointIds.RightShoulder, "Avatar_RightShoulder" },
    { AvatarAnchorPointIds.RightArm, "Avatar_RightArm" },
    { AvatarAnchorPointIds.RightForearm, "Avatar_RightForearm" },
    { AvatarAnchorPointIds.RightHandIndex, "Avatar_RightHandIndex" },
    { AvatarAnchorPointIds.LeftUpLeg, "Avatar_LeftUpLeg" },
    { AvatarAnchorPointIds.LeftLeg, "Avatar_LeftLeg" },
    { AvatarAnchorPointIds.LeftFoot, "Avatar_LeftFoot" },
    { AvatarAnchorPointIds.LeftToeBase, "Avatar_LeftToeBase" },
    { AvatarAnchorPointIds.RightUpLeg, "Avatar_RightUpLeg" },
    { AvatarAnchorPointIds.RightLeg, "Avatar_RightLeg" },
    { AvatarAnchorPointIds.RightFoot, "Avatar_RightFoot" },
    { AvatarAnchorPointIds.RightToeBase, "Avatar_RightToeBase" },
};

image

How it looks like in the SDK, for content creators: (addBox is a custom method for testing this, it just creates an entity, adds a transform and mesh renderer with the specified color and attach it to the specified point) image

How to test the changes?

  1. Use the following url: PLAYGROUND
  2. On the code on the left, add or remove // to show/hide bars for each attach point image

Our Code Review Standards

https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md

Copilot summary

copilot:summary

github-actions[bot] commented 4 months ago

After the CI passes:

Web

This branch can be previewed at:

Desktop:

If you have the launcher installed (download launcher) you can press open on the following link:

SDK 7

SDK 6

More