Jump to content
Hash, Inc. Forums

An accordian rig but with a complicated twist


heyvern

Recommended Posts

Here's the scoop. My plan to use expressions for this isn't working as planned. I am absolutely certain something can be done using simple constraints.

 

Imagine a chain of bones, in any configuration needed to achieve the results. Don't box yourself in. For my example this would be bone spaced out evenly to control the opening and closing of a curtain. It would be easy enough to just use a translate to or orient like on each bone to have this chain "collapse" but I want it to work in a specific way. I want each bone to only move when the previous bone reaches a specific point. Say, half the distance to the next bone, then that bone moves in unison until it hits the next bone and so on. Just like one of those accordian type folder doors or a curtain. Each bone won't budge until the previous bone has reached it.

 

I've been fiddling and playing with this and just can't quite get my head around it.

 

I did do this with expressions but I run into a performance hit when I get past 20 bones. I've tried and tried but once I get up around that number and each bone has an expression the performance drops exponentially. I wonder if this could be done using only constraints, even if it's harder to set up.

 

Put your thinking caps on and in the meantime I will continue to experiment (writing this down often inspires solutions for me).

 

-vern

Link to comment
Share on other sites

Well... lag doesn't work because it just... lags behind. Enforcement can be keyed but... yikes. That is what I'm trying to avoid... key framing every instance of the "fold". I've already done that as my "backup" or "failsafe" solution... which was a total nightmare. Imagine keying 30 bones every 3% of a percentage pose. I had to translate the moving bones on each point of the pose, then key them again at every point so they move to the next position. No copy and paste because each bone that moves moves again exponentially. Got to be an easier way.

 

Another part of this I'm stuck on is how to do an accordian rig with orient like. For instance zig zagging bones where each bone rotates in the "opposite" direction to cause a collapsing bone structure? I know it has something to do with how the bones are rotated. My mind is all polluted with bone constraint behavior from "another" application I won't mention. It lacks the sophisticated bone constraints of AM but allows bones to be constrained with "negative" values. So a rotation constraint can go "backwards" of the target.

 

I'm thinking of adding extra bones at the tips of each joint and using a translate to constraint then reversing every other "hinge" in the accordian bone structure. So it would be base to base, tip to tip. The opposite rotations would happen and the translate to the extra TIP bone would keep the chain connected.

 

-vern

Link to comment
Share on other sites

  • Hash Fellow

here's a partial solution using translate limits. It stacks the way you want in the contracting mode, but opposite of what you want in expanding mode. With more R&D it could perhaps be made to work both ways.

 

pleatTest.mov

 

 

accordianPleat.zip

Link to comment
Share on other sites

Hey! Thanks! That is a lot easier than how I did it.

 

I still would want to keep playing with a "rig" that doesn't require keyed poses. I started with a small curtain then made it larger... which meant re-keying the pose practically from scratch.. etc etc. I would like a system that could be expanded or changed just by adding/deleting bones and the constraints. Your solution works perfectly and is a million times easier than keying the bone translation but this is a challenge for me now to make it even easier.

 

I think I'm onto something using an aim at constraint and rotation limits that might do the trick. As a "tracking" bone translates each bone of a zig zag chain will aim at (with offsets) to this bone. By adding in rotation limits the bones at the front of the chain will collapse and stop. Bones in the back won't rotate until the bone is "close enough". The bones at the hinge will rotate in opposite directions equally creating my accordion effect.

 

-vern

Link to comment
Share on other sites

WOOOOOHOOOOO!!!

 

It works! Coool! Works like a charm. I just put the bone chain spread out "nearly" flat. All bones are parented like a chain one to the other. I add the aim at constraint targeting the "tracker" bone and orient like and spherical/translate limits to control how much they wiggle around when collapsing. Yeeehaaaa! I knew there was a way.

 

I have to go to dinner... but will finish it up and post later.

 

-vern

Link to comment
Share on other sites

Phew!

 

Now I've got it. Less bones too!

 

Translate to and translation limits. Each bone in a chain has a translate to constraint (with offset) to a single target bone. Each bone has a translate limit set to the amount of "spread" between each bone, for example each bone's max translate limit on the Z axis would increment by 10; 10, 20, 30 etc. This is the max spacing after the "collapse". BUT the minimum translate limit is the SAME value for each bone so once collapsed the whole thing still moves as one unit.

 

Tested and confirmed. This is WAY easier to set up than any of the other techniques. yes it requires a lot of constraints but it's not so tedious. I like it. Will post a sample once I clean out all the other bone experiments (I have like 10 different rigs in one model as I tried different ideas) and add some splines.

 

-vern

Link to comment
Share on other sites

Yeehaa!

 

Worked pretty good. Had to use the same number of bones after all but still not to hard to set up. The key is to create the mesh grid for the curtain so it snaps to the grid or at least lines up. Then you know exactly where to place the bones and you know the specific increments to put in the translation limits.

 

So for this sample the grids were 15cm. Each "fold" is 15cm. The main bones are on every 30cm and line up with every other vertical spline in the grid and those splines are bound to those bones. Each of those bones (except the last one) has a single child bone. That other alternating set of vertical splines are bound to each of these child bones and have an aim at constraint to the next main bone in the chain.

 

All of the bones are children of a "root" bone. Only that bone is moved to collapse the curtain. There is an "aim" bone. This bone is the target for a translate to constraint for all of the main bones. Each of the main bones also has a translation limit constraint. This is where the grid units come in. There is 60cm distance between each main bone. Starting with the first bone that starts the collapse the translation limit is min -1000 max 0, then the next bone is max 15, then 30, 45, 60. This allows the curtain to move half the distance to the next bone and so on until the whole curtain is closed. Then if the "root" bone is moved further the whole curtain moves. There is a translation limit on the root bone but that isn't really needed. It just makes it easier. If you have to move the whole curtain the model can be moved or animated. I had to use this extra "root" bone to move things because moving the aim bone collapses backwards.

 

Here's the test movie and the model file. There is a single on/off pose that needs to be turned on.

 

new_curtain_rig.mov

New_Curtain_Rig.mdl

 

Here's a wireframe render.

new_curtain_rig_wf.mov

 

p.s. I can either modify the mesh or offset the bones in the pose or another pose to put in some "folds" at the start when the curtain is "open".

 

-vern

Link to comment
Share on other sites

here's a partial solution using translate limits. It stacks the way you want in the contracting mode, but opposite of what you want in expanding mode. With more R&D it could perhaps be made to work both ways.

 

pleatTest.mov

 

 

accordianPleat.zip

 

 

Cool stuff again, Rob. WHY did I find myself playing this movie over-and-over and wishing it could go faster??? And part of me (a little part) wished you had made that control-bone a lot bigger. HEY! THERE"S KIDS READIN THIS!!! I'm a sicko...

Link to comment
Share on other sites

You aren't going to believe this but somehow I totally missed Rob's contribution earlier. Apparently we posted simultaneously and then I never saw it... the heated fever of creatinve energy. ;)

 

 

WE BOTH HAD SPONTANEOUS CREATIVE GENERATION!!!! Holy cow. Mine was exactly the same. The main difference was I start out "open" with the extra model bone moving. Rob starts out closed. Plus I added in the collapsing folds... but overall the concepts are identical.

 

Here's the FINAL version... lots 'o bones... lots of constraints... thank GOD for search and replace and jEdit. ;)

 

Cloth_Curtain_final.zip

 

 

-vern

Link to comment
Share on other sites

Hah!

 

I was going to do the herculean task of putting both sides of the curtain in one model so I can decal... don't half to. I just duplicate the model so I have one for the left one for the right and then just decal each with half the image. Piece of cake.

 

-vern

Link to comment
Share on other sites

Impressive Vern. Your last render looks great. Did you use simcloth or dynamics?

 

I used simcloth. Would dynamics work for cloth? Is this another option? I find dynamics slower to simulate than cloth. Cloth is pretty darn zippy.

 

-vern

Link to comment
Share on other sites

I actually thought there appeared to be more "weight" by increasing the particle mass... I may be wrong about that though. Not sure what that setting does. Are there settings that can give it more weight without "slowing it down"? Maybe increasing the damping values and increasing the mass? I'm perfectly happy with how it looks in general. It seems to be "large" enough for my needs.

 

In the actual animation I did with Thom and the wall falling (not posted yet) I added in some "hesitation" on the curtain... as if it sticks a little or the guy pulling the ropes pauses as he opens the curtain. I kind of like it.

 

-vern

Link to comment
Share on other sites

Aha! Eureka!

 

It's a combination of settings to make the cloth "heavier" or actually "thicker" in my case. I noticed subtle "bouncing" which can only be caused by stretching. A curtain wouldn't stretch. I had the stretch stiffness set to 100 which I thought was the max... wrong... I set it to like 300 and there is NO stretching now. I adjusted the sheer stiffness way up as well (a curtain is more "still"). I also increased the bend damping and stiffness. Now I'm getting closer to a large thick stiff heavy curtain. It's still pretty tricky guessing what the settings will do. Someday maybe someone will come up with those cloth "materials" for different cloth types.

 

-vern

Link to comment
Share on other sites

Impressive Vern. Your last render looks great. Did you use simcloth or dynamics?

 

I used simcloth. Would dynamics work for cloth? Is this another option? I find dynamics slower to simulate than cloth. Cloth is pretty darn zippy.

 

-vern

Dynamics probably wouldn't work as well as simcloth, collision detection is iffy in dynamics.

Link to comment
Share on other sites

I never thought to change the collision distance. I noticed too some odd folding behavior. I think I need to increase the bend stiffness but increase the damping to cut down on the stiffness a little. Damping should keep it from swinging and fluttering like a "silk curtain". I am pleased with the final closed "folding". It is acting just like a "real" curtain would... almost. ;)

 

 

-vern

Link to comment
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...