Skip to content

Improve RuntimeUtil.IsAvatarRoot() #68

Open
@kaikoga

Description

@kaikoga

public static bool IsAvatarRoot(Transform target)
{
#if NDMF_VRCSDK3_AVATARS
return target.GetComponent<VRCAvatarDescriptor>();
#else
var an = target.GetComponent<Animator>();
if (!an) return false;
var parent = target.transform.parent;
return !(parent && parent.GetComponentInParent<Animator>());
#endif
}

as-is

  • VRCSDK project: true for VRC avatars, false for non-VRC avatars
  • non-VRCSDK project: true for VRC and non-VRC avatars

to-be

  • VRCSDK projects should be able to handle non-VRC avatars, but not lenient enough to treat all Animators as avatars
  • Something like...?
    • If any avatar platform is detected (for example, VRCSDK and/or uniVRM), iterate through all platform specific checks
    • Else, fallback to Animator heuristic (current non-VRC implementation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions