Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

UMA Power Tools Support (v. 2.9)

Discussion in 'Assets and Asset Store' started by UnLogick, Jan 7, 2014.

  1. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
    I am mainly interested in the save to prefab option from the package so maybe there is a way to only use that feature? thanks
     
  2. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
    I am using the HDPR-feature branch of UMA but have the same error on the original UMA asset store download.
     
  3. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
    I am interested to save UMA characters as prefabs during iOS runtime, have you tested the prefab save option on iOS? What is the current working version of UMA with UMA Power Tools 2? Thanks!
     
  4. Bantichai

    Bantichai

    Joined:
    Nov 6, 2016
    Posts:
    114
    Hey @UnLogick

    Just checking in, any hope of an update to 2.8 this week or early next week?
     
  5. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
    Hi!

    I got Power Tools to work with UMA 2.8 (with some great help in the main UMA thread) and I have created a prefab that has some UMA components attached to it. Is it possible to get a clean baked character with the new selected clothes and face/body DNA without UMA components/scripts? I need the new character prefab to it to be integrated in another iOS game (without UMA). Thanks
     
  6. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    @Bantichai I'm afraid not, I hit some problems with the latest features breaking power tools in a bad way... what looked like a walk in the park turned out to be more troublesome. Basically several of the new features manipulates transforms directly rather than through the umaskeleton. Naturally this doesn't work with power tools bone baking where the transforms is created late and some transforms isn't created at all. As soon as time permits it I'll find a solution for this.

    @Admin_Friend_Factory Welcome!
    Glad you got it working and sorry I wasn't around to help with that. I do have a compiling version I could put up on the asset store once I find a minute.

    If all you want is the save to prefab option (without bone baking) that should work with any uma feature, as long as you're inside the editor. The generated prefabs should not reference uma and work on any platform including ios.

    It is impossible to save prefabs from standalone/ios builds, since the unity api simply isn't available. Under such circumstances you'd need an fbx exporter or similar.
     
  7. Bantichai

    Bantichai

    Joined:
    Nov 6, 2016
    Posts:
    114
    That's all good then, I've gone ahead and worked your fix in and I think so far it's looking good, but I've run into another problem. Generally, if I save a prefab without bone baking, I can import that prefab into a new Unity project without UMA or even power tools and it would work fine. However, I've run into some issues now that after I drag over a converted prefab into a new Unity project, the prefab itself only comes with the "Root" and "UMARenderer" components and the mesh and materials are not attached.

    I'm quite perplexed as to the issue, I tried reverting the script back too and I've tried importing a prefab with and without bone baking and still can't get the model to show up. The only other thing I can think of was that I recently installed the "Unity mitigation tool". Converted prefabs that I made prior to installing the mitigation tool still work but any prefab made after gets the issue I mentioned above. So the question is, do you know if the mitigation tool interferes with Power Tools in anyway? All the new prefabs now just say that they are missing scripts .
     

    Attached Files:

  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,818
    Once you create a prefab with this tool, can the prefab be used in a project without having UMA installed at all?

    Also, the store page states the following:

    * Also note that the latest 2.6 features Cloth and Blendshapes are not supported by the Bone Baking yet!

    Does this mean that a prefab won't work with SALSA?
     
  9. Bartek_Gudowski_Friend_Factory

    Bartek_Gudowski_Friend_Factory

    Joined:
    Feb 18, 2019
    Posts:
    54
    Thanks! Are you aware of any FBX exporter that can generate a mesh and texture from UMA during iOS runtime? Or any other suggestion how to create characters during iOS runtime? Many thanks!
     
  10. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    No, but please explain why you need to. If you have UMA at runtime on iOS you can easily recreate the uma character next time your app is launched. Simply save the recipe instead of the mesh and let UMA recreate the character.
     
  11. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Bone baking and Prefab creation is two completely separate features.
    • The bone baking removes the uma adjustment bones such making a lean mecanim humanoid. I have a beta version that supports blendshapes if need be.
    • The prefab functionality saves the mesh, avatar and texture into your unity project, this will work with blendshapes.
     
    Mark_01 and magique like this.
  12. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Just to clarify the correct way to move a converted prefab between projects is to copy the prefab along with the associated textures and all the corresponding meta files. Also you must also ensure that all remaining scripts and shaders referenced by the character exists in the target project. Only the "known" UMA scripts are removed, there might be other scripts left on your characters.

    But I think the real problem is that some unity api must have changed because I'm getting a 150kb prefab when I generate my prefab, this turns into a 2mb prefab when I save my project... :(

    So try saving your project before you copy the prefab to your new project and see if that helps... I'll make sure to fix this in my next update.

    Edit: Initial tests indicates that simply adding a AssetDatabase.SaveAssets(); to line 145 of PowerToolsRuntime.cs does the trick.
     
    Last edited: Mar 11, 2019
    Bantichai and Mark_01 like this.
  13. Bantichai

    Bantichai

    Joined:
    Nov 6, 2016
    Posts:
    114
    Thanks for the quick reply! Saving the project after creating a new prefab has more or less fixed it now. The only caveat is that after transferring a prefab along with all its textures etc into a new project, I need to reassign the textures back to the materials associated with the prefab. That's not really a big issue, I can live with that but I just thought I'd bring it up anyway.

    My other question is, does the bone baking feature disable the UMA mesh hide feature that was introduced in 2.7? I guess that makes sense since it alters the skeleton. Just wanted to bring that up as well as I noticed that some of my models now have clipping in areas that they previously didn't when using the more complex UMA skeleton.
     
  14. Bartek_Gudowski_Friend_Factory

    Bartek_Gudowski_Friend_Factory

    Joined:
    Feb 18, 2019
    Posts:
    54
    Hi!'

    The reason we would like to have prefab created in the iOS app is that we would like to use the character in non-UMA environment later. The recipe is an alternative but would require a heavy intergration.

    The "Unity Editor" prefab created with Power Tools and UMA 2.8 in Unity 2018.3.3 still keeps the UMA components.
    Is you have compiling version of the "clean" prefab without the UMA components ready it would be great. When do you aim to push to asset store?

    Thanks!!
     
  15. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    If you copy the meta files along with the textures the material mapping should work! Use an explorer window to copy it, don't just drag and drop inside of unity. Alternately you can go through the tedious process of exporting a unity package, but copying the files is much easier.

    The mesh hide feature of 2.7 is not supported, power tools have it's own mesh hide feature, so this should be trivial to for me to incorporate once I get a bit of time.
     
  16. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    I think I'm confused, iOS apps runs on iOS devices therefor they cannot create unity prefabs. You can only create unity prefabs inside of the unity editor.

    So when you say you create prefabs and they have uma components on them you must be running in the editor, right? If you're inside the unity editor it doesn't matter that your target is set to iOS you're still running in the editor. And then the only problem is that some uma components are not removed, which components isn't cleaned up properly?

    If you're a coder you can find the current cleanup of uma components in PowerToolsRuntime.cs: 117-127, it is easy to see how this can be improved, I'll add making a proper cleanup system to my to-do list. :)

    Edit: Cleanup System updated, now removes any monobehaviour in the uma namespace.
     
    Last edited: Mar 13, 2019
  17. Admin_Friend_Factory

    Admin_Friend_Factory

    Joined:
    Oct 23, 2018
    Posts:
    24
    Hi! Thanks!
    Yes, I want to find a solution to create prefabs on the iOS devices but I understand that the current version requires Unity Editor functions. If you have an idea how to start to R&D this solution please let me know.
     
  18. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Making a prefab on device makes no sense to me. A prefab is a construct that can only be imported into the unity editor. In theory you could reverse engineer how unity stores the data in the prefab, and write the yaml file on device. But I'd consider it more sane to export an fbx file, but to my knowledge there is no fbx exporter for unity that will correctly export multi material skinned meshes on iOS. Honestly I think it would be best to set up a service where you send the uma recipe and have an instance of unity which builds the prefab for you.
     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,818
    I bought Power Tools today and am very interested in support for Blendshapes with bone baking.
     
  20. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Send me a private message with your email address and I'll send you the beta.
     
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,818
    Sent.
     
  22. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,392
    Hi UnlLogick,

    Could I get sent a beta version as well? Does the "support for Blendshapes with bone baking" mean that it will work with the "expressions" player now? It's been a while since I've worked on my project that uses your system, so I'm trying to relearn it a little bit again.

    I'll send you a pm as well.


    By the way, when I updated from UMA 2.7 to UMA 2.8 I'm getting a "The namespace 'UMA.Editors' already contains a definition for 'RaceInspector'. Any idea on how to get around that? I was trying not to have to completely delete the last version, but maybe I should?
     
    Last edited: Mar 17, 2019
  23. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Unfortunately I've been informed that my beta doesn't work with the latest asset store release. I will deal with this asap (hopefully in the weekend).
     
  24. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    The problems with the Power Tools Beta have been fixed and it now works with UMA 2.8.1 RC 2. (Thanks to @davidosullivan for taking the time to slack with me to find appropriate compromises between uma vanilla and power tools)
    https://github.com/umasteeringgroup/UMA/releases/tag/V2.8.1RC2

    Unfortunately I found a serious bug that will most likely delay the official 2.8.1 release.
    https://github.com/umasteeringgroup/UMA/issues/250

    But whenever uma 2.8.1 is released I can push the release button for power tools!
     
    Teila, hungrybelome and HeadClot88 like this.
  25. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,818
    @UnLogick I'm trying to create prefabs using UMA Power Tools, but it doesn't seem to work on o3n race variants. Is this expected not to work with those?
     
  26. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Prefabs should work with all uma variants! This should be treated as a bug, can you write down some clear repro steps. Including the exact list of o3n race assets you're using and a recipe that causes the problem.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,818
    Very simple. Here are my repro steps:

    1. I opened the provided o3n scene for the Female Orc variant
    2. I modified the eye type, and the skin color
    3. I Selected the character in the scene view and used the power tools option to save as prefabs.

    The resulting prefab was just invisible.
     
  28. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,185
    Not sure this is the problem, but later versions of Unity have been doing this for a bunch of FBX imports as well. You may want to check the material and textures.
     
  29. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    293
    @UnLogick Hello, I just bought Power Tools and I am trying to create prefabs with UMA 2.8.0 on the asset store.

    I'm getting a number of script compile/runtime errors when trying to create a prefab. I tried editing the Power Tools scripts to update to the latest UMA APIs, but there are some cryptic runtime errors I don't understand.

    Can I get access to the beta somehow? Does it work with 2.8.0, or only UMA 2.8.1 RC2?
     
  30. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    pm sent.

    The beta still have two known problems and only works with UMA 2.8.1 RC2 and later.
     
  31. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    293
    Hi, I responded to your PM wth my purchase info a few days ago. Could I get access to the beta please? I've got to bake some prefabs as soon as possible.
     
  32. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    293
    Can anyone who is successfully exporting prefabs with the current Power Tools version please tell me which Unity version and UMA version you are using? I'm deseparate! Thanks
     
    Last edited: Apr 8, 2019
  33. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    33
    Hello, I'm encountering an error when using this. I have Unity 2018.2.2f1, UMA 2.8.0, and am receiving the following error when trying to play:

    Assets/UMA/Extensions/UMAPowerTools/Scripts/UMAImprovedSkeleton.cs(314,24): error CS0115: `UMA.PowerTools.UMAImprovedSkeleton.SetPositionRelative(int, UnityEngine.Vector3)' is marked as an override but no suitable method found to override

    Any ideas as to what might be causing this? Thanks in advance.
     
    Last edited: Apr 9, 2019
  34. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Beta should be in your mail box now.
     
  35. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    The only current version of power tools is my unreleased beta.

    Pm me with your email address and invoice number and I'll send it to you.
     
  36. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    33
    Hi, received the beta, for some reason it imported to the Assets folder, I moved it to Assets/UMA, the previous error is still there as well as a new error:

    Assets/UMA/Extensions/UMAPowerTools/Scripts/UMAImprovedSkeleton.cs(579,27): error CS0115: `UMA.PowerTools.UMAImprovedSkeleton.GetRelativePosition(int)' is marked as an override but no suitable method found to override

    Any ideas? Thanks
     
  37. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    Grab the latest uma release candidate here:
    https://github.com/umasteeringgroup/UMA/releases
     
  38. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    33
    Imported the latest UMA, imported powerTools, did some quick prefab making and everything looks nice. A little problem with the wardrobes of the randomly generated characters (they do no carry over to the prefab once it's made, just a solid color for the clothes) but I'll look over the scene and figure out where the wardrobe parameters are. Nice tool!
     
  39. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    33
    Hi, have been working with the tool and it's good so far but have 2 questions about it (I watched the videos but may have missed these settings). First, the clothes on the UMA characters look right in Game view but not in Scene view. When I save the prefab and place them into another scene they still have a low-res look, as shown in the attachments. Is there a setting to increase the resolution of the clothes when the UMA character is to be saved as a prefab?

    Second, in the UMA Power Tools scene, the characters are spaced very far apart, unlike the tutorial videos where they are close to one another. Is there a setting in this scene to place them closer to one another? Thanks in advance.

    PowerTools1.jpg PowerTools2.jpg
     
  40. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    @rlhalh, I'm almost certain this is caused by the LOD scripts setting the AtlasResolutionScale of the uma character. The prefab is a pure clone of the actual transforms, mesh, textures, etc. It does not actually re-build the character! The solution would be to set it to full lod rebuild it and then make the prefab once that is complete.
     
  41. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    33
    Thanks for the answer. In the scene UMA Power Tools LOD, there's LODController (under parent Power Tools - UMA Setup) where there's a component UMALOD Controller that has LOD settings. Is this where I would change the LOD setting?
     
  42. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    293
    Is it possible to decrease the amount of bones after "Scene Bone Baking"? For my top down game I really need only need say, the head and hand bones. It'd be great if it had some sort of API like AnimatorUtility.OptimizeTransformHierarchy() where you can choose which the bones to keep.
     
  43. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    There is a requirement in AnimatorUtility.OptimizeTransformHierarchy() that the transforms are of uniform scale. UMA scales bones on individual axis and so doesn't match this requirement!

    In the past I've speculated that since I'm already doing re-targeting I could modify it to leave the all the bones with uniform scaling, but it would take a significant effort that I presently don't have time for.
     
  44. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    This is a side effect of running in a scene with the lod system. I'd recommend using a scene without lod to bake prefabs. I'd recommend using one of the serialization scenes that just loads a recipe and then make a prefab from that.
     
  45. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    293
    Darn! Oh well, hopefully one day!
     
  46. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,392
    Hey guys,

    I'm working on being able to use blendshapes (i.e. the expression player) with the skeleton reduction (bone baking) feature. I'm using the updated versions of both UMA (2.8.1 RC2) itself and the Power Tools version (I think, I can't find a version number on this).

    But I'm drawing a huge blank on how to use the bone baking (skeleton reduction) feature again. I'm using the "UMABoneBakingMeshCombiner" in the UMAGenerator, but the expressions are not working if that is all it takes? I can't remember how to do it if it takes more than that. Could I get a quick refresher on how to do it again please, or the video or explanation for it again? :rolleyes:

    I was hoping it would "just work" right out of the box, but I'm pretty sure I need new bones baked in order to get it to work, since I tried turning on the expression player during runtime, and it said I needed an eyelid bone (error: "Attempting to Morph on non animated bone: LidLower_L"). Which makes sense I guess.

    Thanks for any help.
     
    Last edited: Apr 14, 2019
  47. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,646
    This is meant to work out of the box.

    The OnDnaApplied of the ExpressionSlotScript loops through all animated bones in the ExpressionSet (line 40) and informs the skeleton that the bone is animated (line 42). Based on this information the power tools bone baking should leave those bones alone.
     
  48. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    985
    @UnLogick Will power tool work with 03n's race RPG races package on 2.8? I am looking to make prefabs that do not require UMA to be installed.
     
    Last edited: Apr 14, 2019
  49. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,392
    Thanks for the reply :)

    Does this mean when I view the skeleton in the scene during runtime, my UMA characters should have the "LidLower_L" bone (for example)? Because right now, my generated characters (they are generated dynamically during runtime) only have the "Eye_L, Eye_R, and Mandible" bones underneath the Head bone. Should it have more?

    On my characters' "Dynamic Character Avatar" script I see an option called "Load BlendShapes". Do I need to checkmark that box or should I leave it blank?

    I think I might be messing with the setup during runtime with my own code too much and I'm messing something up.....maybe. There's also a chance I didn't install the new version of Power Tools correctly.

    Right now I'm still getting errors that the bones just simply aren't there. So I think my problem is I just need to get the bones to be there somehow.


    ** Just noticed I don't have an "ExpressionSlotScript" on my characters....is this needed? I'm going to test it now. -- Ok I tested simply adding that script to my character prefabs and that didn't work.
     
    Last edited: Apr 14, 2019
  50. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,392
    Ok, good news, I got it to work! I'm very happy about that.

    I had to add the "Expression Slot Script" to my characters (since I didn't have it initially) - along with the "UMA Expression Player".

    Then because I was using my own custom code to instantiate and setup my dynamic characters, I had to add some extra code. The "OnCharacterBegun" and "OnDnaApplied" functions were never being called from the ExpressionSlotScript (by default) for some reason (I don't know why really).

    So I had to create my own "listener" functions in my code in the OnEnable() function, in which I manually call the OnCharacterBegun and OnDnaApplied functions from the ExpressionSlotScript.

    Example code:
    Code (CSharp):
    1. avatarScript.CharacterCreated.AddListener(Created);
    2.         avatarScript.CharacterDnaUpdated.AddListener(DnaUpdated);
    3.    
    4.  
    5. void Created(UMAData data)                                                                                          
    6.     {
    7.  
    8.         //dna = avatarScript.GetDNA();
    9.  
    10.         SetDNAValues();
    11.  
    12.         //transform.GetComponent<Move>().thisAnimator = transform.GetComponent<Animator>();
    13.  
    14.         // Placed this here because the DCS Human Male characters were not getting the proper Animator controller for some reason,
    15.         // and this is the only place that seemed to force these characters to use the controller I wanted properly.
    16.         transform.GetComponent<Move>().thisAnimator.runtimeAnimatorController = transform.GetComponent<Move>().controllerToUse1;
    17.  
    18.         thisSkinnedMeshRenderer = transform.Find("UMARenderer").GetComponent<SkinnedMeshRenderer>();
    19.  
    20.         thisSkinnedMeshRenderer.skinnedMotionVectors = false;
    21.         thisSkinnedMeshRenderer.allowOcclusionWhenDynamic = false;
    22.         thisSkinnedMeshRenderer.quality = SkinQuality.Bone2;
    23.         //thisSkinnedMeshRenderer.quality = SkinQuality.Bone1;
    24.  
    25.  
    26.         // **
    27.         umaDataInstance = gameObject.GetComponent<UMAData>();
    28.         thisExpressionSlotScript.OnCharacterBegun(umaDataInstance);
    29.  
    30.  
    31.  
    32.  
    33.         // Trying to update the DNA during an Update after the character is created, because moving the sliders sometimes
    34.         // causes the DNA to actually update properly on some UMA models.
    35.         doOnce1 = true;
    36.  
    37.         Debug.Log("I'm running the UMA created event function");
    38.     }                                                                                                                                                                                                                                                                                                            
    39.                                                                                                                                                      
    40. void DnaUpdated (UMAData data)
    41. {
    42.         //dna = avatarScript.GetDNA();
    43.  
    44.         //HeightChange(Random.value);
    45.         //BellyChange(Random.value);
    46.  
    47.  
    48.         //**
    49.         umaDataInstance = gameObject.GetComponent<UMAData>();
    50.         thisExpressionSlotScript.OnDnaApplied(umaDataInstance);
    51.  
    52.  
    53.  
    54.         //Debug.Log("I'm running the UMA DNA update function");
    55.     }

    So I basically had to manually force it to call the functions in the ExpressionSlotScript at the right times when the character is created. But that worked!!


    Anyways, long story short, it all seems to be working great now. Thank you for the update and the help :)
     
    Last edited: Apr 14, 2019
unityunity