Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,895
    OK - you can call "GetDNA()" off the DCSPackRecipe, and it will return a list of UMADnaBase. That will give you a list of UMADnaBase. Each will contain an array of names (read only) and an array of values (read/write).

    Characters can have multiple sets of DNA, so you'll have to manage that.

    To repack it, do the following:
    List<UMAPackedDna> PackedDNAlist = new List<UMAPackedDna>();

    foreach (var dna in myListOfUMADnaBase)
    {
    UMAPackedDna packedDna = new UMAPackedDna();
    //DynamicUMADna:: needs the typeHash as this is randomly generated by the DynamicDnaConverter
    packedDna.dnaTypeHash = dna.DNATypeHash;
    packedDna.dnaType = dna.GetType().Name;
    packedDna.packedDna = UMA.UMADna.SaveInstance(dna);
    PackedDNAlist.Add(packedDna);
    }

    // PackedDNAlist needs to replace the previous list and then repack the character.

    This seems like a lot of work to avoid sending the original JSON from the character. If they don't modify them during gameplay, I'd probably go with just sending it once and be done.
     
  2. Flegy

    Flegy

    Joined:
    Jan 5, 2017
    Posts:
    27
    Sorry if stupid question but tried to find on forums and tutorials but no luck. Are weapons also need to be recipes? I am asking because cannot find any example weapon as recipes to test it. Armors working fine except I need a small example how to c# code equipping armors and weapons?

    p.s: I find few video tutorials but they all using item manager asset so it doesn't show the code.
     
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,963
    You can do weapons as recipes, but I think most find it better / easier to handle them as typical props.
     
  4. CTE

    CTE

    Joined:
    Mar 24, 2013
    Posts:
    7
    Jaimi Said:

    "OK - you can call "GetDNA()" off the DCSPackRecipe, and it will return a list of UMADnaBase. That will give you a list of UMADnaBase. Each will contain an array of names (read only) and an array of values (read/write).

    I looked in the DCSPackRecipe and it does not seem to have a GetDNA() method available on the DCSPackageRecipe Class. I only see that on the DynamicCharacterAvatar class and the UMAData class. Did I potentially miss something here? Or do you have some sample code?

    As to why I am not passing the entire JSON. I don't plan on allowing changes to more than 10 to 12 values which can be encoded in 20 to 24 bytes. Although I could pass the entire JSON when using an Interest Management algorithm it would mean sending data each time something/someone came into the scene (unless I cached it possibly). This could get expensive bandwidth wise.

    Thanks again for the help

    Chris
     
  5. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,895

    Looks like that is only on the "DCSUniversalPackRecipe".

    Anyway, all it does is the following:


    public UMADnaBase[] GetAllDna()
    {
    List<UMADnaBase> unpackedDna = UMAPackedRecipeBase.UnPackDNA(packedDna);
    return unpackedDna.ToArray();
    }

    So you can skip that whole thing and just call UnPackDNA directly:

    List<UMADnaBase> unpackedDna = UMAPackedRecipeBase.UnPackDNA(packedDna);
     
  6. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    I made a custom race and I'm noticing on my UMA character, certain overlays within slots seem to take up more room within the final material than others. This is causing my character to loose texture detail in the wrong places.

    For example, I have wardrobe pants that have 1k overlays. When I put them on my character, they immediately show up as 512. Even thought I can clearly see that it could be fitted at 1k. But if I put on another wardrobe item, it takes up the full 1k.

    Is there a way to control this?

    Note: I have the "Initial scale factor" as 1 in the UMAGenerator.
     
    Last edited: Aug 14, 2018
  7. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,895
    You can control the scale different ways.

    On the Slot itself, you can specify an OverlayScale. <<-- This is probably why your pants are scaling down
    On the generator, you can specify the initial scale factor. <<-- this is most useful for lowering processing requirements
    On the UmaData, you can specify a scale factor. <<-- This is most useful for making an LOD system

    Of course, you can increase the atlas size, or also manually decrease the texture sizes (this can be problematic if you've made overlays that actually overlay each other, as the rectangles are stored in pixel coordinates in the recipes -- you'll need to fix them all if you do this after making them.)
     
    twobob, FiveFingerStudios and hopeful like this.
  8. IanAtherton

    IanAtherton

    Joined:
    Jul 5, 2014
    Posts:
    5
    upload_2018-8-14_18-7-27.png

    I'm setting up some adjust bones in blender and noticed because the meshes are separated they don't work across the seam. Would I have to setup this adjust bone while the body is all 1 piece? Or is there a way to fix this without re-merging?

    Thanks for all the help you cool people have provided ;)
     
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,895
    The problem you are seeing is because the matching vertexes aren't weighted the same to the bones. You can manually select and adjust them, or you can weld them back together and re-weight them.
     
  10. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    I would recommend skinning on your "unified" mesh and then make a copy that gets split up. You should be able to copy over your skinning to the individual slots.
     
  11. IanAtherton

    IanAtherton

    Joined:
    Jul 5, 2014
    Posts:
    5
    Thanks Jaimi and kenamis, I guess I'll try skinning the unified mesh first, and then applying that to the separated one.
     
  12. Flegy

    Flegy

    Joined:
    Jan 5, 2017
    Posts:
    27
    thanks for the reply. Can you a little more explain what you mean by use weapons as typical props? How to setup them in library and call from code?
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,963
    What I mean is you would set up the weapons for use as you would with any standard, non-procedural model. If you use the "bone builder" feature in UMA, you can place weapons in the hands of characters before they are built, if that's what you want.

    If you are looking for more information about placing items in the hands of characters, that's something you'd want to research. There's plenty of information around, but nothing I can think of that is like a standard library. If you are looking for very basic information on this sort of thing, you might look at weapons kits with scripts in the store, generalized game kits (like Game Kit Controller), or specific solutions for placing weapons, like Mount Points (sold in the store). But in general it's something that is usually not too complicated, with tutorial type information all over.
     
    kenamis likes this.
  14. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    As a typical prop, you would instantiate the weapon gameobject usually from a prefab. Then you would parent it to the correct hand bone with the correct local position and rotation. You could do this at edit time or runtime. If you have multiple weapons but only one in use at a time, you would leave them all after they are created and just enable/disable the appropriate one.
     
    Flegy and hopeful like this.
  15. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Hi, I have a big problem. The UMA character is half buried in the terrain and no animation is executed. In a new scene, it works correctly. But in the game scene it does not. Any help please?

     
  16. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    Usually that's when there is no animation clip set or it's invalid for the rig. Make sure you set the right animation controller on the DCA component, not just on the animator.
     
    GEOMETRICBYTES likes this.
  17. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Thanks!
     
  18. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Sorry if my question can be silly. But how can I increase the size of the character? If I increase the scale, the character remains in the air.
     
  19. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    there's the height DNA that's probably exactly what you want.
     
  20. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    I can not find something to increase the overall size in DNA. Any other idea?
     
  21. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    You're using the default uma character right? Do you not see "height" as a dna option?
    upload_2018-8-15_21-33-12.png
     
  22. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Oh, I had not seen it. I have put the maximum, but the character is small compared to the world. There is no other way to increase the size? Thank you very much for the help!
     
  23. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Solved. I have used the Bone Builder, and then I have increased the Root scale.
     
  24. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Can I create my own animations for the UMAs? I have to transform it into a prefab, right?
     
  25. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
  26. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    You can create and use any animations that are compatible with mecanim to use with uma. The default uma is a humanoid rig.
     
  27. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Thanks for the help! Yes, I bought UMA Power Tools and several animations (one from Explosive, among them). All work but I have a major problem with all the animations. The character is left with his mouth open. What is the problem?

     
  28. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    That's a common Unity issue. If the jaw bone is set in the rig but not used in the animation then it gets left open. A quick fix is to add the uma expression component (even if you aren't going to use expressions). That component will close the jaw for you.
     
  29. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Thanks, but it does not work with the prefab. Any idea why?
     
    Last edited: Aug 17, 2018
  30. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    172
    Hi there, As Kenamis says, this is a common issue when using animations that do not contain jaw information with models that expect it. If you are using a normal UMA then the expression player is a great quick fix, however, if you're baking your model into a standard prefab using power tools you will have to fix it the same way non-UMA users do:

    You need to create a single frame animation with the mouth closed in your modelling package of choice (one keyframe of closed jaw will do). Then create a new animation layer in mecanim and using a head only mask, apply this single frame jaw closed animation.

    Hope that helps.

    PS: hope you have a good reason for baking your UMA's into prefabs, as you're missing out on all the UMA goodness that way o_O
     
  31. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Solved! Thanks!
     
  32. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    How can I do the following?

    I have a shirt that want to change the tint on it from white to green, to make it a green shirt. But I don't want the buttons to change from black to green...I want them to stay black.

    Would I have to use an overlay with the color change? Of can I create a mask that I can then change it to any color I want?
     
  33. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    Btw, thanks for all of the help...we have gotten so far with UMA.
     
  34. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,963
    It sounds like you want your buttons to be a different overlay, so they can have a different color. So your thoughts are on the right track.

    You can create a new overlay for the whole shirt, which leaves the buttons the original color, and/or make a new overlay for the buttons and force them black ... whichever is easier.
     
    kenamis likes this.
  35. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    Great...thanks a lot!
     
  36. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    I'm just noticing this reply...thanks a lot..
     
  37. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    I've already created wardrobe items...for my custom race.

    Is it possible to fix mesh weights for adjustment bones and add new ones without breaking any of the relationships with the wardrobe items?
     
  38. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Why textures of the prefabs are in low resolution?
     
  39. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,895
    Yes, just regenerate the slots, keep the names the same, and add them to the library. The wardrobe recipes look things up by name, so youll be fine.
     
    FiveFingerStudios likes this.
  40. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,895
    Its just to save texture RAM. When we added the new skin textures, they were 4 times the size of the old ones, and one of the samples would slow down when generating a lot of UMAs on old video cards. You can change this on the generator - increase the atlas size, and change the initial scale factor.
     
  41. GEOMETRICBYTES

    GEOMETRICBYTES

    Joined:
    Aug 23, 2016
    Posts:
    32
    Thanks!
     
  42. Deleted User

    Deleted User

    Guest

    Hi there!

    I've been trying to use UMA for some days now and think it's an awesome tool.

    I've encountered an issue that some other users also reported in the past: the UMA generated avatar is lying on the floor and the complete skin is not working as expected (the animation looks weird).

    problem.png

    I've seen that these users fixed the problem following this tutorial based on Blender:


    But my problem is that our 3D artist works in Maya and has no experience on Blender neither a clue on how to apply the proposed solutions in Maya. For instance, there seems not to be an appropriate translation from Blender's "Apply rotation & scale" to Maya.

    It would be very helpfull for us to:

    1) Know the details on what's the root of the problem on the exported .fbx. Unity is able to represent and animate the .fbx normally, so I assume it's a UMA limitation.

    2) Undersand the concept of the proposed solution so we can think of an alternative for Maya.

    Thanks a lot for the time developing such a great tool and the time on reviewing this post.
     
    Last edited by a moderator: Aug 20, 2018
  43. umutozkan

    umutozkan

    Joined:
    Oct 30, 2015
    Posts:
    312
    Hi David, unfortunately, I have no idea about Maya. But I think that there should be a way of doing that in Maya since it's a pretty basic need (to apply the rotation I mean).

    The issue is probably about UMA's slot builder's assumption on the rotations of those root bones. I wouldn't expect that to change before a major release though (Maybe UMA3?)

    Simply the global and the position bones should be positioned at 0, 0,0, the rotation should be 0, 0, 0 and scale should be 1, 1, 1. Otherwise, the deformations happen when you create slots.

    What you need to do is change the global and position bones to follow these rules. You can, for example, unparent the children of position bone (so they are not affected by the rotations and scales) then fix the global and position bones, then reparent the children. That should do the same thing with applying rotation and position to those.

    Hope this helps.
     
    kenamis likes this.
  44. Deleted User

    Deleted User

    Guest

    Hey umutozkan!

    Thanks a lot for your answer. I tried your solution but unfortunately it didn't work.

    Let me describe the steps I took just in case you can identify a systemic problem:

    a) added the .fbx to my Unity's assets folder
    b) set the rig's "animation type" of the .fbx to "Humanoid"
    c) Clicked on "Configure..." to enter the "avatar configuration"
    d) On the "avatar configuration" I unparented all "Position" children, reseted the "Global" and "Position" transforms and re-attached "Position"'s children.

    At this point "Global" and "Position" have Translation=(0,0,0) Rotation=(0,0,0) Scale=(1,1,1)

    I recreated the race but the issue is still there.

    Do they make sense the changes I made or I completely missunderstood your proposal?

    Again, thanks.
     
  45. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    You can’t change the global position in Unity, you must do it in a 3D package such as Maya or Blender.

    Skinned Mesh characters with bones work differently than regular gameObjects. You can’t just move a characters bones manually and expect it to be fixed. There is much more to them than the transforms that you see.
     
    Last edited: Aug 21, 2018
    hopeful likes this.
  46. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    I’m trying to use UMA simple LOD for both Texture LOD and Mesh LOD.

    Texture LOD works great, but Mesh LOD seems to cause issues...somehow I think I may be using it wrong.

    1. Should I be attaching the component to the UMA character in edit mode? If not, how should I attach it?

    The reason I ask this is because sometimes mesh LOD works, sometimes it doesn’t.
    It seems that UMAContext can't find the recipe when it fails... which leads me to believe that it’s an initiatization issue.

    Also, if I start the camera far enough to trigger LOD when entering play mode I get errors saying that a recipe is missing a slot (which doesnt seem to be true).

    Each scenario happens without me making any changes....


    Any idea what the issue could be?
     
    Last edited: Aug 21, 2018
  47. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    383
    For anyone else looking for the answer to this. I’m using UMA 2.7.0. There is a bug with this script in that version. I would suggest to get a version it and UMAContext from Github as there is a fix there.
     
    hopeful and kenamis like this.
  48. umutozkan

    umutozkan

    Joined:
    Oct 30, 2015
    Posts:
    312
    AS sbmhome suggested you cannot do these in Unity. You need to do it in blender or maya. Sorry if I mislead you, I meant those modifications to be done in a 3d software. Your fbx needs to be "fixed" before you imported it into Unity.
     
    hopeful likes this.
  49. Deleted User

    Deleted User

    Guest

    Hey umutozkan and sbmhome,

    Thanks a lot for your suggestions. Unfortunately, even making the fixes in Maya the problem persists.

    We have been told that the problem may be with scaling. Our artists work with Maya configured in centimeters and with characters with a height of around 160 centimeters. When exporting to .fbx we have the option to convert the file units and when importing from Unity again it is possible to specify a conversion factor for the scale. It seems that these conversions are the ones that produce the problem.

    As an alternative, artists have changed the size of the models to around 1.6 centimeters (same as the Content Creation Pack models). We have done various scaled and non-scaled tests when exporting to .fbx and scaling and without scaling when importing into Unity without any success.

    Unity itself understands perfectly the .fbx files and is able to animate the models configured as humanoids, but UMA seems to have some bug/limitation while parsing/handling this scales, presumably.

    Could you point to the right way of handling this scaling mess or a way to debug what's happening inside UMA regarding the skinning so that I can try and find what's going wrong?

    Many, many thanks for your time and effort.
     
  50. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    336
    As long as it looks correct and the right scale as a regular mesh in unity (non-uma) then it should be fine for uma. If you've made changes to the root bones to correct the original issue, then you'll need to re-extract the t pose. Did you do that part? If so, would you mind sending me what you have in a PM and i'll take a look at the issue?