Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UMA - Unity Multipurpose Avatar on the Asset Store!

Discussion in 'Assets and Asset Store' started by FernandoRibeiro, Dec 24, 2013.

  1. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    Looks to me like your animation source is set to generic,... Make sure you are using a humanoid source.
     
  2. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
  3. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
  4. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
  5. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    This is unfortunately correct. You pay the cost of blendshapes whether they are active or not.
     
    hopeful likes this.
  6. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
  7. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    I was gone for awhile, so just now catching up on this thread. Blendshape baking is a feature in UMA currently. It allows you to "bake" a blendshape's current value so that there is no performance cost from the blendshape. It removes the unity blendshape from the skinned mesh and adds the vertex offsets to the mesh itself during the combining phase. So all you pay is a very very small increase in generation time.

    Now, this wouldn't allow for a dynamic runtime morph (you can unbake it at any time though and/or rebake it), so it wouldn't be useful for say facial animations, but would be useful for body morphs, that presumably wouldn't change after character creation. So, during the character creator (with only 1 character in the scene), you'd have all the blendshapes active and unbaked. Save your customization settings, then once the player enters the game, you bake the blendshapes so that there is no runtime cost. This is all in the blendshape example scene.

    Right now, the api isn't now as simple and clean as I'd like, it's currently a public dictionary on umaData with the key being the blendshape name to bake and the value the weight to bake it at. So you have to manually add/remove entries and convert the dna value to the right range. I'm going to change that soon for the next release though so all that is taken care of automatically.
     
    hopeful likes this.
  8. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    That
    That may be the reason I didn’t see any difference. The blend shapes were present in both tests...as I used the same models.
     
  9. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    Not sure if this is the problem, but make sure your rig has been imported and set to Humanoid AND the animation is imported and set to humanoid.
     
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    It IS a mecanim type issue, though, not an UMA type one. Are you setting the animator up properly in UMA? It's acting like there is no animation set, if I remember right.
     
    FiveFingerStudios likes this.
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    Thanks so much for clarifying this! As a regular reader of this thread, I probably knew all of this at some point, but every once in a while I need a refresher. ;)

    The idea of baking one-and-done blendshapes in the character creator is awesome. That way if you need to morph the character into an alien and this changes the shape of the goggles and everything else the character is wearing, you're still golden ... because all of those zillion blendshapes can be removed once the character is ready to be baked.

    Another example would be if you wanted the player to be able to adjust the width of the brim of their hat, or the size of their mustache. Once the character is finished, bake away those parameters.

    Then, as SecretAnorak has been showing, a small number of dynamic blendshapes on a slot can be kept for expression or other special things. With LOD, this can be kept under control and not consume too much processor.

    Though, I suppose we still need to be judicious in their use, as adding a lot more blendshapes is going to make recipes longer and lengthen the instantiation process for UMAs ... I assume?
     
  12. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    You're welcome. Yea you got the idea. You could even "rebake" (without unbaking) a new value for a blendshape, rebuild the UMA, and have the new vertex positions. So, like if you wanted to have a potion that made your character strong, you could set a high value for the "muscular" morph and rebuild for it to take effect, then when it wears off, set value back to the original and rebuild. So in essence, you can use blendshapes that are baked as artist friendly mesh manipulations at runtime.

    Yea, for non-baked blendshapes every unique blendshape name will come at a cost. I bolded blendshape names because you can have the same blendshape name across many slots and the cost will be almost the same as if only one slot had that blendshape. That's needed and recommended to be able to sync blendshapes across slots, eg; muscular blendshape for torso and muscular blendshshirt so they both morph in sync.
    For baked blendshapes I think the cost per unique blendshape would be much less. I can't remember any details of performance testing. I think I have a umafied humanoid from infinitypbr with lots of blendshapes that I can test when I get home and post the results.
     
    hopeful likes this.
  13. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    Is there a Slack group for UMA? If so, is it possible to get an invite?
     
  14. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    Yea, private message me your email and i'll send you an invite.
     
  15. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
    2018-06-10_19h19_13.png 2018-06-10_19h18_39.png

    For some reason i cant get the clothes to appear on the the avatar. I put the recipe on the avatar and i put the slots and overlay in the library i setup the overlay (texture/diffuse/normal, not how i have it in the photo) yet i cant get it to appear on the avatar
     
  16. Vygar

    Vygar

    Joined:
    Dec 20, 2015
    Posts:
    23
    Recently, I've been putting together a little UMA integration for a project I am working on and I have a couple of questions.

    1) Is there a way to force the avatar's mouth shut without editing my animation files?
    2) At what point after instantiating the Avatar into a scene is it ready to accept the WardrobeRecipes? I tried doing my wardrobe loading in the CharacterCreated callback and even though the slots are applied, they are not shown on the avatar. Tying this same function to a button works just fine just not immediately after instantiating the avatar. What am I doing wrong here?
     
  17. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    Are there any error messages in the console? Is the race of your avatar in the list of compatible races?
     
  18. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    1. You can add the expression player to your character, and that will shut his mouth.
    2. If you are dynamically creating an avatar, you can just add the wardrobe when you create it, you don't have to do it in an event:

    GameObject go = GameObject.Instantiate(AvatarPrefab);
    DynamicCharacterAvatar dca = go.GetComponent<DynamicCharacterAvatar>();
    dca.SetSlot(AddMe); // AddMe is any compatible Wardrobe Recipe.
     
    hopeful likes this.
  19. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    If you aren't going to do any facial animation you can also keep their mouth shut by using a T-Pose with no jaw defined which is more efficient than doing it with the expression player.
     
    hopeful and Jaimi like this.
  20. Vygar

    Vygar

    Joined:
    Dec 20, 2015
    Posts:
    23
    Thank you for the reply! It is much appreciated. I'm using the CharacterCreated event in order to find the Animator and set the runtime-controller (which isn't found if I try to call it too early). Also, I found that if I call my slot method within a delayed Invoke from the CharacterCreated event it works. I still think I am doing something wrong here and I could be misunderstanding what CharacterCreated actually means in the context of this package.
     
  21. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    CharacterCreated is called after the character is built - so you are in effect putting his wardrobe on AFTER he is made. If you put in the delay, then what happens is you are building him twice.

    As part of the startup of the Avatar, the character is built and the following happens:

    • The base race recipe and wardrobe recipes are merged into a single recipe
    • Shared Colors are adjusted on the recipe
    • The character is scheduled to be generated by placing in the queue. If the character is already in the queue, they are not added a second time (only generate it once).
    • (a frame may pass here)
    • The character is generated by the generator
    • When generation is complete, the event is fired. (if the character is scheduled to be built while in the event, it will be ignored because it's still the queued item - if this didn't happen, it could generate an infinite loop as the character gets added to the queue, the events called again, etc.)

    So it's best to just add your stuff to the Avatar right as you create it. Or load him from a character file, or a string.
     
    hopeful likes this.
  22. Vygar

    Vygar

    Joined:
    Dec 20, 2015
    Posts:
    23
    Ah! That makes a lot of sense! Thanks!
     
  23. Vygar

    Vygar

    Joined:
    Dec 20, 2015
    Posts:
    23
    This was just what I needed! Got my little system working as I had hoped.


    Both of these are great suggestions, thank you! I kind of like the idea of a facial expression when the character takes damage. However, a new TPose is also a great idea. I'll have to think on this. Thanks fellas :)
     
    hopeful and Jaimi like this.
  24. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
    My fighters don't but the others have an error that says "____ has a mesh but no material"
     
  25. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I believe I have ran into an issue with dual wield items with UMA, Inventory Pro and Opsive Third Person Controller. In Inventory Pro it appears that the items is unequipped but the TPC animator doesn't update.
    Can anyone help me with this?
     
  26. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    what makes you suspect UMA is causing the issue?

    With a 28k vert, 27k tri, 345 blendshapes "umafied" human male model from infinitypbr.
    No blendshape generation - 21 ms to generate
    All regular blendshapes - 680 ms to generate!
    Baked 272 blendshapes all with weight (zero weighted blendshape get skipped) - 240 ms to generate

    I added some new optimizations in the develop branch that brought the baked blendshapes down from ~500ms to 240ms. Also, I didn't bake all blendshapes, so it could have been even faster if everything was baked. They weren't all baked because I had read the blendshape dna to know what to bake, and the dna didn't have all the blendshapes set up.
     
    hopeful likes this.
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    Thanks so much for looking into this and adding new efficiencies! :)

    I haven't really thought this through, but in a case where we assume that blendshapes are present in the slot library for player use in customization, and not for NPC generation (which would just use bones, as they are more efficient) ... can we specify that the generator skip blendshapes when making NPCs?
     
  28. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    Yea, there is a boolean, loadBlendShapes, on the DCA (and/or umaData) that will skip combining blendshapes entirely or not. It's false by default.
     
    hopeful likes this.
  29. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm not blaming UMA. I forgot to add important information that would make the issue more sense. I'm using the integration code from Secret Anorak. The code that he included with the youtube video. I believe it's an issue with in his code. I asked if he could help with the issue but he said, "I wish I had the time to work that through for you. What I can point you towards is the fact that UMA resets the animator whenever there is a rebuild, so this might be causing your problem. I can only recommend you use the UMA forum thread where minds far." So that's why I'm posting here. I'm using Inventory Pro, UMA2, and Third Person Controller by opsive.

     
  30. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    I know you're not blaming it, I was just curious if you had anymore information of why you thought it might be UMA.
    In your video I can see you're not rebuilding the UMA because you're hiding and unhiding the weapons (normal way to do that), so it wouldn't be an issue with the animator resetting. From the video my suspicion would be TPC. I see the inventory is working correctly and the object is being hidden/unhidden, so it's most likely an issue on TPC's side. I seem to recall a bug or "gotcha" with TPC and dual wielding. Have you check their forum? In your video, there doesn't appear to be any "UMA" things going on when you are encountering that bug.

    It's been awhile since i've used TPC, but I thought for dual-wielding you'd need a state like "OneHand Shield". I only see a state for "Shield" that it's defaulting to for both your mace or shield, and when you dual wield it's stuck on that. Have you tried this animator setup with a regular model to rule out any UMA cause?
     
    Last edited: Jul 18, 2018
  31. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    With the character I used before UMA everything worked. When the player has the mac and shield then unequips them the animator would switch like normal. But using the UMA character and the Inventory Pro code from Secret Anorak the dual wield is not changing the animator back to unarmed like the rest of the weapons.
     
  32. chaza_li

    chaza_li

    Joined:
    Jan 8, 2018
    Posts:
    29
    Hi UMA team,

    With what way can I add recipes to a DynamicCharacterAvatar through script? For example, like using a button and appending a certain piece of clothes to a UMA character?
     
  33. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    The function to add a wardrobe item to a DynamicCharacterAvatar is SetSlot();

    public UMAWardrobeRecipe theRecipe;

    SetSlot(theRecipe);

    Every wardrobe recipe knows where it goes, so you don't have to specify a slot.

    Look here for more informaton:

    http://umawiki.secretanorak.com/Wardrobe
     
    hopeful likes this.
  34. chaza_li

    chaza_li

    Joined:
    Jan 8, 2018
    Posts:
    29
    Hi Jaimi,

    Thanks for the prompt reply! Is there anyway I can retrieve all UMAWardrobeRecipes for the current race all at once? Or should I just make a list in the inspector panel and manually drag them in?

    Thanks so much!
     
  35. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    yeah - I'm not at my computer, but if you look at the simple setup sample scene, it does just that - pulls all the recipes for the current race - in the sample code.
     
  36. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Anyone have any ideas on my issue?
     
  37. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    Can you give us any more information? Any errors in the console? There's an animator state debug you can turn on for TPC. Try turning that on and confirm whether TPC is trying to set the correct state or not.
     
    Last edited: Jul 19, 2018
  38. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171

    Here's the code - it pulls all the recipes from the Avatar (Avatar.AvailableRecipes).

    The Key on the dictionary is the Wardrobe Slot. The Value for the key is a List of the recipes for that Wardrobe Slot.

    Code (CSharp):
    1.         /// <summary>
    2.         /// Wardrobe Button event handler
    3.         /// </summary>
    4.         public void WardrobeClick()
    5.         {
    6.             Cleanup();
    7.  
    8.             Dictionary<string, List<UMATextRecipe>> recipes = Avatar.AvailableRecipes;
    9.  
    10.             foreach (string s in recipes.Keys)
    11.             {
    12.                 GameObject go = GameObject.Instantiate(SlotPrefab);
    13.                 SlotHandler sh = go.GetComponent<SlotHandler>();
    14.                 sh.Setup(Avatar, s,WardrobePanel);
    15.                 Text txt = go.GetComponentInChildren<Text>();
    16.                 txt.text = s;
    17.                 go.transform.SetParent(SlotPanel.transform);
    18.             }
    19.         }
     
  39. chaza_li

    chaza_li

    Joined:
    Jan 8, 2018
    Posts:
    29
    Thanks Jaimi!

    My apologies if I'm missing out something crucial, but it seems that I can't retrieve the AvailableRecipes from Avatar? Is there a specific type that Avatar has to be? I've tried objects of type UMADynamicAvatar and UMAAvatarBase but they do not give me the choice of retrieving Available recipes.
     
  40. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    DynamicCharacterAvatar. That's the component the uma object is using in the "Simple Setup" scene.
     
    Jaimi likes this.
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    I have some UMA clothing that is in the form of Overlay assets, but I can't find instructions on how to use these overlays on the UMADynamicCharacterAvatar. The most I was able to do was drag the Overlay asset to the DynamicOverlayLibrary on the UMA_DCS prefab in the scene, but I have no clue how to get it onto the character. Is there a video on this somewhere?

    [EDIT]
    I found a video that sort of explains it and was able to get it working. A lot more complicated than I would have thought, but not too bad.
     
    Last edited: Jul 21, 2018
  42. umutozkan

    umutozkan

    Joined:
    Oct 30, 2015
    Posts:
    406
    Glad you found out how to do it. I'll try to answer the question anyway for other people that might need to to do the same thing.

    In UMA world overlays hold the textures information along with what UMA material to be used with it. The textures on it depend on the UMA material the overlay uses. (UMA Material depends on the Unity Material it uses and the Unity material depends on the shader) For example UMA standard diffuse normal metallic material requires albedo, metallic and normal textures. This could be completely different for some other UMA material.

    Overlays are applied on top of a UMA Slot. The slot is what holds the geometry information (mesh) in UMA world. This is the same whether you are using the dynamic avatar or the old way. The slot also has the UMA material data on it showing which UMA material it expects on itself. That should be the same with the overlay you are using with that slot.

    For the dynamic avatar, wardrobe recipes are where slot and the overlays come together. You create the recipe. You set the other parts (like the race the recipe is for, the name of the recipe, which wardrobe slot it uses etc.). Then you put the slots on the recipe. After putting the slot you'll see fields for overlay(s) to use with that slot. More than one overlay could be applied to the same slot and they will show on top of previous one.

    Usually, when you create a wardrobe item you have it's own mesh and you create a slot for it and overlay(s). But sometimes (probably this is what you have) overlays may be created that is supposed to be used on body slots (like tight clothing.). For those, you can select the body slots from the combo box in the recipe inspector window. You should put every body slot the clothing covers and put the overlay on each of them. (For example, consider you have an overlay for socks. That should be visible on both feet and the legs part. What you do is putting both the feet slot and the legs slot on the recipe and set the same socks overlay on both of them).

    It's not that complicated actually :) It'll be easier when you get the hang of it.
     
    TeagansDad, kenamis and Jaimi like this.
  43. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    What about clothing for different races? I purchased an Orc race for UMA, but none of the clothing I have works for it. I tried adding Orc as a compatible race in the recipe, but it didn't like it. So it seems that clothing must be designed specifically for a specific race/gender or it doesn't work?
     
  44. umutozkan

    umutozkan

    Joined:
    Oct 30, 2015
    Posts:
    406
    Well if you are talking about these; male orc | female orc then it's not mesh compatible with base UMA, but it is overlay compatible (may need a little work). Orc races require o3n Male & Female Races and use its slots. Changes the DNA only (except teeth). (This is forum page for o3n races)

    Those happen to be my packages on the store by the way :)

    o3n races' meshes are not compatible with base UMA. That means even if you manage to put a clothing item for base UMA on them, it won't fit because of different geometry. On the other hand, texture UV space is the same as the base UMA. That means you can make an overlay only clothing for base UMA work for o3n Races. It just requires a little work.

    I can walk you through it if you'd like. You can post on o3n Races' forum page or you can join the UMA slack channel.
     
  45. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    That would be great. Yes, I'd like some help with getting it to work. I'll post in your forums when I'm ready to work on it again. And thanks.
     
  46. umutozkan

    umutozkan

    Joined:
    Oct 30, 2015
    Posts:
    406
    Sure no problem.
     
  47. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I have created two videos showing the weapon equipping with TPC and UMA.

    UMA Player -

    TPC Player -
     
  48. KaidaStudios

    KaidaStudios

    Joined:
    Aug 4, 2017
    Posts:
    34
    How in the world do I add a weapon? Im using DCS, I figured out how to add clothing and wardrobe, but I cant find out how to add items on their hands.. like a sword and shield , any help? Thank you!
     
  49. Bantichai

    Bantichai

    Joined:
    Nov 6, 2016
    Posts:
    138
    Does anyone know if @UnLogick is still active? I've been trying to get in contact with him regarding an update to UMA powertools, haven't had any luck.
     
  50. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hi @Bantichai
    I've been completely swamped for a while, I can't tell exactly when I'll catch up, but I still intend to.