playMaker

Author Topic: Working with blendshapes in unity with playmaker  (Read 2036 times)

Rajeev

  • Playmaker Newbie
  • *
  • Posts: 8
Working with blendshapes in unity with playmaker
« on: December 28, 2019, 02:13:31 AM »
Hello,
This is my first time in using the Playmaker forum, so please excuse for any errors in choosing the right forum to post my question. I have a gameobject with a blendshape in my Unity project and I also downloaded the Playmaker blendshape actions. I want to change the blendshape value with a slider during runtime but I am unable to figure out the correct sequence. Could you please give me a tutorial for this. I am trying to make a character customization scene and would be really thankful if you could show me how to change blendshape values with Unity UI sliders.

Thanks in advance,

Rajeev

wetcircuit

  • Full Member
  • ***
  • Posts: 158
    • wetcircuit.com
Re: Working with blendshapes in unity with playmaker
« Reply #1 on: December 29, 2019, 03:09:53 PM »
I'll make a small assumption about your scene: that it is a customize your avatar kind of thing with lots of sliders changing individual blendshapes in realtime.

have a look at the UI sliders, they translate from 0 to 1. You need a playmaker action that will GET the UI slider value, save the value as a float variable, then SET the associated blendshape that that value on the model.

Probably each slider and blendshape action are updating every frame, then you'll have a button that saves the avatar settings (maybe as an array saved to PlayerPref), and when you go back to your game scene, the figure will read the array to set it's blendshapes.

Rajeev

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Working with blendshapes in unity with playmaker
« Reply #2 on: December 30, 2019, 05:28:12 AM »
Hello wetcircuit,
Thanks a lot for your prompt reply. I tried a few things based on your advise and finally managed to get it right. All it needed was two Playmaker actions. - UI Slider Get Value and Set Blendshape weight. It works perfectly as long as I don't exit runtime, but all slider values are reset when I hit the Play button once again in Unity since they aren't saved to PlayerPrefs.

I don't want to impose on you, but would it be possible to show me how to save the values of my sliders in an array to PlayerPrefs. Are there any Playmaker actions for that?

Thanks once again

Rajeev

wetcircuit

  • Full Member
  • ***
  • Posts: 158
    • wetcircuit.com
Re: Working with blendshapes in unity with playmaker
« Reply #3 on: December 30, 2019, 02:20:04 PM »
Looks like I misspoke…  :-X

There's no direct way to save an array with PlayerPrefs, but some other discussions suggest using EasySave3:

https://hutonggames.com/playmakerforum/index.php?topic=20055.0

Rajeev

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Working with blendshapes in unity with playmaker
« Reply #4 on: December 31, 2019, 04:17:10 AM »
Hi,
Thanks. I will check out EasySave.