collapse

Welcome to VRTITTIES

A place for VR Porn Games, Oculus Rift Porn Games, Vive Porn Games, VR Porn Game Downloads & VR Sex Games.

Please feel free to discuss anything about Oculus Rift Porn Games, Vive Porn Games and VR Porn Games.

The answer to the anti spam question is facebook. If you have any issues registering then flick me an email or post as a guest. If you make an account you do not have to answer any anti spam questions after 10 posts.

You will need to sign up to the forum and make a number of posts before you can post links to other websites.

If you are ever looking at buying some VR Porn please use my affiliate links on the right sidebar.

Thanks,

VRTITTIES, New Zealand

Chelsearift@gmail.com


Author Topic: Tutorial - BlendShape Animations [Unity]  (Read 15737 times)

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Tutorial - BlendShape Animations [Unity]
« on: December 08, 2014, 10:31:08 AM »
Prerequisites (optional - can skip if you already have a unity model with blendshapes):


Sample Project (4.3 OVRlib):
here

Scripts we will look at (already in sample project):
BlendShapeControllerTest.cs (ya i didn't name it very well, lol)

If you are using MMD4Mecanim, your model will probably have some BlendShapes.  These can be thought of as morphs from 0% to 100% that can applied to the vertices of your model.  The basic idea of this tutorial is, If you update a blend shape a few percent each frame, it can appear as an animation.

Once you have your model in the scene, you can check out the BlendShapes available on the 'Morph' tab of the 'MMD4Mecanim Script'.  You'll probably have to try sliding them yourself to figure out which ones do what exactly.  If you are REALLY lucky there might even be some pussy spreading sliders in there...


This is only a shortcut to the morphs though.  They actually belong to the Skinned Mesh Renderer of the child object.  Whichever object actually has the morphs, is what you want to attach the BlendShapeControllerTest.cs script to (U_Char_1 in this case).


You'll notice when you add the script that it has inputs for source and target objects.  I am using them to detect the distance between these 2 objects, and change action accordingly.  For example, she only starts licking once the player gets so close.  These transitions are done through a very simple finite state machine within the script.  You could obviously change the state transitions to be based off of something else, like player input for example.

continued...
« Last Edit: December 08, 2014, 11:15:05 AM by PornulusRift »

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations
« Reply #1 on: December 08, 2014, 10:31:24 AM »
The Update() function does the following:
Check for user input for lick speed, adjusts lick speed if speed value is still within min/max values.
Check if we passed a distance threshold (state transition), if so update our blendshape values to the values for the new state.
Apply incremental Blendshape adjustments based on delta time since last update, using the speed value.

Other tips:
I added a bool called 'other' to only update the blendshapes every other frame, instead of every frame.  Setting blendshapes is a bit of an expensive call, so you can squeeze out a few more fps by doing that, at the cost of less smooth animations though.

The licking animation is made up of 2 blenshapes being modified each frame.  Your model may have more, less, or none at all.  It's up to you to play around with the shapes and try to find what looks good.

I had to add the dpad controls myself under Project Settings -> Input, and had to disable dpad usage in OVRPlayerController.cs.

Also, Check out BlendShapeController.cs that is attached to the dick for an example of player input controlled morphs.
« Last Edit: December 08, 2014, 10:52:17 AM by PornulusRift »

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations
« Reply #2 on: December 08, 2014, 10:33:29 AM »
Reserved.

Ovulating_Oculus

  • VR Porn Fan
  • *
  • Posts: 5
Re: Tutorial - BlendShape Animations [Unity]
« Reply #3 on: December 10, 2014, 07:54:39 AM »
Thanks for the post!

Is this only going to work for MMD models/rigs, or would it work for SFM models?

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations [Unity]
« Reply #4 on: December 10, 2014, 12:21:26 PM »
If the SFM model has blendshapes it will work.  I've never used an SFM model except through conversion to MMD first (which had blendshapes after conversion - did not convert myself, found them on deviantart).  So I would say 'probably'.

rick

  • Guest
Re: Tutorial - BlendShape Animations [Unity]
« Reply #5 on: December 14, 2014, 08:22:02 AM »
Luckily I also use mmd for mechanim and I have very similar project components to yours I also have an oculus rift. I have been curious as to how you were able to turn off headtracking. I would like that, and the head move controller or whatever ( when the models move their head to you) is awesome, I really wanted that functionality. I have some great stuff too I am working on. I have run and chase ai that can talk utilizing text mesh. However, I am having trouble getting my blendshapes to work with blending animations. For example, I am trying to add an additive layer that only animates facial animations to the base animation that has animations based off of my models rig. (they are vmd files). Basically, I want my model to walk and possibly talk at the same time.You wanna help me out?

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations [Unity]
« Reply #6 on: December 15, 2014, 06:52:50 PM »
Luckily I also use mmd for mechanim and I have very similar project components to yours I also have an oculus rift. I have been curious as to how you were able to turn off headtracking. I would like that, and the head move controller or whatever ( when the models move their head to you) is awesome, I really wanted that functionality. I have some great stuff too I am working on. I have run and chase ai that can talk utilizing text mesh. However, I am having trouble getting my blendshapes to work with blending animations. For example, I am trying to add an additive layer that only animates facial animations to the base animation that has animations based off of my models rig. (they are vmd files). Basically, I want my model to walk and possibly talk at the same time.You wanna help me out?

There's a headtracking tutorial here:
http://vrtitties.com/forum/index.php?topic=108.0

I'm not really sure what you are asking for help with.  Are you saying you have a model with a vmd animation, and you want to use blendshapes to override the mouth animation?  Or do you want to have the mouth animations from 1 vmd file combined with body animation from another vmd file?

This tutorial is doing the first, but it would be difficult to sync it up with a voice.

rick

  • Guest
Re: Tutorial - BlendShape Animations [Unity]
« Reply #7 on: December 16, 2014, 07:51:56 AM »
I would love help with the later of mixing 1 vmd mouth motion with vmd body motion. If you have an option to turn off head tracking with your posted blendshapes tutorial, could you tell me about how to turn headtracking off on your tutorial?

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations [Unity]
« Reply #8 on: December 16, 2014, 10:50:19 AM »
If you just want to turn off head tracking, uncheck the box next to each model's HeadLookController component.  That will be on the right side somewhere when you have the model in your scene selected.

If you want to combine 2 vmd files, you can do that in mmd.  Load up a model and load the body motion.  Select and delete the facial motions, while leaving the body motions, then save this as a new vmd.  Now close mmd completely, and reopen.  Load up the model again but this time load your facial motion.  Now delete the body motions, while leaving the facial motions.  Now you can load your previously saved vmd on top (with only body motions)and save the motions to a new vmd file.  Now this vmd file should have the face and body motions you want.

rick100

  • VR Porn Fan
  • *
  • Posts: 3
Re: Tutorial - BlendShape Animations [Unity]
« Reply #9 on: December 16, 2014, 11:42:12 AM »
Ah see I was looking for something different with the vmd files, I dont want them as one animation. I want the blendshape motions to be versatile, and play alone. For instance, I want the lip motion played sometimes while running and sometimes while in an idle position.
See where I am getting at? Like I want my character to be able to say something while doing anything in game, like an in game npc almost.

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations [Unity]
« Reply #10 on: December 16, 2014, 12:12:24 PM »
That's going to be very difficult.  You would probably want to create functions for each type of mouth movement.  And then somehow trigger these to be called when your character makes the phonetic sound.  You would either have to manually setup your animations by hand for every audio clip, or use some tools specifically for this kind of thing like FaceFX.

rick100

  • VR Porn Fan
  • *
  • Posts: 3
Re: Tutorial - BlendShape Animations [Unity]
« Reply #11 on: December 16, 2014, 02:36:17 PM »
Thanks again. Thing is, I am sure that I can probably code the algorithm for it. I am mainly concerned with the piece that deals with playing an animation that only uses blendshapes, and an animation that's bone animation/and or blendshapes at the same time. if i had that piece, i could figure out things like lipsync. For instance, i could "cut out" the parts of the vmd lip motion datathat fit the syncing i want, an just apply them to a motion of my choice DURING RUNTIME

PornulusRift

  • VR Porn Fiend
  • ***
  • Posts: 91
    • PornulusRift
Re: Tutorial - BlendShape Animations [Unity]
« Reply #12 on: December 16, 2014, 04:42:30 PM »
We'll you can do all that stuff with the scripting in unity, its just gonna be a bit of work.

rick100

  • VR Porn Fan
  • *
  • Posts: 3
Re: Tutorial - BlendShape Animations [Unity]
« Reply #13 on: December 17, 2014, 04:33:59 AM »
If you know of any specifics on how to do that (i.e. simple functions that combine mecanim animations etc.) please let me know

xiaofei12

  • VR Porn Fan
  • *
  • Posts: 2
Re: Tutorial - BlendShape Animations [Unity]
« Reply #14 on: December 23, 2014, 09:18:04 PM »
If you are using MMD4Mecanim, your model will probably have some BlendShapes.  These can be thought of as morphs from 0% to 100% that can applied to the vertices of your model.  The basic idea of this tutorial is, If you update a blend shape a few percent each frame, it can appear as an animation.
« Last Edit: February 03, 2015, 05:58:17 PM by chelsearift »

 

* Download VRtitties

* VRtitties Affiliate Links

* Forum Staff

Will admin Will
Administrator