Request for input on new cloth system

If you’ve been following the cloth stuff at all, you know that I’m sort of stuck on releasing anything further until topix or the author of the topix cloth source code gives me permission to redistribute. I’m not very happy with having any sort of encumberance on the code at all, so I’m currently reimplementing the entire system which I’ve been calling cloth2.

I know what I don’t like about cloth2 and where I think it should go, but I’ve never looked at a 3d modeling/animation package other than blender, let alone used one. So, I’ve never seen any cloth implementation at all, well other than that screen for the topix one on their web site.

I’d like to get input from people who would want to use something like this … what they want for features, how they think it should work and what it should look like. The better you define what you want/mean, the more likely I will be to understand and therefore consider including it in the new system.

No promises for specific features are given or implied by this request, but if I don’t know what you want, its only going to happen because I happened to want the same thing too, :).

Also, don’t limit yourself. One thing I’ve learned in my programming career is that users generally have very poor ideas of what is hard and what is easy to implement. Even if you have a good basis to think something is “too” hard to be implemented, many times some partial solution which is fairly easy to implement is possible.

In any event, having a desired list of features can properly mold the design of the system from the beginning. So, even if your pet feature can’t get implemented right away, its more likely to get implemented later if its know about from the beginning.

And if the cat gets everyones’ tongues, I’ll just crawl back into my hole and code and you guys will all get what I want, :-).

EDIT: One more thing. I’m calling this a cloth simulator only because that’s the ancestory. It isn’t really a particle system because the internals are really springs. But even the current version can do more than cloth simulation, so think out of the box a bit to similar physical processes when you’re thinking of features.

Well, personally I’ll be happy, if your new cloth script conatins same things there is in the topix you modded.

So, collisions with every type of mesh, some sort of physics making flags etc. clothes waving in the wind.

I would help you, but i don’t know a darn thing about python and my coding skillls are extremely limitied. So only thing I can provided is testing your script, but hey,I hope that counts for something. :smiley:

Good luck.

Wow, that sounds great zaz :smiley: I’ve been waiting for that for a long time !

It would be cool to have self collision detection and collision detection with every kind of mesh (not only spheres) and support for animation.

The user should be able to determine the stiffness value of the clothes and the amount of gravity that applies to them.

I’d also like to have have self calculated creases on the garments …

I don’t think to any other feature request for the moment and I’ve never used any other 3d/cloth package but I hope this helps in a way …

Serialsiner

k…wish list time

>easy to use is a must(dont want it beyond the use of half the blenderheads), the gui is a good start.

>working for multible operating systems(a windows build for me)

> pinning points on the cloth, stretchyness, wind, stiffness etc.(what freecloth has)

> saving of animation.

>maybe tearing/ripping when it passes its max strech

>collision for more than spheres

>for more than just a grid? like a jelly effect?

k, thats all i have for now…

Oh yes, every kind of mesh should be considered as a cloth : would be usefull to simulate skin with underlying muscle deformation :wink:

Good input so far, keep it coming.

I feel bad that I was unable to provide anything but a linux build for the topix stuff. I definitely want to make this as painless as a possible
for a normal user to use. I will arrange one way or another to have the module built for as many systems as makes sense.

Creases ? I never thought about those. Are you just talking the normal folds of the cloth or like the crease on a press pant leg ?

How would you want the animaiton saved ? In cloth2 the animation is saved in the vertex keys and has all the advantages and disadvantages that provides. I’ve considered storing the results in the file system somehow also. Another way I’ve thought about is saving the parameters somehow and if its fast enough, simulate the cloth per frame on demand. Maybe supporting multiple options, one render/scrub time and another pre-computed and stored somehow.

PS: I’m only commenting on topics I think I want more input on right now, the other input is noted and I think I have a pretty good idea of what you want/mean by that.

Sorry for my english zaz, I was speaking of the normal folds of the clothes around shoulders, elbows, knees … etc.

As for animation saving I don’t have any idea about which solution would be better … I think the RVK are OK but in fact the best solution is the fastest one.

Nothing wrong with your english in that description serialsiner. Crease was an appropriate word choice for either meaning. Blame this one on the ambiguity of the language, :).

I have one.
Levels of stickyness and resistance.

Stick to would be like making a skin tite suit and resistance would be where the cloth would barely bend.

Also another feature I WOULD love is to make a cloth mesh object. Or a feature to make any mesh into a cloth mesh. This would be great for modeling clean meshes, it could be used for other things other than cloth. It would work like Proportional modeling but it would not affect a radus of vertices it would instead just pull the vertices attached to that vertice then further on.
Yes I know there is a hide vertices feature, but that takes to time to select and hide this straight line feature would be really correct like lifting an eyebrow or opening a mouth without having to hide the top part of the head just to open the mouth.

^v^

I’m not sure I understand how the cloth simulator could help with eyebowse and mouths. When I want to work on my mouths and eyebowses, I normally just take the time once and assign them to a Vertex Group. Then when I want to do something with them, I just pick the vertex group and click the Select button.

Explain this more please, I don’t think I’m getting it.

Resistance/stiffness of the cloth is part of the simulation, both the topix one and the new one I’m working on.

I’ve thought about what you call stick. Not sure what the right term is. I was thinking more like having some sort of tension force applied to the cloth, say like on the waist of a skirt or pair of pants. I was thinking of this more for not requiring the user to make the waist of something the exact right size and allowing, probably through vertex groups, the user to specify which vertices were involved. I suppose you could do it for the entire garment though too, :). I’m not sure when this will go in though, but it would be a nice feature.

Keep dreaming guys or start if you haven’t already. More input, more input, :).

Great to see this moving Zaz!

Not sure about the RVK’s - if there’s a 100 frame limit, then it’s probably not a good idea I would have thought.

I would have thought it was better to store the mesh vertex co-ordinates for each object in a file by first running a simulation. Then, when you change frame, have the script update any mesh which has an associated “cloth animation file”. Maybe the file can just be text files inside of blender, although I don’t know how efficient this is (I guess the files are going to get huge very quickly!)

If you run the simulation itself on frame change, I can see a few problems ahead - for example, if you wanted to go from frame 95 to frame 12 for example, the script would have to do the simulation from the start again. But if you have the option, I guess it doesn’t hurt!

I think what Youngbatcat is talking about is using the cloth mechanics as a modelling tool, in a similar way to the proportional editing tool - so in edit mode you would select a vertex and move it. With the proportional editing tool, it also moves other vertices by an amount related to their distance from the selected vertex. With youngbatcats suggestion, it would move the other vertices according to the cloth dynamics - imagine picking up the corner of a cloth.

Not sure if you can link a script to an action in this way though, and I guess it would make modelling very slow even if you could!

BTW, is the resistance you mentioned below meaning friction? Friction would be great, especially if you can assign different friction co-efficients to non-cloth objects, to control how easily the cloth slips off…

cheers

leon

I see cloth simulation and fluid dynamics as being two sides of the same coin: they share the essential characteristic of having one side of the equasion (solid object or force) Detect and the other (cloth or fluid mesh) BeDetected. These two definitions are simply for explanation purposes and can be reversed (so solid objects BeDetected and fluids Detect)

For fluids (water in a jug) only part of the mesh needs to be BeDetect enabled (the part that actually comes into contact with the jug) and the part that you see when you look into the jug could be plain mesh (with wave effect or noise etc)

If this were possible (thru vertex groups and weight painting for example) then the Detect and BeDetect properties could be ‘hooked’ to the existing mesh(es) instead of requiring designated meshes (or mesh types).

The gameengine (and to a certain extent meta objects) already has the code for Detect and BeDetect and (again, if this were at all possible) only the value of the ‘spring’ simulations will need to be implemented.

If they are able to be assigned by vertex groups then weight painting could define values for ‘tension’, ‘resistance’ (and I’m sure more will be suggested) and possibly even ‘Proximity’ as in Radar Sensor in the game engine (I’m thinking here of wind and flowing water).

Who knows, maybe in a year from now all this will be available thru an integrated gameengine anyway.

%<

I could probably make a windows build of the source if you needed zaz.

just my little contribution

MacBlender

The 100 frame limite is in absolute, not releative, vertex keys. The current version of the topix stuff I have switched to RVKs for this reason and then instructs the user how to convert to absolute vks and then edit the IPO properly. This is because there is no access right now to some stuff I’d need to do that for the user from python.

There’s some very good aspects of doing it this way, but I fear memory consumption and file sizes, memory consumption more. Also, its unclear how blender is engineered, as I haven’t looked at it, towards dealing with very large numbers of AVKs on lots of objects.

I would have thought it was better to store the mesh vertex co-ordinates for each object in a file by first running a simulation. Then, when you change frame, have the script update any mesh which has an associated “cloth animation file”. Maybe the file can just be text files inside of blender, although I don’t know how efficient this is (I guess the files are going to get huge very quickly!)

I’m thinking about using specially named Text files stored in blender to hold the parameters for the simulation. If I can force the reference count on these (press the FKEY), that should work well. Start the UI up and it looks for a file in blender, say SCENENAME.CLOTH or something and loads the parameters.

Also, my current work is splitting the simulation parameters up quite a bit. I won’t describe it now, because its at such an early stage, but if it works out, there’s going to be more parameters to play with and reloading them for the user is going to be more important then.

I don’t think its a good idea to store the results as text files in blender though. Converting from binary to ASCII will increase the data size dramatically. Vertex keys are probably lighter weight than this and directly useable.

I do think that its likely there will be an option of storing the simulation results to a file. At this time, I’m thinking 3 forms of storage, AVKs, file and on demand (no storage). How viable the on demand version is really depends on how fast the simulation is and how fast it can manage its data.

If you run the simulation itself on frame change, I can see a few problems ahead - for example, if you wanted to go from frame 95 to frame 12 for example, the script would have to do the simulation from the start again. But if you have the option, I guess it doesn’t hurt!

Yep. There are some horrible inefficiencies in the way this is implemented. Lots of data traveling from blender to python, into the C code in my module, back to python and then back to blender. And we haven’t even done any simulation work yet. Yuck!

The problem is that the only way to really fix this is to get tighter integration with blender … somehow. I’m not 100% sure what this means. Would this be an effect ? A new type of mesh ? A new constraint ? I’m not sure if it really fits in a category existing in blender now. This is very far into the future stuff though, but nice to think of how it might fit. Also, there might be better ways I can work with the data so it doesn’ t cross those boundaries as much.

I think what Youngbatcat is talking about is using the cloth mechanics as a modelling tool, in a similar way to the proportional
(deleted)
youngbatcats suggestion, it would move the other vertices according to the cloth dynamics - imagine picking up the corner of a cloth.

Yeah, I did sort of think about that application. I’m probably just blinded by details a bit though right now and also with knowing how the current stuff works. You could sort of do this already with the topix version. Just put all the vertices you don’t want to move into the ClothSim.TAGGED vertex group and run the sim on the object … as long as its a Grid mesh, :).

Actually, I think something like this could work. In pincipal its simply another form of storage, in that you’re only going to store one frame. As long as the user can specify which vertices don’t move and which ones do, it might actually work the way he was thinking.

BTW, is the resistance you mentioned below meaning friction? Friction would be great, especially if you can assign different friction co-efficients to non-cloth objects, to control how easily the cloth slips off…

Normally, resistance to me is friction. That’s why I used in my reply to youngbatcat Resistance/Stiffness. He was asking for restistance in the cloth deforming (which makes perfect sense). Because the simulation is implemented with springs, the spring stiffness is what provides that resistance to deformation.

As far as supporting friction, that’s a possibility. Not sure when, but its covered in several of the research papers I’ve been reading. I don’t believe it will make the first round of releases though, but I had some neat ideas for it when I started reading about it, :).

The big problem I see at this point with friction is the performance. The main model I’ve been studying that provides for this took one to six hours to solve this for a garment. There were solving self collision and collision with the model as well as taking into account friction. I think there were 9,000 cloth polygons and 26,000 polygons in the model.

Those are some decently high polygon counts, but not really high, and the paper is from the late 90s, but even with faster computers and fewer polygons involved, I think the solution would have to be a lot faster to be practical. So, I’m not rushing into implementing that one right now.

There are other ways to include friction though, its just a question of prioritizing features and finding good solutions.

Just a small idea, but a way of defining and saving diferent material movement types, silk, cotton, canvas etc would be nice, then we could share our favorite settings.

Also what about being able to say if a fabric is wet or dry or being able to set static friction (sticktion?)? or being able to add random tears or runs or is that better left for texturing.

Great job to take on ZaZ Thanks :smiley:

Ken

Big kudos to you for taking on this project.

One thing that will be essential to the usefulness of any cloth system in Blender is that it will have to be drive by a mesh deformed by armatures. This is how 99.999% of character animation is done, and if the cloth can’t be deformed by an armature-deformed mesh, then nobody will use it. Also, the coth object would have to be allowed to be any non-manifold mesh.

Also, don’t forget that with subsurfs, you can generate a lower res solution and have subsurf smooth it.

Most of my concerns have already been expressed by everyone else.

I wanted to post, however, to say thank you for taking on this huge task. This feature will be enormously useful and a very nice addition to the Blender toolset. Thanks!

dante

I believe this can be handled with the spring stiffness settings, that’s the basis for them any way. Supple materials, like silk, would have low stiffness and stiffer materials, like denim, would have higher stiffness settings. Letting the user pick pre-set values would be a good idea. I think I’d likely handly this by releasing initially without a preset library, or a very limited one, and having users contribute back there settings to be incorporated as presets later.

Also what about being able to say if a fabric is wet or dry or being able to set static friction (sticktion?)?

I’m not 100% sure about wetness, possibly this is already covered by the weight of the material/point masses, which is part of the simulation. It would be a good feature though and something I have considered. Again, I think what is most likely to happen here is to get a release out with documentation on the parameters and let people play to see what they can come up with. Evaluate where we’re at and then see if something needs to be added more than a preset. One weakness in the simulator now is that all of the point masses on the cloth have the same weight, so if the weight parameter works reasonably well to simulate a wet cloth, currently either the entire cloth would be wet or dry.

I discussed friction above, its a possibility and will be added to the desired features list. Unlikely to make it into an early release though.

or being able to add random tears or runs or is that better left for texturing.

It seems to me that a first crack at this would involve textures or the removal of faces from the cloth mesh. Again, a good idea, but I’d like to see the results of some experimentation once a release is out there before specific work is done on something like this.

The simulator actually has a value called the critical deformation rate which would basically map to the force/deformation at which the cloth tears. It would be a neat feature to let you tear the cloth (if enabled), but there’s an awful lot of decisions to be made regarding the geometry of the tear and I’m not sure how to solve that right now in a general sense at least.

Its unclear right now how this will work, but I agree that at some level the cloth simulator needs to work well with the animation system. What I mean by this is it might be problematic to parent the entire cloth mesh to an armature as the deformation of the armature bones would be likely to interfere with the deformation of the cloth simulator. Perhaps there would be a phase in which you dressed your chars and then only the pinned (formerly called tagged) vertices would be the only vertices affected by the armature or other parenting relationship. The remaining vertices would be deformed by the cloth simulator dealing with collision detection, gravity, wind, etc.

This will take some trial and error to see what works best. The topix simulator doesn’t take any of this into account and that was one of the things I was going to be looking at on it next, so I have some ideas, but no concrete solutions yet.