We published first Softimage XSI tutorial called Cloth Simulation with Syflex. - made by Mauro Frau, a professional 3D Animator who is currently working as 3D generalist for Universal Video Corp. in Milan, Italy. Please note that technique used in tutorial may be used in other 3d applications as well. Movie example included...
Cloth Simulation with Syflex in Softimage XSI This article goes through some techniques to create realistic cloth simulation, covering the most important features and potentialities of Syflex. I’ll be refferring to XSI 5.0 but I’ll also try to be as detached as possible from the software itself and concentrate only on Syflex, so that also non-xsi artists will be able to find it useful. Anyway I’m assuming you have a good working knowledge of your software and familiarity with animation. Generally, the more bonds your cloth has, the better.. this happens because the simulation engine gets helped a lot by reference points to stand by. This is also the reason why it’s much more difficult to set up the correct animation for a cloack or a flag than for a t-shirt or a jacket when movements are pretty extreme (fast translations and violent rotations). Cloths like a jacket have very limited behaviours because the whole surface stays constrained to the character’s body, things gets complex when your cloth has a bigger level of freedom. By the way, since you can keep your movements slightly slow, you won’t have big problems. Let’s start with a simple sphere moving and rotating through the space. We’ll be animating a soft santa’s hat, so the sphere will be the head we’ll constrain the hat to. When setting the animation of the sphere remember that the speed and the amplitude of its rotation and traslation curves will set the trickness of the simulation. I recommend to start with some little moves and, once you’re confident with this tutorial, try to pratice with extreme movements, including anticipation, squash and stretch. First of all, Syflex works with polys, avoid nurbs. Model your hat (a revolved spline is ok) without the little ball, we will constrain it later. Don’t be too strict with subdivisions number, we need an highly deformable shape. The mesh must be unique so project a single texture and distribuite the UVs to match the white wreath and the red body; you can also use clusters to assign two procedural materials but we will have to deal with a little trick later if you do so. Once you have your hat ready, give it a position on the sphere, rescale the object if you need, rotate it a little: its orientation will be fundamental to get the gravity force started the right way.
Constrain the little ball to the hat’s last ring of vertices by position and tangency. Spend a few seconds to name objects and clusters in your scene, this will simplify everything later. Before going on, freeze everything, models and transforms to avoid having troubles or strange behaviours. From the Syflex toolbar select Cloth > Create Cloth and your model will become a cloth softbody. Apart from the create cloth operand you see also create skin and create flesh: those are two other different kind of cloth with different parameters, maybe you’ll want to do some tests with them after reading this article; the first is used to create skins or multi-layered clothes with a bigger volume, its effect is similar to a close-fitting nylon suit; the second can create layers of fat on a character or generally add volume and stability to a cloth. Now the hat has into its stack a new node called syCloth; here are general proprieties of the newly created cloth object: a boolean operand of Mute to activate or deactivate the simulation, the first frame option that sets the beginning of your simulation in terms of frames in your scene, its importance is due to our need of some preroll time, expecially for gravity, for the simulation to settle in, so set it about 40 frames before rather than in corrispondence of the start of your main animation. There’s also a value of precision that I generally leave unaltered or keep under 0,005 ..the smaller the better. Let’s now talk about the cache. Differently from many particles engines that starts a new simulation everytime you play it, Syflex calculates its simulation the first time you play it and stores it in a sequence of files located into the path specified here. This is a very important step to understand. It means that once you have set the cache and played the first time your simulation, everytime you make a change to the cloth you won’t see it work until you select your object and do Cloth > Clear cache. If you just play the simulation without clearing the cache, the engine will play the already cached sequence and you won’t see any change. When you’re satisfied of a result you can save the scene with a different name and change the path of the cache, so that Syflex will be able to update the simulation with a new sequence letting you keep the previous result. Density means the mass density of the cloth, so the mass divided by the surface. Don’t loose too much time referring to physical tables, better do some tests remembering that this value sets the heavyness of your cloth. Let’s leave it unaltered as a very heavy cotton. The whole motion is mostly influenced by springs parameters. Springs are like a soft particle grid that gets deformed under the forces applied by the simulation; for those of you who don’t know what springs are, I recommend to do some research on the web, there’s a lot of documentation since they’re also the base component of every standard softbody simulation. As referred into the official syflex documentation, there are three kind of springs’ motion: stretching springs, created along the edges of the mesh, they control the stretching strain of the cloth and thereby its elasticity. These springs are created only along the edges of the mesh. The second kind are the bending springs: they control the bending strain of the cloth. Bending springs connect two vertices of the mesh that are separated by another vertex. The last are the shearing springs, they control the shearing strain of the cloth. Shearing springs connect vertices across the faces of the mesh. These values are all normalized so they can go from 0 to 1, but in the case of damping values is better to keep them under 0,01. Damping attenuates all micro vibrations that happen into the main motion of the cloth, the final behaviour of springs comes from the expansion of non-damping springs motion. I’ll keep them to a relatively high value to avoid flikerings since our cotton is quite stiff. The next pic shows some good settings, use them by now but try to get in confidence with these parameters since their settings are the most influential into the simulation.
Select wreath’s vertices, the head mesh and select Costr > Create Pin to constrain the wreath to the head. Now you have a new node under your syCloth stack. Leave the distance from the constrained object to 0, set the stiff to 0,7 and the damp to 0,9 to have a well blocked position. If you now play the simulation (as said before, don’t forget to have a proper preroll) you’ll see the hat follow the head animation but everything is not so nice yet, we need some more work to reach a realistic effect. Note as the calculation of the simulation slows down the animation the first time you play it, due to the caching of the sequence, and how it’s much more faster the second time since it’s just loading a pre-calculated simulation. Other functions under the constrain menu are Get Pin that allows you to load back your pin selection to modify it, and Set Pin to set it when you’re done. Get Mesh Pin adds to the selection list the collider mesh to help locating it. Apart from the pin there are the nails that are just absolute pins. You can pin a cloth to an object or you can nail it to static coordinates to keep it in place. When you first created the cloth object, under the Cloth menu you saw Get & Set Spring Map and Get & Set Mass Map. They call for a paintable map that you can create with your artisan tools, modify it any time you want and set it, in this case you may want to make the mass of the hat’s highest area lighter that the lower one, as shown in the next image.
Once you’ve set the mass map, clear the cache and play back the simulation to see the changes. From now remember to clear the cache before playing the simulation to see the results of any change. Let’s pass to forces. If you have some experience with dynamics simulation you should know what forces are into a 3d space. Here are definitions from the official docs: Gravity Damp Damp is a viscous force that slows down the movement by dissipating energy. The intensity of the damp force is proportional to the speed. Damping prevents infinite oscillations (such as in a pendulum). On a cloth it is often better to lower the damp constant, in order to prevent dragging the cloth. High values (> 0.001) will slow down the simulation. Air This force is very similar to the previous force: it's also a viscous force. It takes into account the orientation of the cloth and its speed; the force will be maximum for the faces of the cloth moving in the direction of their normals. Wind The wind force is defined by the main direction of the wind, and a perturbation. The perturbation varies randomly, with a maximum given by the Pertub parameter. Turbolence The turbulence force is similar to the wind, but is not uniform both in space and time. Imagine a 3D grid, with a different wind force in each cell. Spring
This force connects 2 vertices of the cloth with a spring. Every single force has slightly different parameters but they’re pretty understandable just doing some tests. If you need a more accurate description of dynamics forces, once more, you can do some research around the web; you should be confident with those theory stuffs if you want to have full control of realistic simulations for 3d animations. Just a little note to remember that computer animation it is not reality, it just simulates reality. A physically prefect set of parameter alone do not assure a computationally perfect simulation. We will now apply a gravity to our hat. To do this, select the object, then Forces > Add Gravity and the new stack-node will appear. You can set gravity for each local axis of the cloth. In case you forgot to freeze transforms before applying cloth, at this point you had to find the right normal direction to the ground.. but since we did freeze everything we just have to set it on a negative y. I used -0,05. Look at the results, now the hat falls down following the pins on the head. We now have an intersection problem, those kind of intersections happen quite frequently working with cloths, so don’t worry.
Select both the hat and the head, then Collide > Collide Mesh to set the head geometry as collision object. Bring up the damping to stabilize the collision and pull up the external envelope to 0,5 to avoid intersections with a little offset around the collider. The other collision options are related to single selections of faces and vertices, with the possibility to reload them back and modify them anytime during your work: Set & Get Collide Polys, Set & Get Collide Points, Get Collide Mesh. Now the problem has shifted, it’s less evident but it’s still there. If you look at the simulation you’ll see there aren’t intersections between head and hat anymore but there are a few between hat’s polygons themselves.
To fix this, activate self collision. This is a good time to pull up the smoothing level of your original mesh (only if you’re using subdivision surfaces ofcourse) to have an higher definition of the problem. Collide > Self Collide will apply self collision, now the simulation should start to get a little slower, depending on your computer, but we are almost done. For self collision too we have a Get & Set command, refferred to faces selections. If you textured the hat with a single bitmap and UV editor you shouldn’t be having any problem but if you created clusters for procedural materials, try to render your hat and you’ll see you’ve lost your original colours. This happens because the self collide operator creates a cluster for collision faces into the object’s stack called sySelfCollideCls that overrides the textures clusters. The trick here is done by moving the textures clusters after the selfcollide cluster into the stack. In XSI you have a Sort Order parameter into the cluster’s options panel, bring it to a very higher number, such as 500 for wreath and 501 for hat’s body. I don’t use to apply textures after cloth operators, I generally prefear working on totally finished and freezed geometries to avoid creating unstability into the scene. Ok, now the simulation should work pretty well, if something does not satisfy you, try to manipulate syProperties parameters, unchache and play again and again the simulation to reach the desired result. Perhaps it’s better mute the selfcollide operator while testing if you don’t have a fast machine. The State menu includes some operators that set and reset the initial state of the cloth, using its current shape and speed at a selected frame. You can call this function after running the simulation for a few frames. When coming back at the first frame, you will see that the initial shape has changed. The same happens for the velocity. The Create Cache menu allows you to stock two different caches and blend their weight but sometimes it’s a little tricky to obtain an easy-to-control result. Any additional component of your cloth should be created and applied before working on the simulation, for example you may want to have a fur on the hat or other constrained objects. Try to plan it before applying Syflex operators. [link to the avi file] Download movie to see some examples.
Mauro Frau is a 3D artist and animator from Italy. He holds a BA in Computer Animation and has been working for television and videogames since 1999. Mauro is currently working as 3D generalist for Universal Video Corp. in Milan. You can find more about his art on www.maurofrau.com . |





Comments Login to comment »
There are currently no comments. If you'd like to add a comment, please login.