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

[Released] Shape Drivers - easily drive blend shapes from Transforms, animations or script callbacks

Discussion in 'Assets and Asset Store' started by Senshi, Jan 20, 2016.

  1. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Store page: https://www.assetstore.unity3d.com/en/#!/content/53272
    Manual: http://www.patrickboelens.com/ShapeDrivers/manual.pdf
    Overview video:


    My second-ever Unity asset just got accepted into the asset store and I'm genuinely excited to share it here! Inspired by Blender's driver system, but completely reworked for Unity, Shape Drivers let's you easily control your FBX models' blend shapes based on Transform or animation properties, or script callbacks. I think the asset's main strength will lie in easily setting up corrective blend shapes, but there are all kinds of uses for it.

    Asset store description:
    Shape Drivers is a tool designed to easily control blend shapes by driving them from an array of different properties – no coding required!

    You can drive your shapes from any gameobject's:
    - Position
    - Rotation
    - Scale
    - Distance to object
    - Distance to point
    - Legacy and Mecanim animation time
    - Mecanim parameter
    - Script callback

    By having the ability to make any gameobject, including bones, a shape driver you can easily drive corrective blend shapes even from baked animations. Other common effects might include character customization features, facial expressions and fake soft-body effects.

    Shape Drivers was made with speed and quantity in mind and has been designed to be as light-weight as possible. It is still extremely powerful though, and allows you to create complex blending hierarchies should the situation demand it. You can even use a script callback to run your own custom logic from within a driver.

    For the quickest support, please hit me up on Twitter (@SenshiSentou) or shoot me a mail via my Asset Store publisher page.

    PS: If anyone can tell me how to prevent the YouTube video from embedding, that would be swell. =P
     
    Last edited: Jan 20, 2016
    theANMATOR2b likes this.
  2. theazz

    theazz

    Joined:
    Oct 20, 2013
    Posts:
    52
    This looks great man. What would be your recomeended workflow if I had a characters which I animated in maya with lots of facial blendshapes and I wanted to bring that animation into Unity. I've looked into attaching custom attributes to FBX in maya then hooking into the AssetPostProccesor but it's a bit beyond me, would this asset help me with a simpler solution? I guess worst case would be to tie a load of extra locators into the export and read they're values in shape drivers that align with Maya but I thought maybe you had a cleverer solution :)

    This kind of thing has kept me making joint based facial rigs but the ease of setup for corrective shapes with this is enough to make it worth the tiny asking price L :)
     
  3. fajarkecoak

    fajarkecoak

    Joined:
    May 17, 2015
    Posts:
    11
    looks great man. love it
     
  4. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Hey, thanks! So if the shapes are to be used only inside the animation itself (ie: as animated and nothing else), I think that should just work out of the box (at least, this worked when exporting from Blender as FBX 7.4 binary iirc).

    If this isn't the case – whether you want more direct control over them, or your version of FBX doesn't support them – I think the two choices you've listed are the easiest. I've never worked with custom FBX properties in Unity, but it seems you can indeed expose them. You could then create a simple script to read out these values and use a Script Callback Shape Driver to drive the blend shapes. Using locators/ empties doesn't seem like a bad solution either, and you could even use a single node to store up to 9 different channels (location, rotation, scale, all in x, y, z), so you don't end up with hundreds of little locators. For example, you could create a locator where scale determines "O-soundness", y-location determines the jaw shape up and down and rotation determines the jaw shape left to right.

    A final solution might be to just use an Animation Time Shape Driver and fill in the timestamps manually. I really wouldn't recommend this uness there are very little shapes and animations though; it's mostly there for one-offs or blending control.

    Thanks, much appreciated!

    Also, two posts after a month of silence? Did this get linked to from somewhere? =)
     
    theANMATOR2b likes this.
  5. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    I just bought this asset... it is PERFECTION! and it is super easy to set up... I am working on a very character heavy game and this just saved me a headache that I have had for months trying to get my morphs working the way I want them. I STRONGLY recommend this to ANYONE who is doing a character heavy game with hero characters... if you wanted to REALLY get perfect deformers for action heavy games, GET THIS ASSET!!
     
  6. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Hey, thank you so much for the glowing review – both here and on the Asset Store –, it's very much appreciated!

    Just to consolidate it here, you mentioned elsewhere that you'd like to see the Drivers working in edit mode. I seem to recall that not really being an option due to some initialization magic taking place during Awake() I'm afraid. It's been a while though, so I'll doublecheck just to make sure, but don't get your hopes up.

    Regardless, I hope that doesn't detract from the asset too much, and happy to hear you've found it useful in your project! Thanks again!
     
    KRGraphics likes this.
  7. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    Nope... it is the PERFECT tool for what I need. I just sculpt my morphs in ZBrush, apply it in Modo, and it works with Shape Driver...
     
    Senshi likes this.
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    I may take it further and do a demo using Shape Driver, such as punching an opponent in the gut and seeing the fist push his skin...
     
    Senshi likes this.
  9. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    I'd love to see the results of this if you do! =)
     
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    I was reading the release notes of something called fake soft bodies... how would I go about doing that...
     
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    Hey guys... I have a question and it involves setting up the blendshapes where it should be smooth. Has anyone dealt with the shape just "popping" when the bone moves? I am doing a sample shape where I am just rotating the leg forward and the shape just "pops" (and it looks odd)... I am trying to see what is causing this... I am using Modo for my corrective shapes.


    You see it... i am going to try the ZBrush route for blendshapes... and then use the shape manager to get this going.

    Edit: I think I solved the issue... just had to fix the influence a bit... :) Back to business...
     
    Last edited: Nov 29, 2016
  12. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Hey, glad you solved it so quickly! Also, apologies I missed your earlier question! Did you end up getting faux softbodies to work nicely?
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    I haven't attempted that yet. And the issue still persists with the leg...it doesn't blend properly.
     
  14. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Alright, first thing's first. It's quite hard to see on the image you sent due to its size; any chance you could submit a bigger recording?

    Some things that spring to mind pre-emptively:
    • Did you select the right axis?
    • Are the start and end values (and influence curve) correct?
    • When editing the shape strength manually (not using ShapeDrivers), does the same pop occur?
     
    KRGraphics likes this.
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    Yes, the axis was set to single axis on x...

    And this doesn't happen in Modo when animated...
     
  16. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Sorry, I meant in Unity still. If you select your character the Mesh object should list your shapes as well; you can edit them there. I'm mostly curious if something went wrong when exporting the shapes, especially as I'm not familiar with Modo. If that works fine, please upload your gif in a higher resolution for me to take a look at.
     
    KRGraphics likes this.
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,998
    Screenshot 2016-11-29 22.12.26.png

    So here is a shot of my leg in the pose and I noticed that the Evaluated value is stuck at 0 until the leg reaches it's apex... and then it pops :(

    I am going to use Zbrush to see if that fixes anything
     
  18. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    That's why I asked you to try adjusting the shape manually. If that works, redoing it in ZBrush won't change anything. Thanks for the bigger screenshot btw!

    So the monitored value is the value it's reading for the specified settings (channel, axis and space). Being 8.278, this doesn't seem anywhere near the range of numbers (start and end values) you entered. (It's also suspiciously close to 180 - 171.776, which is your "actual" x rotation).

    I'd also like to point out that your 3D manipulator widget is showing you the global axes, not the local ones. Since you're (rightfully) using local space in the driver I'd set the widget to show local space axes as well, to ensure you did indeed select the correct axis. If you did, it's likely that you simply set the wrong start and end values. You can use the buttons next to the fields to sample the current (at the time of clicking) value. Force forward may be needed; please read the documentation (rotation info starts at page 6) for an explanation of when and why to use it.
     
    theANMATOR2b likes this.
  19. meshine

    meshine

    Joined:
    Jul 7, 2018
    Posts:
    4
    I keep getting this error
    Code (CSharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. ShapeDrivers.ShapeDriverCInspector.OnInspectorGUI () (at Assets/ShapeDrivers/Scripts/Editor/ShapeDriverCInspector.cs:99)
    3. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1367)
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    5.  
     
  20. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Hey, sorry to hear that! I can't reproduce this on my end though; can you tell me a bit more about your setup/ scene?
     
  21. meshine

    meshine

    Joined:
    Jul 7, 2018
    Posts:
    4
    After reloading other scenes and restarting Unity once (since I just kept working on normally and the example scenes were working) the error has since gone away, sorry for the inconvenience of trying to reproduce it
     
  22. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    No worries, it's still not something that's supposed to happen for sure. If you come across it again please let me know. There might be some weird edge case that I just never encountered before, so any info (or editor screenshots) would be more than welcome.

    In any case I'm glad you were able to keep working and that it's sorted for now. Thank you for purchasing and best of luck with your project!
     
unityunity