Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. Yerkisk

    Yerkisk

    Joined:
    Jul 28, 2015
    Posts:
    19
    Well yes, I'm using Game Events (as defined by Ryan in the Austin 2017 Unite talk) to be notified when the client receive the uma recipe from the server, but I don't see how this could cause issues? Everything in my application is event-based considering that it's an exchange between a client and a server.

    How else would you approach this in a context where you receive the information from a server?
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    Sorry - I mean in any of the DynamicCharacterAvatar or UMAData events. It's not a good idea to update the avatar from those events.

    Anyway - the code shows you getting the recipe for the UMAData. You need the recipe from the DCA itself, so it can restore the wardrobe.

    From the documentation:

    Saving and loading from a string
    You can save the DynamicCharacterAvatar to a string:

    string savedAvatar = Avatar.GetCurrentRecipe(false); // Avatar is a DynamicCharacterAvatar

    Then load him from that string:

    Avatar.LoadFromRecipeString(savedAvatar);

    After loading the avatar, it should be rebuilt:

    Avatar.BuildCharacter();
     
    hopeful likes this.
  3. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    79
    @Jaimi @ecurtz , i don't think the fast generation does anything significant, I have not tested formally, but in my context above I see no differences, but i think i have found an issue.

    So I am now thinking my rig is fine and my T-pose is fine. I'll have to speculate here about what is going on in the hope it explains what i see, even if my explanation/speculation is false.

    The problem I perceive to be related to the animator and the generation of the standard UMA Animator Avatar (I forget it's name). An Animator is added and the UMA avatar is added to it.

    In the first tick I am assuming this Avatar is not initialised or is incorrect in someway (or maybe my rig is somehow incorrect for it) and the centre of gravity of the Animator is at the root position (probably because my bone build is still lying down and its hips are near root height, but that doesn't seem to be a major issue, but it may explain why the default UMA escape this issue in my hands).

    In the next tick, maybe the avatar is converted or something similar and the rendered mesh moves to the correct position.

    However, if the Animator avatar at creation has my new race's avatar this doesn't happen (either the two match or it somehow compensates for rig issues?), the character is rendered in correct pose with correct centre of gravity. Next tick, the UMA Avatar is again listed in the Animator, but then this is fine thereafter. I never got to check what happens when the avatar is updated at runtime.

    What's more, i think i need the Animator with own race avatar present prior to bone build (note bone building changes the avatar in the Animator and i changed it back (need more testing to know how essential changing it back is), but i think i need my races avatar present on creation). I need more experimentation here though.

    So maybe this is all still false leads, by my UMA race works fine with the above modifications to the Animator avatar. If this is a genuine issue, maybe we need to specify an avatar with a race (for bone building and Animator?)? or is my tampering with the avatar in the Animator just fixing another issue?

    Apologies again if i have missed something in the documentation.
     
  4. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    79
    So this wasn't my problem, although it definitely affected how the animator loaded. Must be the rig :(
     
  5. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    I'm happy to assist if I can see the rig, I'm sure you're tired of me saying that.

    Otherwise, I'm not sure why you're not getting your skeleton, animator, and mesh all generated on the first frame - that's what "fast generation" is for. If you are setting the animator manually, there is a place on the DCA to specify an animator per race, so you don't have to do that.

    If you're running the 2.8.1 RC, I added a function to allow more than one "generation pass" per frame on the Generator. (I probably forgot to document this, now that I think about it). You might try setting that to 2 and ensuring that Fast Generation is on, and that you have the race animators setup.
     
    DankP3 likes this.
  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    UMA 2.8 RC2 released.
    You can get it here:

    https://github.com/umasteeringgroup/UMA/releases/tag/V2.8.1RC2

    If there are no reported issues, we will release it to the asset store in a few days.

    UMA 2.8.1 RC 2
    Updated General Documentation.
    Updated Content Creation documentation for Blender 2.8 beta.
    Several changes to internal classes for compatibility with the upcoming UMA Power Tools release.


    The following changes were in 2.8.1 RC 1:
    Restructed files and folders.
    Easier to delete examples.
    Added ASMDEF files to speed compiles. (This is a 2017.3+ feature)
    Various minor fixes and updates (new accessors, build issues fixed, etc).
    Added DCA Randomizer and Random Crowd generator and scene.
    Updated General Documentation.
    Added Content Creation documentation.

    Upgrading from 2.8:

    * You should remove the previous UMA folder before importing! Save all your custom content somewhere, and delete the UMA folder. Many files have changed location.

    Upgrading from 2.7 or a previous version

    * With the change in type, your global library will need to be rebuilt.
    * You can update the old DNAConverterBehaviour prefabs to the new DNAConverterControllers by selecting the warning in the console and following the text directions.
    * HumanMale and HumanFemale are now using Bone Poses for initial bone morphs. This can cause some slight differences in characters having DNA applied. If you need the old behavior, you should change your race to the "Legacy" version of the races.
    * 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.
     
    terrycheung, Ne0mega, chrisk and 2 others like this.
  7. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    I'm also having a rig problem. I am not a Blender user. I'm using Maya.

    I'm importing the Female_Unified.fbx into Maya and none of the joints are unified. The legs,arms and neck and other joints all have crazy rotation data on them. When I zero everything out, it breaks the rig.

    Is there an fbx file somewhere of the rig that has all the joints at 0,0,0?

    Thank you.
     
  8. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    I know several people have used Maya to export to UMA, but I'm not sure exactly what they did. There are other formats (including the native Blender files) here:

    https://github.com/umasteeringgroup/content-pack/tree/master/

    If that doesn't help, I can send you a blend directly that you can load into Blender 2.8, and export in several different formats (I need to check these in, but haven't gotten around to it yet). Blender 2.8 is free to install, and has significantly improved the UI (I know some people freeze at the mention of it - but it really is top shelf now).
     
  9. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    Thanks for getting back to me very quickly. I opened a good amount of these files and they have the same problem in Maya. When I zero everything out arms go straight up and not to tpose. When I zero legs out, the legs go straight up through the body.

    Is there a correct way to export these files from blender when they are opened in another software that all their joint data is 0,0,0? I feel like this is an export problem blender that im not sure how to fix.

    Thank you again.


    upload_2019-3-25_10-31-41.png

    upload_2019-3-25_10-30-48.png
     
  10. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    Blender and Maya work differently - I think the 0,0,0 requirements only matter to Blender, as Maya is showing you absolute rotation and position. Blender shows delta rotations and positions.
     
  11. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    Is there a way to have blender export this this data so it can work correctly in Maya?
     
  12. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    I really don't know, I know that some have successfully used Maya in the past. Are you creating clothing? If so, you should just be able to use it as-is. Maybe someone who is familiar with Maya can respond further.
     
  13. Palanai

    Palanai

    Joined:
    May 3, 2017
    Posts:
    12
    Hey folks,

    I was wondering if you could point me in the right direction regarding how well UMA scales for a multiplayer environment.

    How well does UMA handle performance if there are a 30 - 60 player characters in close, visual proximity to one another? How well does UMA support support LODs.

    Are there any obstacles in integrating a layered dye system for costumes? So that a player could dye the metallic and cloth parts individually of their outfit?

    From what I understand, UMA essentially merges things together into it's own specialized meshes. Which sounds great for a draw call graphics wise, but how do you then describe that merged mesh over a network? How do you kill that mobile/etc, and have all those pieces of gear/clothing/etc have server side objects that can be interacted with, looted, etc.

    Thanks,
    ~ Gabe
     
  14. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    I am looking for tutorials on making UMA character outfits in Maya.
    Are there any on exporting the UMA base models?
     
  15. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    UMA works great multiplayer. Each avatar is quickly serialized to a string that can be sent and reconstituted on the fly.

    UMA is extremely performant. On my Intel Graphics (surface pro - iris 540), I can get around 60fps with 150 UMA on the screen. 30-60 would be a piece of cake for it.

    UMA comes with a LOD component that will automatically rebuild the UMA on the fly as needed. It does automatic Texture LOD (which in my opinion is more important than mesh LOD). To use Mesh LOD, you have to supply LOD slot versions, but UMA will swap those out as needed (ie- you don't have to manage it)

    This is supported through "overlays". Each overlay is merged together along with a set of modulated and additive color channels. To do this, you would break out the different texture parts into separate textures with alpha, and then supply colors to modify them. You can make pieces metallic or non-metallic just by changing the colors on them (adding to the channel(s) that control the smoothness and metallic values).

    That merged mesh is described by a "recipe". Depending on what you need, it can either be serialized to a full DCA recipe with wardrobe, skin colors, etc - or it can be a simpler version that just reconstitutes the mesh and overlays to rebuild a UMA with a "DynamicAvatar" (not a DynamicCharacterAvatar).

    When building for mobile, you of course have to be conservative with textures and mesh pieces.

    Hope this helps.
     
    hopeful and Palanai like this.
  16. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    Several people have used Maya to export, but I don't believe there is any specific Tutorial for it. This thread has quite a bit of Maya chatter earlier that might be helpful. I personally have little helpful knowledge of Maya.
     
  17. Palanai

    Palanai

    Joined:
    May 3, 2017
    Posts:
    12
    That clears up a lot. Thanks, Jaimi!
     
  18. reigota

    reigota

    Joined:
    Mar 23, 2010
    Posts:
    64
    Hello guys!

    I want to create characters with cartoon style. How to do it? How to start?
     
  19. DankP3

    DankP3

    Joined:
    Jul 17, 2017
    Posts:
    79
    3d cartoon models or shader effects or both?
    Any model can be turned into an uma. Secret Anorak has stepwise tutorials on YouTube.
     
  20. reigota

    reigota

    Joined:
    Mar 23, 2010
    Posts:
    64
    Both.
    I tried to mess with the material first but I was very unsucessfull :)
     
  21. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    You can swap out the materials, but you have to touch each part they effect.

    Simplest thing is to create a new Material, and assign a Toon shader to it. Drop one of the unified characters into the scene, and change the material to your new material, and adjust it however you like for best results.

    If you use Toony Colors pro 2, you can set your shader to "Toony Colors Pro 2/Standard PBS" on the material, and change the "UMA_Mat_Diffuse_Normal_Metallic" to use your new toon material, and get a pretty good toon effect:

    ToonUma.jpg

    You can do things like reducing texture size to remove detail (an easy way to test is by changing the Initial Scale Factor on the UMAGenerator to a number like 4 or 8). Of course you'll probably want to modify the DNA to make the character more toony also.
     
    hopeful likes this.
  22. LostTemptation

    LostTemptation

    Joined:
    Jan 26, 2018
    Posts:
    10
    Hey there,
    im kind of new to UMA, but from what ive seen and experienced yet i think it is really nice!
    Ive setup a Character with Blender and split him up in different slots to use with UMA... And the performance is awesome!

    But now im experiencing heavy problems with loading Blendshapes. When i Check the "Load BlendShapes" the start of the Project takes about 10 to 15 minutes. Unity Hangs in the first few frames until UMA finishes the "Load Blendshapes"
    I guess there is some issue with Loading/Combining the Blendshapes wich makes the whole process take very long.

    However after Building the Project and executing the executable it is the same thing. You see the first frame and then the application hangs until UMA finished loading/Combining the Blendshapes (takes about the same time on the exe) After the loading process everything is fine. The Scene runs in VR with solid ~95+ Frames with about 50 animated Avatars.

    My Model has about 50k Polys and is stitched together with 8 different Bodyparts. I got about 1200 Morphs on the Character (Yeah i know its a lot, but i need them for nice customization and to be able to use the Avatar as a "Multipurpose Avatar" ;) )

    Im corious if the Blendshape loading/combining has to be done at Runtime, since it is something, that is not able to change during runtime.
    I wonder if one skilled Developer would be able to make something like a "(Re)Generate Blendshapes" Button, wich does this in the Editor and drops the Result into a JSON for example to load the file when the Project starts.
    I Guess this would speed up the Process a lot.
     
  23. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    340
    Each blendshape is at least array the same size of your mesh's vertices. So you're loading 1200 50k vertex arrays for one character.

    It combines the blendshape whenever the mesh changes. Not sure what you mean by "that is not able to change during runtime". Using UMA powertools you can export your UMA to a normal prefab, but then you lose changing wardrobe at runtime.
    You could also use the "Bake Blendshape" feature which is much faster than a regular blendshape. It allows you to use the same data from your blendshapes but bakes the current value into the mesh when it generates. You lose the ability to change your blendshape value until you regenerate the UMA mesh again, but it is much faster to combine.
     
    LostTemptation and hopeful like this.
  24. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    Like kenamis says - that is quite a large set of data - about 700mb of blendshape data, if my calculations are right. Moving it to json would make it much slower as it had to reserialize everything from text.
    You might want to make sure that you don't have "force text serialization" turned on, though slots are supposed to be forced binary in code, different versions of unity might behave differently.
     
    LostTemptation likes this.
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,028
    Always glad to hear more about the current state of blendshape usage in UMA. We've been talking about blendshapes in general for so long in the thread I can get a bit confused about the current state of it. ;)

    So we have "baked blendshapes" which freezes the blendshape to whatever value it holds at generation - thereby greatly enhancing efficiency - and dynamic blendshapes which can be used during play for things like facial expressions. Sounds perfect! :)
     
    LostTemptation likes this.
  26. LostTemptation

    LostTemptation

    Joined:
    Jan 26, 2018
    Posts:
    10
    With that i mean the Set of existing Blendshapes isnt able to change during runtime.

    Im talking about a way to build that Part of the UMA pre Runtime so it only has to load existing Data and not Generate the Stuff in the first Frame.
    Like when im using the Split Up Model without UMA the Project runs instantly and with a simple Script i can also access all the Blendshapes and Change them on all the different parts and the Unified Model without any performance issues. So the Issue isnt the Blendshapes themself its the process UMA does to build/combine/access them at the first frame.

    Yeah that fits well... Still once the UMA is build everything runs perfectly fine and i can fiddle around witht the Blendshapes without any perfomance issues.

    If that means the Checkbox "Binary Serialization" when creating the Slots, yes it is on.
     
  27. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    There is also a checkbox in your editor settings. First thing to do is to just look at the asset itself inside some sort of editor like notepad - is it json, or is it binary? If it's json (text) then first thing to do is go into project settings/editor and change the asset serialization to mixed, and then go into the library and force save the slot. (it's in the utilities panel).

    If it is binary (which is most likely), then you're dealing with Unity's serialization at this point. You may not be able to do anything about it in the editor. But you might be able to asynchronously load the slot in a separate thread at run time. Not sure if Unity blocks that or not.
     
    hopeful likes this.
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,028
    Going from the release notes, it looks like GPU skinning is fixed for blendshapes in 2018.3.11, which is new.
     
    kenamis, DankP3 and Jaimi like this.
  29. LostTemptation

    LostTemptation

    Joined:
    Jan 26, 2018
    Posts:
    10
    Yep, the Serialization was set to force text. I Changed it to mixed but i cant find the force save for the Slots in the Library. So just deleted them and recreated them but that does not seem to make any difference.
    Also im wondering why the created UMA assets are that big... My Unified fbx Character including the seperate parts is abt. 324MB. The generated UMA Torso asset for example is 682 MB and the Slot 613 MB.
    Also when i click one of the Slot Assets (even the original ones that come with UMA) The cursor Flickers like between loading and normal cursor and the Performance drops really hard (clicking on anything takes a lot of time)
     
  30. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    626
    UMA is limited by the methods Unity provides for adding blend shape data to a mesh, so it's never going to be as efficient as just using the model that was imported. I don't completely understand why you're using UMA in this situation if all your modifications are all being done by the existing blend shapes? There might be simpler methods such as using the Unity built-in CombineMesh that would be faster in your specific case.
     
  31. unity_BrfbXGnh02hDWQ

    unity_BrfbXGnh02hDWQ

    Joined:
    Feb 20, 2019
    Posts:
    1
    i need to change textures by C3# can you help me?
     
  32. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,028
    I don't know what your application goal is (medical?), but those characters are super heavy. Like ... amazingly so; an extreme case. I'm guessing the plan is to run only 1-4 characters at a time? I mean, I'm not sure how big, exactly, that character model would be in video memory, but if it translates directly, you can only get 3 of the unified characters per 1G of video ram ... right? And that's not counting any shader textures or other objects to render.

    UMA was originally designed to be capable of running lightweight characters on mobile devices, and it has been expanded over the years to be able to run more detailed characters for desktop, while still being efficient enough to run many characters at a time.

    But so far, to the best of my knowledge, no one has attempted something like what you're trying to do.
     
  33. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    There is a test branch with support for SRP. You will need to redo the materials, but it all works. Several people have used it. It should be included in 2.9 (the next release is 2.8.1, it will not be in that release).

    https://github.com/umasteeringgroup/UMA/tree/feature-HDRP

    Those that have tried it have done it with HDRP, but LWRP should work also.
     
    Ne0mega likes this.
  34. LostTemptation

    LostTemptation

    Joined:
    Jan 26, 2018
    Posts:
    10
    It does not, as mentioned before iam able to run about 50 of the UMA Chars on Screen in VR without any performance issues (on 1080Ti)
    using the Blendshapes is one of the reasons that this is possible. The shapes are not loaded into video memory and you only have to load one Character. When i would use different eG Heads, Torsos, Legs, etc. they all need to get loaded as soon as they are on Screen and this would kill the application.
    So there are no performance issues. The only thing is the loading of the Blendshapes on the UMA model, wich takes sooo long. After it is finished it runs perfectly fine.

    The part of UMA, that "Copys" the Blendshapes is here:

    Code (CSharp):
    1.  
    2. if (has_blendShapes)
    3. {
    4.    if (source.meshData.blendShapes != null && source.meshData.blendShapes.Length > 0)
    5.    {
    6.        int sourceBlendShapeLength = source.meshData.blendShapes.Length;
    7.         for (int shapeIndex = 0; shapeIndex < sourceBlendShapeLength; shapeIndex++)
    8.        {
    9.            string shapeName = source.meshData.blendShapes[shapeIndex].shapeName;
    10.  
    11.            //If we aren't loading all blendshapes and we don't find the blendshape name in the list of explicit blendshapes to combine, then skip to the next one.
    12.            if (!blendShapeSettings.loadAllBlendShapes && !blendShapeSettings.blendShapes.ContainsKey(shapeName))
    13.                continue;
    14.  
    15.            #region BlendShape Baking
    16.            if(BakeBlendShape(blendShapeSettings.blendShapes, source.meshData.blendShapes[shapeIndex], ref vertexIndex, vertices, normals, tangents, has_normals, has_tangents))
    17.                continue; //If we baked this blendshape, then continue to the next one and skip adding the regular blendshape.
    18.            #endregion
    19.            
    20.            //If our dictionary contains the shape name, which it should
    21.            if (blendShapeNames.ContainsKey(shapeName))
    22.            {
    23.                UMABlendShape[] sourceBlendShapes = source.meshData.blendShapes;
    24.                int i = blendShapeNames[shapeName].index;
    25.  
    26.                if (blendShapes[i].frames.Length != sourceBlendShapes[shapeIndex].frames.Length)
    27.                {
    28.                    if (Debug.isDebugBuild)
    29.                        Debug.LogError("SkinnedMeshCombiner: mesh blendShape frame counts don't match!");
    30.                    break;
    31.                }
    32.  
    33.                 for (int frameIndex = 0; frameIndex < sourceBlendShapes[shapeIndex].frames.Length; frameIndex++)
    34.                {
    35.                    Array.Copy(sourceBlendShapes[shapeIndex].frames[frameIndex].deltaVertices, 0, blendShapes[i].frames[frameIndex].deltaVertices, vertexIndex, sourceVertexCount);
    36.                    
    37.                    Vector3[] sourceDeltaNormals = sourceBlendShapes[shapeIndex].frames[frameIndex].deltaNormals;
    38.                    Vector3[] sourceDeltaTangents = sourceBlendShapes[shapeIndex].frames[frameIndex].deltaTangents;
    39.  
    40.                    //if out dictionary says at least one source has normals or tangents and the current source has normals or tangents then copy them.
    41.                    if (blendShapeNames[shapeName].hasNormals && sourceDeltaNormals.Length > 0)
    42.                        Array.Copy(sourceDeltaNormals, 0, blendShapes[i].frames[frameIndex].deltaNormals, vertexIndex, sourceVertexCount);
    43.                    
    44.                    if (blendShapeNames[shapeName].hasTangents && sourceDeltaTangents.Length > 0)
    45.                        Array.Copy(sourceDeltaTangents, 0, blendShapes[i].frames[frameIndex].deltaTangents, vertexIndex, sourceVertexCount);
    46.                }
    47.            }
    48.            else
    49.            {
    50.                if(Debug.isDebugBuild)
    51.                    Debug.LogError("BlendShape " + shapeName + " not found in dictionary!");
    52.            }
    53.        }
    54.    }
    55. }
    56.  
    57.  
    The Evil Part here is on line 35: Array.Copy() wich copys every single Information of the original Blendshape Array and this process is really slow. (SkinnedMeshCombiner.cs Line 218-271)
    I guess i will have to try to find a different way to do this maybe with AddBlendShapeFrame or something like this, but first i have to dig a bit deeper and need to read a bit more about the alternative ways of adding Blendshapes...
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,028
    Interesting! I've not messed much with blendshapes, as they used to have such poor performance. A couple of years ago I was trying to see how many MCS characters (which use blendshapes) I could have onscreen at a time before the framerate dropped to practically nothing, and it was only 20. I guess Unity has become much more efficient at handling blendshapes. :)

    Anyway, best of luck with the loading / copying issue. It sounds like you know what you're doing. I wouldn't be shocked if there's a Unity bug at the root of this.
     
  36. LostTemptation

    LostTemptation

    Joined:
    Jan 26, 2018
    Posts:
    10
    Just noticed, that it isnt the process of generating the Array itself... This just finishes in a rush, but when it comes to copying them to the target its a Different thing.
    Code (CSharp):
    1. if (has_blendShapes)
    2.     //target.blendShapes = (UMABlendShape[]) blendShapes.Clone(); --Not faster
    3.      target.blendShapes = blendShapes;
    (SkinnedMeshCombiner.cs Line 357)
    Im really corious why this takes so much time since its only a simple copying process...
    Maybe its because of the reallocation of the Memory since the array length isnt specified?! Gnah! i so much want to get rid of this problem...
     
  37. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    340
    The point of UMA is to take different parts and merge them together dynamically at runtime. The merging happens so that drawcalls are reduced and you get your good per frame performance. So, like other's have pointed out, if you need to be able to change parts of your avatar at runtime and you want the reduced drawcall count (like UMA does), then you need to merge your data into one mesh, hence the "loading". I could see having a prebuilt UMA with the data intact at start up time, but that isn't a feature right now (I think there are some workarounds to do that), but as soon as you change one part of your avatar then you will have that same loading and combine hit.

    The evil part...did you profile it? Array.Copy is pretty fast. That section might look slow to you because you're doing it 1200 times per character! Second, you mention looking in to "AddBlendShapeFrame". How do you think the UMA code adds it to the mesh data?!? It collects all the different data parts in the code you linked above and then applies it to the mesh and skinnedmeshRenderer and for blendshapes uses "AddBlendShapeFrame".
    https://docs.unity3d.com/ScriptReference/Mesh.AddBlendShapeFrame.html
    Again, each blendshape is at least the size of the mesh's vertex count (if not up to 3x)
    "deltaVetrices, deltaNormals and deltaTangents arrays must be of size = Mesh.vertexCount"

    A problem implies an issue with the system. It's only a problem when you're trying to combine 1200 blendshapes.
     
  38. LostTemptation

    LostTemptation

    Joined:
    Jan 26, 2018
    Posts:
    10
    As mentioned above i already corrected myself and said that it isnt the array copy.
    yeah i also said that i got to read some more about it and need to dig a bit deeper... Copying Blendshapes is not my daily business you know...
    Nah thats BS. For me it is a problem, and i guess that there are more than a few ppl out there wich would love to see this happening in a blink... But stil yes, i think it is a problem in general, because i cant understand, why this process takes so long... combining a few tousand datasets should not take that much time. But it seems to be more a problem of Unity then of UMA.
     
  39. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    You are moving around a huge amount of RAM - possibly up to 2.5GB or so, using the numbers you posted above.

    If you're going for a character creator for a game, I suggest rethinking the Blendshapes themselves. Perhaps combining them into a set of archetypes (basic body shapes) that can be merged together.
     
    hopeful likes this.
  40. mvaloriani

    mvaloriani

    Joined:
    Jul 15, 2017
    Posts:
    3
    Hi all,
    I created hats slots for my UMA with Mesh Hide Assets for the hair and found no prblem there, everything worked fine.
    Now, I added to my UMA the UMASimpleLOD script and I found out that when it swaps the slots it kind of forgets about the Mesh Hide Assets, even if I added to my hat recipe both the mesh hide for the hair in LOD0 and LOD1.
    Do you have any idea?
     
  41. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    It *should* work - the code scans the full slotlist and regenerates the MeshHideMask after replacing the LOD's.

    Can you add a line in UMASimpleLod like below, and see if it's gettting called?

    Code (csharp):
    1.  
    2.             //Reprocess mesh hide assets
    3.             //Eventually, make this a function in DCA (UpdateMeshHideMasks) and replace correspond code in DCA.LoadCharacter too
    4.             if (_avatar != null && changedSlots)
    5.             {
    6.                 foreach (SlotData sd in _umaData.umaRecipe.slotDataList)
    7.                 {
    8.                     if (_avatar.MeshHideDictionary.ContainsKey(sd.asset))
    9.                     {   //If this slotDataAsset is found in the MeshHideDictionary then we need to supply the SlotData with the bitArray.
    10.                         sd.meshHideMask = MeshHideAsset.GenerateMask(_avatar.MeshHideDictionary[sd.asset]);
    11.                         // Add the next line:
    12.                         Debug.Log("Regenerated meshHideMask for Slot: " + sd.slotName);
    13.                     }
    14.                 }
    15.             }
    16.  
    If everything is working, you should get some log messages when the LOD's are generated that the mask has been regenerated for the slot.
     
    mvaloriani and hopeful like this.
  42. digimbyte

    digimbyte

    Joined:
    Jun 23, 2012
    Posts:
    38
    Question, how do I safely remove/delete the examples?
    can I just comment out or delete this?
    Code (CSharp):
    1. UMA.CharacterSystem.Examples.TestCustomizerDD[] charCustomizerDDs = FindObjectsOfType<UMA.CharacterSystem.Examples.TestCustomizerDD>();
    2.             for (int i = 0; i < charCustomizerDDs.Length; i++)
    3.                 charCustomizerDDs[i].CloseAllPanels();
    I have removed the examples, but this line persists outside the examples.
    is it important?
     
  43. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    Sure - that line is commented out in my version. You might try running 2.8.1 RC - it's much easier to remove the examples, and has some new features. We'll be putting it on the Asset Store soon.
     
    hopeful likes this.
  44. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    Could someone help me understanding why im getting this error. Im creating a UMA from a brand new skelton.

    It does load in the scene. Another problem im having is when it does come into the scene, its rotated 90 degrees?

    Thank you for the help.

    upload_2019-4-5_11-23-5.png

    Exception in UMAGeneratorBuiltin.OnDirtyUpdate: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at UMA.UMAGeneratorBase.SkeletonModifier (UMA.UMAData umaData, UnityEngine.SkeletonBone[]& bones, UnityEngine.HumanBone[] human) [0x0004d] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:336
    at UMA.UMAGeneratorBase.CreateHumanDescription (UMA.UMAData umaData, UMA.UmaTPose umaTPose) [0x000fd] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:310
    at UMA.UMAGeneratorBase.CreateAvatar (UMA.UMAData umaData, UMA.UmaTPose umaTPose) [0x00008] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:272
    at UMA.UMAGeneratorBase.SetAvatar (UMA.UMAData umaData, UnityEngine.Animator animator) [0x00035] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:224
    at UMA.UMAGeneratorBase.UpdateAvatar (UMA.UMAData umaData) [0x000e2] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:199
    at UMA.UMAGeneratorBuiltin.UpdateUMABody (UMA.UMAData umaData) [0x00039] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:399
    at UMA.UMAGeneratorBuiltin.HandleDirtyUpdate (UMA.UMAData data) [0x00230] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:249
    at UMA.UMAGeneratorBuiltin.OnDirtyUpdate () [0x00002] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:272
    UnityEngine.Debug:LogWarning(Object)
    UMA.UMAGeneratorBuiltin:OnDirtyUpdate() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:288)
    UMA.UMAGeneratorBuiltin:Work() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:132)
    UMA.UMAGeneratorBuiltin:Update() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:97)
     
  45. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    1. Did you create a TPose from your new skeleton and assign it to your race? That's needed, because it's how the system generates the Mecanim Avatar.
    2. Do you have the required Global/Position bones in the hierarchy?

    Hierarchy.jpg
     
  46. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    Just found the problem. Hips and Position were children of Global. Im putting Hips under Position now and trying again. Thank you!
     
  47. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    Ok still having the same problem. Rebuilt the character in UMA and still this:

    upload_2019-4-5_12-2-39.png
    upload_2019-4-5_12-4-32.png


    Exception in UMAGeneratorBuiltin.OnDirtyUpdate: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at UMA.UMAGeneratorBase.SkeletonModifier (UMA.UMAData umaData, UnityEngine.SkeletonBone[]& bones, UnityEngine.HumanBone[] human) [0x0004d] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:336
    at UMA.UMAGeneratorBase.CreateHumanDescription (UMA.UMAData umaData, UMA.UmaTPose umaTPose) [0x000fd] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:310
    at UMA.UMAGeneratorBase.CreateAvatar (UMA.UMAData umaData, UMA.UmaTPose umaTPose) [0x00008] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:272
    at UMA.UMAGeneratorBase.SetAvatar (UMA.UMAData umaData, UnityEngine.Animator animator) [0x00035] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:224
    at UMA.UMAGeneratorBase.UpdateAvatar (UMA.UMAData umaData) [0x000e2] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBase.cs:199
    at UMA.UMAGeneratorBuiltin.UpdateUMABody (UMA.UMAData umaData) [0x00039] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:399
    at UMA.UMAGeneratorBuiltin.HandleDirtyUpdate (UMA.UMAData data) [0x00230] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:249
    at UMA.UMAGeneratorBuiltin.OnDirtyUpdate () [0x00002] in C:\Users\Mark\Documents\UMA\Assets\UMA\Core\StandardAssets\UMA\Scripts\UMAGeneratorBuiltin.cs:272
    UnityEngine.Debug:LogWarning(Object)
    UMA.UMAGeneratorBuiltin:OnDirtyUpdate() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:288)
    UMA.UMAGeneratorBuiltin:Work() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:132)
    UMA.UMAGeneratorBuiltin:Update() (at Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs:97)
     
  48. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    Did you extract the new TPose and assign it to the race?

    This is where it is blowing up:

    Code (CSharp):
    1.             while (!umaData.skeleton.HasBone(UMAUtils.StringToHash(bones[missingBoneCount].name)))
    2.             {
    3.                 missingBoneCount++;
    4.             }
    5.             if (missingBoneCount > 0)
    6.             {
    7.                 // force the two root transforms, reuse old bones entries to ensure any humanoid identifiers stay intact
    8.                 var realRootBone = umaData.transform;
    9.                 var newBone = bones[missingBoneCount - 2];

    Which, while I'm not quite sure why it's doing this, seems to imply that it cant find some bones it needs.

     
  49. MarkFitzpatrick

    MarkFitzpatrick

    Joined:
    Feb 8, 2019
    Posts:
    23
    I did extract the new Tpose. Now in the Configure window I did have some bones that were read. So I clicked enforce T-Pose and that fixed it, then I extracted it. Could you see this being a problem?
     
  50. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,005
    No, that shouldn't be a problem. I've only seen this when the two main bones are missing. What are you using to export the fbx? If it's Blender, I can take a look at it.
     
unityunity