we want you! python programmers needed

hello blenderheads and python coders!

this is a python script request i’m posting together with garbager, creator of the blender movie “Out Of Memory”.
we are currently both working on different movie productions and both are going to make an extensive use of cloth simulation.

but first i’d like to give you a short discription of my blender activities:
i’m producer of the blender movies Mindfields, Just One Wish and the Journey to the Center of Earth trailer.
visit my site at http://www.artificial3d.com to see my other blender images.

we are both very serious about our projects and we would like to use this opportunity to make blender more well known in the 3D world. the potential for the outer framework of moviemaking is there, our current problem is a small lack of blender’s functionality.

so what do we need? we need someone or a team of coders who are willing to program a cloth simulator for the current blender versions.
this cloth simulation script should
a) include face collision detection
b) have physics simulation of wind and gravity
c) be animatable and react to moving meshes

so you should be able to create a character with armatures and everything, then the cloth and at the end make them interact.

in other words, the perfect thing to make cool scenes.

what we offer: eternal fame of being the first real cloth simulating programmer for blender :wink:
a place in the credits of our movies [and not just a small note at the bottom]. being mentioned everywhere we post the movies and on any other place we can think of. so… want fries with that? :wink:

we know this is very tricky and difficult to make. some pieces are already existing though. someone already had worked out the wind physics, the dynamica team made a part of the simulation code… the problem should be the assembling of those pieces.
also, this project would be considered closed source until the movies are out, meaning those would be the perfect advertisment for you. after that, do what you like… we’re only giving you some starting help :smiley:

about my movie and its intentions:
it will be mostly fantasy like, but on the other hand realistic
it takes place in the present
it’s some kind of novel
it’s different from the usual 3D animation genres

i’m trying to make it look awesome
i want to take blender one huge step further
i want to archieve the famous high-res-app-quality

and yes, i am indeed crazy.

cant tell you more about the story, only that it’s about a long apprenticeship…

so, if you have any more questions or if you want to develop this cloth simulator for us, reply here, send us a PM or e-mail.

.andy

I only know python+blender a little, if some guru reads this post- I would like to know if this is possible in blender current implimentation.

Like the idea though :wink:

I’ll join @ndy on this request. After long talking with him and great blenderheads (especially Theeth, which is simply God disguised in a mere coder), I had reached the conclusion that all I need for my short movie project is cloth simulation.
I even considered ways to avoid using it, but after OOM started to became more known, and created more reactions that I would have expected, I decided to produce something totally professionnal.
My new project is a love story, which will contains my already known obsessions : City, group, society and individual, among other. Cloth wil be a very important part of the story, as it’ll be used as the movng reference of everything, translating moods, atmospheres, and creating a sub-text.
My goal is not only to try creating mature animated movies, but also to promote, as much as I can, freedom of mind and independant production.
OOM is currently selected for a french short movie festival in September, and will be featured this month in a french magazine about 3D. I keep recieving lots of emails that shows people are interrested in this idea of independant creation. Also, a japanese translation will be very soon released, a very nice friend did the translation and it will be putted online soon, so my work can be seen internationally.
As an independant, I’ve got not much to offer to people that would work on such a cloth simulation plugin or script. But I’ll make my best, if I can take advantage of some interview and appearance anywhere, to talk about the work and give coders’ names, so they can be known widely.
So many incredible coders did wonderful things for Blender during all those years, that I trust people could make this miracle. Talent comes from everywhere, and I’m sure that if we stick together, Blender can become recognized as a tool totally suitable for pofessionnal production, which it is.
Thanks in advance.

Eddy

Hehe, you two have some serious ambitions… :smiley:

I wish you guys the best of luck, I really do – Both of your works are inspirational…

in principle cloth simulation is ok; you just make a particle system in which points are connected by forces (typically f=-kx) to their nearest neighbours. unfortunately the reality, I have found, is fraught with problems:

  • reasonably fast integration methods (euler, midpoint) lead to increasing energy in the system and it gets worse the stiffer the forces (and they need to be stiff for cloth) - the system blows apart.
  • intersection detection is horrid, usually requiring backtracking, variable-time step integration

it might be that for your purposes a simple system would be ok, but if you want any realism, if you don’t want your cloth to move like rubber or oil, then you have quite a lot of crafty maths to solve.
mind you, it’s a lot of fun too.

actually a script to do much of what you ask was going to be one of my plans for the summer

but it was one of those ideals that I mostly have only dreamed about

what I have come up with I shall post below

err, well I can’t seem to find it… but I had a link to a page with a good (or so they suggest) method of integrating cloth constraints (simple math too…, well not very many sqrt()s I mean…)

it may be on:
http://www.btinternet.com/~ahcox/links.html#Dyn
but I didn’t see it there when I last looked

a quick search of what I remember about the page turned up
http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm
(the search can be found here )

it also would be useful if the technique in the above page could be used to for example control how things can move. Different connections can create joints that bend around an axis, objects that can be sheared but not twisted, a way to implement more complex soft-body dynamics quickly.

well, anyway to implement collision detection with cloth like objects there are some things that need to be considered, mainly how accurate you want your collision detection to be, and also how you will deal with the limited accuracy of the zbuffer.

For the latter the zoffset in the material settings is not really a problem.

now for the collision detection, it is almost trivial to test if the triangles in an object touch (or are within a specified distance) of the edges, faces, and vertcies of the triangles in another object. It becomes more complicated when you use 4 sided faces, which blender does not restrict (for understandable reasons) to being planar. The problem with a non-planar quad is deciding how to represent it in your collision detection algorythm.

treating a non-planar quad as the surface that would be generated if subdivided an infinite number of times would be difficult to both code, and for the computer to work with.

I would suggest (gasp) triangluating quads, and putting the edge where there would be the least of an angle between the generated triangles.

or as far as the math goes, the dot product of the normals of the generated triangles you would like to choose the higher value.
(as I doubt that made sense, you get psuedo-code)

if faceHasFourVerticies:
  # determine where the new edge should lie
  a = vec_dot(vec_cross(vec_between_points(face.v[0], face.v[1], 
   ... I got bored, I don't want to finish this, sorry

these edges should only be treated as there in the code, not in the mesh itself

what else is there, if the detail on the cloth mesh is low enough collision detection may only need to be done with the verticies of other objects. Or if it is high enough, with the faces of other objects. There probably could be a way to make things like this into an optimization (test face size, measure cloth face size… compare…?)

what else is there?

oh, I forgot to mention that a good cloth script would have to be able to “Bake” it’s animation for faster playback and network rendering.

one last thing, if you want to see something similar to the technique for intergration I suggest used (or at least tried) above, but it 2d go to
uh, I forget it starts with an s and
nope, I don’t remember. The website doesn’t have a lot of color though, and it uses java and/or flash a lot.

very nice z3r0 d. now we need someone to actually code it… :expressionless:
anyone up for a challenge?
.andy

hmm… still no one?´
:frowning:
.andy

i would love to be in but i cant so much python :expressionless:

Some one created a cloth simulation script a while back. I doubt it would be of much use as it is now because it’s well over two years old, and the Blender Python API undergone major re-working (I think) since then, but it could be of some use as an example, or a starting point. I managed to find where it was hosted (the wonders of Google :D) at http://www-users.cs.umn.edu/~mein/blender/plugins/python/cloth/ The cloth.blend file is the one you want. I’m not sure what version of Blender it was made to run under, but I’d guess it was pre 2.0, possibly pre 1.8. I’d offer to help, but I know no Python what so ever. This has actually been something I’ve really wanted for a while, so I hope this helps out some.

Goo

thanks for the effort, Goo. the topix cloth plugin only works with spherical collision detection… and nobody ever got it working.

does anyone know the creator of this script? maybe he wants to refine it…
…i doubt it.
:-?
i will make this movie in blender anyways, regardless how silly armature cloth looks. but i think Garbager wanted to make his movie with another app if our proposal fails. [correct me if i’m wrong %| ]

.andy

the guy who made the script is kevin mein ([email protected]) , ive emailed him and asked him to come and have a look at this thread, hopfuly he can help us develop it futher.

Correction: it was hosted by Kent mein but was written by Colin withers
[email protected] or [email protected]
www.topix.com

%<