Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    @EdWaters

    Secret Anorak did a newer video on the Advanced Mesh Hiding feature, that other video was from way early in it's development.

     
    cwmanley, umutozkan, EdWaters and 2 others like this.
  2. EdWaters

    EdWaters

    Joined:
    Mar 20, 2017
    Posts:
    7
    I can see that the team that put this system has really thought things through. Many thanks! - Ed
     
    Jaimi and kenamis like this.
  3. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    First i want to thank everyone who has helped in this forum. You All make it easier to learn for those of us who are new at this. Now I have been working on my color sliders for a while now and just about have it where i want it but having just a couple of issues that im hoping someone can pinpoint for me.

    Here is my code

    Code (CSharp):
    1. public class UMANewBuild : MonoBehaviour
    2. {
    3.  
    4.     #region Public Vars
    5.  
    6.     public Slider sldSkinColor;
    7.     public Slider sldEyeColor;
    8.     public Slider sldHairColor;
    9.     public Slider _heightSlider;
    10.  
    11.     public int _skincolornumber = 0;
    12.     public int _eyecolornumber = 0;
    13.     public int _haircolornumber = 0;
    14.  
    15.     public PlayerColorList SkinColor;
    16.     public PlayerColorList HairColor;
    17.     public PlayerColorList EyeColor;
    18.  
    19.     public DynamicCharacterAvatar avatar;
    20.     #endregion Public Vars
    21.  
    22.     private void Awake()
    23.     {
    24.         sldSkinColor = GameObject.Find("SldSkinColor").GetComponent<Slider>();
    25.         sldEyeColor = GameObject.Find("SldEyeColor").GetComponent<Slider>();
    26.         sldHairColor = GameObject.Find("SldHairColor").GetComponent<Slider>();
    27.     }
    28.  
    29.     private void Start()
    30.     {
    31.         avatar = GetComponent<DynamicCharacterAvatar>();
    32.         InitSlider();
    33.     }
    34.  
    35.  
    36.     private void Update()
    37. **************************for testing only*********************
    38.     {
    39.         if (Input.GetKeyDown(KeyCode.Alpha1))
    40.         {
    41.             avatar.SetColor("Hair", Color.green);
    42.             avatar.BuildCharacter();
    43.         }
    44. ******************************************************************
    45.         if (sldSkinColor.value != _skincolornumber)
    46.         {
    47.             _skincolornumber = (int)sldSkinColor.value;
    48.          
    49.             avatar.SetColor("Skin", (SkinColor.list[_skincolornumber].Color)) ;
    50.          
    51.             avatar.BuildCharacter();
    52.  
    53.         }  **************Is working Perfect***************
    54.  
    55.         if (sldEyeColor.value != _eyecolornumber)
    56.         {
    57.             _eyecolornumber = (int)sldEyeColor.value;
    58.  
    59.             avatar.SetColor("Eyes", (EyeColor.list[_eyecolornumber].Color));
    60.             avatar.BuildCharacter();
    61.  
    62.         } ***********doesnt change
    63.  
    64.         if (sldHairColor.value != _haircolornumber)
    65.         {
    66.             _haircolornumber = (int)sldHairColor.value;
    67.             avatar.SetColor("Hair", (HairColor.list[_haircolornumber].Color));
    68.             avatar.BuildCharacter();
    69.  
    70.  
    71.         }**********removes Hair************
    72.     }
    73.  
    74.  
    75.     private void InitSlider()
    76.     {
    77.      
    78.  
    79.         #region RaceSliders
    80.  
    81.         sldSkinColor.wholeNumbers = true;
    82.         sldSkinColor.value = 0;
    83.         sldSkinColor.minValue = 0;
    84.         sldSkinColor.maxValue = SkinColor.list.Count - 1;
    85.         _skincolornumber = (int)sldSkinColor.value;
    86.  
    87.         sldEyeColor.wholeNumbers = true;
    88.         sldEyeColor.value = 0;
    89.         sldEyeColor.minValue = 0;
    90.         sldEyeColor.maxValue = EyeColor.list.Count - 1;
    91.         _eyecolornumber = (int)sldEyeColor.value;
    92.  
    93.         sldHairColor.wholeNumbers = true;
    94.         sldHairColor.value = 0;
    95.         sldHairColor.minValue = 0;
    96.         sldHairColor.maxValue = HairColor.list.Count - 1;
    97.         _haircolornumber = (int)sldHairColor.value;
    98.  
    99.         #endregion RaceSliders
    100.  
    101.     }
    102.  
    103. }
    While the Skin color changes the way it is intended i have two different methods for the hair color....
    First when i use the keycode it works perfectly and turns to the color i set it two but i want this as a slider and when i try to use the slider it removes the hair all together. when i check my inspector the color values are changing appropriately...Im getting no errors


    Thanks in Advance
     
  4. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    My first guess would be that the alpha component of your defined colors is 0. This won't matter for the skin, since it uses a non-transparent shader. But the hair uses a cutout shader, and a zero alpha would make it disappear.
     
  5. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    Sounds reasonable but if that is the case why does it work on keypress using same format...Just curious
     
  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Because you're using a unity predefined color there. It's your HairColorList that is suspect, not the code.
     
  7. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    I just tested that and you are absolutely correct the Alpha is switching to zero how would i stop that from happening or change it to where i want it
     
    hopeful likes this.
  8. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    Figured it out thanks IM AN IDIOT that has been my hold up on three different rewrites just never figured out what the issue was thanks so much
     
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    No problem, glad you got it going.
     
    Jschilz1 likes this.
  10. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    OK One more thing left on my Script that is needed.

    If we have a Button Male and Button female

    what is the best way to have the UMA switch on the UI button press.

    Not sure what the code is to have it build new gender, Please explain and thanks in advance
     
  11. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    There's a "Change Sex" button in the Simple Setup scene that shows how to switch races on the fly if you want to see it in action. Here's the code from SampleCode.cs:

    Code (CSharp):
    1.         public void ChangeSex()
    2.         {
    3.             if (Avatar.activeRace.name == "HumanMale")
    4.             {
    5.                 Avatar.ChangeRace("HumanFemale");
    6.             }
    7.             else
    8.             {
    9.                 Avatar.ChangeRace("HumanMale");
    10.             }
    11.         }
    12.  
     
  12. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    yes sir ive seen that but it only switches gender i want two buttons one to select male and one to select female. But let me try some of those you mentioned see if i can get something like that to work
     
  13. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    Thanks Jaimi you gave me the tools needed again

    this works here may be something better but this works

    Code (CSharp):
    1. public void ChangeMale()
    2.     {
    3.         if (avatar.activeRace.name != "HumanMale")
    4.         {
    5.             avatar.ChangeRace("HumanMale");
    6.            
    7.         }
    8.    
    9.     }
    10.     public void ChangeFemale()
    11.     {
    12.         if (avatar.activeRace.name != "HumanFemale")
    13.         {
    14.            
    15.             avatar.ChangeRace("HumanFemale");
    16.         }
    17.  
     
    hopeful likes this.
  14. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    Latest Episode,.......... (@Jschilz1 I'm a day too late lol)
     
    cwmanley, Jschilz1, UnLogick and 2 others like this.
  15. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    Never too late to learn a new way of doing something.....THe only thing i have left on mine is to save the Uma And drop him into a new scene where he can run and play on my new terrain lol....If you can point me in right direction there id appreciate it...otherwise i am simplifying some of my code cause you showed me a few things that i could have done better


    Thanks
     
  16. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    The simplest way is to use theString = Avatar.GetCurrentRecipe(false); to save a string, and then load that string using LoadFromRecipeString(theString);

    You can also save that string to a file, and then have your prefab automatically load it. This is illustrated in the wiki here:

    http://umawiki.secretanorak.com/Creating_a_customizable_prefab
     
    hopeful and Jschilz1 like this.
  17. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    As Always Cant thank you guys enough
     
  18. Jschilz1

    Jschilz1

    Joined:
    Jul 18, 2016
    Posts:
    47
    Jaimi THanks again,

    As i read through what you linked me it doesnt really explain how you code that. What i would like to do and not entirely sure how is Have a UI Input where Someone can Type the name of their Character. And a Create Button , Once the input is placed and Character is created pressed, I want to load into my new scene and have the UMA drop on my starting waypoint so it is now part of the game that is live. is there some place that explains how this is done? eventually what im going to want is the name of the player(placed on the Input UI and saved by that name) hovering over the UMA in the new scene, so that when i run into a player in game i can see who that players name is. because this is done by the player it has to be scripted ..


    Thanks In Advance
     
  19. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    How in-depth for help are you needing? Jaimi explained the basics needed. Once you hit the create button it should call a script function to save your character recipe. If you want to switch scenes or keep the recipe permanently, you can save it to an asset/file. One way you can do that by setting a filename in the "Load/Save Options" and then in code using avatar.SaveRecipe() and avatar.LoadRecipe()
     
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    Those all sound like things you can look up and find examples of how to do, and which don't relate specifically to UMA.

    I suggest you research it and make a scene using a capsule for a character, or maybe Ethan, and then once you have it working replace that dummy character with your UMA.
     
  21. chaza_li

    chaza_li

    Joined:
    Jan 8, 2018
    Posts:
    29
    Hi there Jaimi or any wonderful people out there, how could I add an adjustable component on the face using the existing bones, or anyway I could extend the amount of customizable parts of the face? I've also tried to make a realistic looking face with using overlays, but the details just couldn't be done as asian faces have quite a different frame compared to other races... Thanks!
    PS: I've tried secret anorak's race creation videos, but for some reasons the converter scene isnt working for me....
     
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    I think in principle you can take a copy of your basic male and female head and alter its appearance toward your desired look in your modeling program. Just keep the neckline the same, so the head can be accurately sewn onto the standard body (assuming you want that).

    Then you should have an Asian head slot to go along with the default head slot.

    If there's anything more to than that, I'm sure someone here will let you know. But you should be able to do a quick experiment and test it out on your own. Like ... make a head with a big nose and add that head slot to your library.

    In theory, it should just be making another slot, a slot like any other.
     
  23. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Yeah - I agree, for this, I would suggest altering the existing head in Blender, from the sources here:

    https://github.com/umasteeringgroup/content-pack
     
    hopeful likes this.
  24. chaza_li

    chaza_li

    Joined:
    Jan 8, 2018
    Posts:
    29
    Thanks guys! I'll be looking into this
     
  25. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    How do you save the UMA asset from script using the UMA DCS?
     
  26. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    You can either do it manually by serializing it to a string, and saving that (See GetCurrentRecipe())

    Or you can do it with DoSave().

    There is code in UMA to do this. See SaveSelectedAvatarsDCSTxt(), it shows how to save using the save function.
     
  27. AdayMelian

    AdayMelian

    Joined:
    Sep 5, 2013
    Posts:
    1
    Hello!
    I'm just testing around with this amazing plugin and I cannot be more surprised about how well implemented and functional is all this characters engine. I'm thinking about using it on a PS4 project, does anyone here has already tested thisin on some game release for this platform or devkit ps4?

    Thanks the implied devs for creating such an amazing tool for gamedev!
     
  28. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    There was a post just a few days ago where someone had successfully tested it on the PS4 and the XBox One, But had issues with the Switch version (probably related to the combine shaders, but maybe texture memory related). I'm not aware of what game they are working on though.
     
  29. Bantichai

    Bantichai

    Joined:
    Nov 6, 2016
    Posts:
    138
    Do you guys have a rough idea when UMA 2.7 will drop officially?
     
  30. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Thanks for the reminder. :)
     
  31. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    UMA 2.7 Released!

    1) New Bone Builder Feature
    2) New Advanced Mesh Hiding Feature
    3) New icons for common UMA assets
    4) Extra bones in slot example; PonyTail
    5) More premade UMA Materials for common shader setups
    6) Moved required files out of Examples folder
    7) Lots of minor fixes...
     
  32. Bantichai

    Bantichai

    Joined:
    Nov 6, 2016
    Posts:
    138
    Awesome! Funny that you responded @UnLogick as the next question was related to you. I'll post over on the power tools forums :)
     
  33. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    I just got version 2.7, but trying to look at the example recipes, I get this error:



    I searched within assets, but the High Poly heads don't seem to be there.
     
  34. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    The filename is mid_poly but the overlay is high_poly, it was moved because it was in examples, I believe. Try rebuilding your global library.
     
  35. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    That should make it find the moved file. But something seems to have gone wrong with the update. I just pulled down the latest version, and opened the "shelly" recipe, and it looked fine. It doesn't seem to even use that slot:

    Capture.JPG
     
  36. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    This was a fresh install in a fresh project. Right off Asset store.

    I tried "Rebuild From Project (Adds Everything)" on the Global Library window, but the error persists. I should probably mention this is Unity 2017.3.1p1
     
  37. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    That scene uses the old libraries. Try opening the slot library and I think (working from memory at the moment) there is a button to remove null or not found recipes, or better yet, switch the whole context prefab to the new one "uma_dcs" to use the global library.
     
  38. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    OK - thanks, I'll investigate further. Something is not right somewhere, but the scene works, and you can edit it with the newer lib in the project.
     
    Last edited: Feb 16, 2018
  39. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Ok - this issue has actually been around since 2.5, but only showed up now because the base race recipe changed. It's because the scene-based libraries weren't updated to include the slots for the new base races. If you're not in one of the scenes that use the scene-based libraries, it will work as expected. The workaround is to replace the "UMA_DEMO_CONTEXT" in the scene with the UMA_DCS prefab (which knows how to find things in the global library if they're not in the scene libraries).
    We'll get this fixed up in the next round of updates.
     
    hopeful likes this.
  40. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Ok, thanks :)
     
  41. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
    I just started using uma today, amazing asset.

    I have a problem though, using existing animations from Mixamo (pictures below). The neck and other body parts look pretty weird. It's probably a problem in their animation's rig, but any idea how to fix this?

    I have 2 other questions. If I want to add a collider on the head for example, do I have to add the collider as a child in run-time after everything is loaded? Or is there an easier way?
    Also, if I want to add a weapon, is it done using wardrobe?
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      235.5 KB
      Views:
      862
    • 2.PNG
      2.PNG
      File size:
      162 KB
      Views:
      963
    Last edited: Feb 17, 2018
  42. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Thanks, we've all been working hard on it. For the animation, try changing the tpose to the mecanim version on the race. Mixamo animations can be tough to get the best quality from. If the tpose doesn't help, might try recreating the avatar in the mecanim editor, and adjusting it there.

    For the collider, you can add the bones at design time using the Bone Builder tool on the UMA menu. Then you can put whatever you want on a bone - collider, weapon, etc.

    Your weapon doesn't have to be a wardrobe item. You can just add it to a bone also. But there are some UMA weapons in some of wills packages that are uma specific. There are advantages both ways.


     
    itsnottme likes this.
  43. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
    Using Bone Builder worked great, thanks.

    About the animations, do you mind clarifying what you meant by "changing the tpose to the mecanim version on the race."?
     
  44. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I'm not at my computer, but somewhere on the racedata asset, there is a tpose field (this defines the skeleton). By default it uses the original tpose, to keep compatibility with older versions. But there is a more mecanim friendly tpose as well that you can can set it to. I don't have the name handy, but I think it's evident when you pull up the list of t poses.

     
    hopeful and itsnottme like this.
  45. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
    After adding the weapons and collides to the skeleton, I keep getting "AddBonesRecursive: " + transform.name + " already exists in the dictionary!" in UMA skeleton.cs of some of them when I run the game.

    Also, for some reason the placeholder is not showing, even though it's enabled. It worked the first few times, but now no longer working even on new objects.
     
  46. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    What's the actual error output? not the code. Usually, that happens when you have two bones with the same name.
     
  47. itsnottme

    itsnottme

    Joined:
    Mar 8, 2017
    Posts:
    129
    It's only a LogError, something like "AddBonesRecursive: Collider already exists in the dictionary!"
     
  48. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
  49. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Yes, that works with 2.7. It has the same DNA set and everything, so the expressions should work also.
     
  50. markashburner

    markashburner

    Joined:
    Aug 14, 2015
    Posts:
    212
    it doesn't seem to work with the Dynamic Character avatar script? It just says not available when I click on active race:

    It works with the old UMA dynamic avatar though....any idea how to get it to work with the DynamicCharacterAvatar script?

    I just recently purchased the asset a moment ago, so would appreciate the help.

    Thanks
     

    Attached Files: