Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Is there any way to bake a UMA dynamic avatar into a standard fbx while retaining the blendshapes for use with an asset like SALSA? I don't need runtime morphing and I want to reduce resource overhead to just the models and textures I am using. Currently, with the base library of male and female content, the resource overhead is somewhere in the neighborhood of .75 GB, which is way too high for my console project.
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Yes . The power tools save the character as a prefab. (But they are currently broken on 2018.3). As well, joens fbx exporter will save as an fbx.
    Plus the newest RC of 2.8.1 also makes it easier to delete all the examples and stuff you don't need.


     
    magique likes this.
  3. Myst12

    Myst12

    Joined:
    Mar 6, 2019
    Posts:
    7
    Hi i am stuck on something, I am trying to connect the UMA clothing to the UMA character through imagery like the recipe/wardrobes/thumbs. so that players can click on the image and call the clothing onto their character to customize their wardrobes before entering the game but I am at a loss as to how to call the slot. Is there another way to do it or do you know of a tutorial that could help?it would be Much appreciated
     
  4. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi guys, is there any feature or debug tool in UMA to test if when importing an fbx the bone rig is correctly reconstructed by UMA? currently the only way I know for this is a bit tedious because you have to import the fbx, configure the avatar, extract Tpose, then create slots for that avatar manually, add an overlay for that slots, then include the slots in the race data base recipe, reassing the T-pose to the race data, and then play the scene, which in my case is slowing me down, I'm trying to find which bone, or collection of bones is wrongly rotated in my rig, meaning that I adjust one bone, export from blender, do all the stuff above, if it fails I have to do it all again. Maybe there is a debug tool that I'm unaware of that will skip the slot creation process etc and just show me if UMA will build the bone structure correctly from the fbx?
     
  5. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    There are two samples included - one that shows how to pick from a list, and another that shows how to pick from an icon. (See the DCS samples).

    If you're looking for something already made, you might want to look at this asset:



    If you need more information, we'll need more specific questions. If you're wanting to create a UI, you should be familiar with UI creation:

    https://unity3d.com/learn/tutorials/s/user-interface-ui

    Generally, you'll pull the available wardrobe slots from the RaceData, and present the user with a set of Wardrobe items that can fit based on the Wardrobe Slot the recipe is marked as using. There is a field on the Wardrobe Recipe that can hold the icon.
     
    Myst12 likes this.
  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Once there is a prefab, can it be used in a project without any UMA code at all?
     
  7. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Unfortunately, there is no current utility that does that. But if you follow the steps above, it should import from Blender correctly. I'm not sure I can automate a generic check, because the FBX will be imported various ways depending on the source/axis/etc. I can make a "Blender 2.8 specific" check that will validate the FBX based on the parameters below, but that will do very little if things aren't looking right in Blender itself.

    1. The Blender bones need to have the visual transform baked in. This is done in pose mode.
    2. The Rig (in object mode) needs to be at 0,0,0 with 0,0,0 rotation.
    3. You need "Global" and "Position" bones (at 0,0,0 - rot 0,0,0) at the top level:

    Global (parent)
    + Position(child of global)
    + Hips (or whatever - your actual skeleton - child of Position bone).

    When exporting from Blender 2.8, the following should be setup in the FBX options:

    Under Main:
    Empty, Armature, Mesh checked.
    Apply (all local)
    Forward = Z Forward
    Up = Y Up.

    Under geometry:
    smoothing: Normals only.

    Under Armature:

    Add Leaf bones
    Primary Axis: X Axis
    Secondary Axis: -Y Axis

    Under Animation:

    Uncheck "Baked Animation".


    When importing the model:

    1. Set the import Scale Factor to 100 (moves it to Unity units)
    2. Build the slots from the model.

    When extracting TPose for a custom race:

    1. If the rig is Humanoid, set the rig to Humanoid, and Apply. Then configure it, enforcing TPose.
    2. Extract the TPose and put it on your new race.
     
  8. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Yes - it doesn't have the UMA stuff attached. The power tools are broken in Blender 2018.3 at the moment though, but I've successfully tested them in 2017.4. The FBX exporter just makes an FBX, so you can use it anywhere. I haven't used this though. I do know that the Unity FBX Exporter doesn't work at all -- gets several errors. I've reported it, but no one seems to care.
     
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    OK. I am using 2017.1.5f1 so it should be fine there.
     
  10. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    magique likes this.
  11. Bartek_Gudowski_Friend_Factory

    Bartek_Gudowski_Friend_Factory

    Joined:
    Feb 18, 2019
    Posts:
    54
    Hi Jaimi! Do you know of any FBX exporter during iOS runtime that can export UMA characters? Thanks
     
  12. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    No, sorry - the only one I'm aware of that works with UMA is Joen's, and his is Windows only.
     
  13. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    Hi, I think there is some isssue with Blendshapes +/- UMA in 2018.3.7f1?

    I built my UMA in 2018.2.20 (with 2.8 RC3) with plenty of blendshapes - all seemingly fine (I have just verified the below is working fine in my old project).
    I exported all and imported into 2018.3.7f1 with current UMA asset store release version.

    Immediately i notice blendshapes have changed. there are now 0-100 sliders and interestingly, when before the values you entered manually were effectively clamped at 0 and 100, now with the sliders sometimes they can be convinced to go past 0 and 100 in the editor and the changes are applied as extreme morphs (although it looks as though this is not supposed to happen).

    At runtime, using the editor i can apply my blendshapes as normal and all seems fine, however, if i remove a wardrobe recipe it all 'falls apart' random the vertices move around flashing into different locations like they no longer know where they are supposed to be. If i reset all blendshapes back to 0 it tends towards normal, but i note the slots are differentially broken and some slots do not now respond to certain blendshapes others are stuck in a blendshape (as their default).

    Some more observations. If i add clothing prior to runtime test and use blendshapes, all is fine. It seems it is also fine if i add clothing before touching a blendshape (during runtime). However, If i add clothing to a character with blendshapes applied first then the clothing no longer follows the shapes properly and the avatar is bust.

    Anyone seen anything like this? It's almost like there is a sorting of blendshapes during UMA update and it is falling over some how?

    Note: all above tests done with editor and not code.
     
  14. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I believe in Unity 2018.3, Blendshapes can now go from -100 to 100, so if you made custom DNA, you might have to update them. Best to ask @dos on slack, as he is the expert on this.

     
  15. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    I haven't yet added the DNA, this is purely an editor issue. Can i get a slack invite, I got overlooked in the forum request thread (at least i never noticed the invite). thx
     
  16. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    Yea, we unclamped blendshapes because Unity unclamped them and some users use past the 0-100 range
    https://forum.unity.com/threads/removing-clamping-of-blendshapes-to-the-range-0-100.504973/

    Per the UMA release notes: "Note: Blendshapes do not work correctly on 2018.3 when GPU skinning is enabled. Please disable GPU skinning in your 2018.3 project until Unity has addressed this bug."
    I believe this is because of the new compute shader for blendshapes. Do you still have the issue if you disable GPU skinning?
     
    hopeful, Jaimi and DankP3 like this.
  17. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    @kenamis , you nailed it, thanks. GPU skinning off and all seems fine so far.

    and apologies, I should read release notes more carefully
     
    kenamis likes this.
  18. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    If you still want an invite, send me a PM with your email, and I'll send one out.
     
  19. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    I think it's fixed in 2019.1 with GPU skinning on too, and might be fixed in a later 2018.3 patch (I had reported the bug)
     
    hopeful likes this.
  20. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Supposedly fixed in 2018.3.6 (haven't tried it though). For some reason, they haven't been announcing the 2018.3 updates, but there is a 2018.3.8 available now.
     
    kenamis likes this.
  21. chaza_li

    chaza_li

    Joined:
    Jan 8, 2018
    Posts:
    29
    Hey guys,

    All in a sudden all my Wardrobe recipes will not show up and it says "Duplicate path for item [asset path]", and now no wardrobe recipes would work. Is there a fix to this?
     
  22. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    That's just saying it's not adding something again because it's already there.
    Has anything happened before this that might confuse it? Did you delete the library folder or upgrade Unity, or update UMA, or anything like that?
    You might try simply repairing the global library. If that doesn't work, next step is to clear it and rebuild it.
     
  23. arteria

    arteria

    Joined:
    May 31, 2007
    Posts:
    2,189





    Winged Demon Warrior Female for UMA

    Today, we release the 'Winged Demon Warrior Female' for UMA
    With this costume, we have provided you with the body and retexture, plus the Wings, which are rigged with additional bones, that have been imported as part of the slots, for animating within unity

    Pack can be purchased for just $25, or $15 today only, if you email arteria3d@live.co.uk for a coupon code.

    Thank you to Jaimi for your much apreciated help with this pack.

    Product Page:
    https://arteria3d.myshopify.com/products/winged-demon-warrior-female-for-uma
     
    Last edited: Mar 14, 2019
  24. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Love the wings, Steve!
    Hopefully we'll see some Angel and Butterfly wings too at some point. :)

     
    hopeful likes this.
  25. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Great :) Will there be a male Version, too?
    I find it really very good to have more various uma stuff like more races (Vampires, some Reptile-humanoids would be cool etc.), and this is a step into that direction!
     
  26. arteria

    arteria

    Joined:
    May 31, 2007
    Posts:
    2,189
    Thanks, yeah I can create a male variant on this
     
  27. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    I keep having artifacts on my UMA that I suspect is because the normlas seams somehow got effed up.

    Take a look:
     
  28. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    When you build your slots, you can supply a "seams mesh" - this mesh is the uncut version with correct normals.
    The Slot Builder will go through, and fix the normals on the slot seams using the normals from the seams mesh.
    Be sure your seams mesh is imported with the same parameters that the original mesh (that you used to create the slots) has, because it has to find them by position.
     
  29. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    Yes, that's was I was hoping to avoid doing. I still did it, though. Remade all my slots, again, with their overlays and all.

    Everything seems fine, now.
     
  30. arteria

    arteria

    Joined:
    May 31, 2007
    Posts:
    2,189
    TonyLi, Jaimi and Firlefanz73 like this.
  31. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Happy Birthday to you Steve! :) Make yourself a nice day...
     
    arteria likes this.
  32. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    So I have been experiencing the same problems as @Cleverlie with my custom races and I needed a vaguely correct (what I am calling birth skeleton, since the animator corrects the defects). I need to bone build and run code on that build prior to avatar completion.

    I have been totally unable to setup a blend file so I can get my skeleton correct for the UMA (the birth pose is laying down and distorted). I am sure this is my incompetence in understanding the blend to unity issues (and not having any idea what Unity is doing behind the scenes).

    Via fbx export using settings from Secret Anorak from the blend I have created something resembling the defective default male discussed above (see below). This seems to work for me as the code I run (prior to avatar creation) is referencing things like head position, which is roughly correct.

    I don't like the fbx exporter because it tends to lose a blendshape or two randomly from some of the slot meshes (who knows why, as most remain intact and they remain present in the blend file).

    I've really tried to understand the export requirements and am now settling on a compromise.

    All this experience is UMA2.8(UAS), Unity 2018.3.7f1, Blender 2.79, if any of that makes a difference.

    It seems OK to use the fbx export to define the T pose and bone build, but use the blend file to build the slots with all the correct blendshapes. This is not ideal, but this is OK in principle, correct?


    upload_2019-3-15_16-42-36.png
     
  33. twospoonstn

    twospoonstn

    Joined:
    Mar 10, 2013
    Posts:
    12
    I'm trying to load a wardrobe recipe from code. I have created the asset bundle by including all the assets in it (textures etc). The bundle is loaded like so;

    hair = AssetBundle.LoadFromFile("somepath");

    Which returns a proper bundle.
    Then using the AssetIndexer;
    UMA.UMAAssetIndexer.Instance.AddAsset(typeof(UMAWardrobeRecipe), "My hair", @"somepath", hair, false);

    This doesn't give any errors, but my questions are if the types are correct etc. And why does it need a path if the bundle is already loaded?

    Finally I assign the hair;
    avatar.SetSlot("Hair", "My hair");

    No errors, but nothing happens.

    If I iterate through;
    var t = UMA.UMAAssetIndexer.Instance.GetAllAssets<UMAWardrobeRecipe>();
    t.ForEach(o => Debug.Log(o.name));

    If fails because the asset I added doesn't have a name. What am I missing?

    Thanks!
     
  34. arteria

    arteria

    Joined:
    May 31, 2007
    Posts:
    2,189
    Also, im offering 1 free UMA costume to any customer for the next 12 hours - email arteria3d@live.co.uk with your request - (Excludes Celtic FULL pack, Winged Demon)
     
  35. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I believe the problem you are seeing is due to the fact that your rig is rotated 180 degrees (selecting the "front" view is showing the front of the character). This is not required in Blender 2.8, but is required for Blender 2.79 using the ascii exporter. You can try the 2.8 settings in Blender 2.79 (using the newer FBX exporter), or put a 180 degree rotation on the rig (see the UMA content pack for a sample of a working 2.79 file with a rig).

    I'm including the updated content PDF that shows the correct export parameters.








     

    Attached Files:

    DankP3 and kenamis like this.
  36. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Is there a warning in the console? (it doesn't error when not found, but it does give a warning.)
    If it is found, and passed to the SetSlot(UmaTextRecipe) function, then I would check the recipe and be sure that it has the Wardrobe Slot assigned, and that the assigned race(s) are compatible with the race that you have on your DCA, as that can also cause it not to be applied.
     
  37. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    Might be time to just update to 2.8? Do you happen to know if how Unity handles direct blend file imports is affected by these differences in the blender update.

    I'll likely try both. thanks for the pdf
     
  38. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Unity doesn't import 2.8 files yet, as far as I know, but I'm not having any issues with the 2.8 fbx import, though 2.8 itself can be a little flaky sometime. I recommend updating anyway, it's heads and tails above 2.79. But save your old blends, as the new ones aren't backward compatible (though you can "append" from them).
     
    DankP3 likes this.
  39. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Don't forget to rebuild your TPose, as that is where the error you are seeing is actually coming from.
     
    DankP3 likes this.
  40. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    So I am beginning to feel incompetent. Only once did I manage to create an extracted t-pose that enabled my avatar to be created standing up (even the the bone build was lying down and the birth pose was distorted when it was created as shown above) . I have tried to follow blender 2.79 instructions and 2.8 instructions. Always with the same/similar results. As far as I can tell normalising/zeroing loc, rot and scale has little impact. I assume I am supposed to 'configure' the rig, enforce t pose and extract, but simply can't get it right. Is there anything else obvious to look for?

    To be clear, this is only an issue in that critical time before the Animator takes over!
     
  41. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I'm not sure how to better document this. If you can send me the blend file, I will be happy to take a look at it.
    Plus, I'm not sure how you are seeing the character before the animator is running?
     
    DankP3 likes this.
  42. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hey guys,

    I'm updating from UMA 2.7 to 2.8 now. I tried once with just overwriting the old version and I got an error that says this:

    "Assets/Standard Assets/UMA/Core/StandardAssets/UMA/Scripts/Editor/RaceInspector.cs(11,15): error CS0101: The namespace `UMA.Editors' already contains a definition for `RaceInspector'"

    Then I tried it again by deleting the main UMA folder in my project, and re-importing fresh UMA 2.8 files. But I still get the same error above.

    Any thoughts on how to fix this? Thanks.
     
  43. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Deleting the UMA folder should have done it. You might try rebuilding your library.
     
  44. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Thanks Jaimi. I found out I had an UMA folder in my plugins folder, but I also had another one outside of it in my main Assets hierarchy as well. Why.....I don't know.. lol. I deleted both and reinstalled and everything compiles now!

    Thanks.
     
  45. twospoonstn

    twospoonstn

    Joined:
    Mar 10, 2013
    Posts:
    12
    This was not easy to figure out. There are several ways of adding assets etc using the framework.
    What I wanted was to download each specific recipe from a bundle and apply it to the avatar.

    Anyways, this works;

    Code (CSharp):
    1.        hair = AssetBundle.LoadFromFile(@"C:\Users\yodel\Documents\unity-projects\AssetBundles\Windows\hh");
    2.        if (hair == null) {
    3.            Debug.Log("Failed to load bundle");
    4.            return;
    5.        } else {
    6.            Debug.Log("Bundle loaded ok");
    7.        }
    8.  
    9.        var overlay = hair.LoadAsset<OverlayDataAsset>("hh_Overlay");
    10.        var slot = hair.LoadAsset<SlotDataAsset>("hh_Slot");
    11.        var recipe = hair.LoadAsset<UMAWardrobeRecipe>("hh_Recipe");
    12.  
    13.        UMA.UMAAssetIndexer.Instance.EvilAddAsset(typeof(OverlayDataAsset), overlay);
    14.        UMA.UMAAssetIndexer.Instance.EvilAddAsset(typeof(SlotDataAsset), slot);
    15.        UMA.UMAAssetIndexer.Instance.EvilAddAsset(typeof(UMAWardrobeRecipe), overlay);
    16.      
    17.        avatar.SetSlot(recipe);
    18.        avatar.BuildCharacter();
    19.  
    After you run the code once, you will see that your global library has now added these items to it. To remove that you can run
    UMA.UMAAssetIndexer.Instance.RebuildIndex() on startup to make sure your global library is not throwing you for a loop (it might look like you're loading it from a bundle, but it's already in your global index).

    To create the bundle just click on the folder for your recipe (I have each "slot" in its own folder with textures etc) and assign it a bundle name. You can then use the UMA AssetBundle Manager to create it for you, or you can write your own menu function;
    it's just one line of code;
    Code (CSharp):
    1.     [MenuItem("Assets/ Build Asset Bundles")]
    2.     static void BuildAllAssetBundles() {
    3.         BuildPipeline.BuildAssetBundles(@"Bundles\",  BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.StandaloneWindows64);
    4.     }
    To make sure nothing get's loaded from however the hell Unity loads stuff, move it out of your project directories. I had issues with it loading bundles automatically for some reason.

    Now you can drop that bundle into an S3 bucket or whatnot and go from there.

    Peace.
     
  46. Yerkisk

    Yerkisk

    Joined:
    Jul 28, 2015
    Posts:
    38
    If anyone can help that would be appreciated. I'm struggling with something that should be pretty simple, if I look at the different videos on the subject.

    I have an avatar created, wearing default wardrobe items. That avatar is loaded by either LoadFromRecipeString or SetLoadString, depending on if the avatar was previously created or not. So far so good. Once created, I use the following to save the recipe to a string to save it on a server (client/server app, when connected the client is sent the recipe from the server) :

    Code (CSharp):
    1. UMAAvatarBase avatar = avatarFemale.GetComponent<UMAAvatarBase>();
    2.             UMATextRecipe asset = ScriptableObject.CreateInstance<UMATextRecipe>();
    3.             asset.Save(avatar.umaData.umaRecipe, avatar.context);
    4.             umaDefinition = asset.recipeString;
    It was working great, until I started using SetSlot to add items. As soon as I use SetSlot and then BuildCharacter, the avatar lose all clothing, even the default wardrobe is removed, all hair, etc. but it keeps the body morphology. The only item that appears is now the item for the slot used in the SetSlot. The item is not set to hide any other slots, and is valid for the avatar race.

    When using avatar.GetCurrentDNARecipe(), it returns the full DNA but with an empty wardrobe set. When using avatar.GetCurrentWardrobeRecipe(), it returns an empty DNA with only the slot set earlier in the wardrobe set.

    Does this sound familiar to anyone?
     
  47. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Are you doing any of this in an event? That can cause problems.
     
  48. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    93
    Sorry for the delay in getting back to you
    First, the documentation is great. Second, I can use the documentation to export the default male and extract a t-pose that behaves as I would expect, so I think the issue must be in my rig.

    I wanted to be clear on what I see, in a slow uma build at runtime, I can advance frame-by-frame. First I see the creation of the red IK target gizmos and blue centre of gravity gizmo. The centre of gravity should be near the hips, but is near the root. Next frame, the character is rendered lying down (centre of gravity near the gizmo and arms and legs reaching for the IK points twisting the mesh). Next frame the mesh jumps to the animation pose. Without the load delays, I wouldn't see this, but I think it points to the issue of having a laying down bone build and some rotation issue I can't see in the rig. I will think about how to bypass the ip issues with my rig and maybe dm you.
     
  49. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    You might want to look at your UmaGenerator, and make sure that "fast generation" is turned on - this will generate the rig and the mesh in one frame. I forget that this is available as it's enabled in the prefab. I'm not even sure of the usefulness of it, actually.
     
  50. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    It's to try and prevent frame rate hits during generation. Might be obsolete at this point.