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
    Hi All,
    I'm pleased to announce my long awaited UMA race creation series, first episode now available.
     
    Seifu_ and hopeful like this.
  2. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    And another one:
     
    hopeful likes this.
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    Oh wow ... lots of sneaky scaling type errors that need to be uncovered and fixed in this process, I see! Thanks so much for clearly documenting it. :)
     
  4. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    You are very welcome, there are cleaner ways of doing it, like removing keyframes at the very beginning. But I think you learn more by seeing all the ugly "gotchas" :D. There are plenty more to come, wait until you see the squiffy normals and twisty feet. :eek:
     
    hopeful likes this.
  5. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    While I'm thinking about it, let me ask a couple of "simple" questions about the state of blendshapes in UMA and Unity. :)

    First, in Unity are blendshapes now more performant? It used to be they were terrible drains on performance and it was best to avoid them, except perhaps for "hero" characters. I think a variety of optimization ideas were discussed, like baking a blendshape to have a permanent effect, and sleeping blendshapes to stop the constant recalculations. Not sure if any of that has come to pass or not.

    Second, specifically for UMA, while I think blendshape functionality was added a few updates ago (thank you, Steering Committee peeps!), we never really got a set of official default blendshapes on the basic models, right? So is the committee looking to add some, like facial blendshapes such as those used by Fuse, and/or body morphs that address certain weaknesses that might exist in UMA's adjust bone framework?

    For myself, I like the functionality of the facial bone structure UMA currently has, but I suspect we could get some added benefit from using a few well-chosen blendshapes too. However, performance is a concern.
     
  6. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    Well, I'm no expert but I have got it working, both with horrible performance and eventually with far better results (which I am going to share with you in a future episode).

    In terms of performance if we tried to use our character as it stands at the end of part 2, UMA would struggle. 50 blendshapes effectively makes the whole mesh 50 times larger as the position of each vertex in each blendshape needs to be stored somewhere. This is not a fun thing.... However, by the time we get around to converting this model, we will have isolated the blendshapes to just a single "face" slot. Far fewer vertices and rationalizing the number of blendshapes means we'll get a lot better performance. Because it's a slot, we can swap it out when we don't need the animation blendshapes, but keep any morphing blendshapes. If you optimize carefully in blender, you can get some great results.

    Hopefully I can open this subject up for everyone to try it for themselves, but I'm very impressed with the results I've had so far.
     
    hopeful likes this.
  7. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    326
    @SecretAnorak Hey do you have any plans of doing an Invector integration Script?
     
  8. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    magique and Aaron2348 like this.
  9. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    326
    Lol my bad I must of missed this one, Thanks Man!!
     
  10. Aaron2348

    Aaron2348

    Joined:
    Dec 12, 2016
    Posts:
    326
    Ans also I'm following the UMA201 videos, and had a question, is coding in new slots not something you have to do anymore? Because in the video I did not see you Open a script to convert clothing to UMA.
     
  11. Flaviof

    Flaviof

    Joined:
    Dec 28, 2013
    Posts:
    19
    Hello there!

    I'm very noob and im trying to use UMA. The first project work all fine. But now i got 6 errors that looks the same:

    Assets/UMA/Examples/Extensions Examples/DynamicCharacterSystem/Assets/Resources/Scene1/SampleCode.cs(208,21): error CS1061: Type `MouseOrbitImproved' does not contain a definition for `Reset' and no extension method `Reset' of type `MouseOrbitImproved' could be found. Are you missing an assembly reference?

    Assets/UMA/Examples/Extensions Examples/DynamicCharacterSystem/Scripts/Scene2and3/TestCustomizerDD.cs(158,15): error CS1061: Type `MouseOrbitImproved' does not contain a definition for `SwitchTarget' and no extension method `SwitchTarget' of type `MouseOrbitImproved' could be found. Are you missing an assembly reference?


    Can anyone help me please?
     
  12. DatoKiknavelidze

    DatoKiknavelidze

    Joined:
    Jul 4, 2018
    Posts:
    9
    Hi guys!
    I'm having trouble with custom race, the characters spawns rotated and hands do weird stuff, also character is not only rotated its also floats in the air. here is the pic
     
  13. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    You probably have two scripts with the same name. The "MouseOrbitImproved" that UMA uses has been modified quite a bit.
     
  14. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    Have you seen this?

    https://www.patreon.com/posts/uma-301-part-2-19838573

     
  15. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    103
    Hello, this might have being answered before but I didn't find the answer, that what is polycount of the characters made with UMA, I am working on mobile game. And I don't have much experience with UMA
     
  16. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    I'm a little below noob level and wanted to ask a general question. I've just started looking at videos and I'm curious about its capacities.

    1. I'm making a zombie shooter, is it possible to dynamically create different zombies based on recipe at the start of a scene load and keep the amount of materials down. if I wanted 40 totally unique characters that shared some of the same clothes, I'm assuming that UMA would create a new material for each unique character?

    2. Is it possible to use UMA to apply blood overlays (in an efficient way) on a character during runtime in a FPS shooter, or is performance strictly for applying overlays and removing overlays really meant for an in-game character creation scene.

    3. Can limbs on a character be hidden during runtime, as I want to show dismemberment.

    I doubt these can be done (and I've already worked on my own dismemberment system)...just wanted to get a better understanding of UMA's capabitlities.
     
  17. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
  18. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    It will vary depending on what you add to the UMA, and what base races you use. The base (low res) model has about 6700 polygons. There are also mid and high resolution meshes with more polygons. The races that are included by default use the mid and low meshes (Mid head and hands, low everything else).

    UMA builds texture atlases and combines meshes to give you maximum performance. But the size will depend on what you add to it, and what gets removed from it. (Adding gloves can remove hands if they are hidden, for example). Here are some counts that I just pulled:

    Base Male Human: 11,188 triangles.
    Human with Will B's cleric Armor on: 13,137
    Human with Will B's Iron Armor on: 16,678
     
    lorddanger likes this.
  19. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    1. Yes, UMA will create a material for each submesh. It will combine as many materials as possible to make the smallest number. There is also a LOD system for textures (see the sample scene). This can lower the dynamically generated texture resolution based on distance, allowing you to have many more UMA's on screen at one time with good response time.

    2. Sort of. You can dynamically add blood splatter. But for targeted spots, you'd need to add some sort of decal (someone asked about this a few messages ago). Will B has some good grunge/splatter texture overlays.

    3. Yes, but you'd need to model the replacements (ie, the bloody meat part with the bone sticking out). If you just removed the arms, then people would see they were one-sided. By default, the arms are attached to the torso, so you would need to break those out into their own slots. Then create a "stump" slot for each side. Then when chopping off the arm, you would replace the arm with the stump. Note that if you had long sleeve clothing, you would need to do that also.



     
  20. DatoKiknavelidze

    DatoKiknavelidze

    Joined:
    Jul 4, 2018
    Posts:
    9
  21. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    113
    Hey guys. How would you recommend approaching this situation.
    I have different textures for base body model, sort of like skins. And I want to be able to change that skin on a character.
    I tried adding new skin as a new overlay and adding that overlay to the base race recipe, but overlays sort of go on top of each other right? If they are layered on same slot?

    Can I create different base race slots and replace those as I would clothes? or is other method preferable?
     
  22. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    Simplest thing to do is to just create a wardrobe item for the new skins - like we do for the faces. Add the torso slot to the wardrobe recipe, and add your new skin overlay to it. That would then be layered over the top of the old skin (in this case, completely replacing it).
     
  23. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    113
    Would that conflict let's say with armor slot that uses torso?
     
  24. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    No - the armor slot would need it's own set of overlays for spatter.

    This works, because when you build a character, duplicate slots are discarded, and the overlays for the duplicates are added to the overlay list for the original slot (and simply "overlayed" on the top of them).
     
  25. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    Thanks a lot for the detailed response.

    I’ll go ahead and start working on some simple examples to get a baseline on performance.
     
  26. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
  27. TUGs_The_Unprofessional_Gamer

    TUGs_The_Unprofessional_Gamer

    Joined:
    Dec 21, 2015
    Posts:
    24
    What is the variable that holds all the Json Data?

    I think the Function that does it is:
    DynamicCharacterAvatar.cs line: 1854
    public void DoSave(bool saveAsAsset = false, string filePath = "", SaveOptions customSaveOptions = SaveOptions.useDefaults)

    but I cant seem to figure out what holds the data!?!?
     
  28. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    @SecretAnorak
    Do you know if we can use characters from Fuse in our own games?
    The same question goes for the rigs and morphs from Mixamo?

    Would it be faster if i use bones for the face and not blendshapes?
    Can i see or read somewhere wich bones UMA support for faces?

    Edit:
    Just found this to answer the first two questions :)
    https://forums.adobe.com/thread/1992542
     
  29. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    Adobe is pretty free and easy with Fuse characters and Mixamo animations. You can use them for whatever you like with the sole exception being distributing the raw files. That's why I can't give you the files in my tutorial. I was about to send you that very link you put in your edit o_O

    As for bones or blendshapes,..... I really can't answer that,... it depends what you're trying to achieve. I'm yet to do any extensive testing. I do know that blendshapes take up a lot of space, especially with high poly meshes, but will give you very precise results. Bones add to the complexity of the skinned mesh, but allow for more freeform adjustments without increased model size, the sacrifice is accuracy. Hopefully after you're done with this series, you will find testing both methods nice and easy so you can make up your own mind.

    With regard to "which bones are supported", you can make up any rig you like. As you'll see later on in this series, we can set UMA dna up to drive any bones we like in any way we like,...….. we love you UMA ;)
     
  30. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    I downloaded and started playing around with UMA...I now see why it so powerful.

    I am currently making a VR zombie game, so performance is crucial for my project. I want to use UMA characters so that I can show dismemberment and damage at runtime.

    My plan was to create new meshes and materials to create new Overlays and use Slots to replace meshes.

    Code (CSharp):
    1.         avatar.SetSlot ("Legs", "MalePants");
    2.         avatar.BuildCharacter();
    I noticed that when the above code is called, it creates a spike in the profiler. This would make it too expensive for me to use at runtime for added blood Overlays or swapping out Slots.

    Is there a way to stagger the work so it doesn't all happen in one frame?

    I've been looking at the code and had no luck so far.


    EDIT: Ok, I've setup a test scene in my project and noticed that the spike isn't so bad and seems to be running much better than I originally thought.
     
    Last edited: Jul 9, 2018
  31. TUGs_The_Unprofessional_Gamer

    TUGs_The_Unprofessional_Gamer

    Joined:
    Dec 21, 2015
    Posts:
    24
    Anyone got a clue to my question? Would greatly appreciate it ^^

    What is the variable that holds all the Json Data?
     
  32. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    Since DNA requires the use of bones, does having more bones take more horsepower to run in the animator (Similar to a regular Unity character) or does UMA do some magic to dynamiclally reduce them at runtime?

    I want to make sure (for my zombies) that the normal ones are as efficient at possible.
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    I don't have data at my disposal for bone usage, but generally it is extremely efficient, and the last time it was tested (a year or so ago) it was far more efficient than blendshapes. There's probably some test results on that like 30 pages back in this thread. ;)

    Another cool thing about the bones is that UMA is prepared to strip out any that you don't need after character generation. So if you want to use the adjust bones in the character creation phase and then get rid of them once the character has been shaped, you can. The expression bones, I believe, can be set up with LOD so that they are deleted when the character is too far away to see the expression. There used to be example scenes for this; not sure what the present situation is.

    So you can do a variety of things to make your game more efficient, like create crowds where they have either no expression or a single individual expression that doesn't change, or they can gain / lose expression bones as they pass in and out of range. If you're thinking of using blendshapes, my prior experience suggests that they are going to drain performance fast, even on desktop, so best to use them sparingly.
     
  34. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    Thanks for the reply.

    I'm currently activating facial blendshapes on my zombies that are close to the player....but have them culled when at a distance.

    I didn't know that it could remove the bones after I generated the shape or remove them based on distance...I've gotta find how to use both of those.
     
  35. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    Yes thank you hopeful and SekretAnorak.
     
  36. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    386
    It's an uma text recipe, an asset. If you mean before serializing it, then it's umaData.umaRecipe.
     
  37. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
  38. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    You can "bake out" the adjustment bones if you use the Power Tools:

    https://assetstore.unity.com/packages/tools/uma-power-tools-2-14249
     
    hopeful likes this.
  39. SecretAnorak

    SecretAnorak

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

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
  41. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
  42. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    Is it possible to put a Slot over another Slot?

    I want to create heavy damage to a character, but I want the character to get that damage whether they have no shirt or a variety of shirts on.

    I plan on making a mesh that would be used in a wardrobe recipe. Is possible to make a slot that can go over any other slot? If not, would I have to make damaged versions of any wardrobe I make?
     
  43. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    Nice! It sounds like you may also be in a position to report on how frame rate is affected by blendshapes. Just scale it up so you have maybe 300 zombies in the scene, and then move the camera in and out of the LOD distance.

    It's possible that having like a half dozen blenshapes on those zombies would not be a big drag, especially when using LOD on them.
     
  44. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    If I'm understanding correctly, you can use another slot if you want to add another small mesh to the character. However, you can also add just an overlay, if you are using predefined damage spots that only affect the texture. You would have to do this for each clothing item, though; that is, have essentially a damaged and undamaged version.

    Another option might be to use a shader that shows damage in some predefined way, kind of like a damage / dissolve shader. It really depends on what you want your damage hints to be like.
     
    Last edited: Jul 10, 2018
  45. DarkCooker

    DarkCooker

    Joined:
    Jan 7, 2015
    Posts:
    119
    We are trying to make a big project using UMA.
    The customization page is almost done.
    However we found that the DNA data options are not enough. E.g eye pupils color, size, eye width, eye distance, etc.

    Am I missing something? Or UMA does not support very detailed customization yet?
    Many Thanks!
     
  46. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,171
    The included models are a starting point. For many people, these are good enough.
    for others, you may want to add some more bones, some more blendshapes, and the DNA to drive them.

    SecretAnorak has some excellent videos (see above) on adding bones and blendshapes.

    Note that for ease of use, I recommend using Blendshapes for facial features and other modifications that won't affect clothing or other additional items. Blendshapes only affect the meshes they are defined on, so if you change someones head with a blendshape, be careful it doesn't affect a hat. (unless you want to add blendshapes for the hat, and sync them up)

     
    TeagansDad and hopeful like this.
  47. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    From the tests I tried with UMA
    I just ran a test with 300 zombie heads (their heads are split from their body). Each head has 6 Blendshapes, which I tweened from 0 to 100 (2 seconds) and back from 100 to 0 (2 seconds).

    For some strange reason, I didn't see much of a difference in performance between the heads without the Blendshapes being manipulated to the ones tweened.

    This was done with just normal character models (not UMA)….not sure if this is a performance consideration with UMA.
     
  48. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    509
    A friend of mine actually created a shader (with Amplify) that can show blood in predefined locations (based on a mask), but I wanted to create more damage than just blood (texture).

    Thats why I was asking about the meshes, I want to be able to swap out undamaged meshes with damaged at runtime.

    Ok, so it looks like there is a lot more modeling work for me, since I'm going to have to also do the clothes....I will have to figure out some clever ways to reduce the workload. I may have to have more models with short sleeve shirts so I can reuse arms.
     
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    I don't think it makes a difference if the blendshapes are manipulated or not, merely that they exist at all. I'm not sure, though. My very limited experience in this area was back when blendshapes were first introduced in Unity.
     
  50. dudedude123

    dudedude123

    Joined:
    Aug 24, 2013
    Posts:
    128
    When i animate the avatar, it keeps doing this
     

    Attached Files: