Search Unity

UMA Power Tools Support (v. 2.9)

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

  1. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Right, as I mentioned you need the latest UMA for the new version of the Power Tools. Otherwise stuff like this will happen.

    I'm sure it's because UMA have been moved between multiple categories that we're seeing these update problems for it.

    Let me know if the problems persists.
     
  2. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Could not load file or assembly 'UMA, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

    I know what this means, but I have no idea why you're suddenly seeing it. Please verify that your project have the UMA.DLL in the project. The project path should be: "Assets/UMA/UMA_Project/DLL/UMA.dll"
     
  3. kmvassey

    kmvassey

    Joined:
    Dec 31, 2013
    Posts:
    15

    Ah, I know the problem then. If you notice, on the other thread, I posted about the virus software quarantining the UMAEditor.dll. Since I work for a company, the company policy was to use the direct .cs source code for UMA, instead of the compiled DLLs. In other words, in UMA/UMA_Project/DLL and Editor, I have all the source code instead of the DLL files. Since UMA is namespaced correctly, it works great this way, and fits better with the policy makers at the studio.

    Now, the question becomes whether I can use the PowerTools with this setup. Is that possible?

    Thank you very much for your time and effort. This is truly an amazing system.

    --Kevin
     
  4. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    How did you manage to replace the UMA.dll with the source files? When I tried something like I lost all scene and prefab references. It's actually quite annoying to develop UMA in the dll's as opposed to raw source. But Unity asked us to do it this way.

    I'm afraid the dll inside the PowerTools that takes care of the re-skinning is deeply integrated with UMA and there is no way to avoid it referencing the UMA.dll. The re-skinning that happens inside the PowerTools for the bone baking is a foundation that I plan to use for several tools helping with content creation, as such I don't intend to share the source code at this time.

    As I wrote in the other thread my recommendation is that you build the dlls from the source yourself such ensuring their integrity. There is no magic tricks related to the dll, just a plain ClassLibrary project with all the source files in it. You can build it with MonoDevelop or Visual Studio.

    There is one more option here, the PowerTools only references the UMA.dll not the UMAEditor.dll! So you can include the UMA.dll that your virus software didn't complain about and only include the source files for the UMAEditor.dll.
     
  5. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Create Prefab button is disabled in Game Mode, is there any way to generate a player prefab from within the game?
     
  6. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Is it possible to export a prefab avatar from a the UMA project and use it in another project? What I get is a pink looking avatar. Animations work. Thanks.
     
  7. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Hi Mikie.

    I think you'll find what you need in this post I made in the main UMA thread:

    Exporting UMA prefabs to other projects

    The important thing is to export all required shaders and textures with your prefab. Hope this helps.
     
  8. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    Hello,

    Just purchased this today after watching the three video tutorials, looks nice. However when I load the example scenes in PowerTools directories I get the following if I hit play(and characters do not show up in crowd example or 101 scene).

    Code (csharp):
    1.  
    2. System.NullReferenceException: Object reference not set to an instance of an object
    3.   at UMA.PowerTools.SkinnedMeshCombinerThreaded.GetDestinationMeshCount (.CombineInstance[] sources) [0x00000] in <filename unknown>:0
    4.   at UMA.PowerTools.SkinnedMeshCombinerThreaded.CombineMeshes (UMA.PowerTools.SkinnedMeshDataThreaded target, UnityEngine.Matrix4x4[] targetEffectivePoses, .CombineInstance[] sources, System.Collections.Generic.Dictionary`2 hashToNewIndex, UMA.PowerTools.PoliteThreadAbortHandler abortHandler) [0x00000] in <filename unknown>:0
    5.   at UMA.PowerTools.UMACombineMeshCoroutine.ThreadedDoWork (UMA.PowerTools.PoliteThreadAbortHandler abortHandler) [0x00000] in <filename unknown>:0
    6.   at UMA.PowerTools.UMACombineMeshCoroutine.ThreadedWorkerFunction (System.Threading.EventWaitHandle killEvent, UMA.PowerTools.PoliteThreadAbortHandler abortHandler) [0x00000] in <filename unknown>:0
    7.   at UMA.PowerTools.UMAGeneratorThreaded.ProcessWorkJob (UMA.PowerTools.UMAThreadedWorkJob workJob) [0x00039] in /Users/kclark/gamedev/uMud/Assets/UMA/Extensions/UMAPowerTools/Scripts/UMAGeneratorThreaded.cs:167
    8.   at UMA.PowerTools.UMAGeneratorThreaded.WorkerThreadFunction () [0x00070] in /Users/kclark/gamedev/uMud/Assets/UMA/Extensions/UMAPowerTools/Scripts/UMAGeneratorThreaded.cs:115
    9. UnityEngine.Debug:LogError(Object)
    10.  
     
  9. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    If you just downloaded the latest version of Power Tools, make sure you update to the latest version of UMA as well, since it apparently needs it to function properly. You might want to reinstall them from scratch, from the asset store, to make sure you have the latest of both.
     
  10. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    You need to export the two(or more) textures next to the prefab too.

    Because textures are an asset that you may want to change resolution on for different build targets Unity insists on having raw png for those rather than embedding them directly in the prefab.

    EDIT: Other than that read what FargleBargle wrote. :)
    Second EDIT: The Locomotion controller is optional really, just remember to set a controller in your new project.
     
  11. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    As long as you're in play mode inside the editor it should be possible to create prefabs. If I disabled the button it was probably due to stability issues. Primarily if you press the button twice or if unity recompiles source code, or something silly like that. I should add a deep copy at run-time to the prefab code to avoid those problems. You can still create the prefab from the "UMA/Power Tools/Save Character Prefab" menu just be aware of the mentioned known problems.

    If you want to create prefabs at runtime I made an API call to do just that.
    Code (csharp):
    1.  
    2. namespace UMA.PowerTools
    3. {
    4.     public class UMASaveCharacters
    5.     {
    6.         public static GameObject SaveCharacterPrefab(string assetFolder, string name, UMAData umaData)
    7.         { ... }
    8.     }
    9. }
    10.  
    Since this is an editor class you should embed your code with
    Code (csharp):
    1.  
    2. #if UNITY_EDITOR
    3. UMA.PowerTools.SaveCharacterPrefab("Assets", "MyPrefab", myUmaData)
    4. #endif
    5.  
     
  12. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hey tiggus

    Did FargleBargle's reply help you or does the problem persist?

    Regards,
    Joen Joensen, UnLogick
     
  13. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    I downloaded both at the same time yesterday so they are up to date as far as I know. (UMA 1.0.8.0 and UMA PT 1.0.2.0)

    Restarted project just to be sure and still having same issue with the demo scenes. I can see the characters in the third scene(serialization one) although I do still see that error in console. I am running Unity 4.3.3 on OSX if that helps.
     
  14. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    I just imported everything into a clean project, but was unable to reproduce this problem locally.

    There have been a number of package/update problems on the asset store associated with UMA.
    Please try the following steps:

    1. Try creating a new empty project.
    2. Re-download both packages, force a re-download even if you have the newest of both packages!
    3. Import the UMA package first
    4. Import the Power Tools package next
    5. Open the scene and press play.
    If this doesn't help try mailing me the full Unity log file for that session, not just the failing exception. Some part of the import must have failed on your system.

    Regards,
    Joen Joensen - UnLogick
     
  15. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    Thanks will mail you the logfile, tried the above with a new project with just UMA and UMA PT(in that order) and same issue.
     
  16. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Added Video: UMA Power Tools 05 - Recipe Tool integration.



    If you're a package developer and you want to integrate your package with the Power Tools I've added a nice reflection based helper class that you can incorporate into your package. It has all the core functionality that allows you to detect if the Power Tools are present and show UMA characters inside the editor.
     
  17. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    UMA Power Tools updated to 1.0.3
    Increased Stability for UMA preview in EditorAdded PowerToolsIntegration that other packs can use to query if power tools exists and use the show preview functionality. You can freely copy this file to your packages to integrate with the UMA Power Tools. Remember to change the namespace to avoid clashes with other packages!

    Enjoy!

     
  18. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    UMA Power Tools updated to 1.0.4
    Fixed a critical threading issue

    I believe it was the cause of Tiggus problems. But I still need confirmation that the fix is good on mac with Unity Pro.
    Also there seemed to be some files that wasn't properly updated in 1.0.3 so it's recommended to get 1.0.4, even if you believe 1.0.3 is working for you I recommend getting the threading fix.
     
  19. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    Hi Joen,

    Just downloaded your latest 1.0.4 as well as UMA 1.0.10.0(released yesterday) and it is working now(on OSX with Pro), thanks for squashing that bug so fast!
     
  20. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Glad to hear it, I like being at 0 open bugs. :)
     
  21. aelrhermoul

    aelrhermoul

    Joined:
    Jan 3, 2014
    Posts:
    13
    Hi UnLogick,

    As you suggested, I'm submitting a bug report regarding the issue I mentioned on the UMA thread. The problem is that when I use the UMA Threaded Generator, as provided in your updated scene, I get a strange skin wrinkling issue in female models:

    $uma_powertools_skin.jpg

    As soon as I switch back to the default generator, the problem vanishes. I should note that I'm using a custom version of UMACrowd, which for the most part is the same exact code. It seems to be working fine with the default generator. I'm currently running UMA 1.0.1.0 and UMA Power Tools 1.0.4.0.

    1. Update UMA to 1.0.1.0 by importing the package into the existing project
    2. Import UMA Power Tools
    3. Open UMA Power tools example scene: Updated scene01 - crowd
    4. Copy the UMAGenerator game object which uses the Threaded Generator script
    5. Open the scene I was working on and paste the UMAGenerator with the threaded script
    6. Change the UMACrowd object to reference the new UMAGenerator object
    7. Run the game

    I should also note that I'm using Daikon Forge UI in this project, in case that has any bearing.
     
  22. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    It's not a bug it's a feature!

    No seriously, try this:

    #1 Duplicate the UMAGenerator in the scene you're working on.
    #2 Assign the monobehaviour of the duplicated generator to be UMAGeneratorThreaded instead of UMAGenerator. (This is the top value in the component inspector)
    #3 Change the crowd reference
    #4 Run the game

    By duplicating the generator from your scene you're sure it will get exactly the same settings.

    If this doesn't solve the problem please send me a unitypackage with the failing scene in it so I can take a look.
     
  23. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    Hi Joen,

    the Power Tools look like a great buy but I wanted to get some more information first:

    * are they also useful for Unity PRO users?
    * could you post some numbers to compare the normal generator with the threaded one in the started crowd scene?
    ** memory consumption
    ** # total gameobjects
    ** frames per second
    ** for pro and non pro
    ** on android/ios

    This would really help to get an understanding of the advantages of the package. By now with €28 it's unfortunately not a steal anymore.
     
  24. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hey 10FingerArmy

    I'm sorry I don't have that statistics available. I could show you demo scenes with statistics saying as high as 30% speed increase. But that is a rigged setup of using statistics to my advantage.

    The truth is that it makes skinning/animation faster but cost more to spawn a character.

    So if you are frame rate is limited by GPU you will see probably see no benefit at all using just the UMA content available today, unless you use GPU skinning in which case there will be some benefit! Of course the profiler will still show you the benefit, but all the time gained will be wasted on waiting for the next frame.

    The actual skinning is much faster, but if you look at your profiler for a simple scene with just a single character you probably use less than 1 ms per frame on skinning. If you spawn a hundred characters you'll certainly see a significant benefit!

    There is one place where you will certainly see the benefit and the is spikes while building. I spent a lot of time smoothing everything out to give you more control of cpu spent vs avoiding spikes in main thread usage.

    Also building textures without Pro is MUCH faster and runs perfectly smooth with the Power Tools!

    The real benefit in my opinion is that it allows you to create UMA content without worrying about how many customization bones you add because they will be baked away. I can easily imagine adding fifty or more customization bones to a single chest piece of armor, to avoid that generic scaled look.

    Potentially that could mean adding bones to every spike on that suit of armor to control length and even add a bit of curve! As soon as it's baked away you don't have to worry about the run-time cost all those bones would incur.

    So without giving you raw statistics i hope you got the information you were looking for.

    Cheers,
    Joen Joensen, UnLogick
     
  25. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    Thanks a lot Joen for these explanations!
     
  26. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Tried importing the latest PT and UMA and get this error

    Assets/UMA/Extensions/UMAPowerTools/Scripts/AutoLoaderAvatar.cs(5,7): error CS0246: The type or namespace name `LitJson' could not be found. Are you missing a using directive or an assembly reference?

    What does this mean?
     
  27. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    It means there was something wrong with your UMA installation. LitJson is a serialization library that UMA uses.

    AutoLoaderAvatar does have a using statement for LitJson but the PowerTools really doesn't use LitJson so you can safely delete the line saying:
    Using LitJson;

    I'll make sure to do the same for the next update.

    Best Regards,
    Joen Joensen, UnLogick
     
  28. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    I'm interested in getting this. Some questions:

    How does texture layout look for a prefab? Some characters I'm making will be seen close up. I would want to make sure I can get most out of the texture size for those cases, even multiple textures if it looks better.

    Your prefab function supports the face bones stuff in the content pack, right? (I'm sure yes but I wouldn't want to assume and be out of luck :p )
     
  29. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    The atlas you get is the atlas generated by UMA. It's fairly good but in some cases not quite perfect.

    Any bone added to the AnimatedBones array will not be baked away, as such you'll be able to do all the run-time facial animations you want. I've already discussed with Eli how he will add an empty SlotData item with the correct animated bones to support his Facial Animations.
     
  30. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Well I bought it, seems like it will be pretty useful for my project. :)

    Great! I'm not sure how to add bones to that though could you please explain that.
     
  31. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Well UMA gets the Animated bones from a number of sources. Unfortunately there is currently no inspector that will let you set it on the SlotData or the RaceData, but that will be added.

    For now the only way to set it is to access the race prefabs directly. You'll find the two prefabs in the "UMA/UMA_Assets/Races" folder in your UMA installation.
    1. Drag the prefab for the scene to be able to fully expand the bone hierarchy.
    2. Find the UMAData located on the first child of your race instance in the scene hierarchy.
    3. Expand the AnimatedBones array, default UMA comes with 53 animated bones.
    4. Set the Array Length to support the facial bones you want to add.
    5. Drag the bones from the scene hierarchy to the Element positions in the inspector.
    6. Once done go to the top of the inspector and click the "Apply" Prefab button. This will update the changed settings back to the prefab.
    7. Delete the instance from the scene to clean up.
    Improved workflows for this is being added as we speak. As I mentioned Eli Curtz is doing some awesome stuff with facial animation and he is also working on proper inspectors to set this up neatly.
     
  32. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Ok, now I follow you. I'll wait for those improved workflows but this will be helpful in testing a few things, thanks.
     
  33. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Eli's stuff is well worth the wait, I did a small session with him today and it's truly awesome.


    I guess this is also a good time to mention I'm working on an eye pack for UMA.

    There will be something for all size and shapes.
     
  34. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Just a feature request for prefabs: obj export support like this: http://wiki.unity3d.com/index.php?title=ObjExporter so we can work on the textures in a 3d space like zbrush, and then we could just place our edited texture on the rigged model.

    (It's somewhat tough to paint over in 2D photoshop on models that have been warped by the adjustment bones.)

    That would be a really cool addition IMO.
     
  35. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Really? So this would be for customizing the textures after they've been generated by UMA. I see no problem with this except the obvious, if you tweak the UMA character later the UV map could change. Leading to some problems of reconstruction your changes.

    There is certainly no technical problems in including an obj exporter. I just need to remind people that what you export is not a skinned mesh, only a single unskinned pose is exported. So while it's good for texture work, it is useless for changing the mesh.
     
  36. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Yes I would just be using this for texture repainting purposes. I'm thinking of going for a very illustrative texture style so following the actual mesh in 3d can help me a whole lot laying that out.

    Anyway, hope that obj export can make it into an update, that would be great.
     
  37. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Right now I have a few open tasks already
    1. Fix Additional/Dynamic bone problems in UMA
    2. Finish Wings and Horns Pack.
    3. Finish Eye Pack.
    But after those I see no problem in adding this feature.
     
  38. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Cool! I appreciate it.
     
  39. Ya_hen

    Ya_hen

    Joined:
    Nov 25, 2013
    Posts:
    15
    Hello, guys
    Is there a way to save prefabs from code?
    for example I have only one avatar on the scene and I want to save him into prefab, how can I do that?
     
  40. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Yes, in the UMA.PowerTools namespace you'll find two static methods to do just that.
    Code (csharp):
    1.  
    2. namespace UMA.PowerTools
    3. {
    4.    public class UMASaveCharacters
    5.    {
    6.       public static void SaveCharacterPrefab(UMAData umaData, string prefabName);
    7.       public static GameObject SaveCharacterPrefab(string assetFolder, string name, UMAData umaData);
    8.    }
    9. }
    10.  
    Cheers,
    Joen Joensen, UnLogick
     
  41. Ya_hen

    Ya_hen

    Joined:
    Nov 25, 2013
    Posts:
    15
    Thanks, but I have such mistake " Assets/UMA/XXXXXXXXXXXX.cs(10,24): error CS0234: The type or namespace name `UMASaveCharacters' does not exist in the namespace `UMA.PowerTools'. Are you missing an assembly reference?
    "
    I have 2 solutions in my project $Untitled.png . Is it normal?
    When I try to add reference I get this " A reference to 'Assembly-CSharp-Editor' could not be added. Adding this project as a reference would cause a circular dependency." And I can't create my script in 'Assembly-CSharp-Editor' project. It automatically sends to 'Assembly-CSharp' proect.. (
    What should I do??
    Thanks.
     
    Last edited: Feb 13, 2014
  42. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
  43. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Hmm, right, I might have made a slight mistake here. Editor can invoke the normal assembly but not the other way round. So clearly the code needs to be moved away from the editor dll.

    I'll be making a PowerToolsRuntime static class that contains the SaveCharacterPrefab methods.

    EDIT: Removed code block, turned out to be less trivial than expected to move this block due to other editor references. You can pm me for the update or wait till I submit the next update to the asset store, sometime before the weekend is over.

    Thanks for the heads up,
    Joen Joensen, UnLogick
     
  44. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
  45. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Well I had time to try this today, I put the "mandible" in a new bone slot for the female and male race prefab. For some reason it still doesn't play mouth anims with mecanim after I add that.

    It uses the rest of the custom animation: legs, arms, head tilt moving but the jaw doesn't do anything, however the jaw moves on the model I made the anim for (which is not uma rig.)

    Oh well something must be amiss but it isn't that big of a deal at this point since it's too early to do complete face animations.
     
  46. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Looking at the UMA Avatar it seems that the UMA Jaw Bone isn't connected to the Mecanim Humanoid Jaw. As such it will not re-target. That means only animations made specifically for UMA will work.

    I'll ask Fernando if there is a reason not to connect the jaw and eyes to Mecanim Humanoid. But regardless of this if you want proper facial animations (not just jaw and eye movement) you need to build it directly for UMA! I know Eli Curtz is working on a facial animation pack for UMA.

    Cheers,
    Joen Joensen, UnLogick
     
  47. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Ah I see you're absolutely correct. I tried the UMA content animated and exported and it does move the jaw in unity so it's definitely a UMA compatibility with standard mecanim problem. Glad I understand what is going on there now.
     
  48. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    We added the mandible and eyes into the TPose data in the git repository so they will be included in the Mecanim avatar by default with an upcoming UMA release.
     
  49. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    Oh cool!!! Thanks.
     
  50. Ya_hen

    Ya_hen

    Joined:
    Nov 25, 2013
    Posts:
    15
    Hello, guys)
    I have 2 scenes: one with creation avatar and one with game.
    I save avatar with help this code " UMA.PowerTools.PowerToolsRuntime.SaveCharacterPrefab("Assets/Resources", "Player", prefab); " and in game scene I instantiate new prefab.
    When I run project from unity everything is fine ( I press play button and then play with my new avatar ), but when I build my project ( i included 2 scenes ) and run exe file nothing happened ( I press play button and nothing..) Help me please.
    Thanks.