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

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    That is one ugly dog. :) It needs some fur. I like Lassie.

    Is all that face-making the dog is doing actually in the current version of the GIT UMA?
     
  2. cyby89

    cyby89

    Joined:
    Apr 30, 2014
    Posts:
    35
    hi,

    I just wrote a tutorial how to replace the UMA.dll with the source code.
    You can also find it on my blog here.

    If you want to replace the UMA.dll with the source code from https://github.com/huika/UMA, Unity3d will loose references to essential scripts such as SlotData.cs, OverlayData.cs …

    The following script will replace the corrupted references.
    1. remove UMA.dll from your project
    2. add source code of the dll to the project (https://github.com/huika/UMA)
    3. press the menu “UMA/Replace UMA DLL”

    Some reasons to replace the dll with source code:
    - remove UMA.dll and LitJson.dll from your build project
    - debug UMA to find bugs or learn how it works (I have a bug in my case, but I’m not sure if its UMA or something else)

    Code (CSharp):
    1.  
    2.  
    3. using UnityEngine;
    4. using UnityEditor;
    5. using System.Collections;
    6. using System.Collections.Generic;
    7. using System.IO;
    8. using System.Text.RegularExpressions;
    9. /// <summary>
    10. /// If you want to replace the UMA.dll with the source code from https://github.com/huika/UMA, Unity3d will loose references to essential scripts such as SlotData.cs, OverlayData.cs ...
    11. /// 1. remove UMA.dll from your project
    12. /// 2. add source code of the dll to the project (https://github.com/huika/UMA)
    13. /// 3. press the menu "UMA/Replace UMA DLL"
    14. ///
    15. /// Good read how fileID and guid work with DLLs:
    16. /// http://forum.unity3d.com/threads/problems-compiling-dlls-from-monodevelop.148617/#post-1024523
    17. ///
    18. /// Hint:
    19. /// - This is script is not optimized for performance, because you only run it onces ;-)
    20. /// - Assets must be serialzed as Text, you change this here: Edit -> Project Settings -> Editor -> Asset Serialziation = Force Text
    21. /// </summary>
    22. public class UMAReplaceDLL
    23. {
    24. [MenuItem("UMA/Replace UMA DLL")]
    25. static void Replace()
    26. {
    27. List<UnityReference> references = new List<UnityReference>();
    28. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "1772484567", FindAssetGuid("OverlayData", "cs"), "11500000")); // OverlayData.cs
    29. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-1278852528", FindAssetGuid("SlotData", "cs"), "11500000")); // SlotData.cs
    30. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-335686737", FindAssetGuid("RaceData", "cs"), "11500000")); // RaceData.cs
    31. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-1571472132", FindAssetGuid("UMADefaultMeshCombiner", "cs"), "11500000")); // UMADefaultMeshCombiner.cs
    32. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-946187639", FindAssetGuid("UMALegacyMeshCombiner", "cs"), "11500000")); // UMALegacyMeshCombiner.cs
    33. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-1550055707", FindAssetGuid("UMAData", "cs"), "11500000")); // UMAData.cs
    34. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-1708169498", FindAssetGuid("UmaTPose", "cs"), "11500000")); // UmaTPose.cs
    35. references.Add(new UnityReference("e20699a64490c4e4284b27a8aeb05666", "-1175167296", FindAssetGuid("TextureMerge", "cs"), "11500000")); // TextureMerge.cs
    36. ReplaceReferences(Application.dataPath, references);
    37. }
    38. static string FindAssetGuid(string assetName, string assetExtension)
    39. {
    40. string fullAssetName = assetName + "." + assetExtension;
    41. string[] guids = AssetDatabase.FindAssets(assetName);
    42. foreach(string guid in guids)
    43. {
    44. string assetPath = AssetDatabase.GUIDToAssetPath(guid);
    45. if (assetPath.EndsWith(fullAssetName))
    46. {
    47. return guid;
    48. }
    49. }
    50. // make sure that we don't continue and break anything!
    51. throw new System.Exception("Unable to find guid for " + fullAssetName);
    52. }
    53. static void ReplaceReferences(string assetFolder, List<UnityReference> r)
    54. {
    55. if (EditorSettings.serializationMode != SerializationMode.ForceText)
    56. {
    57. Debug.LogError("Failed to replace refrences, you must set serialzation mode to text. Edit -> Project Settings -> Editor -> Asset Serialziation = Force Text");
    58. return;
    59. }
    60. string[] files = Directory.GetFiles(assetFolder, "*", SearchOption.AllDirectories);
    61. for (int i = 0; i < files.Length; i++)
    62. {
    63. string file = files[i];
    64. if (EditorUtility.DisplayCancelableProgressBar("Replace UMA DLL", file, i/(float)files.Length))
    65. {
    66. EditorUtility.ClearProgressBar();
    67. return;
    68. }
    69. if (file.EndsWith(".asset") || file.EndsWith(".prefab") || file.EndsWith(".unity"))
    70. {
    71. ReplaceReferencesInFile(file, r);
    72. FindNotReplacedReferences(file, "e20699a64490c4e4284b27a8aeb05666");
    73. }
    74. }
    75. EditorUtility.ClearProgressBar();
    76. }
    77. static void ReplaceReferencesInFile(string filePath, List<UnityReference> references)
    78. {
    79. var fileContents = System.IO.File.ReadAllText(filePath);
    80. bool match = false;
    81. foreach(UnityReference r in references)
    82. {
    83. Regex regex = new Regex(@"fileID: " + r.srcFileId + ", guid: " + r.srcGuid);
    84. if (regex.IsMatch(fileContents))
    85. {
    86. fileContents = regex.Replace(fileContents, "fileID: " + r.dstFileId + ", guid: " + r.dstGuid);
    87. match = true;
    88. Debug.Log("Replaced: " + filePath);
    89. }
    90. }
    91. if (match)
    92. {
    93. System.IO.File.WriteAllText(filePath, fileContents);
    94. }
    95. }
    96. /// <summary>
    97. /// Just to make sure that all references are replaced.
    98. /// </summary>
    99. static void FindNotReplacedReferences(string filePath, string guid)
    100. {
    101. var fileContents = System.IO.File.ReadAllText(filePath);
    102. // -? number can be negative
    103. // [0-9]+ 1-n numbers
    104. Regex.Replace(fileContents, @"fileID: -?[0-9]+, guid: " + guid,
    105. (match) =>
    106. {
    107. if (match.Value != "fileID: 11500000, guid: " + guid)
    108. {
    109. Debug.LogWarning("NotReplaced: " + match.Value + " " + filePath);
    110. }
    111. return match.Value;
    112. });
    113. }
    114. class UnityReference
    115. {
    116. public UnityReference(string srcGuid, string srcFileId, string dstGuid, string dstFileId)
    117. {
    118. this.srcGuid = srcGuid;
    119. this.srcFileId = srcFileId;
    120. this.dstGuid = dstGuid;
    121. this.dstFileId = dstFileId;
    122. }
    123. public string srcGuid;
    124. public string srcFileId;
    125. public string dstGuid;
    126. public string dstFileId;
    127. }
    128. }
    129.  
    130.  
    Edit: updated the source with the latest version from here
     
    Last edited: Jul 11, 2014
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    I think that's just in Fernando's personal development software. He had a video running the same animations for the original UMA guy before UMA was released.
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Thanks for looking into this and bringing this script to the community!

    I realize it was Unity that asked for the DLL, but probably for a project like UMA that is all about customization, and which could lie at the heart of numerous game projects, people would prefer to have access to working source code without a lot of fiddling.
     
  5. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Would also like to use UMA with substances if anyone has any progress on this I'd love to know about it. :)
     
  6. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Looks more like a wererat than a werewolf.. I was kinda liking the earlier versions better for a werewolf look.. Still looks good, just not seeing a wolf in him... heh
     
    derkoi likes this.
  7. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    229
    Is there a way to quickly update the skeleton rigs that already exists for UMA?

    For example I've attached a string of clothing bones coming out of the hip of the UMA rig model in my 3d package.

    Is it it possible to import the new bones into the default male / female rigs in Unity or do I need a whole new race or how should I proceed to make sure these bones will be there if I add clothes for them?
     
  8. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    It´s just animated facial bones, nothing fancy at all.
     
  9. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362


    That´s going to be super helpful =D Thanks a lot @cyby89 !!
    I´ll be travelling for two weeks, but as soon I´m back I´ll consider including this on the base project, with your permission.

    Cheers
     
  10. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    One developer got it working already, but it require some ugly hacks. I personally want to get it working as well, I´ll play with that when I´m back from travel.
     
    derkoi likes this.
  11. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    I was actually aiming for something closer to this visual style

    other than the traditional beautiful werewolf.

    But it´s just a tutorial file, it´s up to you to get it exactly as you would like =)

    PS: This art is not mine!!!
     
  12. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    As far I know, this is already fully functional, please keep an eye for @UnLogick for how to get it working.
     
  13. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182

    Oh you're not that far off then.
     
  14. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Awesome. Thanks :)
     
  15. amonitzer

    amonitzer

    Joined:
    Sep 9, 2012
    Posts:
    6
    Hi,

    I'm seeing a lot of issues while instantiating random characters (based on the crowd demo). On terminating the game (either in the editor or the player), the whole runtime hangs or crashes. I've also had some issues with another plugin that uses a C++ library. The player on Windows complains that I'm trying to call a pure virtual function.

    This happens whenever I instantiate more than one avatar in a single frame, maybe there's an issue with that? The crowd demo uses a staggered approach.
     
  16. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    I don´t remember testing instantiating more than one avatar in a single frame, this might in fact be the problem. It´s not really worth doing this as updating the avatar shape/mesh/atlas won´t happen for more than one of them per frame at all.
     
  17. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    For anyone looking for the new race tutorial
    ;)

     
    adventurefan likes this.
  18. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  19. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    Has anyone used this with animation packages like Mixamo's?
     
  20. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    You mean UMA, or the werewolf race?
    Many devs are using UMA+Mixamo, but I didn´t tested the werewolf with other animations yet.
     
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Glad to see the race tutorial videos are coming in! :)

    A lot of people are going to want to make their own races, I bet.

    Is there anything else that's soon to arrive? We've been waiting on UMA 1.2 for a while now, right? Also, UnLogick had a pack that looked like it was near release several weeks ago. A few other projects have been mentioned, like wings, emotions, and LOD solutions, but I have no idea where those are in the pipeline.
     
  22. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    To have a sneak peek on 1.2, take a look on the Git version, you can expect everything there to be on AssetStore UMA 1.2.
    Considering all the other features and projects, can´t tell for sure, there are many devs working on different projects and each of them have their own schedules. The race tutorial was something I was talking about for months actually, but timing was better with the 1.2 changes on GIT.

    I´ll work on latest part of the race tutorial voice over now, and will only be able to get any new content in the next two weeks, after I´m back from travel.
    Cheers
     
  23. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Third part =) One more and that´s it for the next two weeks :D
     
  24. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    This is the latest part:
     
    adventurefan likes this.
  25. amonitzer

    amonitzer

    Joined:
    Sep 9, 2012
    Posts:
    6
    Well, that's unfortunate, since in my game, multiple Avatars might appear at the same time (for example, on a character selection screen)…

    In any case, I think crashing the whole runtime is a rather severe problem (notwithstanding that this shouldn't even be possible from pure C# code), maybe could you look into this anyways? Maybe this is a symptom of a larger problem that just hasn't manifested itself in any other way yet and could result in some hair-pulling later on (for example, it might crash the runtime on single instancing on every millionth avatar).
     
  26. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    I think I wasn´t clear, we can have more than 100 avatars at the same time:


    The limitations is that UMAGenerator has a queue that limit that only one is being processed each time. This means the second avatar can only be generated after the first one is completed. It´s possible to implement a priority line to speed up the update of important avatars first though.
     
  27. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    I'd like to ship my facial animation stuff not long™ after 1.2 ships. There's a reasonably recent WIP demo here.
     
  28. amonitzer

    amonitzer

    Joined:
    Sep 9, 2012
    Posts:
    6
    By “appear”, I meant “create”, not exist. When I open my character selector, all the player's avatars have to be created at the same time.
     
  29. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    You'll need to create in the background and hidden one by one and do a make visible when all are ready. You'd need simultaneous 100 threads to create them all at once.

    If you want you can 1 by 1 create 100 different avatars to your liking and save each. You'll still have to load one by one and keep them hidden until all 100 are loaded. Note that loading is for all intents and purposes the same as creating.
     
  30. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Excellent, but the animation demo reminds me a bit too much of people in withdrawal.
     
  31. Blessedone

    Blessedone

    Joined:
    Jul 16, 2012
    Posts:
    9
    Hey guys i was just about to fiddle around for the first time with UMA but was just wondering ... is there support for quadrupeds? or other types besides bipeds?

    I'm making animals with them .. cats, dogs, horses, bears and wolves ... possibly birds and fish in future
    is this feasible at this time?
     
  32. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Ah! First time I've seen that. Pretty cool! Do you have a WIP thread somewhere?

    The upper lip seems curiously stiff. The model is British, perhaps? ;)
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    As I recall, UnLogick was doing something with sheep ... and goats ... and giraffes ...

    I'm not sure what all that was about, but if you look backward in this thread there should be a note or two from him on that. You'll be able to spot it pretty quickly by the animal pictures.

    But theoretically, yes, you can use UMA for those things, you just have to make new races for them all. And instead of using humanoid animation, you'd use generic.

    You could use UMA to change proportions on the animals so they aren't all the same size, and change color, and change parts, so that if for instance you're doing a type of animal with horns or antlers, you could have a few slightly different looking horn / antler models that could pop up on them, helping to create the impression of a diverse population.
     
  34. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    @ecurtz - For what it's worth, I tried to make a "determined" look and struggled with it. I selected bared teeth, frown, narrowed brows, brows up on ends, wrinkled nose .. and it was kind of close, but looking maybe more like an ill grimace.

    I suppose you're working on it, but as a way of illustrating the flexibility of your kit, I suggest you develop a set of facial poses that people can use as one-click emotions. Like happiness, disgust, anger, sadness, and so on, pre-loaded in the system.
     
  35. Blessedone

    Blessedone

    Joined:
    Jul 16, 2012
    Posts:
    9
    ty hopeful i will track it down i really appreciate your reply
     
  36. Blessedone

    Blessedone

    Joined:
    Jul 16, 2012
    Posts:
    9
    anyone know where i can get a copy of the latest Power Rigger? i cant seem to find it anywhere.
    @UnLogick any help?
     
  37. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Power Rigger hasn't been released yet.
     
  38. Blessedone

    Blessedone

    Joined:
    Jul 16, 2012
    Posts:
    9
    hmm ya now im confused because it appears that generic rigs aren't even released yet from UMA
    ...well crap i got all excited and thought i'd be building this today :(

    "In the unreleased UMA 1.2 we introduce Mecanim Generic and you can now build all kinds of beings and machines."
    quote from
    http://uma.unity3d.com/wiki/index.php/Newbie_Section#Races
     
  39. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Power Rigger? As in replacement for Mixamo Auto-Rigger to use in Blender? Or directly in Unity for export to Blender? I'll buy.
     
    SememeS likes this.
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    UMA 1.2 isn't in the asset store yet, but it is available at GitHub:

    https://github.com/huika/UMA

    We were discussing this earlier on this forum page ... I asked when UMA 1.2 would be coming out, and Fernando said it is basically the version that is currently on GitHub.

    Fernando said, "To have a sneak peek on 1.2, take a look on the Git version, you can expect everything there to be on Asset Store UMA 1.2."
     
  41. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Yeah thanks, feedback like this is very helpful. The individual poses aren't finalized but this sort of stuff helps with the tweaking. It will come with presets for all of the basic emotions and phonemes as well as a bunch of little animation clips. In this case you probably wanted brow in as well, although that one is pretty subtle because of the UMA topology, it really needs a wrinkle map.
     
  42. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Very nice! I won't need the phonemes or any complex system in that regard, but it would be great to have a palette or portfolio of facial expressions and the ability to tweak them. A good source for depictions of emotions might be found in cartoons and comic books, as the artists there are forced to convey a feeling with a static image.

    I don't know how complicated your project is, but if the speech part is a big deal you might break the project up into two parts ... the phonemes and the expressions. I'd expect that the market for expressions is much larger than the phoneme one.

    For what it's worth, there's a utility in the store that looks like it can help make poses in Unity: Skele. I've not used it yet, but it looks useful for staging cutscenes and so on.
     
  43. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    You can email me (or just wait for release) if you want more details but the basic shapes that show up on the sliders are defined in a Blender animation and all of the expressions, poses and animations just set the weights and combinations of those. The shapes are based off Jason Osipa's excellent Stop Staring: Facial Animation Done Right, modified to use UMA's bone based animation rather than morph shapes. Everything comes down to the quality of those basic shapes, so getting them as nice as possible (given the limitations of the UMA rig) is the biggest challenge.
     
    Last edited: Jun 19, 2014
  44. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412

    imo this is huge limitation in some cases and waste of framerates/core power where we could create more chars than 1 (and split them into threads for huge army). This constraint is due to Unity limitation or UMAGenerator? (in first case as i see we cannot workaround but in second case i could rewrote UMAGenerator in future)
     
  45. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,630
    Have you looked into the UMA Power Tools asset? It might have what you're looking for. Here's the thread.
     
  46. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412

    ty for reply however i think u misunderstand me - i dont need threaded atlassing or bone reducing i need (in future) spawning multiple avatars each framerate (as i see now its impossible without sending each avatar to each thread which is waste of their power because 1 thread could easily handle more than 1 chars per framerate - and main thread too)
     
  47. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469




    Apparently there is be a method to make blendshape compatible with cloth and bones setup, I would pour monies at anyone who can make it works with UMA!
     
  48. Blessedone

    Blessedone

    Joined:
    Jul 16, 2012
    Posts:
    9
    guys i really dont get how to make a generic rig in uma lets say animals for instance... am i missing some documentation i need to read?
     
  49. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Unless I'm missing something he's just weighting the vertices of the shirt to the vertices of the base mesh rather than the bones. This is the other standard way of doing it and has some small advantages and disadvantages from the UMA approach but it doesn't produce dramatically different results.
     
  50. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    229
    Face stuff looks promising ecurtz. Will there be some kind of expression settings saver included so we can call them easily in-game like you would blend shape or something?