Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Have you confirmed that you have the correct recipe in that call? If you do then this is an UMA question and I might be able to help you, if not then I can't.. :)
     
  2. Thorious

    Thorious

    Joined:
    Oct 24, 2015
    Posts:
    22
    I have verified the correct recipe loads correctly from the server to the client. Curious how other UMA users have handled Multiplayer in the past? I know people have it running in multiplayer, I even saw a video from Secret Anorak where he shows a multiplayer test of the UMA. Just never goes into any detail about it.
     
  3. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    Hi Thorus, I'd love to do a multiplayer tutorial, but it's just too huge to do in the little spare time I have. However, I have used a couple of different methods to pass characters around.

    The simplest method is to use an RPC to send or request a string when a new player enters a room, that string is of course their UMA recipe it's no different from sending any other type of string data, you just need to send it reliably and make sure it is not accidentally dropped from the message queue.

    I have also used an online MySQL database to hold player recipes. Any alterations to the outfit are uploaded to the database then an RPC tells other clients to read and update the new recipe in an MMO style.. This reduces traffic to the multiplayer server (such as photon) and instead uses the database for stuff that doesn't need to update 20 times per second.

    Don't know if that's what you're after. Let me know if I'm barking up the wrong tree.

    Hope that helps.
     
  4. Thorious

    Thorious

    Joined:
    Oct 24, 2015
    Posts:
    22
    I am using UNET. As of now, the host can see everyone, but the clients can only see their own recipes. The recipes do load from the server and each of the clients see their own recipe.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UMA;
    4. using System.IO;
    5. using UnityEngine.Networking;
    6. using System.Runtime.Serialization.Formatters.Binary;
    7. public class Player_Creator : NetworkBehaviour
    8. {
    9.     [SyncVar]
    10.     public string PlayerID;
    11.     [SyncVar]
    12.     public string syncUMAData;
    13.     void Start()
    14.     {
    15.         GenerateUMA();
    16.     }
    17.     public override void OnStartLocalPlayer()
    18.     {
    19.         syncUMAData = Player_Data.playerData.umaSerialData;
    20.         PlayerID = Player_Data.playerData.playerID;
    21.         CmdSaveUMADataOnServer(syncUMAData, PlayerID);
    22.         CmdLoadUMADataFromServer(PlayerID);
    23.     }
    24.     ////////////////// Load and Save //////////////////
    25.     public void Save()
    26.     {
    27.         //Generate UMA String
    28.         UMATextRecipe recipe = ScriptableObject.CreateInstance<UMATextRecipe>();
    29.         recipe.Save(umaDynamicAvatar.umaData.umaRecipe, umaDynamicAvatar.context);
    30.         syncUMAData = recipe.recipeString;
    31.         Destroy(recipe);
    32.         CmdSaveUMADataOnServer(syncUMAData, PlayerID);
    33.     }
    34.     [ClientRpc]
    35.     public void RpcLoad()
    36.     {
    37.         //Regenerate UMA using string
    38.         UMATextRecipe recipe = ScriptableObject.CreateInstance<UMATextRecipe>();
    39.         recipe.recipeString = syncUMAData;
    40.         umaDynamicAvatar.Load(recipe);
    41.         Destroy(recipe);
    42.     }
    43.     [Command]
    44.     public void CmdSaveUMADataOnServer(string strData, string ID)
    45.     {
    46.         BinaryFormatter bf = new BinaryFormatter();
    47.         FileStream file = File.Create(Application.persistentDataPath + "/" + ID + "UMA.dat");
    48.         PlayerUMAData data = new PlayerUMAData();
    49.         data.umaSerialData = strData;
    50.         bf.Serialize(file, data);
    51.         file.Close();
    52.     }
    53.     [Command]
    54.     public void CmdLoadUMADataFromServer(string ID)
    55.     {
    56.         if (File.Exists(Application.persistentDataPath + "/" + ID + "UMA.dat"))
    57.         {
    58.             BinaryFormatter bf = new BinaryFormatter();
    59.             FileStream file = File.Open(Application.persistentDataPath + "/" + ID + "UMA.dat", FileMode.Open);
    60.             PlayerUMAData data = (PlayerUMAData)bf.Deserialize(file);
    61.             file.Close();
    62.             syncUMAData = data.umaSerialData;
    63.             PlayerID = ID;
    64.             RpcLoad();
    65.         }
    66.     }
    67. }
     
  5. wiseman_2

    wiseman_2

    Joined:
    Dec 11, 2013
    Posts:
    66
    the thing that seemed to make it hardest to tell was that on my screen all of the eyes appeared to be blue, and it threw me off on a couple of them....
    looks like it's going well though
     
    Mikael-H likes this.
  6. wiseman_2

    wiseman_2

    Joined:
    Dec 11, 2013
    Posts:
    66
    Mikael H: Just a quick thank you... about the render Texture... worked great after that info... Took me a few tries to get a hold of it and put it into a png , but have it all working now....

    Now just have to finish grabbing the bones and weights, and I think that's it to have everything to put my pre-fab together...
    After that I think integration with several other packages is much easier...
     
    Mikael-H likes this.
  7. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello,

    I made an own script for my weapon added to my UMA character.
    The Basic idea is like recommended to me in this Forum somehow, to have a collider (box or capsule) for the weapon.

    So I wrote a small script (should be enhanced later) that should detect collisions of my UMA weapon:

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class WeaponCollision : MonoBehaviour {
    4.  
    5.     public GameObject Weapon;
    6.  
    7.     //private CapsuleCollider collider;
    8.     private BoxCollider boxCollider;
    9.  
    10.     // Use this for initialization
    11.     void Start () {
    12.         Init();
    13.     }
    14.  
    15.     void Init()
    16.     {
    17.         if (Weapon != null)
    18.         {
    19.             //collider = new CapsuleCollider();
    20.             //collider.isTrigger = true;
    21.             boxCollider = Weapon.AddComponent<BoxCollider>();
    22.             boxCollider.isTrigger = true;          
    23.         }
    24.     }
    25.  
    26.     public void InitWeapon(GameObject weapon)
    27.     {
    28.         Weapon = weapon;
    29.         Init();
    30.     }
    31.  
    32.     // Update is called once per frame
    33.     void Update () {
    34.    
    35.     }
    36.  
    37.     void OnCollisionEnter(Collision col)
    38.     {
    39.         Debug.Log("Weapon Collision");
    40.         if (col.gameObject.tag == "Monster")
    41.         {
    42.             Destroy(col.gameObject);
    43.         }
    44.     }
    45.  
    46.     void OnTriggerEnter(Collider other)
    47.     {
    48.         Debug.Log("Weapon Trigger");
    49.         if (other.gameObject.tag == "Monster")
    50.         {
    51.             Destroy(other.gameObject);
    52.         }
    53.     }
    54.  
    55. }
    56.  
    For my UMA Player and Monster prefabs, I added this script.

    I do not use recipes but create each UMA being with random Parameters.

    So I want to initialise the weapon script when I create the UMA Slots somehow, for example here (with a nice sword of WillB):

    Code (CSharp):
    1.             umaData.umaRecipe.slotDataList[9] = slotLibrary.InstantiateSlot("M_Bard Sword");
    2.             umaData.umaRecipe.slotDataList[9].AddOverlay(overlayLibrary.InstantiateOverlay("M_Bard Sword Lute"));
    3.  
    4.             WeaponCollision weaponScript = GetComponent<WeaponCollision>();
    5.             if (weaponScript != null)
    6.                 weaponScript.InitWeapon(umaData.umaRecipe.slotDataList[9].?);
    7.  
    I am not getting the correct idea how to initialize and start somehow, can anybody help me out?
    Do I Need to get the sword with GetComponentsInChildren somwhow or how do I get it / add the collider?

    Thanks a lot,
    Firlefanz
     
  8. SecretAnorak

    SecretAnorak

    Joined:
    Mar 19, 2014
    Posts:
    177
    Hi Thorous,

    I'm afraid I don't know UNET at all, and I can't really work out what you are doing from your code fragment. Perhaps I can help you solve your problem in a more abstract way. I always strip things back to basics and make some test code when I get stuck. You need to isolate and eliminate where the problem is occurring. It's going to be in the way you pass recipes around between clients, or in the way you generate UMAs from those recipes.

    I am assuming you are going to use string recipes.

    Forget about UMA for a moment and make sure you have a good handle on passing strings around. To start with, try making each client define a player message before connection and pass it around to other players. Make sure each client receives other player's messages. If that works then you can be sure you have a working communication channel. Swap out the message for the UMA Text recipe and voila. Use that string to generate your remote player's avatar.

    Remember, if you know the strings are correct and it still doesn't work then it must be the way you are applying them to your generator code.
     
  9. Thorious

    Thorious

    Joined:
    Oct 24, 2015
    Posts:
    22
    I am not sure adding a weapon as a slot is a good idea, I would do something like this to add a weapon to the character.

    void LoadRightHand(string invItem, int type)
    {
    // This grabs the prefab of the item from the resources folder /Resources/Prefabs/Items/
    invItem = "Prefabs/Items/" + invItem;
    GameObject rHandItem = Instantiate(Resources.Load(invItem, typeof(GameObject))) as GameObject;
    Transform hand = umaData.skeleton.GetBoneGameObject(UMASkeleton.StringToHash("RightHand")).transform;
    rHandItem.transform.SetParent(hand);
    rHandItem.transform.localPosition = new Vector3(0, 0, 0);
    rHandItem.transform.localRotation = Quaternion.identity;

    // Add your collider to the object or have the prefab already have the collider. Although you may have issues with the animations, if your using any.

    //Sets the animator for the player to what weapon they are using.
    m_Animator.SetInteger("WeaponType", type);
    }
     
    hopeful, Firlefanz73 and Jaimi like this.
  10. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello Thorious,

    thanks a lot! I will try that :)
     
  11. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    I have Problems getting the skeleton somehow.

    When using the script from above (Thanks a lot, Thorious),
    umaData.skeleton is always null while umaData is always set.

    I had it during creating the uma character gameobject first, did not work there.

    Then I pasted it to my npc movement script, which is attached to my UMA being.
    That is even better because I Need to Change later to a pickaxe, an axe or a weapon etc.

    I added to the first line:
    umaData = GetComponentInChildren<UMAData>();

    Still I get umaData, but still the umaData.skeleton is null.
    That's strange, because I have animated UMA, that works very well.

    Any idea how I can get the skeleton or what could cause my Problem here?

    Thanks a lot!

    Firlefanz
     
  12. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Sorry, don't know exactly what your problem is. Until you find the problem you could traverse the object hierarchy using transform.Find(path)

    This will get you a reference to the transform you want and then you can ue it to set as parent for your pickaxe or whatever.

    Read up on it here: http://docs.unity3d.com/ScriptReference/Transform.Find.html
     
  13. Thorious

    Thorious

    Joined:
    Oct 24, 2015
    Posts:
    22
    Not sure of the issue, but i have that code in my generator script. My character only has two hands and I have a weapons script that passes in the item and the type into that script depending on what hand it is going into. Referencing a script is rather easy, let me know if you need to do that. Maybe post more of the code that your using, it will help to troubleshoot the issue.
     
  14. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello,

    thanks a lot for your help!

    I added the Hand item at later timepoint and now it works.

    The sword in the Hand is still added as a Slot for testing purposes. It works perfect.

    The staff here is always too high with maybe 90° wrong direction?

    I have used a sword, a staff and a Club prefab from WillB's RPG Starter package, and it is the same for all of them.

    It is also the same in my game and in my character Editor here in the Screen:

    upload_2015-12-20_22-33-28.png

    The staff is moving already with the Player. Any idea how to fix that Offset / displacement?

    Here my current used code:

    Code (CSharp):
    1.     public void LoadRightHand(string invItem, int type)
    2.     {
    3.         try
    4.         {
    5.             UMAData umaData = GetComponentInChildren<UMAData>();
    6.             if (umaData == null)
    7.                 umaData = GetComponentInParent<UMAData>();
    8.             if (umaData == null)
    9.                 umaData = GetComponent<UMAData>();
    10.             if (umaData != null && umaData.skeleton != null)
    11.             {
    12.                 // This grabs the prefab of the item from the resources folder /Resources/Prefabs/Items/              
    13.                 rightHandItem = Instantiate(Resources.Load("Prefabs/" + invItem, typeof(GameObject))) as GameObject;
    14.                 Transform hand;
    15.                 hand = umaData.skeleton.GetBoneGameObject(UMASkeleton.StringToHash("RightHand")).transform;
    16.                 rightHandItem.transform.SetParent(hand);
    17.                 rightHandItem.transform.localPosition = new Vector3(0, 0, 0);
    18.                 //rightHandItem.transform.localRotation = Quaternion.identity;
    19.  
    20.                 // Add your collider to the object or have the prefab already have the collider. Although you may have issues with the animations, if your using any.
    21.  
    22.                 //Sets the animator for the player to what weapon they are using.
    23.                 //anim.SetInteger("WeaponType", type);
    24.             }
    25.         }
    26.         catch
    27.         {
    28.             Debug.LogWarning("Error in LoadRightHand");
    29.         }
    30.     }
    31.  
    Any idea what I am missing still or why this Offset?

    Thanks a lot. You are a great help :)
     
  15. wulveagfin

    wulveagfin

    Joined:
    Oct 3, 2014
    Posts:
    27
    Brand new to UMA.

    I can't get it to switch to Android build quickly.

    Steps to recreate:
    Create new Unity project.
    Immediately switch to Android.
    Go to "Asset Store" in Unity.
    Download/Import UMA 2.
    Unity Freezes on loading "UMA\Content\UMA\Legacy\Overlays\MaleHead01_normal.png".

    Task Manager doesn't show Unity doing anything. The progress "hold on" bar just stops there and does nothing for minutes. I give up and kill Unity via Task manager.

    Windows 10 x64, latest 1511 build.
    Unity 5.3.0f4

    If you start a new Unity project. Leave it on the default Windows mode. Download/Import UMA2. It will finsih extremely quickly. Then if you "switch" to Android, it'll freeze on the same step.

    Ok pre-post edit; it just ticked to another asset in the same subfolder. It seems to be doing work, but insanely slowly, and not using any CPU or RAM to do the work. The harddisk is SSD.

    My machine is a very nice powerful box. Is this normal?
     
  16. wulveagfin

    wulveagfin

    Joined:
    Oct 3, 2014
    Posts:
    27
    I left it alone for a couple hours. At some point it finished converting to Android. Hella slow. When I finish this game and need to convert between Android, Apple, and Windows it's going to take forever to create the release builds.
     
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    @wulveagfin - I would guess that this is a Unity bug of some sort. Probably best to check in the Android threads to see what U5.3 might have messed up.
     
  18. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Create a parent transform in the prefab and fix the offset and angles in the prefab itself.
     
    Firlefanz73 likes this.
  19. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    I have had similar problems with android in general. If I need to keep an android version I actually keep an entire copy of my project for android in a different directory and then never push from that one, only pulling (using git). That way you only need rebuild for android once.
     
  20. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello Mikael,

    this sounds like a good idea, but I really have Problems getting the correct Position and Rotation for the prefab.
    Any idea how I can get it? Why is the Slot at the perfect place, and why the prefab always wrong?

    It moves and animated correctly, but look at the Screen above. Can I calculate the correct spawning Location and rotation somehow? Thanks a lot :)
     
  21. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    usually the best thing to do with this is just to go ahead and create the game object, add the weapon as a child, parent the new game object to the bone, and then manually position the weapon so it looks right, and save the new game object as a prefab.
     
  22. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    I have bought the UMA RPG Starter package from WillB.

    There are already several weapons in it, and there is a prefab for each weapon.
    I also tried to create an own prefab from a weapons skinned mesh.

    When I add the weapon asset as a UMA Slot (like the clothes or armor), it is in the correct Position already. It is perfect and animating.

    When I attach the delivered or my own prefab as a child to the Hand, it is animating but at the wrong place and Rotation and hard to get it right.

    Do I have to ask Will where to attach it? I hoped there was a way to get it without trying a lot.
    Do you guys always equip every tool or weapon in Hand just as a Slot?

    Like Thorios suggested I added it with the source above to the right Hand bone..
     
  23. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    @Firlefanz73 - If I remember correctly, once when I was helping Will process one of his characters for the RPG Starter Pack, there was a situation where the sword wasn't properly matched to the character. Will had to fix something on his end in order to get it to work. It's possible this is another one of those circumstances. You might ask him to check on that particular character, to make sure the sword is hooked up right.
     
    Firlefanz73 likes this.
  24. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208

    Will has set his weapons to animate as part of the model itself, tied directly to the skeleton. This is fine if you're only going to use the weapons that come with the package.

    If you need a generic weapon system that uses other weapons, you'll need to do it like Thorios suggests. And as such, your model *wont* be tied to the bones of the skeleton, but would instead be a child of the hand bone. In the first method, the coordinates on the weapon would be offset from the origin enough to appear where the hand is. In the second method, the weapon would actually be at the origin.

    To make Wills weapons work in a generic fashion (the second method), you would need to load it into a modeller, and move it to the origin, and rotate it so it points correctly when a child of the hand bone.

    Either way is fine, but the generic method would allow you to use any weapons from the asset store.
     
    Last edited: Dec 23, 2015
    Firlefanz73 likes this.
  25. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Thanks a lot guys!

    I managed to put my own weapons with no Avatar / Skeleton attached in their fbx directly to the Hand as suggested.
    I will remove that Avatar / Skeleton from Will's weapons and use them the same way.

    Thanks for your help :)
     
    hopeful likes this.
  26. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    121
    uma_pbr_halflense.jpg Hi,

    I'm seeing a problem in my demo (and my later code) for the PBR examples where the eyes have some half circle messing up the whites of the eye. Looking at the textures I dont see where this is, but since it's in my demo I believe it came that way.

    Does this happen to everyone else, is there a way to resolve it?

    Attached a screen shot of it.



    -g
     
  27. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Haven't used the PBR stuff yet but to me that looks like the horizon being reflected in the eyes.
     
  28. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    121
    That makes sense. How do I get rid of it? The glassy look is fine, but do I need to put some kind of special box around it or something? Seems a little overboard to have full horizon reflections in eyes. :)

    -g
     
  29. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Either use another skybox or use another material for the eyes.
     
  30. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    121
    Thanks!
     
    Mikael-H likes this.
  31. wiseman_2

    wiseman_2

    Joined:
    Dec 11, 2013
    Posts:
    66
    I have now spent hours looking, but for the life of me , I can't find how to change uma skintone in code...
    I can set it on creation, but when I try to change it ,nothing happens

    Code (CSharp):
    1. umaData.umaRecipe.slotDataList[3].SetOverlayColor(color, "MaleBody02");
    2.             umaData.isTextureDirty = true;
    3.             umaData.Dirty();
    if color is the color that I want to change skin tone to... what am I doing wrong?

    I also looked through the example scenes, but color change was the one thing that wasn't hooked up in the examples
     
  32. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    umaData.Dirty(false,true,false);
     
    LexOdin and hopeful like this.
  33. wiseman_2

    wiseman_2

    Joined:
    Dec 11, 2013
    Posts:
    66
    thanks...that's it...
    really appreciate it
     
  34. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    Unity 5.3.1f1 Windows 64-bit

    New Empty Project, imported from Asset Store:
    - UMA 2
    - UMA 2 PBR

    Visual Studio 2015 -> 11 Warnings:
    • Warning CS0169 The field 'UMACustomization.DnaScrollPanel' is never used UMA Stuff.CSharp D:\Unity\Projects\UMA Stuff\Assets\UMA\Example\Scripts\UMACustomization.cs 19
    • Warning CS0169 The field 'UMACustomization.sliders' is never used UMA Stuff.CSharp D:\Unity\Projects\UMA Stuff\Assets\UMA\Example\Scripts\UMACustomization.cs 69
    • Warning CS0169 The field 'RecipeEditor.draggedObjs' is never used UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\RecipeEditor.cs 26
    • Warning CS0618 'SlotData.slotName' is obsolete: 'SlotData.slotName is obsolete use asset.slotName!' UMA Stuff.CSharp.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\UMA\Core\Scripts\SlotData.cs 42
    • Warning CS0618 'SlotData.materialSample' is obsolete: 'SlotData.materialSample is obsolete use asset.materialSample!' UMA Stuff.CSharp.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\UMA\Core\Scripts\SlotData.cs 43
    • Warning CS0618 'EditorGUIUtility.LookLikeControls()' is obsolete: 'LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.' UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\RaceInspector.cs 26
    • Warning CS0618 'EditorGUIUtility.LookLikeControls()' is obsolete: 'LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.' UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\RaceInspector.cs 69
    • Warning CS0618 'EditorGUIUtility.LookLikeControls()' is obsolete: 'LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.' UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\SlotInspector.cs 73
    • Warning CS0618 'EditorGUIUtility.LookLikeControls()' is obsolete: 'LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.' UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\SlotInspector.cs 212
    • Warning CS0618 'EditorGUIUtility.LookLikeControls()' is obsolete: 'LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.' UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\UMABonePoseBuildWindow.cs 110
    • Warning CS0618 'EditorGUIUtility.LookLikeControls()' is obsolete: 'LookLikeControls and LookLikeInspector modes are deprecated. Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.' UMA Stuff.CSharp.Editor.Plugins D:\Unity\Projects\UMA Stuff\Assets\Standard Assets\Editor\UMA\Core\UMABonePoseMixerWindow.cs 43
     
    Last edited: Dec 28, 2015
  35. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    In addition to the above, PBR example scenes throw over 200 errors and 4 warnings...mostly from Scene01 - Crowd Recipes - PBR

    UMA/Content/UMA/PBR/Example/Scenes

    Also there are two Scene06 - .... one of them should be Scene05 apparently.

    IMHO the ReleaseNotes and UMA_Manual files should be removed...they're from version 1.x so I assume they're no longer useful.
     
    Last edited: Dec 28, 2015
  36. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    If you are using UMA 2 from GITHUB, I've just checked in a fix for the PackedRecipe saving code that could cause shared colors to be incorrectly saved to the asset. I've also added a "Collapse All"/"Expand All" to the recipe editor since it can be painful to figure out where things are in a recipe when it has a bunch of slots in it.
     
    Mikael-H and hopeful like this.
  37. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Since I was in the code, I went ahead and added a couple of changes that people had requested:

    1. When creating a new asset from the context menu, it would change the directory on you. This is now fixed.
    2. Added a "Drag/Drop" area for dropping slots into the recipe editor. This will take multiple slots, or folders, and will scan recursively. This functionality was copied from the SlotEditor.

    Go grab the latest version from Github:

    https://github.com/huika/UMA
     
    Firlefanz73, hopeful and Mikael-H like this.
  38. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Thanks for your work Jaimi :)
     
  39. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hi Jaimi,

    now that it works, would you like to add my "HandsBehaviour" script to the UMA 2 package?

    I have a simple sword and a hammer mesh I would give you to let you add, too.
    Both are Standing on (0,0,0) and with my script they can be attached to the hand, it also works with animations.

    In my eyes this would be a cool Feature for UMA 2. If you wanna have it, please let me know :)
     
  40. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    It's maybe a bit specific for the base UMA, but I can add it to the Character System, if you'd like.

    Edit: One bug in last nights update (can't drop a single slotdataasset onto pad). Fixed.
    also - Changed the recipe editor so it remembers the mode it is in -- so when you're creating a bunch of recipes, don't have to switch to the Slots tab all the time.
     
    Last edited: Dec 31, 2015
    Firlefanz73 and hopeful like this.
  41. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello everybody,

    I added my HandBehavior script with a sample hammer prefab (with mesh).

    Usage:

    Globals.LoadRightHand("Hammer", 0);

    If anybody can make use of it, feel free to add it to your Project.
    @Raimi: If you like to add it to the Character System of Course you may do it

    Have fun :) And have a nice new year 2016 (here it is 6 hours to go)


    /// Use a prefab with a mesh renderer located under Resources / Prefabs or change the path in the code (see Instantiate)
    /// and use LoadLeftHand or LoadRightHand to attach something into his Hand
    /// Attach this script to an UMA character
     

    Attached Files:

  42. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    I'm creating a character customizer and have followed Anorak's great tutorials but what I'm unsure about is how to load slots and their matching overlays without explicity knowing the overlay's name.

    For example:
    to load MaleHair01 slot and overlay I do
    Code (CSharp):
    1. umaData.umaRecipe.slotDataList[1] = slotLibrary.InstantiateSlot("FR_High_MaleFace");
    2. AddOverlay(1, "MaleHair01");
    I've added all my slots and overlays to
    Code (CSharp):
    1. public List<SlotDataAsset> maleHairSlots;
    2. public List<OverlayDataAsset> maleHairOverlays;
    then I can add my overlays like this:
    Code (CSharp):
    1. AddOverlay(1, maleHairOverlays[selectedMaleHairStyle].name);
    But if the hair style chosen in the editor requires a slot and overlay, how do I load the overlay that matches the slot?
     
  43. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Because there is no actual link between slots and overlays (on purpose - that way you can change out the overlay if you wish), you just have to know what the overlay is. There is a way to link overlays and slots though - through a recipe. For an example of how to use recipes to define and customize, I've created and released a character customizer if you like, it's here:

    http://forum.unity3d.com/threads/uma-character-system.371051/
     
  44. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Thanks Jaimie I'll check it out! Any idea how customized like UMAZing do it?
     
  45. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    If I recall correctly, they have a series of arrays you fill out on the component. I think the solution that I use is more comprehensive, as you can have as many overlays and slots in a piece of equipment as you want (a piece of chest armor might be a padding overlay on the torso, a slot and overlay for the breastplate, and a slot and overlay for pauldrons, for example).
     
  46. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Just installed your editor I love it! Great work!
     
  47. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Hello,

    I am trying to Change my face Slot to another Slot with another overlay. It is in real time in my Editor Scene.

    When I do it, nothing seems to happen. But when I Change something else that works, then changes happen: I have no face anymore, just the mouth and eyes is still there, but no face.

    My current Code for changing a Slot to the new Slot for faces:

    Code (CSharp):
    1.     public void ChangeFace()
    2.     {
    3.         activeFace++;
    4.         if (activeFace > 8)
    5.             activeFace = 0;
    6.  
    7.         if (umaData.umaRecipe.slotDataList[2] != null)
    8.             umaData.umaRecipe.slotDataList[2].RemoveOverlay();
    9.         if (IsMale)
    10.         {
    11.             umaData.umaRecipe.slotDataList[2] = slotLibrary.InstantiateSlot(FaceSlot);
    12.             umaData.umaRecipe.slotDataList[2].AddOverlay(overlayLibrary.InstantiateOverlay(string.Format("M_face {0} overlay PBR ", activeFace), SkinColor));
    13.         }
    14.         else
    15.         {
    16.             umaData.umaRecipe.slotDataList[2] = slotLibrary.InstantiateSlot(FaceSlot);
    17.             umaData.umaRecipe.slotDataList[2].AddOverlay(overlayLibrary.InstantiateOverlay(string.Format("F_face {0} overlay PBR ", activeFace), SkinColor));
    18.         }
    19.  
    20.         umaData.Dirty(false, true, true);
    21.     }
    Any idea what's wrong? Thanks a lot!

    Firlefanz
     
  48. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Are you setting "FaceSlot" anywhere? or is that a property that uses "activeFace"?
     
  49. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,316
    Got it working...

    Code (CSharp):
    1.     public void ChangeFace()
    2.     {
    3.         activeFace++;
    4.         if (activeFace > 8)
    5.             activeFace = 0;
    6.  
    7.         if (umaData.umaRecipe.slotDataList[2] != null)
    8.             umaData.umaRecipe.slotDataList[2].RemoveOverlay();
    9.         if (IsMale)
    10.         {
    11.             umaData.umaRecipe.slotDataList[2].SetOverlay(0,overlayLibrary.InstantiateOverlay(string.Format("M_Face {0} Overlay PBR", activeFace), SkinColor));
    12.         }
    13.         else
    14.         {
    15.             umaData.umaRecipe.slotDataList[2].SetOverlay(0,overlayLibrary.InstantiateOverlay(string.Format("Fem Face {0} Overlay PBR", activeFace), SkinColor));
    16.         }
    17.         umaData.Dirty(false, true, true);
    18.     }
     
    Last edited: Jan 4, 2016
  50. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Anyone that can explain this line to me:
    Was this ever explained?
    I have commented out line 188 in OverlayColorData for now, since it seems to set additive colors to black in the recipe - rendering setting them manually in inspector useless. When the line is commented out it seems to work fine.
    Code (CSharp):
    1. channelAdditiveMask = new Color[channels];
     
    hopeful likes this.