Help - Search - Members - Calendar
Full Version: Free curtain rig model from "Change Your Pants"
Hash, Inc. Forums > Forum Archives > A:M Forums Archive > (2010) > Vern's World
heyvern
Here's the actual curtain set up and model used in the "Change Your Pants - episode 1" project ready to simulate.

UPDATED: Now includes a text document with these instructions
Click to view attachment

UPDATE: The Curtain Rod model used in the animation. This model is the right size to fit two curtains fully closed that overlap slightly. There are two rods connected on each side. One curtain for each "rod" with some spacing between them. It's got odd "knobs" on the sides that were to connect it to other piping and struts. Includes a material which isn't that exciting.

Click to view attachment

A few notes:

Decals and the two separate curtain models
There are two curtain models. They are IDENTICAL but are still separate models. The reason for this had to do with a decal rendering issue. Originally I had ONE model in the chor twice. The right curtain was scaled -100 on the X axis. I then used a decal sequence to set the decal to a reversed alternate image to create the whole logo across both curtains using just one model. For some reason this didn't render correctly. At the last minute I had to just save out a separate model with a different decal image. The right curtain model in the chor is still scaled -100 on the x axis because it is EXACTLY the same as the left except for the decal. I just replaced the original duplicate with this new "right" curtain model so I could render my project.

If you would like to replace the decal provided (AM logo) you can edit the images provided and replace it or just add another image to the decal and eliminate the one that is there. Keep in mind the "reversed" image must be "reversed" and "offset" the same way so that it runs across both curtains. There is an offset or overlap of the two images so the curtains can "overlap" slightly when opening and closing.

Opening and closing the curtains
To open and close the curtain make sure the pose is turned on. Translate the "root" bone along the x axis. Move it in the direction you want the curtain to go.
Additionally, translation doesn't open it "all the way". If you need to open further use negative X scaling on the root bone. This will squeeze it "tighter" as it opens. Don't go too far or you may get problems with the cloth simulation and intersections.

Do not move any bones but the root bone. The root bone only needs to move along the x axis. I just the use the arrow keys. I can't actually remember if moving it in other axes has an adverse effect.

Pre-roll and the "bouncing" curtain
In the project I didn't do any "pre roll", so the curtain will "bounce" a little. To add a pre roll just select the choreography. Expand the Plugin Properties|simcloth triangle. Turn the "use chor time range" off and set the start to a negative frame and the end to where ever you need it. Now when you simulate it will key the curtain before frame zero which should eliminate some of the "bounce". You may need to tweak this.

ALERT! Dynamics force setting
The dynamics|force setting in the chor has a -425 Y setting. This makes the cloth behave more... clothy with my curtain. It worked for my project. There may be better settings for cloth but this worked well for me so I went with it. Keep in mind this setting will effect anything that uses the dynamics | force property of the choreography.

--------------------------

Update: Wireframe animation and a description of the rig

Click to view attachment

I wrote this as much for myself as for others. This is a detailed description of what the heck is going on. If I ever get hit by a bus and lose my memory I should be able to understand how I made this thing. YOU HAVE NO OBLIGATION TO READ THIS.

This short wireframe animation of a scaled down version of the curtain rig shows a little bit how it works.
The horizontal bones have a translate constraint to the "aim" bone and a horizontal translate limit. The aim bone is not seen in the video. It's position is irrelevant and it never moves. The root bone is not used in any of the constraints either. It's only purpose is to move all of the other bones forcing them to collapse based on the limits and the constraint to the aim bone.

The whole system relies on a precise grid in 10cm units. Each translation constraint is based on that grid and the number of bones or width of the curtain. The curtain grid is based on a with spacing of 10cm. The vertical spacing is irrelevant. I "stretched" it to make up for computer limitations. I was able to make the curtain taller without increasing the complexity of the simulation.

There are 32 units across and 17 horizontal bones. Each horizontal bone controls every other vertical spline. Each bone translates to the stationary "aim" bone with an offset equal to its position in the "grid" of 17 bones. Each bone but has a translation limit based on the 10cm it must travel to "reach" the next bone. The bone closest to 0 on the X axis has a translation limit of 160 because it moves "last". The farthest bone out has a limit of 0 because it moves first. The "width" of the curtain is 320cm. Each curtain section is 20cm, two "sides" and the center spline that moves back as it folds.

What happens when the parent or "root" bone is translated is that each bone stays put or seems to be not moving because it is constrained to the aim bone which is outside of the root bone hierarchy. The horizontal curtain bones can only "not move" when the root bone is HIGHER than the constraint limit. When the root bone is moved below that constraint value the bone follows along in the negative X direction because the MIN value for the limit is -1000. When the last bone is reached and the curtain is fully open, each limit has a -1000 on the x so the whole rig can continue to move past the open position. It can move as far open (to the left) on the X up to -1000, but when closing it "stops" at the point on the grid where it is in the final closed position.

The "moving" of these bones is an illusion. When the bones AREN'T moving they are constrained to the aim bone and actually "move" in the opposite direction but in a way that appears to be stationary. The root bone is higher than the limit and so the limit and constraint to the aim bone is in full effect. (that is why the exact 10cm values is critical). When those bones are moving they really aren't moving, they are being dragged along by the root bone, the parent. Just like any child bone would "move" with a parent bone. The translation limit only stops movement of the bone at the full closed position. (The parent bone translation actually seems to "override" the constraint to the aim bone. But without that constraint the system would not work. That DOES confuse me.)

For example: Bone 21 has a 100cm X translation max value. That is the position when the curtain is closed. It can't go beyond that position to the right. There are 10 bones "in front" of it that have lower values by 10cm (90, 80,70 ect) and will move first. So the root bone slides back, to the left until finally it's position reaches bone 21's 100cm limit on the constraint to the aim bone. That constraint has kept it "stationary". The root bone was HIGHER than that value. Now it is LOWER than 100cm and bone 21 must follow along with the root bone. There is no constraint keeping it in place.

Folding: Those "other" vertical splines and bones

Each of the horizontal bones has one child bone that is oriented along the Z axis. These bones control the "collapsing" of the inner folds and each have an aim at constraint to the PREVIOUS horizontal bone in the chain. The location of this bone is critical to create the pseudo "translation" of the vertical spline back. By adjusting the "pivot" this causes the spline to move "straight back" (close enough) as this bone continues to aim at it's target. Since it is a child of the horizontal bone eventually it "stops" and travels along happily with it's parent bone.

This "seems" complex but only in "execution" (applying the constraints). In reality it's quite a simple set up. It's just a tiny bit tedious. The current "width" of this curtain is the limit I could go with a cloth simulation. Beyond this grid size the cloth simulations were taking a very long time on my computer which is really nice but not a power house. This is a limitation with my computer.

-vern
Rodney
Very cool Vern. Thanks! smile.gif
Thanks for the description as well.
It's a treat to see how you put this together.
steve392
Thank's Vern Im sure I can learn from this ,its a bit over my head as yet but if I use that tinfoil hat , maybe
johnl3d
pdf of this post until this reply..curtain directions



Click to view attachment


Thanks Vern
heyvern
Thanks John!

Is it better to include the instructions as PDF or text with the zip file? I suppose so if it gets "passed around".

I will do that and "re-upload".

-vern
jason1025
Thanks Vern

nimblepix
Thank you noble Vern.
mtpeak2
Thanks Vern. I was curious as to how you set that up.
jason1025
I cant seem to get the cloth to act like cloth. Its very stiff. Am I not simulating the spring systems correctly? Do I need to review cloth tutorials? Any ideas off hand?
jason1025
QUOTE(jason1025 @ Feb 16 2009, 07:56 PM) *
I cant seem to get the cloth to act like cloth. Its very stiff. Am I not simulating the spring systems correctly? Do I need to review cloth tutorials? Any ideas off hand?




nevermind
heyvern
I forgot to mention the "curtain hooks" and the "invisible" group of patches and the single spline at the top not part of the cloth.
I also discovered a "mistake". Not really a mistake but extra work that might be considered unneeded involving assigning all the points in the cloth to bones.

the Non Cloth Spline and the bone assignment "mistake"
The very top spline is not in the cloth group or material. It is not cloth. It is what keeps the cloth crumpling to the floor. There are still some aspects of this that I didn't understand completely during creation. For instance, binding the splines of the cloth to those bones. All vertical splines are bound to a single bone at the top. This is not neccessary. The top horizontal spline is not part of the cloth material and it also does not need to be bound to bones for this to work but... it would look odd and stretch the splines so it is kind of needed. However that single "non cloth" spline has no other effect on the cloth "action" except to keep the cloth from falling down.

So only the CPs of the first spline of the cloth group (the second horizontal spline at the top) need to be assigned to bones. All the other splines do not really absolutely need bone assignment. I only just discovered this.

However, I am leaving it the way it is because if I assign those points to bones it makes no difference in the simulation and it is easier to "see" what the curtain is doing before the simulation. Obviously for "cosmetic" concerns the first spline needs to be assigned to bones to prevent extreme stretching of the splines causing strange curvatures and also only the top two rows of points would move when doing the initial curtain animation which looks odd and annoying.

Yes, technically a "mistake" but the mistake can be used as a visual "aid". If it has no adverse effects on the results and it helps then it's good. I only mention it so that we are all aware that the bone assignments I used in the model were not crucial to the final cloth simulation. This could avoid confusion if you apply the techniques I used for other cloth simulations.

The Curtain Rod
The curtain rod is a separate model available in the first post (I will add it after posting this) It has two rods that go all the way across and are connected with a sort of "M" or "H" shaped structure on each end. I needed to use this set up to prevent the two curtains from colliding or touching AT ALL before the cloth simulation. I had trouble with that at first. Often I would use the spline positions of the curtains at the end of one simulation to start another so they connected seamlessly. After folding up or even when not quite closed the folded curtain could be touching the other curtain. I used this adjustable curtain rod to maintain the spacing.

If there was too much "touching" the cloth sim freaked out over all the over time authorization and work permits required and refused to do the job. I truly believe the cloth simulation may be part of some "union" organized by animation software features. It will do what needs to be done but don't push it unless you have a lot of money (computer power) and time. wink.gif

Invisible Patches and Curtain Hooks
I needed to hang the curtain on the curtain rod (can you believe I left that little detail to almost the last minute?) so the hooks or "hoops" are placed one at each forward fold of the cloth when it closes. That hook is bound one to each horizontal "main" curtain bone (the 17 across the top). The top row of patches belong to a group assigned 100% transparency. The hooks are "attached" at the bottom of those patches. Over and through the first spline/patch that is cloth. This creates the illusion that the whole curtain is all cloth. I could have left that top row visible, part of the cloth color group, but it looked "odd". that part didn't act like cloth and it stuck out the top of one of my panels. It was too stiff. By hiding that row that first visible row behaves like cloth but is restrained by the non cloth it is attached to. This seemed the simplest way. I looked into the cloth property with groups that are set to be "attached" or whatever. Maybe that would work as well... but this was so simple.

To use the curtain hooks just create a long curtain rod and place it in the chor so it runs through the hoops. In the stage crash of my animation I just constrained each curtain to the curtain rod... translate to and orient like. The "Y" shape and connection of the curtain rod prevented the rod and curtain from spinning around wildly. I remember that as a huge problem with the cloth sim. With a single curtain rod "tube" the rod would cause the curtain to spin and whip around like a ships sail in a storm and crash the simulation. By making sure that the curtain rod was "loosely" held in position during the physics it would not go crazy.

For fun tricks, put some models with cloth deflector materials in the path of the closing curtains. The curtains will drape and flow around them very realistically.

Additional: Physics mixed with cloth
There is a "trick" I realized too late to use in my project regarding cloth and physics. A newton dynamic object can be "static with action". Like thom walking and kicking things. assigning that property to a cloth object AFTER simulating will allow it to move other newton dynamic objects in its path. You create "_Newton" patch groups in the cloth model that make contact with a newton object in the chor, causing a physics reaction. You MUST make these groups for it to work right, otherwise it uses the "bounding box" shape of the WHOLE model in the physics simulation. It uses this newton group to define a "hull" around those points. The smaller and more precise the groups are the more realistic the physics.

So say the cloth was closing and it hit some loose objects in its path, it could push those objects away. However the objects will have no effect on the cloth. This is a one way ticket. You could do a resimulation of the cloth after doing the physics simulation... but... this could get quite tiresome. I of course will be attempting that very thing eventually. wink.gif

EDIT: You may need to make adjustments to physics for this cloth interaction to work well. "Fast" moving cloth can send newton objects flying so fast they could go into a low earth orbit. Not that you could zoom out in the chor far enough to see this result. wink.gif

-vern
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.