One of the features of the new version of the Cloth Deformer is Grab Zones. Interaction with hands and other moving objects that need to grab the cloth can be faked by using a spherical zone(s) at the start of the simulation to grab any number of vertices of the cloth. When the grab object is moved the held vertices move with it to maintain the same local position in the zone, so they rotate as well as translate.
This animation shows a Michael 5 figure for Genesis trying to get attention by waving a slightly ripped t-shirt. The cloth was given 4 seconds of animation to drape before starting to wave it about. Some proxy objects were used on his arms and hand to prevent any possible collisions with him and get a very fast simulation result. The shirts self-collisions all work well – but moving at that speed it’s hard to see any poke-thrus anyway.
In future I’d like to be able to have the grab zones turn off somehow to release their held vertices. Also to be able to grab vertices during the simulation would be important. That will be easy to code but a special ‘zone’ primitive is something I’ll need first so that it can have the right on/off switches in the properties interface.
More demanding simulations, such as a full length dress, push my plugin to its limits. That doesn’t mean it can’t get results though. While also trying out Carrara 8.5’s stability with a Genesis 2 figure this simulation took about 2 hours to run, allowing about 5 seconds to go from a zeroed pose to being seated and then drape. Again it is the still image that I am very happy with here, worth spending some extra time to do a little embroidery on the dress.
What is hidden in this render is that the collar of the dress sort of broke when the character’s neck bent. The bent elbow is also a dangerous area for any practical simulation because the cloth can end up with nowhere to go. Use of simple primitives under the skin is a good safety precaution. Unlike certain other simulators, when mine goes wrong it doesn’t end up in a disaster.
The current code looks at all of the possible collisions of a thick vertex with an assumed convex surface – an elbow pit or neck is a concave surface. The treatment of more complex surface interactions is what I hope to code next. When viewed as an animation the fabric actually twitches a lot between frames, here and there. If the surface collisions can be processed with more consistent results this should diminish. With simple primitives there is never any twitch.
The arbor prop was not used for collisions, a few cubes were placed into the scene and then hidden for the bench seat and arm rest.
The conforming hair is not dynamic but morphed to get it out of the way for the render. Such a hair style could possible work with draping too. The simulation can handle layered cloth over cloth. Internal cloth to cloth collisions are still treated as particle to particle hits to push them apart.
What is also on display here is the new Subdivider plugin. You can get this in my Laboratory to try out. It implements Loop(s) subdivision which is optimized for a triangular mesh. Carrara uses Catmull-Clark subdivision which works with quads. The Subdivider can be applied at the end of the Modifier stack when the simulation is finished to get 4 times the facets while smoothing out the cloth.
My plan for the plugin was always to expect that where it was to fit the figure’s torso to keep it as a conforming actor then allow for dynamics when it came to capes and dresses etc. Again this simulation example did break but maybe the next version and my theories about concave and convex surfaces will work…The good thing now is that with the simulation timeout problem fixed I can run many more of them than before.
As I started to try out more complex simulations with full figures and drop cloths and costumes a serious issue with the Cloth Deformer emerged. A task switch in windows or a screen saver timeout would totally kill the simulation. The only way to keep it going was to start the simulation and then make sure to give the mouse a shake every few minutes. If I was away for too long then hitting escape to stop the simulation would immediately bring up my blank screen saver letting me know it had died.
I could not find an answer or get much help with this and had to try and carry on without being able to run longer simulations then walk away or leave them overnight. I had to be there at the desktop or nearby and keep an eye on the clock.
I was looking for a solution in the wrong places and wasting precious time too. I assumed it was a Carrara SDK issue and that I was doing something wrong. It was really only when I noticed that after running a big demanding render on multiple cores that upon returning to a word document, after leaving it open on the desktop untouched for an hour, that as I typed there was no response to my keystrokes. After more than a few seconds I could start to type okay.
So I seem to have finally understood and hopefully fixed this problem. Windows is deciding that despite it working hard and doing millions of calculations that my simulation is not important or not responding and then making it, or the system, idle after a certain time period. Only by calling WINAPI SetThreadExecutionState(…) with the right flags, very frequently, in all of the simulation loops, can the plugin now be left to run on its own.
Here is a link to the old WIP Thread over on the archived DAZ 3D Forum.