Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    For now you can adjust the capsulle collider to correct that.
     
  2. TRoNDaNeflin

    TRoNDaNeflin

    Joined:
    Mar 26, 2014
    Posts:
    67
    I've tried but he starts flickering, strobing up and down. I think the capsule tries to compensate the offset I'm giving him and pul him dow, then up, then down. Kinda weird...
     
  3. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Just wanted to show you where I'm at so far. Really enjoying UMA, thanks to those who've contributed. :)

     
  4. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hmm, I would say that you should try changing the dna converter and lifting the guy a bit higher. Whatever bone positions the dna sets uma will tell Mecanim is the right one. So if the feet is halfway into the ground, the Mecanim Avatar will consider that correct.
     
  5. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Awesome stuff!
    I like your assortment of Props, really nice.

    Oh and sneaking, don't let the carps spot you! :)
     
  6. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    This is looking great! Really very high quality =D
    You´ve done your own skin overlay, or the difference is on the shader? It looks to have less high frequency detail, looking really good on this environment. :)
     
  7. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Thanks, the aim is to give the player enough choice to make an individual character. The sneaking will be needed too as heavy footsteps scare the fish! :)

    Thanks. I've tweaked mainly the lighting, the shader is from the package. The skin overlays are from your Dionysus Athena packages. :)
     
  8. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,455
    Nice work. Also like the sneaking up. Looks very professional.

    btw, can you share what other UMA add on assets did you use for this project.

    Cheers.
     
  9. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Thanks, I just used the main UMA package the Dionysus Athena skin overlays.
     
  10. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hehehe Great marketing for my assets =D
     
  11. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    Great assets deserve great marketing. :)
     
  12. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    Hi,
    Is there any tutorial for create my own race, any video of document? I was try to add my own model as new race, but i don't know how to fill race UMAData in race prefab, there are a lot of animated bones and huge temp bone data, need i fill it manual?

    $捕获.PNG
     
  13. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    I believe Fernando is planning on doing a race video soon, but you can ignore Temp Bone Data (it will be hidden internally in 1.2) and there is a script called "UMA Process Bones" in the DLL for filling in the Animated Bones.
     
  14. tomi-trescak

    tomi-trescak

    Joined:
    Jul 31, 2013
    Posts:
    78
    Guys

    In university of Western Sydney we are working on a small project of simulation of life in the city of Uruk 3000 B.C. Students love UMA as they can generate many Uruk inhabitants with traditional clothing and looks. But, we ran into problems with hair, do you have any pointers of how could we generate also hair of different sizes? Or how can we simply approach having more that the 2 types of hair provided, so that it would work with UMA?

    Kindly appreciated.

    Tomas
     
  15. tomi-trescak

    tomi-trescak

    Joined:
    Jul 31, 2013
    Posts:
    78
    I thought I contribute a bit as well and I provide code for IMHO better editor for the Random Crowd Sets. This is how it looks:

    $Screen Shot 2014-03-31 at 9.40.40.png

    Below is the code that needs following pre-requisites:

    1. Install ReordableList asset from: https://bitbucket.org/rotorz/reorderable-list-editor-field-for-unity

    2. You need to define following enum and add it to class "CrowdOverlayData"


    Code (csharp):
    1.  
    2. public enum OverlayType
    3. {
    4.     Other,
    5.     Skin,
    6.     Makeup,
    7.     Hair
    8. }
    Code (csharp):
    1.  
    2. [System.Serializable]
    3. public class CrowdOverlayData
    4. {
    5.     ...
    6.     public OverlayType overlayType;
    7. }
    8.  
    And here is the editor

    Code (csharp):
    1.  
    2. using System;
    3. using UnityEditor;
    4. using Rotorz.ReorderableList;
    5. using System.Collections.Generic;
    6. using UnityEngine;
    7.  
    8. [CustomPropertyDrawer(typeof(UMACrowdRandomSet.CrowdRaceData))]
    9. public class CrowdRaceDataEditor : PropertyDrawer {
    10.     public override float GetPropertyHeight (SerializedProperty prop, GUIContent label) {
    11.         var innerEntriesProp = prop.FindPropertyRelative("slotElements");
    12.         return ReorderableListGUI.CalculateListFieldHeight(innerEntriesProp) + 20;
    13.     }
    14.    
    15.     public override void OnGUI (Rect position, SerializedProperty prop, GUIContent label) {
    16.  
    17.         var height = position.height;
    18.         var race = prop.FindPropertyRelative("raceID");
    19.         position.height = 18;
    20.         EditorGUI.PropertyField(position, race);
    21.         position.y += 20;
    22.        
    23.  
    24.         position.height = height - 20;
    25.         var innerEntriesProp = prop.FindPropertyRelative("slotElements");
    26.         ReorderableListGUI.ListFieldAbsolute(position, innerEntriesProp, ReorderableListFlags.DisableReordering);
    27.     }
    28. }
    29.  
    30. [CustomPropertyDrawer(typeof(UMACrowdRandomSet.CrowdSlotElement))]
    31. public class CrowdSlotElementEditor : PropertyDrawer {
    32.     public override float GetPropertyHeight (SerializedProperty prop, GUIContent label) {
    33.         var innerEntriesProp = prop.FindPropertyRelative("possibleSlots");
    34.         return ReorderableListGUI.CalculateListFieldHeight(innerEntriesProp) + 45;
    35.     }
    36.    
    37.     public override void OnGUI (Rect position, SerializedProperty prop, GUIContent label) {
    38.         var height = position.height;
    39.         position.height = 18;
    40.         var requirement = prop.FindPropertyRelative("requirement");
    41.         EditorGUI.PropertyField(position, requirement);
    42.         position.y += 22;
    43.        
    44.         EditorGUI.LabelField(position, "Possible slots", LabelHelper.HeaderStyle);
    45.         position.y += 18;
    46.         position.height = height - 45;
    47.         var possibleSlots = prop.FindPropertyRelative("possibleSlots");
    48.  
    49.         //ReorderableListGUI.Title("Possible Slots");
    50.         ReorderableListGUI.ListFieldAbsolute(position, possibleSlots, (pos) =>
    51.         {
    52.             pos.height = 20;
    53.             EditorGUI.LabelField(pos, "No slots");
    54.         }, ReorderableListFlags.DisableReordering);
    55.     }
    56. }
    57.  
    58. [CustomPropertyDrawer(typeof(UMACrowdRandomSet.CrowdSlotData))]
    59. public class CrowdSlotDataEditor : PropertyDrawer {
    60.     public override float GetPropertyHeight (SerializedProperty prop, GUIContent label) {
    61.         var innerEntriesProp = prop.FindPropertyRelative("overlayElements");
    62.         return ReorderableListGUI.CalculateListFieldHeight(innerEntriesProp) + 65;
    63.     }
    64.    
    65.     public override void OnGUI (Rect position, SerializedProperty prop, GUIContent label) {
    66.         var height = position.height;
    67.         var width = position.width;
    68.  
    69.         position.height = 18;
    70.         var requirement = prop.FindPropertyRelative("slotID");
    71.         EditorGUI.PropertyField(position, requirement);
    72.         position.y += 20;
    73.  
    74.         var overlayListSource = prop.FindPropertyRelative("overlayListSource");
    75.         EditorGUI.PropertyField(position, overlayListSource);
    76.         position.y += 20;
    77.  
    78.         EditorGUI.LabelField(position, "Possible overlays", LabelHelper.HeaderStyle);
    79.         position.y += 18;
    80.  
    81.         position.height = height - 65;
    82.  
    83.         var innerEntriesProp = prop.FindPropertyRelative("overlayElements");
    84.         ReorderableListGUI.ListFieldAbsolute(position, innerEntriesProp, ReorderableListFlags.DisableReordering);
    85.     }
    86. }
    87.  
    88. [CustomPropertyDrawer(typeof(UMACrowdRandomSet.CrowdOverlayElement))]
    89. public class OuterListEntryEditor : PropertyDrawer {
    90.     public override float GetPropertyHeight (SerializedProperty prop, GUIContent label) {
    91.         var innerEntriesProp = prop.FindPropertyRelative("possibleOverlays");
    92.         return ReorderableListGUI.CalculateListFieldHeight(innerEntriesProp) + 25;
    93.     }
    94.    
    95.     public override void OnGUI (Rect position, SerializedProperty prop, GUIContent label) {
    96.         var height = position.height;
    97.         var innerEntriesProp = prop.FindPropertyRelative("possibleOverlays");
    98.         position.y += 5;
    99.         position.height = 18;
    100.         EditorGUI.LabelField(position, "Overlay Data", LabelHelper.HeaderStyle);
    101.         position.y += 18;
    102.         position.height = height - 25;
    103.         ReorderableListGUI.ListFieldAbsolute(position, innerEntriesProp, ReorderableListFlags.DisableReordering);
    104.     }
    105. }
    106.  
    107. [CustomPropertyDrawer(typeof(UMACrowdRandomSet.CrowdOverlayData))]
    108. public class InnerListEntryEditor : PropertyDrawer
    109. {
    110.     public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
    111.     {
    112.         var overlayType = prop.FindPropertyRelative("overlayType");
    113.         if (overlayType.enumValueIndex == 0 || overlayType.enumValueIndex == 1)
    114.         {
    115.             return 80f;
    116.         }
    117.         if (overlayType.enumValueIndex == 2)
    118.         {
    119.             return 40f;
    120.         }
    121.         else
    122.         {
    123.             return 60f;
    124.         }
    125.     }
    126.    
    127.     public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
    128.     {
    129.         var width = position.width;
    130.         var x = position.x;
    131.         var labelWidth = 60;
    132.  
    133.         position.height = 16;
    134.  
    135.         var overlayId = prop.FindPropertyRelative("overlayID");
    136.         EditorGUI.LabelField(position, "Id");
    137.         position.width = labelWidth;
    138.         position.x += labelWidth + 5;
    139.         position.width = width - (labelWidth + 5);
    140.         overlayId.stringValue = EditorGUI.TextField(position, overlayId.stringValue);
    141.  
    142.         position.y += 20;
    143.         position.x = x;
    144.         position.width = labelWidth;
    145.         var overlayType = prop.FindPropertyRelative("overlayType");
    146.         EditorGUI.LabelField(position, "Type");
    147.         position.x += labelWidth + 5;
    148.         position.width = width - (labelWidth + 5);
    149.         overlayType.enumValueIndex =
    150.             (int) (UMACrowdRandomSet.OverlayType) EditorGUI.EnumPopup(
    151.                 position,
    152.                 (UMACrowdRandomSet.OverlayType) Enum.Parse(typeof(UMACrowdRandomSet.OverlayType), overlayType.enumNames[overlayType.enumValueIndex]));
    153.  
    154.         if (overlayType.enumValueIndex == 0 || overlayType.enumValueIndex == 1)
    155.         {
    156.             position.y += 20;
    157.             position.x = x;
    158.             position.width = labelWidth;
    159.             var minRGB = prop.FindPropertyRelative("minRGB");
    160.             EditorGUI.LabelField(position, "Min RGB");
    161.             position.x += labelWidth + 5;
    162.             position.width = width - (labelWidth + 5);
    163.             minRGB.colorValue = EditorGUI.ColorField(position, minRGB.colorValue);
    164.  
    165.             position.y += 20;
    166.             position.x = x;
    167.             position.width = labelWidth;
    168.             var maxRGB = prop.FindPropertyRelative("maxRGB");
    169.             EditorGUI.LabelField(position, "Max RGB");
    170.             position.x += labelWidth + 5;
    171.             position.width = width - (labelWidth + 5);
    172.             maxRGB.colorValue = EditorGUI.ColorField(position, maxRGB.colorValue);
    173.         }
    174.  
    175.         if (overlayType.enumValueIndex == 3)
    176.         {
    177.             position.y += 20;
    178.             position.x = x;
    179.             position.width = labelWidth;
    180.             var hairColorMultiplier = prop.FindPropertyRelative("hairColorMultiplier");
    181.             EditorGUI.LabelField(position, "Hair Mult.");
    182.             position.x += labelWidth + 5;
    183.             position.width = width - (labelWidth + 5);
    184.             hairColorMultiplier.floatValue = EditorGUI.FloatField(position, hairColorMultiplier.floatValue);
    185.         }
    186.     }
    187. }
    188.  
    189. static class LabelHelper
    190. {
    191.     public static GUIStyle HeaderStyle;
    192.    
    193.     static LabelHelper()
    194.     {
    195.         HeaderStyle = new GUIStyle();
    196.         HeaderStyle.border = new RectOffset(2, 2, 2, 1);
    197.         HeaderStyle.margin = new RectOffset(5, 5, 5, 0);
    198.         HeaderStyle.padding = new RectOffset(5, 5, 0, 0);
    199.         HeaderStyle.alignment = TextAnchor.MiddleLeft;
    200.         HeaderStyle.normal.background = EditorGUIUtility.isProSkin
    201.             ? LoadTexture(s_DarkSkin)
    202.                 : LoadTexture(s_LightSkin);
    203.         HeaderStyle.normal.textColor = EditorGUIUtility.isProSkin
    204.             ? new Color(0.8f, 0.8f, 0.8f)
    205.                 : new Color(0.2f, 0.2f, 0.2f);
    206.     }
    207.    
    208.     static Texture2D LoadTexture(string textureData)
    209.     {
    210.         byte[] imageData = Convert.FromBase64String(textureData);
    211.        
    212.         // Gather image size from image data.
    213.         int texWidth, texHeight;
    214.         GetImageSize(imageData, out texWidth, out texHeight);
    215.        
    216.         // Generate texture asset.
    217.         var tex = new Texture2D(texWidth, texHeight, TextureFormat.ARGB32, false);
    218.         tex.hideFlags = HideFlags.HideAndDontSave;
    219.         tex.name = "ReorderableList";
    220.         tex.filterMode = FilterMode.Point;
    221.         tex.LoadImage(imageData);
    222.  
    223.         return tex;
    224.     }
    225.    
    226.     private static void GetImageSize(byte[] imageData, out int width, out int height) {
    227.         width = ReadInt(imageData, 3 + 15);
    228.         height = ReadInt(imageData, 3 + 15 + 2 + 2);
    229.     }
    230.    
    231.     private static int ReadInt(byte[] imageData, int offset) {
    232.         return (imageData[offset] << 8) | imageData[offset + 1];
    233.     }
    234.    
    235.     /// <summary>
    236.     /// Resource assets for light skin.
    237.     /// </summary>
    238.     /// <remarks>
    239.     /// <para>Resource assets are PNG images which have been encoded using a base-64
    240.     /// string so that actual asset files are not necessary.</para>
    241.     /// </remarks>
    242.     private static string s_LightSkin =
    243.         "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAECAYAAABGM/VAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEFJREFUeNpi/P//P0NxcfF/BgRgZP78+fN/VVVVhpCQEAZjY2OGs2fPNrCApBwdHRkePHgAVwoWnDVrFgMyAAgwAAt4E1dCq1obAAAAAElFTkSuQmCC";
    244.     /// <summary>
    245.     /// Resource assets for dark skin.
    246.     /// </summary>
    247.     /// <remarks>
    248.     /// <para>Resource assets are PNG images which have been encoded using a base-64
    249.     /// string so that actual asset files are not necessary.</para>
    250.     /// </remarks>
    251.     private static string s_DarkSkin =
    252.  
    253.         "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAECAYAAABGM/VAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADtJREFUeNpi/P//P4OKisp/Bii4c+cOIwtIQE9Pj+HLly9gQRCfBcQACbx69QqmmAEseO/ePQZkABBgAD04FXsmmijSAAAAAElFTkSuQmCC";
    254. }
    255.  
     
  16. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Wow, nice stuff. I think we all agree this is a vast improvement.

    Great stuff!
     
  17. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Tomas I did a few adjustments to both to your code and to the crowd itself and committed it to git.

    Also included a uma custom build of the Editor.ReorderableList.dll from rotorz.
     
  18. tomi-trescak

    tomi-trescak

    Joined:
    Jul 31, 2013
    Posts:
    78
    There is one more thing that needs to be done and is a possible bug in your code. You either need to re-think the "useSharedOverlayList" ... by for example showing it as a drop down with names, or you need to enable the checkbox in following drawer like this:

    Code (csharp):
    1.  
    2. [CustomPropertyDrawer(typeof(UMACrowdRandomSet.CrowdSlotData))]
    3. public class CrowdSlotDataEditor : PropertyDrawer
    4. {
    5.     public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
    6.     {
    7.         var innerEntriesProp = prop.FindPropertyRelative("overlayElements");
    8.         return ReorderableListGUI.CalculateListFieldHeight(innerEntriesProp) + 85;
    9.     }
    10.  
    11.     public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
    12.     {
    13.         var height = position.height;
    14.         var width = position.width;
    15.  
    16.         position.height = 18;
    17.         var requirement = prop.FindPropertyRelative("slotID");
    18.         EditorGUI.PropertyField(position, requirement);
    19.         position.y += 20;
    20.  
    21.         var overlayListSource = prop.FindPropertyRelative("overlayListSource");
    22.         EditorGUI.PropertyField(position, overlayListSource);
    23.         position.y += 20;
    24.  
    25.         var shared = prop.FindPropertyRelative("useSharedOverlayList");
    26.         EditorGUI.PropertyField(position, shared);
    27.         position.y += 20;
    28.  
    29.         EditorGUI.LabelField(position, "Possible overlays", LabelHelper.HeaderStyle);
    30.         position.y += 18;
    31.  
    32.         position.height = height - 85;
    33.  
    34.         var innerEntriesProp = prop.FindPropertyRelative("overlayElements");
    35.         ReorderableListGUI.ListFieldAbsolute(position, innerEntriesProp, ReorderableListFlags.DisableReordering);
    36.     }
    37. }
    38.  
     
  19. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    Hi ecurtz.
    Thanks for your suggest, i see the new race works fine, but still have some error. here is the error code, could you tell me how to fix it?
    Code (csharp):
    1. Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.
    2. UnityEngine.Transform:set_parent(Transform)
    3. UMA.SkinnedMeshCombiner:RecursivelyMapToNewRoot(Transform, Transform, Dictionary`2)
    4. UMA.SkinnedMeshCombiner:RecursivelyMapToNewRoot(Transform, Transform, Dictionary`2)
    5. UMA.SkinnedMeshCombiner:CloneBoneListInNewHierarchy(Transform, Transform[], Dictionary`2)
    6. UMA.SkinnedMeshCombiner:CombineMeshes(CombineInstance, CombineInstance[], Transform, Dictionary`2)
    7. UMA.SkinnedMeshCombiner:CombineMeshes(SkinnedMeshRenderer, CombineInstance[], Dictionary`2)
    8. UMA.UMADefaultMeshCombiner:UpdateUMAMesh(Boolean, UMAData, String[], Int32)
    9. UMA.UMAGeneratorBuiltin:UpdateUMAMesh(Boolean)
    10. UMA.UMAGeneratorBuiltin:HandleDirtyUpdate(UMAData)
    11. UMA.UMAGeneratorBuiltin:OnDirtyUpdate()
    12. UMA.UMAGeneratorBuiltin:Update()
     
  20. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there Tomas!
    First of all, thanks for improving UMACrowd, that was a huge contribution =)
    There are two basic ways to handle hair variation and customization of it´s size: The most complex solution will provide most flexibility, you would need to provide extra bones to control hair size, in this case the hair mesh would be skinned to those extra bones parented to the head itself. This way you could access them and adjust their scale, the same way we do with the body. The tricky part is correctly positioning the extra bones in a strategic point, so that its scale adjust deforms de their correctly.
    The simple solution could be just swaping between different hair styles (completely different meshes, already modified to specific lengths), that´s what we usually see on most games.

    What you guys might have to consider is which shader to use with hair itself, as it usually requires both anisotropic and a good way to handle depth sorting.

    I´m planning on supporting integration with LUX (http://forum.unity3d.com/threads/235027-Lux-an-open-source-physically-based-shading-framework) and Joen is already working on that as well, so I´ll be providing spec/gloss following it standards.

    LUX has a good hair shader, that we might be able to start using as the standard UMA hair shader, as for now we don´t hace one.
    Cheers
     
  21. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Sorry, I did not write that code, and I don't see anything obvious that could cause this error. Do you have any more information about what you were doing/changing? That code does have a special case checking for a bone named "Global" at top of rig. Try comparing rig bones from new race to existing race and check for "Global" bone.
     
  22. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    I use the default bones from "ContentPack_1.1.0.1" , just scale and rotate it to fit my own model, i have no idea about this error.
    Anyone can help me?
    I need to sleep now ,it's one o'clock in the morning.
    Good night.
     
  23. karlog

    karlog

    Joined:
    Nov 13, 2013
    Posts:
    1
    I want to change the UMA character models texture format into RGB24 .

    It is currently in Argb32 Format.

    The purpose is that I want to do a render texture of my main cam and take a screenshot of the character without the background.

    If DLL are needed to be edited for this, then can you please specify which dll I need to edit and what I need to change to achieve the required result.
     
  24. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    229
    Really nice! Thanks for sharing it with us all.
     
  25. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Hi, in the movie on slots&overlays where did you get the boots? Is it in the asset store? Thanks.
     
  26. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745

    I have no idea what you're talking about, sounds to me like what you need is not at all related to uma. The Argb32 vs RGB24 formats have no effects on the background in the scene. Depending on shaders RGB24 may or may not work for some textures. But switching to RGB24 will not remove the background.

    Using Unity Camera layers can prevent the rest of the scene from rendering, such rendering only the character. Alternately you can insert a plane behind the character to conceal any unwanted background.
     
  27. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there =)
    I´ll be updating the AssetStore UMA tutorial with those boots as soon the latest video tutorial of this series is recorded and uploaded.
     
  28. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    I've created several slots and overlays without issue but I'm getting this error on one of my Hair Slots

    ArgumentException: length
    System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Array.cs:971)
    UMA.SkinnedMeshCombiner.CombineMeshes (UMA.CombineInstance target, .CombineInstance[] sources, UnityEngine.Transform rootBone, System.Collections.Generic.Dictionary`2 boneMap)
    UMA.SkinnedMeshCombiner.CombineMeshes (UnityEngine.SkinnedMeshRenderer target, .CombineInstance[] sources, System.Collections.Generic.Dictionary`2 boneMap)
    UMA.UMADefaultMeshCombiner.UpdateUMAMesh (Boolean updatedAtlas, UMA.UMAData umaData, System.String[] textureNameList, Int32 atlasResolution)
    UMA.UMAGeneratorBuiltin.UpdateUMAMesh (Boolean updatedAtlas)
    UMA.UMAGeneratorBuiltin.HandleDirtyUpdate (UMA.UMAData data)
    UMA.UMAGeneratorBuiltin.OnDirtyUpdate ()
    UMA.UMAGeneratorBuiltin.Update ()

    Anyone know what's causing this?
     
  29. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    What material sample are you using on that slot?
    Does it include extra bones?
    Does it include base rig?
     
  30. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Yes it in cludes the base female rig, simple diffuse material, no extra bones.
     
  31. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Simple diffuse material-> You mean UMA sample material or something else?
    If you managed to get other slots working, I´m betting it might be something with the material sample.
     
  32. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Although I selected UMABaseShader in the Material Builder, when I generate the character It says Materials Element 0 and 1 are missing.

    $tehI1eM.jpg
     
  33. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    Hi guys, i found my skinned mesh renderer 's root bone is quite different from default race.my is "Hips", and the default is "Global". Both of fbx use the same bones, does it matter?
     
  34. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    I wouldn´t consider that a problem on creating your own race, if the global bone still exists, but it could lead to different results on calculating bounding box position.
    Cheers

    Edit: As @ecurtz state below, the mesh combiner access the SkinnedMeshRenderer root bone, so this might lead to more trouble than I expected. It´s really important to correct it to Global.
     
    Last edited: Apr 2, 2014
  35. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    The mesh combiner works off the root bone, which could possibly cause the error you are getting. Much as I hate to disagree with Fernando, I'd change it to match, at least for testing.
     
  36. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    Hi Fernando, i am a beginner of blender, could you tell me where is the RootBone of skinned mesh renderer come from? I try to google it,but can not found answer, thank you :D
     
  37. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    On blender, the global bone should be positioned right between the avatar feet.
    But the important step is setting the root bone to global, as you can see on below image.
     
  38. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Just to update everyone else, the hair mesh didn´t had skinning data :)
    Might not be the only problem, but I sugested solving this first.
     
  39. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    I try this before, but it still print error, when i print the rootBone name in CombineMeshes,it revert to default name "Hips",so i look the source code ,found this
    Code (csharp):
    1.  
    2. public void UpdateNewRace()
    3.     {
    4. ……
    5. umaChild = Instantiate(umaData.umaRecipe.raceData.racePrefab) as GameObject;
    6. ……
    7. }
    8.  
    and the RootBone used in SkinnedMeshCombiner
    Code (csharp):
    1.  
    2. public static void CombineMeshes(ref CombineInstance target, CombineInstance[] sources, Transform rootBone, Dictionary<Transform, Transform> boneMap)
    3.         {
    4. ……
    5.                 var sourceBones = rootBone == null ? source.bones : CloneBoneListInNewHierarchy(rootBone, source.bones, boneMap);
    6. ……
    7. }
    8.  
    It looks like the rootBone in SkinnedMeshCombiner is revert by Instantiate?
     
  40. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Hi guys!

    Not sure if there's a better place for this but I wanted to share a couple of tips for using Maya for content creation.

    Tip #1 When you import the base meshes into Maya you'll notice that the transforms are 90,0,180. This means that your custom content has to have these transforms. Do this right before you skin.

    1. Edit->Delete all by type history
    2. Rotate model 90,0,180
    3. Modify->Freeze Transforms
    4.Rotate model 90,0,180 again so it's back in the right position/
    5. Smooth bind.

    Tip #2

    If you're using the base mesh to model clothing that approximates the shape of one of the base mesh parts
    1. Click the piece of the separated mesh you want to use (torso, legs etc.)
    2. Edit->Duplicate

    After you're done using the duplicated mesh to model the clothing asset
    3. Skin->Bind Skin->Smooth bind
    4. Click the UMA Base mesh piece, hold shift then click the piece you duplicated
    5. Skin->Edit Smooth Skin ->Copy Skin Weights
    6. Delete the base UMA Meshes and export all

    I've come across some problems that seemed to arise from having multiple UV channels so if you get a 'length' exception in Unity when trying to load your Slot make sure your mesh only has a single UV channel.

    I'm not a Maya pro but just wanted to pass along the few things I've figured out by myself and with the help of the great UMA community.
     
  41. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    Thanks, Hedonsoft!
     
  42. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    No problem :) If you run into any issues let me know. I'm more than happy to help you figure them out.
     
  43. Deleted User

    Deleted User

    Guest

    Is it possible to just put the specular in the alpha channel in Photoshop instead of using the material drag and drop?

    Also, can you have colors for different parts on things like armor by using a single alpha map or is it a single color only?


    (Haven't tried it yet. Will be trying it out probably tomorrow.)
     
  44. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    229
  45. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  46. Deleted User

    Deleted User

    Guest

    What's the difference between SLtoUMA.blend and UMA blender?
     
  47. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Yes, if you know what you're doing it is quite possible to create the right texture in photoshop all we do is shuffle channels around.
     
  48. losetear

    losetear

    Joined:
    May 28, 2013
    Posts:
    9
    Hi ,
    I fixed this error, the causes of error was used the wrong rootBone, and i linked "myRenderer" of umaData to the fbx file.so when code Instantiate new go,the rootBone revert to the wrong target.
    $捕获.PNG
    when i link it to race prefab's skinned mesh renderer and fix the rootBone, error disappeared.
    Thank you all for your help :D.
     
  49. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there =)
    Use the Material Builder to generate the slots, as showed on this new video tutorial series.

    I´ll work on the latest video for slots Overlays and start the one for new races, that might be useful for the steps you´re working on as well.

     
    Last edited: Apr 3, 2014
  50. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    I'm the last person who should attempt to answer a technical question, but I believe UMA.blend is the one you want to use for making clothing.

    While a lot of the videos give some insight into UMA, for clothing creation it's probably best to start with with this one and then move through the "slots and overlays" series.

    SLtoUMA is, I think, for importing Second Life textures.