I’d like to be able to manipulate a mannequin within UE4 as a prop. Has anyone ever done this before?
Edit: To clarify, I want to spawn a mannequin and be able to pose it in the virtual space. For instance, lets say I am looking at 4 chair designs in VR and I want to place a mannequin in each chair to see if it looks comfortable, to tall, to short, maybe the arm rest doesn’t hit right, maybe the back angle is to steep. Like I want to be able to manipulate the control rig while I am in the game.
It could work this way:
Create a blueprint class based on the character class and add your mannequin as the skeletal mesh.
Go into your skeleton and add sockets to all bones that want to be able to rotate.
Now add collision spheres or static meshes and attach them to your sockets.
After that you need to save every rotation value of your colliders in a variable that is written to your Animation Blueprint every tick. Make an Animation Blueprint, add a Variable for every bone in your Mannequin you want to manipulate in VR and set them every tick in the Event graph.
Now you can use those rotational values in your Animgraph to drive the individual bones with a Transform Node, you can choose whether to add or to replace the existing values. Be aware that the initial bone rotations and axis vary throughout the skeleton, so make sure to have a proper look at those when setting this up.
All that is left now is to get the overlap events from your collision spheres/meshes when your VR hands intersect with them. While they overlap you can just add the local rotation of your hand/makes them snap to your hand rotation or whatever you deem fit.
This should allow you to pose the mannequin in forward kinematic fashion in realtime.
In your control rig there is a window that was hidden by default for me. When editing your control rig, go to Window > My Blueprint. This will open the usual dialogue that allows you to add variables and functions to your control rig. I created a vector variable to hold the desired position of my control.
Then in the Rig Graph I get that variable and feed it into the location pin on a “Set Translation - Control” node which is set to handle my control.
The kicker here is to click the variable in the ‘My Blueprint’ window and then over on the variable details panel, check “Instance Editable”. This allows the AnimBP to change the value of this variable:
In your AnimBP, add a “Control Rig” node and set it to use your Control Rig class. Since you made that variable “instance editable”, you should now see it listed underneath the “input” section in the details panel. Tick “Use Pin” there to expose it as an input, then you can feed in your desired control location and update it however you usually update data in your animation blueprint. (For me I have a skeletal mesh component in my blueprint so I “Get Anim Instance” off the skeletal mesh component, casting it to my AnimBP type and running a setter function that I have added to the AnimBP):
Wow! thanks for this! This makes a lot of sense. I’m a little lost at the end though. Would you mind elaborating a little? I’m still pretty new to UE4.