VR IK Body - Support

It seems like it’s possible to use something other than motion controllers for hands position and rotation but I am not sure how to set this up. VRIKBody has “VRInput Option” which can be set to Direct VR Input, Input From Components and Input From Variables. How does each mode work and how do we configure for each of them?
Docs mention that if we don’t want to use motion controller components then we should use the ActivateInput() instead of Initialize and VRInputFromComponents has to be false.
ActivateInput node says on the other hand that this function activates the recording of HMD and motion controllers and if we want to use components then we should use Initialize.

I guess all this means is that we can either feed the motion controller components to the plugin or the plugin will grab the motion controller data automatically.

What about using variables? How does one set it up? How and where do we feed the hands positions for the IK solver. We are using leap motion to drive hands instead of the motion controllers therefore it would be really good if we could just feed the leap hands transforms to the VRIKBody.

Option 1. Direct VR Input. You need to call ActivateInput() in BeginPlay. No need to add motion controller components to player blueprpint. The plugin will receive data from VR API functions.

Option 2. Input from Components. Player Pawn must contain Camera component and two Motion Controller components. Call Initialize(Camera, Right Hand Comp, Left handComp) in BeginPlay. Actually, you can use any other scene components and animate them as you want. In runtime the plugin will consider positions of this components as head and hands positions.

Option 3. Input from Variables. Call ActivateInput() in BeginPlay. Then call VRIKBody::UpdateInputTransforms(Head Transform, Right Hand Transform, Left Hand Transform) in Tick before ComputeFrame(). (Transforms are in world space, this method doesn’t work with replication).

if you need both leap motion and replication, I’d recommend to use ‘Input from Components’. Add simple Scene Components to you pawn blueprint to simulate hands and update their location and rotation in Tick().

Thanks for the prompt reply and clarification, I was actually trying Input from Components but I wasn’t sure I was doing it correctly, simple Scene Components won’t work I had to use an abstraction of it like Sphere Collision.

I added the suggested workaround. It had the effect of the legs spreading out more so they are more horizontal to the ground. I can send you my character mesh if you feel it would be easier to test?

From Docs: “All transforms are in World Space or relative to Player Pawn origin if both VRInputFromComponents and FollowPawnTransform flags are false.”
Do you mean: All transforms can be calculated either in World Space or Relative Space to Player Pawn origin.
If VRInputFromComponents and FollowPawnTransform are false then transforms are calculated in World Space and if both are true then it is calculated in Relative Space.
Am I correct on that?

Also could you explain a little how the new character height is calculated, our main character transforms into a HULK after calibration. For some reason it is not scaled uniformly, instead it looks like he gets less scaled upwards and more in other directions, it looks wider than it should be.

Yes, your mesh would help me (ykasczc@gmail.com).

But this workaround should work anyway. Can you also make a screenshot of the vr preview window? Are you sure you changed Effector’s location space in TwoBoneIK node settings to world space? If feet are too high even after TwoBodyIK nodes, it could be caused by something else then i expected - most likely, ground detection error. By default, pawn’s Z coordinate is considered as a ground level. Try to change to this setup: https://pp.userapi.com/c841430/v841430062/5ca68/dEpnD5zRESM.jpg

Transforms are calculated in World Space if InputFromComponents is true or FollowPawnTransform is true.

it simply takes a vertical distance from hmd to the ground and adds some fixed static offset. I’m planning to take out scale coefficient to the component’s settings, so you’ll be able to adjust it as you want.

Yes checked and I have made the correct changes. I emailed you the FBX.

Sorry about poor quality image, ignore the hands (they are fine), after making the latest suggestion it appears as though the character is squatting/crouching down which is an improvement.

I can’t figure out yet why our character is wider and more flat than it should be, hands look quite flat. It’s as if it was scaled up in width and scaled down in height.

On the other hand, I’ve been trying to add the BlendSpace for the walk/strafe animations. I am not sure what kind of node I should use for blending BlendSpace with the Snapshot. I tried to blend using “Layered blend per bone” but it is not giving the results we want. Sure when not moving we want to use the Snapshot data and when moving we want the BlendSpace animations but we also need movement, rotation, and turning mechanisms. I tried playing with Root Motion for that reason and noticed that if Root Motion is disabled in VRIKSkeletalMeshTranslator then the lower body is not affected at all by the plugin. When I enabled Root Motion the character was again moving and rotating but it was off by 90 degrees to the right and it was rotating all the time with camera, it’s only supposed to rotate after exceeding some angle to allow torso twist and some angle of freedom for looking around without unnecessary character rotations.
Also we can’t just use IsMoving for blending between BlendSpace animation and Shapshot data because then we loose the Leaning mechanism which we like. I suppose leaning happens when we are moving in a limited radius and when that radius is crossed it will trigger feet adjustment/walking but we need to know when it happens if we are going to trigger animation in that moment.
Another thing that one might want is “turn animations” while turning but then again how do we blend and when do we trigger them.
I think the plugin should provide more variables/bools with different states. Maybe I am just trying to approach this problem in a wrong way…

Thanks for the update last week. I have another smaller issue which I hope you can help with. The character’s feet are below the floor and not visible Is there a setting I can use to raise the character mesh a little? I tried toggling the Use Actor Location as Floor bool. Thanks.

It’s possible that I misunderstood you before. If default skeletal mesh is ok and your mesh scale looks wrong, it could be a bug. Can you make a screenshot or - it always helps - send me the mesh itself (ykasczc@gmail.com)?

There is another problem. Pelvis is a parent bone for both spine and legs. When you apply legs animation by ‘Layered blend per bone’ to pelvis, it overrides pelvis position generated by plugin.

In my demo project I apply strafe animation only to thigh bones. See ABP_VRIKAvatar’s anim graph. This approach has a problem too: as legs animation rely on pelvis, pelvis bone removed from the animation partially breaks it.


Another approach is to apply strafe animaiton to pelvis and legs and use PoseSnapshot since first spine bone after pelvis. It gives another problem: as strafe animation change both rotation and location of pelvis bone, it affects whole torso position and adds some error to head and hands locations (although you can fix hands with TwoBoneIK node). Note that if you use strafe animation as a base and add PoseSnapshot above, your strafe animation overrides root bone position. And if you use a mesh without separate root bone before pelvis (like Mixamo), it could give more errors I never faced.

I suggest to use the first approach. If you have an idea how to improve it and get clear blending, please let me know. I’ll try to implement it in the plugin.

What flags would you want?

Your skeletal mesh has root bone above the surface, so it looks like root bone translation scaling bug. Try this temporary solution:

I don’t seem to be able to find the node Set Pose Snapshot Structure? I also tried toggling context as well and dragging off the Mesh Pose var and the Make Pose Snapshot.

**Yummy-Vegetables, **try this https://www.youtube.com/watch?v=cJsuo3niOTQ

docs folder isn’t appearing in location specified, is this documentation up to date?

Sorry,

New documentation: VRIKBody_Help.pdf - Google Drive

太棒了,感谢。我们正在尝试。

1.0.7 Update info

New parameters:
(float) VRIKSkeletalMeshTranslator::**ScaleMultiplierHorizontal **(mesh height multiplier)
(float) VRIKSkeletalMeshTranslator::**ScaleMultiplierVertical **(mesh width multiplier)

Both require VRIKSkeletalMeshTranslator::**RescaleMesh **= true

Hi,

I was wondering if there will be a version of the plugin that is compatible with Unreal Engine 4.19