Home Technical Talk

Animation Question (animating ropes and cables)

polycounter lvl 8
Offline / Send Message
Glacierfox polycounter lvl 8
Hi guys, wondering if anyone can help me with this. I'm trying to what should seem like a simplistic thing but I can't get it to work properly.

I need to animate a cable using bones swinging in the wind between two telegraph poles. I dabble in animation here and there but this has me embarrasingly stumped...

I basically need to lock the position of the 'free' end of the bone chain in place and control the IK from the middle so I can make it swing somehow...or something like that.

Thanks, Danny.

Replies

  • GlowingPotato
    Options
    Offline / Send Message
    GlowingPotato polycounter lvl 10
    you can simulate with nHair, using wind and fields, and then bake the simulation. i have done this before, pretty much straight forward.

    EDIT: you can easily start with something like this. https://www.youtube.com/watch?v=jId_Ghrd7MI
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Can I convert that simulation data to bones then? I need it in bones so I can export it to Unreal 4. I already have a moderate selection of Apex stuff running so I need this to be baked to bones.
  • Redsett
    Options
    Offline / Send Message
    Redsett polycounter lvl 4
    Spline IK should work fine for this. Just put clusters on the Spline IK curve and parent to your controls.
  • jfitch
    Options
    Offline / Send Message
    jfitch polycounter lvl 5
    You should be able to bake the simulation into keyframes I believe, if you go that route. Spline IK also makes sense.
  • Sand
    Options
    Offline / Send Message
    Sand polycounter lvl 4
    Spline Ik wouldn't really work in this situation because it needs to connect on both ends and stretch. Maya's spline IK keeps the same length, and even most stretch solutions tend to cause the bones to overshoot the end goal slightly.

    In this situation I would use a Motion Path (Animate --> Motion Paths --> Attach To Motion Path). Distribute your joints (at least three of them; beginning, middle, and end) evenly along the path using the "U Value" attribute. Then make clusters on the curve and attach them to your controls.
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Right, thanks guys. I'll have a go taking into account the methods you've highlighted. I'll let you know how it goes.
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Right guys, I've tried a whole range of things including motion paths and all sorts and this is getting frustrating now. I have two wooden posts and I need the rope to sway in the wind between the two posts and its getting unnecessarily complicated. there must be an easy way of doing this?

    Im just going to hand animate a simple sway animation using key frames and bones but i cant get the bones to 'anchor' at each end and allow me to do this without one end swayig all over the place away from the point i set it at :S
  • Redsett
    Options
    Offline / Send Message
    Redsett polycounter lvl 4
    Sand is correct. Just make a curve along your cable, select a joint then your curve. Animate/Motion Path/Attach to Motion Path. Repeat that step for each joint. Then select all the joints, under inputs in the channel box you'll see the motion path, right click U Value and break connections. Now for each joint adjust the U Value evenly along the curve. 0 and 1 U Value will be the static joints.

    1 divided by your number of joints will be the spacing between each U Value.

    Now just make clusters on the curve to control it.

    Edit: 1 divided by your (number of joints - 1), don't count the one at 0. :P
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Right, created my line (CV Curve). Made my joints. Clicked the bones, clicked the curve and the first bone and attached to motion path the repeated for the rest. its set some keys on the time line, when I scrub along, the bones go all over the place on the wrong axes and everything.

    i can set the position of the root bone using the U value but randomly adjusting the U value for the rest just flips them around and all sorts. What have I done wrong.

    Taking into account I've never animated in Maya before I have no idea what I'm doing. I'm a 3ds max user and I cant even get it to work in that. When I create things in 3d programs, I like to know exactly what my actions are doing. I can't even seem to grasp what 'break connections' even does, so i cant troubleshoot my own work. Cant even get this to work in Modo 801...

    Also, in those screens I am aware im looking in the channels box and not the attribute editor, i was just changing some of the values to see what happened.
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Right i fixed the weird angles by changing the 'front axis' for each of the bones.

    Am i supposed to break connections for just the first and last bones? because if i break connections for all the bones it seems that the bones aren't attached to the curve any more. If I attach to curve and then break connections, aren't i just detaching the joins from the curve I just attached them to ? :S


    so ive broken all connections and tried moving around the curve using its control vertexes. the bones kinda follow the curve a little bit but the last bone DOES NOT stay in place. As i move the vertexes the bones just compact down....

    Like, I've done exactly as you guys said, and its not working at all. Any other suggestions? I need this rope swinging as soon as hahah
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    you can simulate with nHair, using wind and fields, and then bake the simulation. i have done this before, pretty much straight forward.

    EDIT: you can easily start with something like this. https://www.youtube.com/watch?v=jId_Ghrd7MI


    yes thanks for the input mate. I can already do that fine, i need both ends of the chain to be attached to an object (like the electricity wires you see hanging from the poles in the street)

    I NEED to use bones as this needs to go into Unreal 4. and it needs to be looping so im ignoring simulations altogether. Thank though
  • Redsett
    Options
    Offline / Send Message
    Redsett polycounter lvl 4
    1) Make curve
    2) Place joints onto curve with motion path.
    3) Break connection to U Value(deletes the keys)
    4) Space out the joints along the curve using the U Value.
    5) Animate the curve using clusters.
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Redsett wrote: »
    1) Make curve
    2) Place joints onto curve with motion path.
    3) Break connection to U Value(deletes the keys)
    4) Space out the joints along the curve using the U Value.
    5) Animate the curve using clusters.

    Thank you Redsett. I really appreciate your help. I'll follow this. I hope I don't appear to be a complete idiot, I'm actually an artist trying to do a little animation for this project I'm working on! I'll post back with how it goes :)
  • Redsett
    Options
    Offline / Send Message
    Redsett polycounter lvl 4
    Not a problem. I would use those joints as the "control" joints. Then make a separate joint chain(the export joints) and parent constraint each joint to the control joints; use those to bind to the mesh.
  • GlowingPotato
    Options
    Offline / Send Message
    GlowingPotato polycounter lvl 10
    You can bake the nhair simulation to bones. I have done this for a character hair, using bones.

    When she walks, her hair bounces and move around, using bones.

    And i did this for hanging ropes too. Just place a point constrain on the root and end joint of your joint chain.
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Redsett wrote: »
    Not a problem. I would use those joints as the "control" joints. Then make a separate joint chain(the export joints) and parent constraint each joint to the control joints; use those to bind to the mesh.

    Thank you very much and for that extended advice. It went absolutely smoothly, the animation looks great. Really appreciate your help.

    Thanks, Danny
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    You can bake the nhair simulation to bones. I have done this for a character hair, using bones.

    When she walks, her hair bounces and move around, using bones.

    And i did this for hanging ropes too. Just place a point constrain on the root and end joint of your joint chain.


    Ah I see, I had no idea you could do that. I'll research that a bit more and give it a try with some other asset in the future, thanks!
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    Hi again, a bit of a problem has arisen. When it came round to adding this animation to Unreal 4, it turns out that the engine does not support 'multiple roots' so I had to go through the process again but with a chain of joints instead now.

    A couple of problems have arisen when I'm trying to do this. I've set everything up as I did before with the separate root bones along the curve and everything.

    I've made a separate bone chain next to it and those bones have been constrained to the ones on the curve using the 'parent constraint'

    The problem lies when I try to move the curve using the clusters that I have assigned to each control vertex on the line. As you can see in the image I do not select the last cluster along the line for movement as this moves the last joint in the new chain and I need that static. When I move the joints in the 'control set-up' using the clusters, the chain of joints doesn't seem to follow it very well, spiking off all over the place.


    (I haven't skinned the rope yet, I'm just trying to get the joints to animate first)
  • Sand
    Options
    Offline / Send Message
    Sand polycounter lvl 4
    The issue may be caused by the offset you have between the joints. Try making both chains directly on top of one another then Parent Constrain them with "Maintain Offset" turned off.
  • Glacierfox
    Options
    Offline / Send Message
    Glacierfox polycounter lvl 8
    I've actually managed to do it now. I just selected the last joint in the chain, then selected the root and applied a point constrain. That kept the last joint perfectly still. Then i just animated it :)
Sign In or Register to comment.