Remember that the preview values are just that, for preview. Once you find a good left/right joint location you should copy those into their default values. Generally the joint targets shouldn’t need to change.
In your preview with certain joint positions, your elbows will bend, and at a good range they will bend naturally. Since we’re using the same model, you can probably use the same values as I have in the image I posted earlier. Do remember that the character ‘forward vector’ is by default in the Y direction in the animation blueprint.
, thanks for all the advice by the way. I get that the preview was just to test out the values and that the default is where those values actually live but what I was saying is that whether I am in preview or default the values that I change don’t affect the skeleton in any way. For example I set all the joint values to 10000 just to see some results and nothing happened there was no bending even in unnatural ways. When I get to the office I’ll test it out with your numbers but I’m afraid the problem above will still persist. Based on my IK set up from the earlier pictures do you think I could have set something wrong?
EDIT:
Hey so I just used your values in the default area but still the elbows do not bend. What is your Effector Location Space? Mine is in component space so is my Joint target location space. I’m playing with different variations of these as well but I still don’t get any bend. Could you also show me which bones are part of your IK system? Here is my set up the left matches the right.
Hey so I’ve been playing around with the IK and also FABRIK thanks to n008 in the hydra forum but I’ve noticed that my hands do not move in the Y axis which is my forward and back or toward the skeleton and away. Both n008 and I were wondering if maybe the data is scaled too far out in front of the player and therefore would stretch out the arms not allowing the bones to bend. Do you think this might be a possibility. I’m just doing guess work at this point.
ok i just wanted to say, i tried this on 4.51 and i didnt work for me :\
so i switched to the blueprint fps project and everything worked fine ever since. (same bug as joemamaishere123) to bad though :s
not sure if i did anything wrong i just created a new blueprint derived from MyCharacter and used that child to implement all the leap functions (interface/controller).
either way thanks for the plugin and the response ^^’
I went back to my IK implementation for the hydra and I realized that I was misrepresenting a few facts. I’ll break these down into topics
Actor origin vs component space origin. Whenever you get Actor->Get location, it will give you the location of your actor origin (0,0,0), which in the default character is close to the pelvis, but not in any way related to the pelvis bone. The component space on the other hand will give you the origin of your mesh, which for the default character is at his feet. I thought my implementation was using component space, but I realized I had automatically added the world location and used world space for my effector locations.
So if you want to use component space for effector location you need to find the mesh location transform relative to the actor origin (mesh->location) and add that offset to your hand positions, or if you use world space for effector location, you need to add the actor world location to your hand positions.
Joint Targets, its important to specify the space you use these in, I recommend using component space or something that follows the body form such as spine_03. The proper way should be using the upper arm bone space, but this is very difficult to calibrate correctly in my experience.
Also if you’re doing animations which involve your hands I recommend blending out your IK contribution for the duration or you may get ‘elbow jitter’, using a stable space such as component will minimize this type of animation blending jitter.
Left Hand Location and Right Hand Location values are actor origin offset hydra values converted into world space (Hydra in Actor Origin + Actor Location).
Joint Targets are in spine_03 bone space, they are fixed, set as default values and never changed. You can see the spine_03 axis in the persona preview
Hand Locations are just values I changed to show poses where the elbows bend naturally. Right hand fist is closed using finger IK.
Please note that I do not consider this example to be anywhere near perfect, but something that has worked for my testing purposes. Here’s an example of the previous setup which had component space joint targets using a Razer Hydra and an Oculus Rift DK2: Gfycat Album
@Ryunigia
Still working on fixing this class of bug, its an architecture bug which only affects the Leap Plugin. I haven’t had the time to properly address it.
Regarding the temporary fix, if you want to use C++ for gameplay, do that. Subclassing a blueprint child and adding the leap component there should work. You also have the option of adding the leap component to a simple blueprint actor and forwarding the values to your pawn/character.
Wow thank you I did these changes and immediately was able to bend my elbows in persona. to have it running in game I had to do some math to calculate for the mesh offset. I’ll be making a tutorial of some kind once I actually get both arms working right.
So now I need to add the leap rotation data. How would I go about doing that? I tried getting the palm rotation but could figure out how to get that. I’ll keep pluggin away at it. Thanks!
Ok so now I’m working on adding rotation to it. This is what I have so far but I’m not getting any rotation to my hand.
To get the rotation from my palm position I do a rotation from Xvector then I set a Right Hand Rotation variable.
After that I get the Right hand rotation from my leapController BP and set the right hand rot inside my AnimBP event graph
Then in my AnimGraph I grab my right hand position and my right hand rotation plug that into a make transform and then all that goes into a FABRIK.
Since I know it doesn’t rotate my hand I know it’s not working. Does any one have any suggestions? Also if anyone wants to know how I got this far I will supply you pics, just let me know.
Update to 0.7.2
-Circle gesture radius now in UE scale
-Swipe Gesture speed now in UE scale
(0.7.1)
-Hidden Leap header and private implementation from UClasses
-Fixed image stability, will now correctly resize when requested.
-R8 texture no longer causes memory leaks
-Added Gesture sub-classes and corresponding events (e.g. Swipe Gesture
Detected). Will allow for easy determination of direction and other
properties of gestures. You can also cast general gesture detection to
the correct sub-class gesture.
-Added own category of logging, pay attention to log output to help you
with debugging errors.
The plugin is now properly encapsulated and includes various memory leaks and bug fixes. Also added all the missing sub-gestures, if you’ve been looking for gesture sub-classes such as SwipeGesture or CircleGesture, this is the update you’ve been waiting for.
Example of displaying circle gesture’s you’re making, either of the two cases can be used, they are equivalent after the generic gesture is cast.
It terms of how you’re sampling the rotation it appears correct. I’m not sure what the fabrik rotation does (haven’t used it myself yet), if you’re having trouble using it, you could instead simply rotate the characters hand bone using FK (transform bone) *after *you do the hand IK.
Do note that you will likely have to rotate your leap rotations such that they are in the bone space. For the hydra, I adjusted to the local space using something like
There should be more details on this in the hydra thread. You can change axis directions or swap them around using break rot, but all rotation transforms should be combined using combine rotators, which uses quaternions in its implementation, this ensures you do not have a gimbal lock by converting axis.
Thanks I got it working! I initially wasnt able to get the rotation from the palm but thanks to the API I found out I had to Frame > Hand > Rightmost > Palm Normal and Palm Direction > Break Rot > Make Rot.
Now I need to work on the finger IK any suggestions?
Xeno I’ve posted all the blueprints to get the hands matched to the position if you look at the past couple of posts I have three pics that show everything that I have done. First I’d say get the debug spheres working cuz that really helped me to understand and visualize how leap data is being transferred. Once you have that check out the past posts, if you fall into some trouble ask away I’ll try to help.
ok thank you ! I’m going to try (again :p)
But just to know you are only using Leap Motion Controller data or you are also using the Oculus Rift?
Because I only have the the leap motion
Good luck for the fingers o’
I’m hoping someone can offer some advice. I’m trying to create actual spheres instead of the debug spheres so they can collide with objects. I haven’t found a way yet to create a static sphere and pick out the specific joint to attach each sphere to (most likely the best solution if possible).
Instead I modified the Draw Debug Sphere function to spawn a blueprint actor with sphere instead and then set the lifespan to something extremely short. I also tried using an event tick to delete all actors of that blueprint class. It works for a while but eventually UE4 leaves a ghost of the deleted actor in the scene outliner and it crashes.
Any one experience the same or found a way to create a simple set of spheres and move them rather than respawn (basically how to get the location of each and every joing LEAP provides).
Xeno - I am developing for the oculus so all my variables are set up to be attached to the oculus but you can play with those values until you get something that works for you.
Fabianoberlin - You have to install the plugin folder to your project file and NOT the engine folder.
It’s working in the editor. I just can’t make it work to the build project. So I’m assuming that I also need to copy to the project folder where I built it. I did it. But it crashes when I launch.
Or does it automatically copy the “Plugins” folder to the right build location?
In this documentations its states to use the newest version I have that however none of my blueprint nodes look similar to any of the nodes in the example. the only way to expose Metacarple is after a fingers node and select pointer by id node and after selecting the bones node i can not find a location for that bone? only showing finger tips. also hands never seem to move in or out just side to side and up and down, but the wrist component moves in all proper directions.