Home Technical Talk

Blender: Can a bone have two parents? [Robot game character rigging]

Hello polycounters!

I have a problem with my Character (mechanical robot) rig in Blender 2.77. It will be animated and imported into UnrealEngine 4 as a NPC.
My plan for this model is the following: simple bone hirarchy to move all the joints, as well as various cables connecting various leg and arm bones with each other. The base rig was done quit fast. The cables are now my problem, since they should mvoe smoothly along with the rig itself. These cables will have to move, because they are not conencted to only one bone, but for example the upper and lower leg, lower leg and foot and so on.
Here are some screenshots of the rig and how it should be:





Final question: How can I kind of create a bone which has two parents? Because that would be what I need at one site of the cable at least. 
(I also tried weight painting with the cables, but they went completely mental, and they of course ignored the collision of the legs.)

Meaby someone knows a solution for this, im pretty sure there is one. I couldnt find anything about that on google.

Thanks in advance,
David

Replies

  • antweiler
    Options
    Offline / Send Message
    antweiler polycounter lvl 8
    I have no clue of Blender, but bones cannot have two parents by nature. What you need in your case is a parent constraint (how its called in Maya) by which one object drives another one, independently of the joint hierarchy
  • RN
    Options
    Offline / Send Message
    RN sublime tool
  • HabakukFreitag
    Options
    Offline / Send Message
    @antweiler yeah, I was messing around with the constraints too. You can add a child of constraint to the last bone, but the problem with that is, that the bone to bone parenting is always "more important", so the constraint is kind of working but will be broken as soon as the bone to bone parent comes into action. I hope you know what I mean!

    @RN Thanks for that tip mate, I didnt knew anything about them actualy, looks realy handy! Problem with this: I dont think that Unreal Engine 4, the target software for that robot here, is accepting these Bendy Bones...  :/
  • Prime8
    Options
    Offline / Send Message
    Prime8 interpolator
    I don't fully understand why you want to have two parents at one side of the cable.

    You can try something like this, though I don't know the export to UE4 will handle that, I only used this kind of setup in Blender so far.


    Red - Your leg bones
    Yellow - Cable bones
    Blue - IK target, parented to the leg bone in the center
    Green - tip of cable bones, IK contraint with the blue bone as target 

    Instead of the blue IK target you can use the lower leg bone as well, in other cases though you might not have that bone and need to add one just as target.



  • HabakukFreitag
    Options
    Offline / Send Message
    @Prime8 Hey man, that actualy worked:D Oh god, it took me so long to get to that point finaly, thanks alot!! One small problem: As soon as I move the leg, the whole rig gets moved a bit, even the other leg. It feels a bit buggy, Im guessing this has something to do with the Inverse Kinematics Constraint right? Is there a way to make it less buggy? Besides from that: Thank you a lot, this is pushing me so much!
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    That's a smart setup, Prime8.

    @ bug: Set the Chain Length value of the Inverse Kinematics constraint to the number of cable bones.

    It defaults to zero which uses the whole hierarchy above the constrained bone. The constraint will solve all the way up to the hip bone (which is usually the parent of other branches in the hierarchy), so this is why the entire body moves in a strange way if left at the default value.
  • Prime8
    Options
    Offline / Send Message
    Prime8 interpolator
    Good that it helped! Didn't think it's a particularly smart setup, used it quite a lot for what I call "secondary kinematics", not sure what the correct term is.
    Let me know how the export to UE4 is doing later, I'm curious.
    As RN said, limit the Chain Length and you will be fine.

  • HabakukFreitag
    Options
    Offline / Send Message
    @RN yep, that worked, thanks a lot! 

    @Prime8 Alright I will, I have to make some more trial and error before I get this setup into Unreal. I will probably redo that rig again, I dont think its done very good, feels all a bit buggy. Another thing: It is probably a bit too performance heavy for my game, if I add like 5 bones for 10 cables on the whole mesh. That would make an extra of 50 bones, which is a bit mental. But meaby I will use this setup for another animated mesh in the game, this "physic cable" setup with bones seems to work quit good. If I do it, I will add it here! Thank you both for your advice, it was very valuable for me!
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    There's the alternative of shape keys (also called blendshapes or morph targets).
    They're lighter than skeletal deformation since the engine is only interpolating the position of vertices between two points, as opposed to transforming each vertex by a bone matrix which is costlier.

    In your case you would 'drive' the shape keys (i.e control their weight in the final mix) whenever the robot bends its legs, so that the cables are deformed in sync.
    - https://docs.unrealengine.com/latest/INT/Engine/Content/FBX/MorphTargets/index.html
    - https://docs.unrealengine.com/latest/INT/Engine/Animation/Persona/AnimCurves/index.html
  • HabakukFreitag
    Options
    Offline / Send Message
    @RN Oh, good point! I will read that article through for sure, last time I red about morph targets I was messing around with the UDK, totaly forgot about these. Thank you again!
Sign In or Register to comment.