Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,317
    Marmoset and UMA, a match made in Heaven.
    You mentioned "documentation", do you mean the Marmoset doc or UMA doc.
    Excellent work.

    Flash - Do you know which part of UMA does not work with Flash?
    Knowing the area that does not work will help the community of Unity Flash users to find a work around solution.

    Edit: Just finished watching most of the videos from the UmaBeta site. Great stuff.
    I would like to make a character using UMA body and a werewolf head, wondering how this can be done. Would I have to make a new head, create new bones ? Can you give some suggestions on how something can best be achieved.

    Edit: Just read the documention:
    "For a completely different race, such as horses, you will need unique content "
    Question is how to create Unique Content? Would be great to get a video on how to create new Content, like creating a horse head.

    Cheers.
     
    Last edited: Dec 28, 2013
  2. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,393
    very nice thanks!
     
  3. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43
    hello , there seems some bug in your code, or am I misundersdanding

    first I used UMADynamicAvatar to generate an UMA I saved
    then as follows I assign the UMAData to UMACustomization script, everything works fine, I can tweak the new UMA
    Code (csharp):
    1. public void SetUMAData(Transform umaDataTransform)
    2.     {
    3.         UMAData tempUMA = umaDataTransform.GetComponent<UMAData>();
    4.  
    5.  
    6.  
    7.  
    8.         umaDynamicAvatar = tempUMA.gameObject.GetComponent<UMADynamicAvatar>();
    9.  
    10.  
    11.         if (tempUMA)
    12.         {
    13.             umaData = tempUMA;
    14.             if (cameraTrack)
    15.             {
    16.                 cameraTrack.target = umaData.transform;
    17.             }
    18.           //  print("KKJJHGG");
    19.             if (umaData.umaRecipe.slotDataList != null)
    20.             {
    21.                // print("RRRRRRRRRRRR");
    22.                 foreach (SlotData data in umaData.umaRecipe.slotDataList)
    23.                 {
    24.                     if (data)
    25.                         print("slotName" + data.name);       //
    26.                     else
    27.                         print("Slot null");
    28.                 }
    29.  
    30.  
    31.             }
    32.             umaDna = umaData.umaRecipe.umaDna[typeof(UMADnaHumanoid)] as UMADnaHumanoid;
    33.             ReceiveValues();
    34.         }
    35.     }
    but when I try to change a slot , I got null exception,
    Code (csharp):
    1. public void ChangeShirt()
    2.     {
    3.         if (umaData.umaRecipe.slotDataList != null)
    4.         {
    5.             foreach (SlotData data in umaData.umaRecipe.slotDataList)
    6.             {
    7.                 print("slotName" + data.name);
    8.             }
    9.            
    10.         }
    11.  
    12.  
    13.         //umaData.umaRecipe.slotDataList[2].AddOverlay(overlayLibrary.InstantiateOverlay("MaleShirt01"));
    14.         //UpdateUMAAtlas();
    15.     }
    16.  
    as above,when I try to access the umaData' s slotList, Unity throw out null exceptions

    so I made another test:
    foreach(SlotData data in umaData.umaRecipe.slotDataList)
    {
    if(data)
    print("slotName"+data.name); //I got this line executed, but all the data names are empty
    else
    print ("Slot null ") //this prints as well, so many SlotData in list are null
    }

    it's confusing, how can I change a certain slot element when I can access the slot

    }
     
    Last edited: Dec 28, 2013
  4. waltergs

    waltergs

    Joined:
    Mar 21, 2011
    Posts:
    11
    Can i use UMA to desing my Characters for my game or only for avatar?
     
  5. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    I´ll start recordinh video tutorials, hopefully today, and at some point I´ll include an example of werewolf or something simmilar. There had been so many changes to the project that I´ll need to start all over again.

    For a werewolf, you can usually save the male torso, so it would be possible to use those clothes/items without any modification :)

    About flash: as Unity itself discontinued flash support I didn´t worried providing support from my side. To be sincere there has been months since the last time I tried a flash build, I might be able to give it a try, but won´t expect it working any time soon.
     
  6. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there!
    SlotList can have empty slots, that´s why you need to check if that index has a SlotData at all before trying to access i.

    "it's confusing, how can I change a certain slot element when I can access the slot"
    You simply overwrite that slot with a new one, using the same call we do on UMACrowd. Keep in mind you need to set the slot base overlay as well.

    Cheers =D
     
  7. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Sure!!!
    Enemies, npcs, main characters, use it on anything you would like =))
     
  8. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,317
    Does anyone know what is a good way to do Facial Animations with UMA and Unity's plugins ?

    What I mean is that currently there is FaceShift.com and FacePlus from Mixamo. How to best use these plugins with UMA ? It seems that these tools are not bone based. Is there some way to bridge the divide between Morphing and Bones for facial animations so that these tools or others can be used to drive UMA's facial rigs.
     
  9. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,359
    Best thing I have ever seen in Unity3D and it's FREE!!
    Thank you for all this amazing work! I will update Unity to 4.3 and test this.

    By the way, you should change your signature to this thread and not the locked thread in WIP section.
     
  10. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    613
    I've been part of the beta group and have done work on facial animation in UMA. I haven't looked at FacePlus data yet, but I will have a solution for using at least FaceShift and Tagarela. I'll try to put up a demo next week.
     
  11. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Yay! First video is out :)
     
  12. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    875
    Oh my Good ! ! Thank's you ! !
     
  13. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    First off, thanks for a great asset. This is something long overdue in Unity, and a great complement to the Mecanim animation system. I came to Unity years ago, after checking out Second Life, and games like URU, that offered simple character customization. I always wished for a similar simple avatar creation scheme in Unity. Now, it looks like at least the foundation for one finally exists.

    That said, I think you need to add a few things to make this a fully realized system. Your examples show great potential, but right now, all they give you is a plain full of random characters. We need a workflow that turns this into something we can use in our own games.

    First, a way of picking clothing, hair, skin color, etc. I'm sure this is all possible, but your example scene seems more focused on random characters and crowd creation. I know that creating different clothing will require external modelling and texturing apps, but it seems that you've already provided a few basic examples. You can fiddle with hair and eye size, but can't pick color, except by hitting play over and over. The same goes for clothing. To get the combination of features and clothing you want this way could take forever. You need a feature picker, that can be expanded using user generated content, to go along with the customization tool you've already provided. Some templates for making custom clothing would help as well, though maybe I just need to dig a bit deeper to find them.

    Next, a workflow for turning a UMA character into a permanent main game character or AI, using new or existing Mecanim animations. Robin Schmidt's Character System for Mecanim, for instance, comes with a nice set of animations covering walking, running, climbing, swimming, and weapon use. Several AI NPC controllers are also available. If you could show how to retarget something like that to a UMA generated character, it would go a long way to making UMA more useful.

    On a related note, some basic scripts or instructions for such things as attaching cameras and different character controllers to UMA characters would be nice. Being generated at runtime, they're different than standard characters, and need to be handled differently by any associated scripts. Since this is something everyone that uses UMA will need to tackle at some point, some examples would help make this process a bit simpler.

    I know UMA is new, and still being developed. Maybe some of these features are already available or being worked on. Ive watched some of your help videos already, but haven't seen anything on these subjects yet. I know you're planning to make more. Just thought I'd offer a few suggestions on subject matter for future efforts.

    Thanks, and keep up the great work.
     
    Last edited: Dec 29, 2013
  14. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,317
    This is wickedly awesome. A demo would be super cool.

    Cheers.
     
  15. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,317
    Sensational.
    Grande Muito Obrigado.
     
  16. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43

    Can't agree more:cool:
     
  17. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Just started exploring UMA and it looks incredible! One thing I'm having trouble with is when the characters are generated there is no save script attached. I attach it manually but the only options I see are 'Save Avatar Txt' and 'Save Avatar Asset' There 's no 'Load Avatar' option.
     
  18. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Actually if you are a coder you can do all of this, i didn't know nothing about c# when i got UMA (only js), but actually i have all the things you said, and i'm not an expert.

    PD: If you want to use other models that don't come with UMA, you need to say to the developer to the package if he can help you to retarget it, or do it by yourself.
    Cheers!
    $shot_131223_174708.png
     
  19. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    If you add an UMADynamic Avatar into the scene then you just point the Recipe slot to your saved asset and it will load it.
     
  20. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    There is but you need to expand the window a little more haha
     
  21. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    Yes, if you can glean enough from looking at the code, you won't need anything else, but not everyone is a coder, and not everyone has time to stumble around trying things at random to figure it out. I've only been playing with UMA for a short time, so maybe it will all come to me eventually. If not, I can always wait for one of the promised helper packs. All I'm saying is that some documentation on what does what wouldn't hurt. And if documentation and scripts for these things are already available, where do I find them? Why should everyone that uses UMA have to reverse engineer it first, or write their own scripts for some of this really basic stuff? If it wants to be a viable alternative to traditional avatar creation methods, the whole point is to be better, faster and easier. Fernando has already explained a lot in his first video, and promised there would be more. I just wanted to nudge him to cover some of these other areas as well if that's the case.

    As for re-targeting animations from other packages, I've done that using standard skinned mesh models. I'm just not sure how to do it with UMA models, unless I can save them to another format first. How do I rig it, or make a prefab out of it if it only exists at run-time? The same goes for attaching cameras and other scripts. I know there's probably a simple enough answer, and I probably just need to dig a bit deeper. Some notes or tutorials explaining the full process of going from what we see in the demos to characters we can use in an actual game would certainly speed things up.
     
    Last edited: Dec 29, 2013
  22. Leandro_Gado

    Leandro_Gado

    Joined:
    Sep 29, 2013
    Posts:
    14
    Why are you distributing it as a dll? Having to recreate the project just to test small changes in the source code is tedious.
     
  23. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    Until Fernando have time to make an updated set of videos I can only recommend actually browsing the Beta Site and looking through all the old videos. Some of the information will be outdated, but it will still help you understand the inner workings of UMA.

    UMA is utilizing the CreateAvatar API to create custom humanoid Avatars. This means that all humanoid animations works automatically! The avatar is created using the actual tweaked dimensions of the character!

    But if you want to know the full rig you can just look at Male_Unified and Female_Unified located in the UMA package. The Legacy Mesh Combiner works on the assumption that all body parts uses the same rig as the base mesh. The somewhat slower Default Mesh Combiner is smart enough to recognize additional bones, useful for wings, horns or gear that can be tweaked.

    There is no generic character designers available at this time. The code in Crowd makes it simple for coders to create their own, but the lack of meta data makes it hard to make one that will work with unknown content from the asset store. We're currently working on a set of meta data to help make generic editors.

    The UMA framework is not fully integrated with design time. Creating all those Meshes, Game Objects, Textures, Avatars and Components is really unforgiving when not in play-mode, causing crashes if you mess up the slightest. Indeed the way I do it in my Power Tools is to spawn a UMA character and then immediately destroy all UMA components before Unity have a chance to reload scripts.

    We worked long and hard to make the release ready for Christmas, but there simple wasn't time to also update all of the documentation in time. So for you'll have to make do with what we got.

    Best Regards,
    Joen Joensen, UnLogick
     
  24. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    Unity requested that we built UMA into a dll to reduce build time of the solution. Also as a clear indicator of what is the core library and what is content for it. So if you mess with the dlls you may break stuff and we wont be able to help you. That being said there is absolutely no reason why you shouldn't peek under the hood and change stuff if you want to.

    If you download UMA from github I set up post build rules in the visual studio solution that copies the dlls into the project on windows machines. I haven't tested if the post build rule works for Mono Develop as well, but it should be trivial to set up a copy post build rule. Having such a post build rule greatly eases the workflow of changing the dll code.
     
  25. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    Hierarchy Of Doom goes away?
     
  26. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    Thanks for the reply Joen. I know you and Fernando have been working hard to make this all possible, and I didn't mean for my comments to be taken as criticism of what you have already achieved, which is really amazing. They were more of a suggested road map for future development. Now that the UMA framework is in place, the only things missing are a few user tools to streamline the process of integrating it into games. I know some of these are already in development, and that 3rd party developers will probably add more in the coming months. It seems to me that the whole point of releasing UMA for free is to encourage as many people as possible to start using and developing content for it. If it only gets used by hard core coders, or people who can already create and rig their own characters, it won't be achieving its full potential. I'm sure that the ultimate goal for everyone is to make it as simple and painless to use as possible.

    If there are more videos on the beta site, I'll certainly look them up. I can also see what your Power Tools pack adds to the mix when it's released. It sounds promising. The web player demos of GUI based feature pickers, as well as the picture KirbyRawr posted above of his home brew solution, show that all of this is possible. I can wait a bit longer for some of these extras to arrive.

    PS. Saying "It's simple for coders to create their own" kind of reminds me of a physics professor I had in college. He filled a blackboard up with calculus, turned to the class and said "From this equation, it's intuitively obvious that... blah, blah, blah."

    Someone (it may have been me) put up their hand and said "Excuse me, but it's NOT intuitively obvious."

    The professor looked dumbstruck for a moment, then started to pace back and forth at the front of the room, deep in thought. After about five minutes of this, he stopped, faced the class, and replied "It IS intuitively obvious". He then resumed his lecture where he left off, with no further elaboration.

    Sometimes a bit of elaboration helps. Never assume everyone is going to just "get it" without a little help. Even coders can be a bit slow figuring things out sometimes.
     
    Last edited: Dec 30, 2013
  27. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    Well I don't imagine people will get it, just because I say it's simple. :)

    But I do believe that if you play around for half an hour with the code from UMACrowd you will end up with an understanding of how to set up a character in UMA. How to control their clothing, colors and sizes, even if you're not a full fledged coder. Do I understand your request for more tutorials and a workflow for non-developers? Certainly!
     
  28. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    I see a trend in the comments and questions.
    When will this or that be done? We simply don't know, since none of us is getting paid for this, we're doing it in our spare time. This is the UMA development that I'm aware of:
    • Usability, Fernando is working on more updated video tutorials.
    • Character Editor, Barney G is working on an editor as well as extending the SlotData and OverlayData with groups and relationships so the editor can list the appropriate options. So if you pick the cutout head the editor will know you need a nose. If you add a shirt(SlotData) you may want to decide which of the 5 appropriate overlays(textures) you want on it. Once this system is in place it will be mandatory to fill out these values when you submit UMA content to the asset store! It's the only way we can make a generic character editor work.
    • Proper documentation, unfortunately we don't have anyone working on this.
    • In-editor functionality, I'm working on some tools for my pack, but that is the only development I know of.
    • Content, I know of a few content providers who has been working with UMA for a while. But I have heard no release dates.
    UMA is open source and anyone is welcome to step up and join our ranks. All content will be reviewed by the UMA Steering Group before entering the official UMA package.

    About our vision for UMA.
    Our vision is not and has never been to make a full fledged plug and play solution. We will not provide a complete character controller library. We will not even attempt to make the perfect character editor. Customizing your in-game character means interacting with the rules in your game. There is no way UMA can set up those rules for all games: How much protection does a plate armor give against light sabers? Does that even make sense?

    Instead the plan is to provide an simple yet powerful character editor that allows you to choose from all available content to make the characters. That should then serve as inspiration for making integration between 3rd party RPG/Character Controller/etc packs and UMA. Adding slipperiness or power jump functionality to certain boots and such tying everything together. Or simply making a stand alone UMA character editor pack with fancy animations and flying menus that would make any AAA title jealous.

    I don't know exactly what I expected 5 days ago when we released UMA. The idea behind releasing during the holidays was to hit the dedicated hobbyist. The ones who like me simply cannot fathom going a full week without touching a bit of code. But not even in my wildest dreams had I imagined 1300 downloads already. And the positive feedback has been overwhelming.

    For this I thank you all.
    Joen Joensen - UnLogick
     
    RealSoftGames likes this.
  29. ICGames

    ICGames

    Joined:
    Nov 4, 2012
    Posts:
    12
    Epic read/watch/tinker... Just finished going though all the docs all the movies and the entirety of both threads on this asset. I know this is only going to be a complimentary post from what appears to be a johnny come lately but I cannot begin to tell you how much development effort this is going to save us. I am really looking forward to what is to come for this tool and rest assured we will be taking full advantage of its capabilities for the title we are working on.

    Big thank you and hats off to Fernando and I am excited to see what new goodies are coming with Joen's power tools. I am also looking forward to the day we can show you guys what we will be doing with UMA, unfortunately we have more work to do before that happens. Regardless big thank you gents, I appreciate what you have done here.
     
  30. JMab

    JMab

    Joined:
    Nov 29, 2013
    Posts:
    14
    Hi Joen, Fernando and team,

    I agree that it doesn't take much fiddling round with UMACrowd.cs to figure out how to create your own dynamic UMAs - and allow them to be customized via sliders and other GUI controls.

    One minor gripe I have now though is, why release it on the Asset Store as a Complete Project? I'd imagine that most people will want to integrate UMA into their existing projects, however by importing it, all of your project settings get overwritten each time (unless there's a way around this that I'm not aware of). I understand that UMA will go under its own category at some point - will it cease overwriting all project settings at that time?

    Anyway, a minor gripe, I have no other issues with what has been released, and am attempting to create some content now with the older tutorial vids.

    Cheers,

    JMab

    Edit: Actually, thinking about this, maybe it's just as simple as not importing the "settings" files...
     
    Last edited: Dec 30, 2013
  31. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,317
    I can only see the amount of work that has gone into creating UMA.

    Lot's of Sweat and Tears and Hair Pulling and of course Jubilation for triumphing all of the unknown variables in order to give birth to UMA on the Asset Store. Big Big Kudos to the UMA team.

    The way I see this package is that it is a Framework for Customizable Characters and the crowd example is a demo of the capability of the system. It was never meant to be a click and drag type package. In the future, people will be creating GUI driven packages to sell on the Asset Store. As for now, think of this package as for Coders and Developers who want to extend and build upon the Awesome work that the UMA team has so graciously provided for Free.

    Cheers.
     
  32. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    Developer or hobbyist, time is money, and anything you can do to shorten the learning curve will be welcome.

    As for tutorials, I've watched several of the videos on the beta site, and while they cover a lot of ground, and provide insight into the underlying code and methods used by UMA, they're a bit frustrating when you're looking for quick answers to specific questions. A 15 minute discourse on every feature used in the UMACrowd script is great as part of a complete UMA course, but you might want to add some quick, task oriented tutorials as well, that are focused on specific things a user might want to do. Identify which script handles a function, and walk through the process of changing it. Things users might get stuck on, where a simple example would be all they'd need to get going again. Nothing longer than 3 to 5 minutes. I'm more than willing to explore a bit on my own if I have some signposts along the way. Here are a few suggested topics:

    - How do you change clothes, hair, or eye colors? (OK, I'll look a the UMACrowd script. Still a quick tutorial would take some of the guesswork out of it for newcomers.)

    - Where do you put new clothes and other content so that UMA can use them? Presumably additional UMA content will soon be available on the asset store. Will there be a standard way to add and use it?

    - How do you attach a third person camera that follows the character? (I finally figured out how to get the Camera Follow script to track the characters in your demos, but it sure wasn't "intuitively obvious").

    - How do you take a character created in the UMA project, and import/transfer it into your existing game project? (This might also answer JMab's question.)

    - How do you apply off the shelf Mecanim animations to a UMA character? If it handles them automatically, fine, but where do you put an FBX animation for instance, and what, if anything needs to be done before UMA can make use of it? Do you need to use the included Locomotion controller, or can you substitute your own? If so, are there any special caveats?

    I know you guys can't do it all for us. You've done lots already, and I can't thank you enough for what's already been released. I also realize that some things just need more time to be developed. UMA is really only a framework. Some extended usability features may need to wait for 3rd party developers to step in and create them. I expect I'll also need to do a bit of my own coding to suit my specific requirements. Most "off the shelf" scripts I currently use have been hacked or modified in some way by now. Still, it was nice to have them as starting points. Right now, what I'd like to see most is more examples, tutorials, and documentation.
     
    Grave174 likes this.
  33. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43
    Hi, I am still trying to figure out how make UMA work as I want.

    First I used enum to remember slot index
    Code (csharp):
    1. public enum MaleSlotIndex { Eyes = 0, Head = 1, Torso = 2, Hands = 3, InnerMouth = 4, Legs = 5, Feet = 6, HeadEyes = 7, Ear = 8, HeadMouth = 9, Nose = 10, };
    then I generated UMA this way
    Code (csharp):
    1. void DefineSlots()
    2.     {
    3.         Color skinColor = new Color(1, 1, 1, 1);
    4.         float skinTone;
    5.  
    6.         skinTone = Random.Range(0.1f, 0.6f);
    7.         skinColor = new Color(skinTone + Random.Range(0.35f, 0.4f), skinTone + Random.Range(0.25f, 0.4f), skinTone + Random.Range(0.35f, 0.4f), 1);
    8.  
    9.         Color HairColor = new Color(Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), 1);
    10.  
    11.         if (umaData.umaRecipe.raceData.raceName == "HumanMale")
    12.         {
    13.             int randomResult = 0;
    14.             //Male Avatar
    15.  
    16.             umaData.umaRecipe.slotDataList = new SlotData[15];
    17.  
    18.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Eyes] = slotLibrary.InstantiateSlot("MaleEyes");
    19.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Eyes].AddOverlay(overlayLibrary.InstantiateOverlay("EyeOverlay"));
    20.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Eyes].AddOverlay(overlayLibrary.InstantiateOverlay("EyeOverlayAdjust", new Color(Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), 1)));
    21.  
    22.            
    23.            
    24.            
    25.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head] = slotLibrary.InstantiateSlot("MaleHead_Head");
    26.  
    27.             randomResult = Random.Range(0, 2);
    28.             if (randomResult == 0)
    29.             {
    30.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleHead01", skinColor));
    31.             }
    32.             else if (randomResult == 1)
    33.             {
    34.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleHead02", skinColor));
    35.             }
    36.  
    37.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.HeadEyes] = slotLibrary.InstantiateSlot("MaleHead_Eyes", umaData.umaRecipe.slotDataList[1].GetOverlayList());  //这个HeadEyes其实就是眼球,上面的Eyes是眼框
    38.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.HeadMouth] = slotLibrary.InstantiateSlot("MaleHead_Mouth", umaData.umaRecipe.slotDataList[1].GetOverlayList());
    39.  
    40.             randomResult = Random.Range(0, 2);
    41.             //if (randomResult == 0)               //这个随机结果就加猪鼻子
    42.             //{
    43.             //    umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Nose] = slotLibrary.InstantiateSlot("MaleHead_PigNose", umaData.umaRecipe.slotDataList[1].GetOverlayList());
    44.             //    umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleHead_PigNose", skinColor));
    45.             //}
    46.             //else if (randomResult == 1)         //加正常人的鼻子
    47.             {
    48.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Nose] = slotLibrary.InstantiateSlot("MaleHead_Nose", umaData.umaRecipe.slotDataList[1].GetOverlayList());
    49.             }
    50.  
    51.             randomResult = Random.Range(0, 2);
    52.             if (randomResult == 0)             //加精灵类的耳朵
    53.             {
    54.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Ear] = slotLibrary.InstantiateSlot("MaleHead_ElvenEars");
    55.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Ear].AddOverlay(overlayLibrary.InstantiateOverlay("ElvenEars", skinColor));
    56.             }
    57.             else if (randomResult == 1)        //加正常人的耳朵
    58.             {
    59.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Ear] = slotLibrary.InstantiateSlot("MaleHead_Ears", umaData.umaRecipe.slotDataList[1].GetOverlayList());
    60.             }
    61.            
    62.  
    63.             //随机头发部分
    64.             randomResult = Random.Range(0, 3);
    65.             if (randomResult == 0)
    66.             {
    67.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleHair01", HairColor * 0.25f));
    68.             }
    69.             else if (randomResult == 1)
    70.             {
    71.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleHair02", HairColor * 0.25f));
    72.             }
    73.            
    74.  
    75.             //随机胡子部分
    76.             //randomResult = Random.Range(0, 4);
    77.             //if (randomResult == 0)
    78.             //{
    79.             //    umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleBeard01", HairColor * 0.15f));
    80.             //}
    81.             //else if (randomResult == 1)
    82.             //{
    83.             //    umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleBeard02", HairColor * 0.15f));
    84.             //}
    85.             //else if (randomResult == 2)
    86.             //{
    87.             //    umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleBeard03", HairColor * 0.15f));
    88.             //}
    89.             //else
    90.             //{
    91.  
    92.             //}
    93.  
    94.  
    95.  
    96.            
    97.  
    98.             // 眉毛部分
    99.             randomResult = Random.Range(0, 2);
    100.             if (randomResult == 0)
    101.             {
    102.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleEyebrow01", HairColor * 0.05f));
    103.             }
    104.             else
    105.             {
    106.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Head].AddOverlay(overlayLibrary.InstantiateOverlay("MaleEyebrow02", HairColor * 0.05f));
    107.             }
    108.  
    109.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Torso] = slotLibrary.InstantiateSlot("MaleTorso");  //添加躯体部分
    110.  
    111.             //随机出一个身体
    112.             randomResult = Random.Range(0, 2);
    113.             if (randomResult == 0)
    114.             {
    115.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Torso].AddOverlay(overlayLibrary.InstantiateOverlay("MaleBody01", skinColor));
    116.             }
    117.             else
    118.             {
    119.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Torso].AddOverlay(overlayLibrary.InstantiateOverlay("MaleBody02", skinColor));
    120.             }
    121.  
    122.  
    123.             randomResult = Random.Range(0, 2);
    124.             if (randomResult == 0)
    125.             {
    126.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Torso].AddOverlay(overlayLibrary.InstantiateOverlay("MaleShirt01", new Color(Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), 1)));
    127.             }
    128.  
    129.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Hands] = slotLibrary.InstantiateSlot("MaleHands", umaData.umaRecipe.slotDataList[2].GetOverlayList());
    130.  
    131.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.InnerMouth] = slotLibrary.InstantiateSlot("MaleInnerMouth");
    132.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.InnerMouth].AddOverlay(overlayLibrary.InstantiateOverlay("InnerMouth"));
    133.  
    134.  
    135.             randomResult = Random.Range(0, 2);
    136.             if (randomResult == 0)
    137.             {
    138.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Legs] = slotLibrary.InstantiateSlot("MaleLegs", umaData.umaRecipe.slotDataList[2].GetOverlayList());
    139.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Legs].AddOverlay(overlayLibrary.InstantiateOverlay("MaleUnderwear01", new Color(Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), 1)));
    140.             }
    141.             else
    142.             {
    143.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Legs] = slotLibrary.InstantiateSlot("MaleJeans01");
    144.                 umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Legs].AddOverlay(overlayLibrary.InstantiateOverlay("MaleJeans01", new Color(Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), 1)));
    145.             }
    146.            // umaData.umaRecipe.slotDataList[15] = (slotLibrary.InstantiateSlot("HairTest", umaData.umaRecipe.slotDataList[1].GetOverlayList()));  //这里直接可以另外做的头发加到这个男性的头上
    147.             umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Feet] = slotLibrary.InstantiateSlot("MaleFeet", umaData.umaRecipe.slotDataList[2].GetOverlayList());
    148.  
    149.         }
    codes above works , but problem occurd when I try to change some overLay within slots

    for example , this is the method to change UMA's shirts;
    Code (csharp):
    1. public void ChangeShirt(OverlayData shirtOverLay)
    2.     {
    3.         if (shirtOverLay == null) return;
    4.  
    5.         if (umaData.umaRecipe.slotDataList != null)
    6.         {
    7.             List<OverlayData> overLayList = umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Torso].GetOverlayList();
    8.             if (overLayList.Count < 1) return;
    9.  
    10.             overLayList.RemoveRange(1, overLayList.Count - 1);   //since each slot must have at least one base overlay, here I remove all overLays on UMA's legs
    11.  
    12.             overLayList.Add(shirtOverLay);
    13.             UpdateUMAAtlas();
    14.         }  
    15.     }
    it kind of works , but sometimes, UMA's pants are removed too, that guy goes naked:D
    so my question is Why? I am changing Torso slot, why legs overLay got affected?
     
    Last edited: Dec 30, 2013
  34. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43
    am I doing it the stupid way? anyone, any reply will be appreciated
     
  35. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43
    another question: how does SlotData's tags work? I tag some slot I am using in scene on the inspector, and the SlotLibrary did use those slot when generating new UMA
    but when I do this
    Code (csharp):
    1. foreach (SlotData slot in umaData.umaRecipe.slotDataList)
    2. {
    3.        if(slot)
    4.       {
    5.              if(slot.tags !=null)
    6.              {
    7.                        if(slot.tags.Length>0) print("Tag: "+ slot.tags[0]);    //I got nothing from here
    8.              }
    9.              print("slot name"+slot.slotName); //this  got printed
    10. }
    11.            
    12. }
     
  36. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    Actually I don't know, the asset store team did that for us. :)
    Probably because it's best you open it in a different project to tinker and play. Before deciding on integrating it into your package.
     
  37. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    If you want to just import the kit then you can just uncheck the settings files you don't want to overwrite, they should be the first files in the import box.

    I was a little confused why it was a complete project as well.
     
  38. ICGames

    ICGames

    Joined:
    Nov 4, 2012
    Posts:
    12
    I had the same thought when I first imported in too, I admit I kind of rolled my eyes a bit, sorry for that. Then I thought about it and I never use an Asset Store package out of the box anyway. Mostly because we have a very strict project folder structure so all packages need to be re-sorted into that and then packed back up and added to the appropriate package category in our package repository. So I will be doing the same with this one anyway once I have finished mucking about with it.
     
  39. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    UMACrowd.cs!
    I'd recommend watching the Content Creation tutorial video even if it's outdated, or look at the material importer window, I'm afraid you'll find no in depth docs on that one either, but if you fill in all values it should "just work(tm)". It is possible to convert your meshes and textures into SlotData and OverlayData without the material importer window, it's just very tedious. Once it's been converted into SlotData and OverlayData, add them to the SlotLibrary and OverlayLibrary. UMACrowd access all it's content from those libraries and so you're mostly set to go.
    Don't use UMA for this, there are several first person controllers and follow cam scripts on the asset store, use one of those.
    Either you have to include UMA in your project and rebuild them at run-time or you have to wait for my power tools or invent a similar solution that stores the generated assets.
    You tell UMA which AnimationController to use. Then you feed events into the Animator... just like any other Mecanim Character, only difference is that the creation of the Animator and Avatar is hidden from you.
    Well like you said time is money, that also goes for our time. I agree that the project would benefit from more docs, perhaps we should start a kickstarter to hire someone to make clean proper docs. If everyone gives a dollar that should be enough to pay someone for some nice docs. Alternately we can sit down and do the opensource thing and wait for someone to do it.

    This reply was not meant to be snide or rude, I appreciate your feedback and I fully understand the frustration that lack of documentation causes. But personally I'm focused on celebrating the holidays and getting my power tools released. After the power tools I have a commitment to Josef to get the wings and horns on the asset store as well. So there will be no docs from me in the near future.
     
  40. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    You are not supposed to use the GetOverlayList and manipulate it directly because then stuff like this happens. When you set up the MaleLegs you actually told it to use the same OverlayList as the Body! Please read the following code snippet closely.

    Code (csharp):
    1.  
    2. umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Legs] = slotLibrary.InstantiateSlot("MaleLegs", umaData.umaRecipe.slotDataList[2].GetOverlayList());
    3. umaData.umaRecipe.slotDataList[(int)MaleSlotIndex.Legs].AddOverlay(overlayLibrary.InstantiateOverlay("MaleUnderwear01", new Color(Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), Random.Range(0.1f, 0.9f), 1)));
    4.  
    So what you did with your
    Code (csharp):
    1.  
    2. overLayList.RemoveRange(1, overLayList.Count - 1);   //since each slot must have at least one base overlay, here I remove all overLays on UMA's legs
    3.  
    Was actually to remove the underwear and all other overlays on the legs.
    The reason it was designed this way was to ease atlas generation. Since body and leg shares texture it is better to share overlay list rather than attempt to merge two lists and end up with the question if underwear is added first or shirt is added first. Now it's one list and so you have full control.

    Once we've added the group system on Overlays and SlotData you will get helper functions to do Remove("Shirts") before you AddOverlay(myNewShirt); Or even a AddOrReplace(myNewShirt); which could keep the list index of the old shirt.
     
  41. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Using v1.0.4.0 win7. The save and load does nothing as near as I can tell. But seems great.
     
  42. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    You need to select one or more UMADynamicAvatars in the scene view... not just their skinned mesh, but the actual root that contains the UMADynamicAvatar.
     
  43. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    OK. I have the load and save kind of working. Is there anyway to load a saved model without instantiating it?
     
  44. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    I'm not sure what you mean.

    If you save to an asset you can link a UMADynamicAvatar to it and have it load on start.
    If you just want to load the recipe as a base template before you apply further changes to it that's possible too, I recommend looking at the Load function to see the actual steps.
     
  45. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Great I have the UMADynamicAvatar working. Looks like one could make a large number of great models just from what you have provided. Do you use the same rig for all models?
     
  46. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43
    Once we've added the group system on Overlays and SlotData you will get helper functions to do Remove("Shirts") before you AddOverlay(myNewShirt); Or even a AddOrReplace(myNewShirt); which could keep the list index of the old shirt.[/QUOTE]

    You mean now we can't actually use group and tag right now?:confused: , you guys are just putting the codes there?
    when will this feature be added? cox my project is quite pressing
     
  47. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    @Joen: Thanks for taking the time to answer some of my questions in detail. I know you're busy. While I appreciate much of it, the point of my post was to suggest future targeted video tutorials, so that users can get a bit of guidance doing some of these things. Even with all of your helpful suggestions, the path is still pretty bumpy at this point.

    Right. I spent a few hours mucking around with this yesterday, and while I eventually got what I wanted, it struck me as a very inelegant and time consuming way to do the job. Sifting through close to 500 lines of code to find the feature you want to change, and then commenting out all the randomizing code, without completely breaking it just seemed awkward. I know the UMACrowd script is really just for demonstration purposes. What would be nice would be a stripped down production version, that brought these choices into the inspector, so that the script itself could be left alone. Either that or a GUI similar to UMACustomization, available at run-time. I know you have your hands full right now, but this is an open source project after all, so maybe someone that's already figured this out could step up and post something for the rest of us to use.

    On a side note, picking and choosing avatar features like this, especially for the female models, kind-of flashed me back to the pervy teenagers in "Weird Science", trying to build Kelly LeBrock on their home computer. The only difference it seems was that they, back in 1985, had a GUI, even if it used cheesy 1980s vector graphics.

    Yah, I watched several of these as well, and my eyes kind of glazed over through most of it. There are nearly 40 minutes of video just on content creation, and this doesn't include the ones on cloth creation, or using Marvelous Designer. I'm more interested in simply importing 3rd party assets and maybe recoloring them than creating clothing from scratch. I'm sure the answers I want are in there somewhere, but I might have been asleep by the time I got to them. This is why I suggested some shorter targeted videos. I'll check out the material importer though.

    Right. I've already discovered that the smooth follow script provided by Unity works better for my purposes than the one provided in the demo, but my question was more about techniques for attaching a camera to a UMA avatar at run-time. Manually selecting the generated character as a camera target after the game is running is fine in a demo, but in a real game you'll want this to happen automatically. You can't select it as a target in the inspector in advance. You can't tag it and save it as a prefab, so your camera can find it by its tag when it's instantiated. None of the methods I'm familiar with work here. Everything has to happen at run-time. So what's a good way to get the main camera to automatically find and lock onto a newly generated UMA character?

    Again, "including UMA in your project" doesn't really work when all of your instructional materials are saying to run it on its own to avoid overwriting settings. Still, if it doesn't need all of the included settings files to work, I can omit them when importing it, or like you say, wait a bit longer for a version that doesn't do this.

    I tried this using the standard Mecanim retargeting instructions available at http://docs.unity3d.com/Documentation/Manual/Retargeting.html, but ran into problems precisely because the Animator and Avatar were hidden. What I'd like to see is a modified version of these instructions that takes the unique nature of UMA avatars into account.

    Hey, I'd be glad to contribute if I could, but right now, I'm too much in the dark to be much help explaining this stuff to others. I'm not in a huge hurry though at this point, so I can wait until you or some other developer has time to address some of these issues. Don't worry about it for now. Enjoy the Holidays!
     
    Last edited: Dec 31, 2013
  48. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    Well sure you can use, what I meant is that we haven't added the helper functions for it, it's not finalized and will change at a later date.
    But you're free to manage this anyway you'd like. But right now you have to ensure that the right slots get the right overlays.
     
  49. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,618
    Just export the content of the UMA folder into a unity package and import it into your project. Everything will work!

    For setting up animations and stuff just refer to ANY mecanim humanoid avatar! The avatar on the racial prefabs will do just fine. The entire concept of Mecanim is that it retargets automatically, so it makes no difference that we end up creating a different avatar!
     
  50. Ribosome

    Ribosome

    Joined:
    Jan 15, 2013
    Posts:
    43
    You mean now we can't actually use group and tag right now? , you guys are just putting the codes there?
    when will this feature be added? cox my project is quite pressing
    The reason it was designed this way was to ease atlas generation. Since body and leg shares texture it is better to share overlay list rather than attempt to merge two lists and end up with the question if underwear is added first or shirt is added first. Now it's one list and so you have full control.

    Once we've added the group system on Overlays and SlotData you will get helper functions to do Remove("Shirts") before you AddOverlay(myNewShirt); Or even a AddOrReplace(myNewShirt); which could keep the list index of the old shirt.[/QUOTE]