sidebar features
sidebar content

Go Back   Blender Artists Forums > Artwork > Blender Tests

Reply
 
Thread Tools
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
I recently found an easy way to simulate a chain moving using softbody and vertex parents. Here's the result:

http://s132.photobucket.com/albums/q...chainthing.flv

I can control the ends with an armature so it's easy to animate, and since it uses soft body it's easy to customize gravity and speed.

And here's the blend file for those of you too lazy to set it up yourselves. =]
http://www.mediafire.com/download.php?frgfydxnxud

Last edited by LiveWire; 19-Jan-08 at 05:06.
#1   Old 18-Jan-08, 14:04   
Reply With Quote


musk's Avatar
musk musk is offline
Member
 
Join Date: Jun 2007
Location: Germany
Posts: 2,548
And now a tutorial please on how to achieve that or even better give us the blend
pretty please
............................................
My WIPS: Chameleon and Fly Short, Belor
Interesting Vimeo Channels: Blender Tutorials Channel, Blender Animation/Video Channel, Blender Timelapse Channel
Go vote for feature requests for blender on Blenderstorm.org
#2   Old 18-Jan-08, 14:16   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
I'll get a tutorial together. =]
#3   Old 18-Jan-08, 14:19   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
Alright, here's a quick tutorial (set-up is slightly time-consuming):

Start with a plane. Enter edit mode, select all, and scale down along the Y axis to get this shape:

Click image for larger version

Name:	pic1.jpg
Views:	175
Size:	12.9 KB
ID:	32559

Enter edge select mode. Select only the two longer sides. Press W and select "Subdivide Multi". Enter the number of chain links you want minus 1. I want 10 links, so I entered "9".

Enter edit mode and select every other vertex on the top and bottom edges.

Click image for larger version

Name:	pic2.jpg
Views:	170
Size:	14.9 KB
ID:	32560

Scale along the Y axis and scale press zero. (Just press S, Y, 0, Enter)
Click "Remove Doubles" in the Mesh Tools. The result is a lot of triangles like this:

Click image for larger version

Name:	pic3.jpg
Views:	175
Size:	20.6 KB
ID:	32561

Create a new vertex group (name it whatever you want. I left mine as "Group") and assign the four vertices on the far left and the far right to it.

Enter object mode and enable soft body. Enable "Use Goal" and use the vertex group that you created. Set "G Stiff" to 0. Here's how I had mine set up. Depending on how you want you chain to move, you might want to tweak it some.

Click image for larger version

Name:	pic5.jpg
Views:	161
Size:	21.9 KB
ID:	32562

Now, if you press Alt+A, your mesh should sag in the middle.



Create a chain link (you can shape it however you want. This method doesn't work for rings very well.) Size the link down until it fits in the triangle on the far left of your mesh. Copy the link several times, moving it along the X axis, until you have one over every triangle of your mesh.

Click image for larger version

Name:	pic6.jpg
Views:	173
Size:	17.7 KB
ID:	32563

Holding down Shift, select the first chain link and the triangle-mesh (in that order) and press Tab to enter edit mode. Enter face select mode and select the face on the far left (directly beneath the selected chain link). Press Ctrl+P and create a vertex parent.

Click image for larger version

Name:	pic7.jpg
Views:	185
Size:	27.4 KB
ID:	32564

Now the time consuming part: do the same thing to all the other chain links. Create a vertex parent with the triangle directly below them.

When you are done, press Alt+A. Your chain links should sag with the triangle-mesh.

To animate it, simply add an armature modifier to the triangle mesh and set two bones to control the four vertices on the far right and the far left. Make sure the armature modifier is on top of the softbody modifier.
Animate the bones, then bake the soft body. Your chain will follow wherever your mesh goes. You can then move your triangle mesh to a different level so it doesn't show up in the render.

Let me know if I need to clarify anything (You probably noticed I'm not great at explaining processes like this.) =]

And I'd upload the .blend, but I'm not sure how. Can someone tell me how?

Last edited by LiveWire; 27-Jan-08 at 15:36.
#4   Old 18-Jan-08, 15:23   
Reply With Quote
oblenob's Avatar
oblenob oblenob is offline
Member
 
Join Date: May 2007
Location: Scotland - U.K
Posts: 702
try uploader.polorix.net or googling free file hosting
............................................
VirtualAnvil --> HERE

""I am a PC and I like life without walls."
In a life without walls, where do you put Windows and Gates?"
#5   Old 18-Jan-08, 18:59   
Reply With Quote
spiffyandy's Avatar
spiffyandy spiffyandy is offline
Member
 
Join Date: Dec 2005
Location: Sedro-Woolley WA
Posts: 965
WOOOOO thanks for the tut!
............................................
Buy my stuff, or make your own! Click Me!
*** Currently working on my marble game again!***
#6   Old 18-Jan-08, 21:03   
Reply With Quote
Borgleader's Avatar
Borgleader Borgleader is offline
Member
 
Join Date: Jul 2006
Posts: 1,135
nice tutorial thanks
............................................
My blog
My deviantart gallery
#7   Old 18-Jan-08, 23:12   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
Alright, I uploaded the blend. (see first post)
#8   Old 19-Jan-08, 05:44   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
FYI, I just tried this out using rings for the chain links, and it worked ok!
#9   Old 19-Jan-08, 06:18   
Reply With Quote
MPPIC MPPIC is offline
Member
 
Join Date: Jul 2002
Location: Bremen
Posts: 122
Brilliant, thanks!

I think the setup would be much easier/quicker if blender's dupliverts had an option to automatically vertex parent the duplis when you make them 'real'. i once hacked this into the source, wasn't very difficult. But it was a hack only.
What do you think, would such an option be generally useful? If you can provide some use cases, I could try to whip up a decent patch (as time permits, so no promises).

Cheers, Björn
#10   Old 19-Jan-08, 07:10   
Reply With Quote
meschoyez's Avatar
meschoyez meschoyez is offline
Member
 
Join Date: Dec 2006
Location: Córdoba, corazón de mi país ;) Argentina
Posts: 696
@LIveWire:nice tutorial and a very good new approach to chain animation!
thanks!
............................................
lastt WIPs in here Puppet painters theatre, mainframe characters, apaches test, Oscar Chichoni's chimneys

finished artwork: Chromanorama & There! Our Home!

www.epanimation.com.ar | my studio
www.martineschoyez.com.ar | my personal site
#11   Old 19-Jan-08, 11:32   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
Thanks for the feedback, everyone!
@MPPIC: The only problem with your idea is that in this method you need to make vertex parents with 3 vertices. Each triangle is a parent, not each vertex. More of a dupliface instead of a duplivert.
#12   Old 19-Jan-08, 13:12   
Reply With Quote
MPPIC MPPIC is offline
Member
 
Join Date: Jul 2002
Location: Bremen
Posts: 122
@LiveWire: That's true... but it should be no problem to automatically vertex parent to 3 vertices = a face for 'duplifaces'. But what about quads? Just tested, and (as expected) duplifaces seem to pick one tri out of a quad to work with, so automatic parenting (to 3 vertices) could work with identical results.

I imagine this workflow:
  • model controller mesh and link
  • dupliface link on the controller mesh
  • make duplis real with option 'add parenting' (can't think of a good name right now)
Much faster, especially for long chains :-)
Anybody think this is something worth investigating? Any other nice use cases?
#13   Old 19-Jan-08, 16:03   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
Come to think of it, could you get this to work with just dupliface? I didn't really think about it, but you may not need to "make real" at all. Unless, of course, you wanted to edit the mesh of one particular chain link and not the others.

As for other uses, it's basically a quick way to dupliface something and be able to edit each instance of it individually.
That could come in handy if you're making objects float on water.
#14   Old 19-Jan-08, 16:52   
Reply With Quote
patdog's Avatar
patdog patdog is offline
Member
 
Join Date: Jun 2005
Location: Amsterdam / E.U.
Posts: 685
Quote:
Originally Posted by LiveWire View Post

To animate it, simply add an armature modifier to the triangle mesh and set two bones to control the four vertices on the far right and the far left.
Although this might seem obvious - the armature modifier should be moved up in the stack above the Softbody = otherwise it'll just stretch the last triangles

Thanks for a rewarding tutorial LiveWire
............................................
I say stupid things. I\'m human.
#15   Old 26-Jan-08, 10:07   
Reply With Quote
rndrdbrian's Avatar
rndrdbrian rndrdbrian is offline
Donating Member
 
Join Date: Dec 2001
Location: Scotland, UK
Posts: 1,108
Now could such a technique be used to drive a chain driven cog at the appopriate speed according to the movement of the chain and have the chain wrap around the cog correctly?
#16   Old 26-Jan-08, 17:28   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
@patdog: thanks for pointing that out.

@rndrdbrain: are you people never satisfied? This method is really more for having a chain that reacts realistically to its surroundings. I'm not sure how well it would be able to affect its surroundings. Maybe a cog-driven chain would work, though. I'll have to look into it.
#17   Old 26-Jan-08, 17:35   
Reply With Quote
Gimble Gimble is offline
Member
 
Join Date: May 2002
Location: Canada
Posts: 304
I noticed that if the bone isn't moving, the "chain links" seem to "jitter" back and forth.
Is there some way to prevent this or reduce the effect?

To see what I mean, select the bone in pose mode, and delete the last 2 keys.
#18   Old 26-Jan-08, 21:49   
Reply With Quote
LiveWire's Avatar
LiveWire LiveWire is offline
Member
 
Join Date: Jul 2007
Posts: 145
@Gimble: Yes, I've noticed that. I think if it's possible to get rid of that, it would have to be done by tweaking the softbody. I'll experiment with that some.
#19   Old 27-Jan-08, 00:53   
Reply With Quote
Gimble Gimble is offline
Member
 
Join Date: May 2002
Location: Canada
Posts: 304
Hi LiveWire

I reduced the 'Error Limit' setting in the 'SoftBody Collision' panel to the minimum value of 0.001, and that seemed to almost completely cancel out the "chain links" jittering back and forth.
#20   Old 27-Jan-08, 01:33   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:12.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists