Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom Humanoid Avatar representation in Editor

Discussion in 'Immediate Mode GUI (IMGUI)' started by Subliminum, Jan 26, 2019.

  1. Subliminum

    Subliminum

    Joined:
    Nov 9, 2017
    Posts:
    97
    Hello,

    I was wondering if it is possible to have a custom avatar style humanoid representation in the editor for displaying information about a ragdoll? I couldn't find anything online other then the normal tutorials for Avatar masking etc. I thought this could be a nifty way to get a graphic of the ragdoll's various limb states. Any help would be greatly appreciated! :)

    Subliminum.
     
  2. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    Hi,

    I have actually attempted this myself (https://forum.unity.com/threads/making-custom-avatarmask-style-editor.514769/)

    You can find how unity made the avatar editor here: https://github.com/Unity-Technologi.../Editor/Mono/Inspector/AvatarMaskInspector.cs


    From what I remember the editor works like this:
    There are two images, one image is what you see(okay its actually multiple images of all the body parts) and the other image is used as a sort of bounding box, lets call this image
    ImageB
    . ImageB has different coloured areas which relate to each bodypart. these areas would overlay the corresponding bodypart if the images where drawn on top of one another.

    When the user clicks on the editor, it gets the location of that click (in pixels), then it gets the pixel in that location from
    ImageB
    .

    It then gets the colour of that pixel.

    From the colour it knows which bodypart was selected. the head might be yellow, and a leg might be green.

    With that information it turns the bodypart on/off


    I hope that helps
     
    Subliminum likes this.
  3. Subliminum

    Subliminum

    Joined:
    Nov 9, 2017
    Posts:
    97
    Wow thanks! This will come in handy, i've always wondered how they'd built that UI.
     
  4. Subliminum

    Subliminum

    Joined:
    Nov 9, 2017
    Posts:
    97
    Here's a package containing some graphics i'm going to try to use to make a similar system, for anybody interested in this :)
     

    Attached Files:

    BinaryCats likes this.