Search Unity

UMA - Unity Multipurpose Avatar on the Asset Store!

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

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Yes, but you either have to use a modelling app that doesn't recalculate the normals, figure out a way to make Blender stop the normal recalculation at the seam, or create a seams mesh to fix them up. I'm not an advanced Blender user, so there might be a way to stop it from doing that.

    edit: this guy seems to have a technique for that:

     
    Last edited: Apr 21, 2020
  2. ChickenHero

    ChickenHero

    Joined:
    Jul 18, 2016
    Posts:
    79
    Thank you, Haimi.
    I could understand immediately after watching the video.
    The clothes are tied together.
     
    Jaimi likes this.
  3. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Thanks, about updating my project, do I have to delete all UMA folders and reimport the package or can I directly import the new version on top of the old version?
     
  4. rkk001

    rkk001

    Joined:
    Jun 16, 2016
    Posts:
    3
    Heya, sorry if this has been asked before but i'm having an issue where it looks like an edited mixamo animation is coming out tilted? Theres no weird deformations or anything, it just seems like the entire model is rotated a bit.
    upload_2020-4-21_20-4-47.png
    it's a bit problematic because in the scene viewer he looks like he's going to tip over. I don't know what's causing this or where I might start looking for a potential fix, but this is what i did:
    First in blender:
    1. i uploaded to mixamo the mixamo fbx for the UMA body found in the content maker pack, and then downloaded one of the animations as a .dae so that I could edit it in unity (Other formats wouldn't import properly for me)

    2. in blender i added some rotations thru the dopesheet and graph editor.

    3. then i saved as a blender file

    In Unity:
    1. I uploaded the mixamo uma model and downloaded the T Pose so that I could create an avatar from it within unity. I used this avatar for the animations i edited.

    2. I baked the Y axis rotation so that it would face forward in the animation tab for the edited animation file.

    I think that's pretty much it, in the unity preview shown in the screenshots above, i used the unified male body and it seems to look fine, but in the game, when i apply that animation to the UMA dynamic avatar it comes out tilted as seen in the screenshots.

    Anyone know why this might be happening, or some potential fixes? I was thinking if I couldn't figure it out, I would just hardcode a compensating rotation on the transform for whenever this animation is applied, but I'd rather avoid doing that...

    Any help would be much appreciated.
     
  5. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Best to save any extra content and delete the folder before importing.
     
  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Try switching the tpose on the racedata to the mecanim friendly version. Otherwise, might need to adjust the mecanim avatar in the editor on the animation. Some of the issue seems to result from your game character being much more physically fit than the other model.

     
    rkk001 likes this.
  7. rkk001

    rkk001

    Joined:
    Jun 16, 2016
    Posts:
    3
    Switching the tpose seems to have fixed it, whew! Thanks a lot!
     
    hopeful likes this.
  8. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    You're wecome. The Mecanim tposes will be the default in 2.10, should have done that earlier.
     
    TeagansDad and rkk001 like this.
  9. unity2

    unity2

    Joined:
    Jan 10, 2013
    Posts:
    23
    Hi,

    I am using UMA in mobile and having 6-7 characters at a time on screen. But fps is quite low on device. Any tips for optimization especially skinned mesh renderer. Unity docs suggest bones should be less than 30 but UMA have 157 bones. How can I reduce bones. Thanks in advance.
     
  10. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Absolute first thing you should do is lower the atlas texture size, and increase the "Initial scale factor" on the generator, to make sure you are not overbooking RAM. This is the leading cause of slowdown when using UMA.

    if you really need to do bone baking, I believe that was a feature of the UMA Power Tools:

    https://assetstore.unity.com/packages/tools/modeling/uma-power-tools-2-14249
     
  11. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hello again, I'm trying to implement aging blend shapes from daz character to UMA, and I found even if the mesh shape do change to a child, the skeleton is still adult's. And the animation will tear the child mesh apart. Is there any solutions in UMA to deal with dynamic bone structure?
     
  12. maewionn

    maewionn

    Joined:
    Jan 18, 2016
    Posts:
    38
    Heyho, might be noobish question, but here I go.

    I just imported the standart UMA girl, gave her some clothes via recipes and added in a few animations and switch between them.
    No matter which animation I choose, the UMA Char talks all the time.

    When I remove her expression set, she obviously stops talking, but has her mouth open and no other mecanim facial animations trigger, no matter how I set the override flags in the Expression Player.

    Additionally, if I try to set her expression via standalone script, the "default behaviour", aka talking, seems to override whatever I do.

    How can I fix this?
     
  13. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I'd recommend implementing big shape change DNA with bones, instead of with Blendshapes. Also, be sure you are using 4 bone weights per vertex in your quality settings.
     
  14. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    The talking animation is actually on the controller "Locomotion with head". You can change that in the DCA settings to "Locomotion" or whatever you want.

    The gaping mouth issue is because the Jaw is mapped in Mecanim, and that's what happens with Mecanim if you don't supply a jaw animation, but you have mapped the jaw. You can either switch out the TPose on the race to use the no-jaw version, or you can add the expression player which will force the jaw closed.
     
    hopeful and maewionn like this.
  15. givizator

    givizator

    Joined:
    Oct 23, 2018
    Posts:
    30
    Hey :)

    Is there any documentation on how to have a lot of wardrobe assets in the project but not load all the textures/assets before they are used ?

    I saw the new version 2.10 with addressable assets, which I guess might be the solution, is there any documentation on how to setup things to do that with it ?

    Thanks !
     
  16. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    It includes documentation on how to setup the addressables. By default it will behave as you suggest if you have addressables enabled, and you generate the groups.
     
  17. givizator

    givizator

    Joined:
    Oct 23, 2018
    Posts:
    30
    Sorry, I just saw the documentation a few seconds ago as I was looking for it rather online.
    My bad, I'm digging on it right now !
    Thanks :)
     
  18. givizator

    givizator

    Joined:
    Oct 23, 2018
    Posts:
    30
    Can you explain how the label system works to load the appropriate assets ?

    For example, I've added a new asset once the basic setup was done and worked well, and I've set it up into the addressable and rebuilt the system :



    But when I load a basic scene with a UMADynamicCharacterAvatar Human Male, I see that all the assets related to that Wanderer clothes are loaded, even if I'm not using them.

    So I'm guessing that it's because of the label system as they are taggued UMA_Base ?
    But if it's the case and all assets are tagged UMA_Base, they'll also be loaded too even if never used.

    What am I missing ?
    Thanks !
     
  19. givizator

    givizator

    Joined:
    Oct 23, 2018
    Posts:
    30
    Ok so I think there is a few bugs.
    I do the initial install and everything works fine.

    Then I had a new asset in the global library, regenerate the addressable and once it's done, Unity freeze, so I kill and restart it.
    Then I rebuild the addressable build.

    Now I have this error when I run the scene that was working :


    And if I try to rebuild the UMA addressable again, I have that error :


    At that point, the only solution is to clear the UMA database and redo the whole process again.

    Also, when I redo it, the assets Wanderer I was talking about are no longer loaded when they are not used, so I guess that was more related to that than the labels things.
     
  20. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    UMA will label everything with UMA_BASE. Everything else gets labelled by the recipe that it's in.
    if you use the "fast" option, it will stick everything in a single group (shared items), and that is flagged as "pack separately", so everything generates it's own asset bundle.,

    When a character is built, it gathers all the recipes, and then tells the addressable system to load the labels for those recipes. It doesn't ever tell it to load UMA_Base -- that would defeat the purpose. That's there for if someone wants to manually load them.

    After a character is generated, the previous recipes are then scheduled to unload. (the time is adjustable on the generator). Everything is reference counted, so nothing unloads unless it's completely unused.

    In the editor, Unity will of course reference and load a ton of items, and doing things in the Global Library will cause things to load also. So you can't just look at usage in the editor without being very careful about what you access. The simplest thing to do is to exit Unity after everything is setup, and then reload and run immediately. Then you can track memory usage with the memory profiler.
     
  21. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Are you using the version from the develop branch? Because that line of code is complaining about this line:

    if (IsUMAGroup(group.name))

    The only way that can through an error is if you have a null group in your addressable settings, which I'm not even sure how that would happen.

    If you're not on the develop branch, please upgrade so I can match your error to the code.

    As I mentioned in the previous message, it's complicated to track loading/unloading in the editor. You have to actually use bundles (in the play settings) and you have to not touch anything in the editor, and that includes doing anything with the UMA Global Library.

     
  22. Aimed

    Aimed

    Joined:
    Jan 7, 2014
    Posts:
    9
    Hello Jaimi,

    Thanks a lot for creating such a wonderful tool. UMA is amazing!
    I'm trying to create these different characters where one of them is buffed and one is fat and I have two different textures with full bodies for that. I've tried to create ColorDNAConverter to blend between them as overlays but it doesn't work. Nothing happens. What am I doing wrong?

    Thanks in advance,

    Valentyn
     
  23. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    You're welcome from all of us - it's definitely been a group effot.

    Color DNA is the correct way to do this. Since I don't know what you've done, all I can suggest is to look at the "Elf Or Alien" DNA that does this. It blends colors and normal maps using the colors on the overlays. It's exactly what you need.


     
  24. qpuilie

    qpuilie

    Joined:
    Jan 14, 2020
    Posts:
    69
    Thank you very much
     
  25. Aimed

    Aimed

    Joined:
    Jan 7, 2014
    Posts:
    9
    According to "Elf Or Alien" example it blends only normal maps. It doesn't blend between actual textures. All overlays use the same texture but different normal maps. I have actual textures of a fat guy with a big belly and a skinny muscular guy. How can I approach this? Or where should I look in the code to implement this myself.
     
  26. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Elf Or Alien blends both the diffuse (channel 0) and the normal (channel 1). It's exactly what you need to do.

    EldOrAlien.png
     
  27. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    UMA 2.10 has been pushed to the asset store, pending review.

    What's new in 2.10
    Minimum supported version is 2018.4
    Requires .Net 4.X compatibility in player settings.
    Important: In this version, the DynamicAssetLoader is only kept for compatiblity with old projects. To use Asset Bundles, you should either use Addressables, or manually download them and load them into the library.
    Support for Addressables
    Automated generation of addressables groups (including LOD slots)
    Automated labelling of indexed items by recipe (including LOD slots)
    Automated cleanup of slots/overlays/textures
    Significantly reduced memory overhead
    Build requests are queued up with all relevant data
    Added recipes to Addressables. If you do this, you must load them before access (they are all labelled by recipe and with 'UMA_Recipe')
    Will now Keep shared group on regeneration.
    Can now filter on non-added recipes.
    Can now individually choose to add a recipe to addressables, or to update a recipe.
    Plugin system to customize how addressables are generated.
    New global library window
    New functions to mark items by various parameters
    New Addressables Menu to generate items
    New Ability to remove unused slots/overlays using the addressable groups (Remove Orphans). Requires generating labels from recipes.
    New Ability to remove items from library by dropping a folder onto the lib
    Repair function will now attempt to repair addressable item groups and labels
    Can view if an item is in resources, or addressable now
    Protected resource items from being deleted as orphans
    Added a label field to recipes to allow the user to override addressable label names
    Moved Mesh Hide mask creation to mesh building, to address sync issues
    Updated DNA checks to pull from global library instead of searching resources. Fixes an issue on android
    When the animator is rebuilt, the layer weights are saved and restored now
    LoadFromRecipeString now has a flag to clear the existing wardrobe when loading
    Added SetRawColor function (and code) so you can pass in an OverlayColorData and the sytem won't monkey with it
    UMAMaterial Changes
    Added checkbox to use the overlay multiplier color as the background for alpha blended overlays.
    Added a multiplier to allow adjusting that color. This improves the look of hair (gets rid of banding on the edges)
    Added a "Non Shader Texture" flag to the texture channels. This allows a texture to be combined, but it will not be set on the material.
    Added menu option to convert all UMAMaterials to use LWRP/URP material property names. you will still need to run the unity update utility in addition to this.
    Added Animation Clip Target Renamer to help with renaming targets for UMAs when the animation is broken
    Reworked compatible races recipe loading, so they are figured out in the index at startup
    Context changes
    Created a new UMAGlobalContext context that pulls everything from the global library.
    (This removes the need for the various libraries - racelibrary, slotlibrary, etc.)
    All access to UMA data now goes through the contexts.
    Created new prefab UMA_GLIB using the global context. It is recommended to switch to this version in 2.10.
    LOD Improvements
    Added "Maximum LOD Level" to SlotDataAsset, and Suppressed flag to SlotData for use by LOD systems
    Added "Use Slot Dropping" to UMASimpleLOD, this will suppress slots based on the fields above.
    By default, the eyebrows, eyelashes, and Inner Mouth are set to drop after LOD 0. Eyes are set to drop after LOD 1.
    Ability to hide slots by Slot tag.
    Added support for 32 bit index buffers (large meshes). To enable, add UMA_32BITBUFFERS to the player defines. This is experimental at this time.
    Verify button in Slot Builder Window will detect UV Coordinates that are out of range.
    Added Elf male and Elf female races with base race recipes.
    CollisionMatrixFixer will read the current layermask settings for Ragdoll and NoCollisions, and use those if found.
    Added "AutoSetLayers" property to UMAPhysicsAvatar. When set, the player layer will be the current gameobject layer, and the Ragdoll layer will be read from the layermask settings.
    Added Shader Parameter Mapping to UMAMaterial - UMAMaterials can now map shared colors to color properties in the generated material. Useful for shaders that have extra color parms (like skin & hair shaders).
    Added "AtlasResolutionScale" to DynamicCharacterAvatar. Using this, you can lower the atlas resolution for specific avatars, for example ones used for icons, etc. Warning: UMASimpleLOD can override this, so don't use in conjunction with that component.
    Added "Resources Only" flag to UMA recipes. Checking this will skip adding this recipe, and it's slots, overlays and textures to Addressabe groups.
    New Menuitem on UMA Menu: "WebGL/Enable Embedded Resources". This will turn on embedded resources in WebGL, allowing UMA to work right in WebGL.
    Overlay coordinates can now be specified in UV range (0..1) in addition to absolute range. This should make it much easier to handle Unity converting textures to square on mobile, or the need to resize textures for performance.
    New Detail Normal map texture channel type, allows combining of normal maps in UMAMaterials (standard renderer only at this point)
    New Non-Shader texture channel type, allows a texture to be accumulated on the atlas, but not sent to a material.
    The first RuntimeAnimatorController for compatible races will now be added if a race specific controller is not found.
    You can now pass a constructed DynamicCharacterAvatar to the UMARandomAvatar.Randomize() function to regenerate it randomly.
    New scene ("OverlayAligner") to convert and adjust overlay coordinates visually.
    Performance improvements - up to a 5% increase in speed when building under 2019.3 due to boneweight optimizations.
    Added support for more than 32 wardrobe slots (problem with Masked Field editor)
    Added DefaultRendererAsset property to DynamicCharacterAvatar. This lets you set "UpdateWhenOffscreen", the renderer name, etc, for the default renderer. If you don't add a DCA Renderer Manager, or setup a Renderer Asset for a slot, this one will be used to set renderer properties.
    Standard Races now use mecanim-friendly avatars by default
    New "How To" scenes
    * How to construct a DCA from scratch
    * How to construct and load a DCA from a prefab
    * How to load and save a DCA to a string
    * How to use a slider to control DNA
    Various bug fixes & changes
    Fixed various overlays that were missing textures or had the wrong count
    Fixed some scenes that had broken over time
    Sometimes a shader would not be compiled correctly.
    Reworked recipe editor and disallowed duplicate mesh hide assets.
    Fixed bug where you couldn't add a Wardrobe Collection using SetSlot before Start() was called on the DCA.
    Fixed bug in 2019.3 where it was not finding the type for RuntimeAnimatorController in build.
    Fixed bug where WardrobeCollections would end up indexed in multiple places
    If you supply an avatar and animator from the project, it will no longer attempt to delete the avatar when changing the race
    Many more bugs/fixes/updates.
     
    hopeful and ChickenHero like this.
  28. Aimed

    Aimed

    Joined:
    Jan 7, 2014
    Posts:
    9
    That's exactly what I am doing. If you'll look at "M_Bod smooth" overlay texture it is the same one as the actual texture.
     
  29. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Supply your own overlay(s) with your own fat guy textures, and then blend whatever texture channels you want to blend, by modifying the alpha of the color channel like ElfOrAlien does.
     
  30. Aimed

    Aimed

    Joined:
    Jan 7, 2014
    Posts:
    9
    I am doing that, it doesn't work. Please, take a closer look at ElfOrAlien sample. There're 3 overlays there and all 3 of them use the same texture, difference is only in bump maps.
     
  31. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hello, I met a very strange issue with my custom race:
    I've got my custom race set up correctly in Editor and in build on my PC.
    upload_2020-4-27_14-18-45.png

    But when the build runs on other PCs, the character's chest becomes strange:
    upload_2020-4-27_14-19-48.png

    I tried to pack the meshes and textures into resources or addressables and build them. No help, still weird on other PCs. And for this cannot be reproduced in Editor, I really don't know how to debug it.

    Any insights on this matter?

    Edit: It seems like the two vertices are not binded to corresponding bones and kept the original T-pose positions. They are in the correct position when the character is in T-pose. I've tried to rebuild the torso slot but this issue remains.

    Edit2: The slots and recipes of the race was created in a Unity 218 project, and the build of that project has the correct look on all PCs. I cleanly imported latest UMA into current Unity 2019 project and copied all the data for this race to the new project, and added them into the global library. All works correctly in Editor, other PCs also got correct results when in Editor, but no matter which PC we use to build the project. The build will always show that vertex issue exept on my PC.
     
    Last edited: Apr 27, 2020
  32. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I'm assuming when you setup your overlays, that you would NOT just duplicate the same diffuse texture. I think you are missing some fundamental pieces of the way that UMA works, and what overlays do.

    I recommend watching Secret Anoraks videos, especially the 100 and 200 series. As well, there is some helpful docuementation in the UMA folder.
     
  33. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208

    Be sure that your quality settings has 4 bone weights (skin weights) per vertex on every quality level. Some quality settings set this to 1 or 2, and it will cause Unity to discard weights at runtime.
     
  34. Aimed

    Aimed

    Joined:
    Jan 7, 2014
    Posts:
    9
    Of course! My diffuse textures are different and I want to blend them, so I use channel 0 and do exactly as in "ElfOrAlien" example but it won't blend, it blends only channel 1! And even in "ElfOrAlien" example it doesn't blend channel 0 and blends only channel 1. Both used overlays in "ElfOrAlien" example have the same diffuse texture. Please, could you double check and confirm this?
     
  35. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I *did* double check. It does exactly what you want.

    I edited the "m_bod smooth" overlay to have a different diffuse texture. (There's actually a smooth body texture. I used that one). I drew a star on top of the smooth body texture. Then tried Elf or Alien... and it worked.



    Something must be wrong in your setup. Check your materials, check your overlays, check the setup of the DNA, etc.
     
    kenamis likes this.
  36. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
  37. arteria

    arteria

    Joined:
    May 31, 2007
    Posts:
    2,189
    hopeful and Jaimi like this.
  38. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Got the issue solved, turns out not only on the mesh you have to set the skinned quality to 4 bones, in the quality settings you also need to set all the quality levels to use 4 bones, or low graphic quality levels will bring you expanded breasts
     
    hopeful likes this.
  39. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    331
    Hi Jaimi,

    Do you have any tips for easily swapping the shaders on an UMA at runtime? Basically I want to give players a choice between two distinct shader styles.

    I was considering having an alternate recipes for each item, but that feels like it might be a little tedious to set up and error prone.

    Another option I'm considering is setting the alternative shader directly on the UMARenderer materials every time the UMA finishes updating its recipes, but this solution still feels a little convoluted to me.

    The cleanest solution I've come up with so far is swapping the material on the few UMA Materials I am using across the project (assuming they have matching material properties and property names). This feels like the most reasonable solution to me, but I don't like that it changes the UMA Materials directly in my project instead of changing an instance of them.

    Any advise would be greatly appreciated!

    Thanks
     
  40. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I would modify the UMAMaterial, and swap in a material and change texture keywords as needed. Would definitely be the least work and the cleanest way.

     
    Graham-B likes this.
  41. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    331
    Thanks Jaimi, that's where I was leaning too.

     
  42. andrew_unity628

    andrew_unity628

    Joined:
    Apr 1, 2020
    Posts:
    9
    I'm generating my character at runtime by instantiating a preface based on DymanicCharacterAvatar. That's working fine, but then I'm trying to immediately add a sword game object to their right hand, as shown in the MountObject sample scene. There's a race condition, as adding the sword GameObject as a child of the RHand GameObject fails due to the UmaData not existing yet. What's the recommended way of solving this? I can write custom events to hook after the Avatar's UmaData is initialized, but before doing so I'm wondering if there is a more appropriate approach.
     
  43. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    112
    Uma 2.10. Trying to apply to Global Index new files which I manually loaded from Addressable.
    Calling method UMAAssetIndexer.Instance.ProcessNewItem(raceData, true, false)

    What am I doing wrong?
    upload_2020-4-29_11-40-33.png

    Exception (Android):
    Code (CSharp):
    1. W/Unity: Exception in UMAAssetIndexer.AddAssetItem: System.ArgumentNullException: Value cannot be null.
    2.     Parameter name: key
    3.       at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00000] in <00000000000000000000000000000000>:0
    4.       at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) [0x00000] in <00000000000000000000000000000000>:0
    5.       at UMA.UMAAssetIndexer.AddAssetItem (UMA.AssetItem ai, System.Boolean SkipBundleCheck) [0x00000] in <00000000000000000000000000000000>:0
    6.       at UMA.UMAAssetIndexer.ProcessNewItem (UnityEngine.Object result, System.Boolean isAddressable, System.Boolean keepLoaded) [0x00000] in <00000000000000000000000000000000>:0
    ------------------------ UPDATE
    I added log line of code in UMA AddAssetItem
    And got that the ai._Guid is NULL.
    How to fix it?

    ------------------------ UPDATE
    Lol, looks like GUID is not null just in Editor. It doesn't have a sense.
    Does it mean I can't manually load UMA files then index them?
     
    Last edited: Apr 29, 2020
  44. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hello again, I ran into some problems with setting multiple colors in one material:
    upload_2020-4-29_17-2-47.png
    I have a hair shader that can let me change the root and tip color for more interesting hair looking, I tried to use shared color to control these two colors by setting them on different channels:
    upload_2020-4-29_17-6-12.png

    But the shared color on the avatar seems only use the first channel's color to set to all colors:
    upload_2020-4-29_17-8-8.png
    upload_2020-4-29_17-8-25.png

    Any suggestions on changing multiple colors in one material?
     
  45. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    That script relies on the UMAData existing to find the bones, so if you want to use it, you will need to wait for the character to be constructed before enabling it. You can do this in the CharacterCreated event.
     
  46. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    ProcessNewItem is exposed specifically so you can add items at runtime.

    It looks like the #endif is out of place there. That should be editor only code.

    This:
    Code (CSharp):
    1. #endif
    2. #endif
    3.                 TypeDic.Add(ai._Name, ai);
    4.                 if (GuidTypes.ContainsKey(ai._Guid))
    5.                 {
    6.                     return false;
    7.                 }
    8.                 GuidTypes.Add(ai._Guid, ai);
    9.  
    should be changed to:

    Code (CSharp):
    1. #endif
    2.                 TypeDic.Add(ai._Name, ai);
    3.                 if (GuidTypes.ContainsKey(ai._Guid))
    4.                 {
    5.                     return false;
    6.                 }
    7.                 GuidTypes.Add(ai._Guid, ai);
    8. #endif
    9.  
    I'll fix this in the next point release (2.10.1) which will inevitably follow in a week or two.



     
  47. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Oh - as well, if you want UMA to manage the loading/unloading of the addressable assets, you can call LoadLabelList() to have UMA load the addressables for that label into the system, and manage it.

     
  48. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    That code relies on the shared colors being set in the overlay.

    You can use the shared colors to "shader parameter mapping" on the UMAMaterial to dynamically map the current shared colors to the material.

     
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    BTW, a slightly belated congrats to the UMA community for reaching the 200th page on the thread. :)
     
    Jaimi likes this.
  50. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    And this is the 10,000 post!

    And so it's not wasted, there are a few small issues reported. I'll likely release an update in 2 weeks or so that contains small fixes.
     
    Deleted User and Wolfmoss like this.