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

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. Rosie-Posie

    Rosie-Posie

    Joined:
    Nov 20, 2013
    Posts:
    54
    Hello Jaime,

    First of all, I want to thank you for all the support you have provided for UMA over the years!

    I am integrating my own base mesh as a new race and I was getting a similar issue others have had in the past: my character animated in the wrong orientation, mainly flat on it's back. I've fixed the issue by adding rotations to the Root/Global/Position bones in Maya before exporting as suggested earlier in this forum thread, but it all feels a bit hack-y to me. Is this actually the best practice out there?

    I am exporting my FBX from Maya with Y-up and here are the rotations I figured I needed for it to display properly.

    Root : X= 90 Y=90 Z=0
    Global : X= -90 Y=0 Z=90
    Position : X=90 Y=0 Z=0

    I actually had to guess these numbers, I tried reversing the ones that get applied at run time in Unity, and my character was still not in the right position.

    Cheers,
    Rosie
     
  2. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    Hi Rosie, me as you, use Maya not Blender. If you was the one who model and rig your char on Maya then most sure that you have your bones oriented in Maya World axis default Y-Up and not as Blender which use Z-Up, if so, all you need then is to rotate Root -90 on X, and send it to Unity as Maya file not as FBX ( at least that is what I do).


    The other way to solve the issue ( if you dont want to make any rotation on the root/global..) is by changing the lines in the UMA code where they adjust the localRotation of the bones, of course if you are not planning to use any of the models made for UMA already xD, because if so then those model will have then the issue with the animations.

    You can find those lines of code in UMADefaultMeshCombiner line 75 and 86, and if you use the Meshhide on the GeometrySelector.cs line 80, and if you use BoneBuilder on the UmaBoneBuilderWindow.cs lines 168 and 180.


    I don't belong to the UMA team, but i decide to answer your post, because I think they are Blender users and not Maya ones like we are.
     
    Last edited: Jul 6, 2019
    cwmanley and Jaimi like this.
  3. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    I'm glad you all have figured this out, it can be quite confusing with all the different modellers - left handed, right handed, Y-up, Z-up, etc.
    Making code changes has it's own dangers of course, as they have to be manually propagated to newer versions. I'm hoping in the 3.X release (which is not in the near future), we will be able to make this all easier.

    @egherbaz - do you mind if I include your picture and information below in the UMA Content Creation documentation?


     
  4. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    @Jaimi: I don't mind, you can use it for whatever you want or need.

    But Jaimi my info depends a lot in which way is hip bone joint oriented (that is why I included the joint orient picture) and if you are sending the model as Maya file and not as FBX file to Unity. For example, I tested using a model from Autodesk Character Generator (
    https://charactergenerator.autodesk.com/) exporting it for Maya (they have for unity too) and with that, the rotations I need to put on the bones was:
    Root: (-90, 0, 0)
    Global: (90, 0, 90)
    because their Hip bone is joint oriented (90, 0 ,0) Z-Down

    if the hips (or the main bone) is already oriented with Y-up, then the only rotation you need to add is on the Root: (-90,0,0) to make it work with UMA and if the file sent to Unity is Maya file (i never tested sending as FBX). And that rotation is just for reversing the adjust the UMA code does, because that code is made for models oriented with Z-Up.

    PD: I said bones, but what i'm actually using for Root,Global and Position is not a bone, it is a group, and I use a group because Root,Global and Position, don't need|have mesh weights.
    And Jaimi, on UMA 3.x xD, I think you just need to add a conditional var on the Base Race Data asset asking for axis orientation (if is Z-Up or Y-Up), reference it on UMAData and then use that var on the scripts i mentioned (you know what i mean)

    Regards
     
    Last edited: Jul 6, 2019
  5. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, guys, I have a little problem changing UMA recipe during the runtime.
    My UMA character is just fine at the start of the game but when I change the recipe (just change some meshes) during the runtime, (by calling BuildCharcter(...)), it tries to rebuild Avatar and complains like the following.
    Code (CSharp):
    1. [18:09:13:464] AvatarBuilder 'Player': Transform 'index_01_l' parent 'hand' must be included in the HumanDescription Skeleton
    I think the problems is my character's bone hierarchy changed during the runtime. Yeah, the character can hold the weapon it cause some changes to the bone hierarchy. The weapons. FYI, has HanderPoser from FinalIK where it can help place your hand on the weapon positioned exactly the way you want. In order to do that, it has to use the hand bone structure exactly the same as your original character and make a copy to place it on the weapon. I think this is where the AvatarBuilder doesn't know what to do with extra hand bones on the Weapon.

    My question is, why is it trying to rebuild Avatar where are no structural changes to the character and how I can avoid rebuilding Avatar during the runtime. Right now, all I need is to change some meshes to pickup some clothes. I would appreciate for your help.

    Thanks.
     
  6. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,314
    Very nice one again!

    The hair is so great :)
     
  7. pegassy

    pegassy

    Joined:
    Sep 28, 2017
    Posts:
    49
    Hello,

    I am working on a 1st/3rd person game project using UMA. I am trying to separate and turn off the 3D hands and head on UMA during the 1st person view. Is there a tutorial or resource you can recommend that shows how to do that?

    Thank you.
     
  8. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    There is a Renderer Management feature coming in the next release that will allow you to do this (it's in the Develop branch on github if you want to take a look).

     
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Changing slots also has the ability to add or change bones, so it rebuilds the avatar. We will revisit this during the next major release (not the next upcoming release). For the extra bones issues, I'm not sure why that is causing a problem - there are many extra bones in the UMA skeleton, not sure why one more would cause an issue. I've put in a trello task to look at it. There are ugly workarounds if needed (ie, removing and readding the bad bones during the events)
     
  10. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    I think the main problem is that the Weapon has a copy of LeftHand bones for the exact hand(finger) placements and Unity Avatar Builder complains about it.

    I guess the best is not the rebuild the avatar if didn't change from the previous somehow. It will also help the performance side as well.

    I think the quick solution might be to provide manual option whether to rebuild the avatar or not.
    In my game, avatar never changes. Could you please show me where this can be done? I've looked at the code but it seems like it must rebuild every time.

    Thanks.
     
  11. pegassy

    pegassy

    Joined:
    Sep 28, 2017
    Posts:
    49
    That's wonderful. Thank you.
     
  12. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    There is a checkbox on the avatar to rebuild skeleton or not, is that what you are after... Maybe I am not following the problem.
     
  13. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    @DankP3, if you turn it off, it won't build the character at all. When you change slot, you still need to rebuild the UMA character without out rebuilding the Unity Avatar. This Unity Avatar is the one you need when you want to use Animator and it doesn't need to be rebuilt every time we change slots.
     
  14. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    There's more work involved there tracking that down than you might think. I have a trello task for this, I'll try to look at it during the week.
     
  15. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    @Jaimi, thanks a lot!. I tried a stab at it but failed. Yeah, it seems quite involved how the character is rebuilt.
    I'll really appreciate it.
     
  16. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
  17. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Awesome!, I'll definetely check it out. Thanks a lot!
     
  18. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    I just tried and it worked great, except one problem.

    When it begins, it looks like it has to go thought the rebuilding Avatar at least once, even if it already has the Avatar.
    Otherwise, it's causing an error; character appears in T-Pose.

    Thanks a lot for the help.

    I had to make the following two changes in order to fix it.

    From DynamicCharacterAvatar.cs
    Code (CSharp):
    1.            if (!keepAvatar)
    2.                 umaData.KeepAvatar = false;
    3.             // commented out.
    4.            // umaData.KeepAvatar = keepAvatar;

    From UMAGeneratorBase.cs
    Code (CSharp):
    1.     if (!umaData.KeepAvatar || animator.avatar == null)
    2.                         {
    3.                             UMAUtils.DestroySceneObject(animator.avatar);
    4.                             SetAvatar(umaData, animator);
    5.                             // added
    6.                             umaData.KeepAvatar = true;
    7.                         }
     
  19. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    It has to build the avatar at least one time - but it shouldn't rebuild it after it has built it once. I put in some logging and it showed only 1 creation across the entire array of tests (rebuilding, etc)

    What is your workflow?


     
  20. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    I use UCC and the Player has to have bones pre-built in order for the correct setup and I provide Avatar to the Animator.

    upload_2019-7-9_12-23-53.png
     
  21. saltysquid

    saltysquid

    Joined:
    May 1, 2017
    Posts:
    41
    I'm using UMA for my character creator in my game. When the game starts I'd like to display a profile image on screen of the character the player made. Something like a small box with the players head and name. Are there any methods or tricks to doing something like this? I debated taking a screen shot via script and then manually cutting out the image... but with different screen resolutions I'm not sure this would work quite right. Any help is appreciated.
     
    hopeful likes this.
  22. erw29

    erw29

    Joined:
    Sep 27, 2018
    Posts:
    13
    Hey,

    i'm using UMA in combination with FinalIK's VRIK and for this purpose, I need an animator with no animation at all. I recognized when using a UMA with the standard Locomotion Animation, the generated Avatar gets placed on the ground correctly. However, when I use a custom made Animator, the middle of the Avatar gets placed on the ground and the feet are having a weird position. Where is this coming from and how can I fix it?

    Best
     
  23. erw29

    erw29

    Joined:
    Sep 27, 2018
    Posts:
    13
    Never mind, I just removed the animator after creation.
     
  24. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Basically what you need to do is construct your UMA, and once it's built, use a Camera with a RenderTexture to take a picture, and use that texture. That way you can target the camera at the head, and then set the exact texturesize, FOV, etc, so you get exactly what you want. Take a look at the "Photobooth" scene that is used to create the clothing icons.
     
  25. saltysquid

    saltysquid

    Joined:
    May 1, 2017
    Posts:
    41
    Thanks a lot, I'll give that a shot
     
  26. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    @Jaimi: If I have a base model and a default wardrobe on the legs hiding the base legs, if I put on another wardrobe on the legs, do I have to hide the base legs again on the recipe?
     
  27. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Yes. BuildCharacter() constructs a new recipe from scratch each time.
     
  28. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    Thanks Jaimi.
     
  29. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
    I keep getting these errors:


    Assets\UMA\Core\Editor\Scripts\OverlayLibraryEditor.cs(164,51): error CS0234: The type or namespace name 'TextureCompressionQuality' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

    Assets\UMA\Core\StandardAssets\UMA\Scripts\SkinnedMeshCombiner.cs(57,83): error CS0246: The type or namespace name 'BlendShapeSettings' could not be found (are you missing a using directive or an assembly reference?)

    Assets\UMA\Core\StandardAssets\UMA\Scripts\SkinnedMeshCombiner.cs(429,56): error CS0246: The type or namespace name 'BlendShapeData' could not be found (are you missing a using directive or an assembly reference?)

    Assets\UMA\Core\StandardAssets\UMA\Scripts\SkinnedMeshCombiner.cs(608,75): error CS0246: The type or namespace name 'BlendShapeSettings' could not be found (are you missing a using directive or an assembly reference?)

    Assets\UMA\Core\StandardAssets\UMA\Scripts\RaceData.cs(28,49): error CS0426: The type name 'DNAConvertDelegate' does not exist in the type 'DnaConverterBehaviour'

    Assets\UMA\Core\StandardAssets\UMA\Scripts\OverlayData.cs(38,27): error CS0426: The type name 'OverlayType' does not exist in the type 'OverlayDataAsset'

    Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAData.cs(266,53): error CS0426: The type name 'DNAConvertDelegate' does not exist in the type 'DnaConverterBehaviour'
     
  30. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    It looks like you have mixed versions. When upgrading UMA, you have to delete the UMA folder and import from scratch so it cleans up all the source files.

    If you didn't upgrade, then the problem would likely be that you imported some old assets that included portions of UMA itself in the package. To fix this, delete the UMA/Core folder, and reimport the UMA package from the asset store.

     
  31. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
    I updated and reimported UMA, now I got one issue:

    Assets\UMA\Core\Editor\Scripts\OverlayLibraryEditor.cs(164,51): error CS0234: The type or namespace name 'TextureCompressionQuality' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
     
  32. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    Just finally uses the LoD prefab for the first time. It flags an error, saying atlas too small. Is this harmless? I don't get it with the same UMA in a non-LoD prefab.
    I figure the atlas will be rescaled as part of the LoD process, but was not expecting error messages.
    Thanks as always.
     
  33. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    I'm not seeing this - the atlas size should be affected of course, but only because it can be trimmed way down.
    You might want to look at the settings I tested with, and make sure you didn't set an LOD offset in the wrong direction (making it larger) or something like that.

    I set the LOD DIstance to 2 to make it switch faster. Here at LOD 3, I got a 128x256 atlas with no errors.

    If this doesn't address it, can you look at the albedo texture size at the different LOD levels and let me know what you see?

    SimpleLOD.jpg
     
  34. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    TextureCompressionQuality is in UnityEditor - there should be a "using UnityEditor" at the top. Are you using a beta or alpha of Unity?
     
  35. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    Apologies, I had added a recipe, which I had forgotten about. All working as expected.
     
    Jaimi likes this.
  36. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
    Im using 2019.3.0a8
     
  37. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Ah - we do not officially support alpha or beta versions because they change throughout their release cycle. My guess is that they moved the TextureCompressionQuality somewhere. You might be able to fix it by right clicking on it and letting Visual Studio suggest a "using".
     
    hopeful likes this.
  38. BlankMauser

    BlankMauser

    Joined:
    Dec 10, 2013
    Posts:
    138
    Does UMA support mixing bone poses with blend shapes? For example lengthening the leg bones to make a character taller, or widening their hip joints + scaling to have wider hips? I understand that it has bone scaling but scaling and posing would be two different features correct?
     
  39. pegassy

    pegassy

    Joined:
    Sep 28, 2017
    Posts:
    49
    I am getting some strange mesh deforms (top pictures) on UMA characters only during the build, but not in editor play mode (bottom). I cleared out the global library except the UMA folder contents to make sure it was not causing this. Any idea what may be triggering this? I had a similar problem with textures and that turned out to be related to the third party UMA assets that I was using. But in this case there is no third party UMA asset involved. Thank you.

    upload_2019-7-14_18-43-14.png
     
  40. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Yes, it supports both bone and blendshape deformation. You can combine them as well in a single DNA if you want.
    However, there is not any magic in blendshapes - if you use a blendshape to make your character fatter, for example, you also have to include the same blendshape on all his clothes so they deform correctly, and these do take up more memory. This is why I recommend using skeletal deformation for body parts, and leave blendshapes for things like ears/face/etc.
     
    Last edited: Jul 15, 2019
  41. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Most likely thing is your quality settings have the number of bone influences at 1 or 2. The standard humans that ship with UMA require this to be set at 4.
     
    hopeful likes this.
  42. jakes-du-preez

    jakes-du-preez

    Joined:
    Aug 14, 2013
    Posts:
    30
  43. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Yes - first, you will need to use the next version of UMA (2.8.2). You can get the "in development" version here:

    https://github.com/umasteeringgroup/UMA/tree/develop

    After adding the SRP package, and converting the materials in the project, you will need to adjust the UMAMaterials so they use the correct Texture Slot keywords for each channel. These have changed in different versions of the SRP, so select the dropdown to find the correct one.
     
  44. CaptainNoah

    CaptainNoah

    Joined:
    Jul 17, 2018
    Posts:
    1
    Did you get this to work? When I try to save the "Recipe" to my mysql db it removes the backslash "\" escape characters and then wont parse when I try to load it.

    EDIT:
    got it to work; in my php stored proc I used addslashes($recipe)
    this saved the string in the correct format

    Thanks
     
    Last edited: Jul 17, 2019
  45. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Perhaps a PHP or MySQL db person can help best.

    But generally this happens when you are constructing code from the string, instead of using it as a variable. The compiler will try to translate the "escape" characters.

    For example:

    string MySQLInsert = "update mytable set mycolumn = '" + theCharacter +"' where ID = 10";

    That would put the literal text of the variable in the string, and then when the string is evaluated by the compiler/interpreter, it would see only the string, and think your backslashes are escapes.

    The way to get past this is usually creating parameters, and then passes the variable as a parameter to the SQL Command object yourself.

    This is beyond the scope of UMA, as it's really PHP and MYSQL doing this to you at this point. The string is a JSON string, but also has JSON on JSON action going on inside it.

     
  46. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Willbgameart.com has some Historical, Fantasy and Sci-fi clothes. Arteria3D.com has some historical, fantasy and steampunk.

    I have a (free) modern clothing casual pack coming if I can just find the time to finish it up - maybe a couple of weeks.
     
    hopeful likes this.
  47. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    Hi Jaimi

    On the UMA/Runtime Menu there is an option to save the texture generated to a PNG, when I use that option, what I get is a texture with 512 * 4096, but all my textures width are 1024, except for the head that I use 2048x2048.
    Why the atlas generated is using just 512 on the width?

    another question: the rect included in the overlays, works for a particular texture on the atlas or it works for the entire atlas? I ask this because I use atlas for my proyect, and on my enviroment models (houses, etc which don't use UMA) I put on the rect the pos of the texture in the whole atlas, w/o changing the uvs (which are full square), and I did a test with UMA by adding a texture with a rect,and the way i found to display on the model was by changing the UVs position.
     
    Last edited: Jul 18, 2019
  48. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    The UMAGenerator has an atlas size and a scale factor that affect this. The atlas size sets the maximum size of the atlas. The scale factor reduces the size of the textures. Set your atlas size to 4096 and your scale factor to 1 to get the best resolution.


     
  49. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    xD thanks now I get a better atlas, but i have another question: are you planning to code a rect for access a relative position of the entire atlas? or is already coded? because as I understand right now the rect is for access a relative pos of the texture that overlay contains and not a relative pos of the atlas.
     
    Last edited: Jul 18, 2019
  50. egherbaz

    egherbaz

    Joined:
    Sep 21, 2012
    Posts:
    34
    My case is this:
    I have a collar slot which use a 1024x1024 texture, but the UVs just takes 719px on the height of that texture (0 to 1 in U and 0 to 7 on V space)

    then i have shoulders that use only 256x256 textures.
    so what I did to save atlas space, was to add those small textures at the top of the collar texture by using the UMA wardrobe (so I still have just 1 1024x1024 texture and not 1 of 1024 and 4 of 256), but the UVs of the shoulders are full square (0-1 space) they are not in 7.5 space

    uvs.png

    I know that by using the UVs as they are on the 2nd image UMA will display the textures on the models, but I dont want to change the UVs, I want to keep them as full square and still want to save atlas space. I know I can achieve that by using a NPOT texture on the collar (1024*768) but what if the empty spaces are at x,y rel pos of the texture and i want to overlay does empty spaces with other textures w/o changing the UVs?

    Is there a way to achieve that with actual UMA? keeping the full square UVs and still saving atlas space by having those small textures as overlays for collar base texture instead of being base textures themselves.
    I know it can be done if there is a way to tell on the overlay where is the relative pos of the texture in the Atlas, but the way uma is working now is for telling the rel pos in the texture itself not in the atlas, or am I wrong?
     
    Last edited: Jul 18, 2019