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. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    The above patch to SkinnedMeshCombiner.cs put the bone count down to 103 and generally put performance back to what it was in 1.x.

    Not understanding what's really going on there, isn't there some way to cache that data? That's an awfully expensive piece of code to be running all the time.
     
  2. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    It's a bug in the code which is supposed to fix slots which have the same skeleton but were exported from different software so the bone binding in the skinning doesn't match.

    If that doesn't make sense you just need to know it's a bug and will get fixed. ;)
     
  3. blumental

    blumental

    Joined:
    Mar 1, 2015
    Posts:
    5
    Hello, guys!

    Could you a little bit help me: I'd like to know, if it is possible to change the shape of an avatar right in Unity. Suppose, I take a male asset from "UMA / UMA_Assets / Races / Human male" and add it to the hierarchy of my project. And now I'd like to make his shoulders much bigger, his waist incredibly thinner, etc. Do I have to go to Blender for that, make the changes there and then import it again to Unity? Or there is a way to carry out such transformations right in Unity?

    Thank you in advance!
     
    Dajack likes this.
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    So for optimizing for lots of uma characters on screen in an environment where losing a lot of detail is just fine, what is a good general approach? I have a large open world massive pvp game where 200+ uma characters on screen is a baseline.

    I'm basically looking to see if there are any quick and dirty solutions I can do now for testing/alpha, but also what's the long term approach.

    Long term is the solution just creating models for the slots with lower poly counts, and rigging with fewer bones? What about combining slots? For instance let's say I take all the slots where I don't want to customize them but just always have them the same, would it make sense to combine those into a single slot?
     
  5. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    This is floating point comparison so I'm suspecting it could be hardware related... please list OS along with results.

    Win 7 - Intel, exactly 53 bones for all crowd avatars
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Win 7 here as well
     
  7. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Intel or AMD?
     
  8. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
  9. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Just glancing at the code, just the way it's written is begging for strange errors. It's doing far more then it should, and it's modifying two of the input parameters and returning a value??? Floating point errors would be the last place I would be looking.
     
  10. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Crap... so what is it then?

    ecurtz had repro and I got him on skype... we'll try to sort this out tomorrow.

    About caching it and stuff... this check is supposed to run 53 times per SlotData... And it only happens when creating the character... it does not take a significant amount of time on my system. All it should be doing is do 16 float compares. The number of times the check is performed increases only when you add your own additional bones or if you use 3rd party meshes that would otherwise fail and give incorrect results!

    If we wanted to we could reduce the number to much less than 53 times per Slot simply by processing the mesh and remove unused bone references. The Head Slots really doesn't need the finger bones. ;)
     
  11. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    How would you go about merging and matching multiple bone lists where each bone is allowed to appear more than once with different bind poses?

    Adding the bindpose to the list is merely done for convenience, if we didn't add it here we would have to do additional processing to find the bindposes later. We could add the data to the BoneIndexEntry but I fail to see how that would be more neat.

    The other argument we change is a the dictionary of other known bones and bindpose combinations, this is utterly crucial.

    The only way to pretty it up would be to wrap everything into a class/struct such avoiding the List and Dictionary to be arguments. If you feel strongly for it I don't mind if you tidy it up. :)
     
  12. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    I'm in the process of loading my created character (saved to a string in playerprefs) to my game scene. I have it working with the following code but I'd like to clean it up a bit. I only need the Male_Unified object. Is there a cleaner way to do this or do I need to manually remove Male_Unified from the parents and destroy what I don't need?

    UMA_Capture.JPG

    Code (CSharp):
    1. createdCharacter = new GameObject("Player Character");
    2.         var umaDynamicAvatar = createdCharacter.AddComponent<UMADynamicAvatar>();
    3.         umaDynamicAvatar.Initialize();
    4.         umaData = umaDynamicAvatar.umaData;
    5.  
    6.         var avatar = umaData.gameObject.GetComponent<UMAAvatarBase>();
    7.  
    8.         CharacterString = PlayerPrefs.GetString("Character");
    9.  
    10.         var asset = ScriptableObject.CreateInstance<UMATextRecipe>();
    11.         asset.recipeString = CharacterString;
    12.         avatar.Load(asset);
    13.         Destroy(asset);
    Thanks
     
  13. AMEncurio

    AMEncurio

    Joined:
    Apr 3, 2014
    Posts:
    2
    Well, I know it's difficult to give an estimate for when something is done regarding programming, still gotta ask :D
    How long do you think will it take you to finish the Unity 5 shader conversion?
    I just need an estimate, like 2 weeks or 3 months if possible :)

    And thanks for UMA, it's truly an amazing asset!
     
  14. GMagnetic

    GMagnetic

    Joined:
    Dec 8, 2014
    Posts:
    23
    Hmmm... more noob questions.

    I want to attach a mixamo animation that is currently attached to a free maximo character to a UMA avatar.
    The animation works fine with the original character, but when attached to the UMA avatar it does not work.
    The UMA avatar floats up slowly through the plane and the legs are bent and deformed. I presume this has something to do with rigging, etc. but I can't seem to find a tutorial that explains how to properly accomplish this.

    Is there a tutorial on this that I can't seem to find?

    Any help much appreciated.
     
  15. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Sounds like the animation isn't imported as Mecanim Humanoid. Select the mixamo character fbx file and set it up as Mecanim Humanoid. Then add the animation to an Animation Controller and tell UMA to use that animation controller. Do not try to change the Animation Controller at run-time after the character have been created, tell UMA in advance!
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,629
    Looking forward to using UMA2 in U5 indie! :)
     
  17. GMagnetic

    GMagnetic

    Joined:
    Dec 8, 2014
    Posts:
    23
    100% correct, had to select humanoid and add the clip before run time, thanks.
     
  18. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    We're talking about removing support for 4.6.x non-pro and just cut everything related to the old indie atlassing in UMA2.0.

    Is there any UMA projects out there running Unity 4.6.x on indie license who doesn't plan on going Unity 5 after this announcement?
     
    ImpossibleRobert likes this.
  19. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    UnLogick and I fixed the excessive bind bones. It was an issue with the Matrix4x4 equality test being too strict.
     
    cyby89 and hopeful like this.
  20. Urbanwarfare-Std

    Urbanwarfare-Std

    Joined:
    Jan 6, 2013
    Posts:
    33
    Sorry if this question has been covered before (I didn't find it). Is there a tutorial regarding how to save your avatar so it can be used in a project without having to have the generator running etc? Also how do you modify settings on the rig it generates (for example altering the default settings for fixed positions on the Y-axis etc so that UMA generates with those settings included on each instance)

    I'm currently using UMA to generate avatars for a field hockey simulation game - its working great so far thank you for making this for Unity, keep up the good work :)

    TIA

     
    ImpossibleRobert likes this.
  21. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Bump :)
     
  22. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    In order to use UMA characters without the generator you need to save them into prefabs. Essentially this means saving the mesh, the avatar, the textures and the entire hierarchy into a prefab. My power tools contains a method to do that.

    I'm not sure what you mean about altering the Y-axis, but if you want to alter the character pose then that is stored in the t-pose asset. You can make new t-pose assets by opening the mecanim customization for the unified character and adjusting the mecanim t-pose. Once you're happy with the result use the menu item UMA|Extract T-Pose to save the t-pose and assign the new t-pose to the RaceData.
     
    Dreamaster likes this.
  23. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Not quite sure what you're asking. Your code should work fine though there is a bit redundant code in the middle. This is a tiny bit cleaner.

    Code (CSharp):
    1. createdCharacter = new GameObject("Player Character");
    2.         var umaDynamicAvatar = createdCharacter.AddComponent<UMADynamicAvatar>();
    3.         umaDynamicAvatar.Initialize();
    4.  
    5.         CharacterString = PlayerPrefs.GetString("Character");
    6.  
    7.         var asset = ScriptableObject.CreateInstance<UMATextRecipe>();
    8.         asset.recipeString = CharacterString;
    9.         umaDynamicAvatar.Load(asset);
    10.         Destroy(asset);
    The whole part about Creating the ScriptableObject may seem odd, but it allowed us to seperate the load/save logic from the core UMAData where it didn't belong. It also allows alternate file formats, which is important if you have an mmo type networked game with many characters.

    It is possible to remove the constant creation and destruction of the TextRecipe by re-using a single recipe. Then the code would look like this:
    Code (CSharp):
    1. createdCharacter = new GameObject("Player Character");
    2.         var umaDynamicAvatar = createdCharacter.AddComponent<UMADynamicAvatar>();
    3.         umaDynamicAvatar.Initialize();
    4.  
    5.         umaRecipeAsset.recipeString =
    6. PlayerPrefs.GetString("Character");
    7.         umaDynamicAvatar.Load(umaRecipeAsset);
    As soon as Load has been called there is no harm in changing the umaRecipeAsset again.
     
  24. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Two questions
    1) Is the uma 2x http://uma.unity3d.com/wiki/index.php/UMA2x compatible with unity 5!?

    2) I have got most of UMA down to a T manually. I have imported several slots and can edit in the editor/use the little DNA .asset to apply these slots and overlays. However, how do I simply add a slot (item of clothing) by script.???
    Is there some video or documentation I have missed (please link if I have)
    Otherwise I presume I would start with a variable with the slot attached or load it from resources

    then do I need to access UMADynamicAvatar?
    I can see a .SetSlots and GetSlots function but how do I work with it?
     
  25. Suraia

    Suraia

    Joined:
    Oct 20, 2014
    Posts:
    16
    Hi,

    Me again. I wanted to try and add my own outfit I'm trying to make for my project using UMA. So I started with the pants I made in blender following Fernando's UMA Cloth creation tutorial when I noticed this one is for the beta version I think.

    I copied the legs mesh of the separated female mesh and scaled it a bit to begin with. I created a new Normal map and a diffuse and specular map to try if it works.
    I made a folder in the slots folder and copied my exported FBX file there.


    Then I went to the races folder to get the female prefab mesh

    I dragged them into the UMA builder like so

    But no matter what I try it won't take the Race Prefab.

    I hope someone can help me with this so I can continue with my project.
    Thanks in advance.
     
  26. AMEncurio

    AMEncurio

    Joined:
    Apr 3, 2014
    Posts:
    2
    The prefab for the race has no SkinnedMeshRenderer component, so that field won't take it.
    Try using the unified female fbx file ;)
    MaterialBuilder_SkinnedMeshRenderer.JPG
     
  27. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
  28. Suraia

    Suraia

    Joined:
    Oct 20, 2014
    Posts:
    16
    Thanks AMEncurio,

    I think it works, but now I get an error or rather a whole bunch of them when I run the program.


    This is the RandomPool UMACrowd Random sets settings I made for the pants

    Needless to say my pants is not showing up in the game view.

    Can anyone help me with this?
     
  29. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    I just made SlotData, OverlayData and RaceData partial. This means you can create your own SlotData_Extension.cs that extends the UMA SlotData with your custom fields.

    SlotData_UnLogick.cs:
    Code (CSharp):
    1. namespace UMA
    2. {
    3.     public partial class SlotData
    4.     {
    5.         [UMAAssetFieldVisible]
    6.         public string UnLogick_MyString;
    7.     }
    8. }
    9.  
    Notice the newly created UMAAssetFieldVisible attribute, we use a lot of custom inspectors on the SlotData, OverlayData and RaceData, this attribute will ensure that the field becomes visible in the inspectors.

    You can use this change to add Descriptive Text or information about which overlay should be default for this slot or something like that. As long as you prefix the fields like I did with UnLogick_ above then you don't have to worry about UMA creating this exact field.
     
  30. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
  31. Couz

    Couz

    Joined:
    Nov 2, 2012
    Posts:
    3
    Hello everyone,

    I use the UMA for a while and I wonder if it is possible to make holes in the clothes using the Alpha?
    I did some tests and each time the holes are black, not transparent ...

    Thank you in advance
     
  32. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Sure you can, just set a transparent cutout shader on your material.
     
  33. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    What would be the answer to the second question? Help appreciated
     
  34. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Was this directed at me? how do I actually apply the variable to a UMA avatar??
     
  35. Suraia

    Suraia

    Joined:
    Oct 20, 2014
    Posts:
    16
    Thanks UnLogick,
    I'll check it out and hope I can get it to work with that :)
     
  36. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    No, for you I would recommend you take a look at the UMACrowd.cs

    Before the RandomSets the crowd used code to set up the avatars. That old legacy code is still there and if you remove all RandomSets the crowd will actually use it.
     
  37. Couz

    Couz

    Joined:
    Nov 2, 2012
    Posts:
    3
    Thanx UnLogick
     
  38. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    I'm taking a look some line quotes would be nice. Everything seems to reference random generation and the sets what I want is to apply a slot to a given avatar by script.
     
  39. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Here is what I have so far
    Code (CSharp):
    1.  
    2.     void ReloadGear(){
    3.         transform.root.GetComponent<UMADynamicAvatar>().umaData.umaRecipe.slotDataList = new SlotData[1];
    4.         transform.root.GetComponent<UMADynamicAvatar>().umaData.umaRecipe.SetSlot(0, slotLibrary.InstantiateSlot("Pilot"));
    5.         transform.root.GetComponent<UMADynamicAvatar>().umaData.umaRecipe.slotDataList[0].AddOverlay(overlayLibrary.InstantiateOverlay("Pilot"));
    6.     }
    I see the clothes in the data but not actually generating, do I need to setDirty() somehow ???
     
  40. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Yes, rather than building a complex notification system we decided that it was easier for everyone that you notify UMA yourself.

    Code (CSharp):
    1. transform.root.GetComponent<UMADynamicAvatar>().umaData.SetDirty(true,true,true);
     
  41. Massonator

    Massonator

    Joined:
    Feb 7, 2013
    Posts:
    4
    Hey guys.

    Great work with this project, I've been using it for months now for my character customiser. Though, I am currently having an issue, which I can't figure out how to fix.

    I've just upgraded to U5, and I am trying to use the built in PBS. The albedo map is working correctly and applying to the model, however the other maps will not apply unless I expand the shader section of the generated UMA's inspector. Strange little issue that I am not sure how to fix. Sorry if this has come up before too, this thread is quite long! In case it is needed, I am using U5 and UMA 2.0. This issue does not happen with the UMA Bump/ Specular or any legacy shader, just the new U5 shaders. Thanks!
     
  42. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Yes, it's very nice Eli and me have had our eyes on it for some time. It truly is stunning results, far better than any of the competitors I've seen.

    We're working on improving UMA Expressions so that it will one day reach the same quality. But for now this package seems to be unparalleled!
     
  43. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    You need to set the textureNameList on the Generator to { "_MainTex", "_BumpMap" }

    You assign material textures by name, and the shaders controls what is the "correct" name, so UMA needs to know those strings in order to work. I'll add a check in the Validate method to properly warn about incorrect textureNameLists. Note that this check will only be performed in the Editor as the run-time platforms have no way to retrieve them!
     
  44. Massonator

    Massonator

    Joined:
    Feb 7, 2013
    Posts:
    4
    Yes I had already done that. I was using a custom skin shader in Unity 4 before and had everything working correctly. It's not a naming issue, it is literally all fixed at runtime when I expand the shader details in the inspector of the generated UMA. I can provide screenshots if I am not being descriptive enough.
     
  45. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    This is not actually giving anything it cannot find a SetDirty function
     
  46. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    It's just Dirty(), not SetDirty()
     
  47. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    As stated in the Power Tools forum thread we're in a transition moving to UMA 2. Once UMA 2 is released on the asset store the Power Tools will support it, but our focus is launching UMA 2 because UMA 1 doesn't work with Unity 5. We could make UMA 1 work with Unity 5, but I feel that would only make the current confusion worse. :)

    The fact that Unity 5 comes full featured means that we're removing some indie code in UMA 2. The only ones who will be affected is Unity 4.x indie users. UMA 2 will support Unity 4.6 pro and Unity 5 free.

    As soon as UMA 2 is released proper I'll update the Power Tools to support it.
     
    adventurefan likes this.
  48. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Several git branches has been deleted. We now have the following branches.

    master (UMA 2x)
    uma122 (UMA 1x, latest asset store version)
    Unity5Purge (UMA 2x, clean up branch where we're removing indie code)
     
  49. Massonator

    Massonator

    Joined:
    Feb 7, 2013
    Posts:
    4
    Okay, so I've fixed my issue, and thought I would post about it to let others know and a quick fix for it. When the bump map is generated for the character and applied to the model, the shader has a default bump map scale of 0, making it appear as if the bump map is not there. I fixed this by just adding a place holder texture in the normal map on the material sample, and setting the normal map scale float value there.
     
  50. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Ecurtz and I have been hard at work optimizing the new UMA 2.

    I'd like to share our results with you. Keep in mind this is just a modified Crowd scene, to make the speed more impressive I'm destroying all unneccesary components like Locomotion and colliders. (But they are still being created as part of the default race prefab)

    Notice the creation speed as well as the atlas update speed when you cut the atlas sizes in half. You can use mousewheel to scroll closer and see the up close effects of the reduced atlas size, or you can scroll far away and see at which distance it becomes impossible to tell.

    Warning: To accommodate 64 avatars the atlas resolution is already set at .25, meaning you can increase Atlas Resolution twice, which will probably make your gpu run out of texture memory. :)





    http://glscene.com/unity/UMA2Webplayer/

    I hope you're as excited about UMA2 as we are.
     
    Last edited: Mar 8, 2015
    hopeful and cyby89 like this.