[WIP] another cloth engine (node-based)

if the clothes doesn’t twist , this method is ok. but now I’m thinking about the point memery method,Firstly,cloth-point-A detect three nearest collider points and find these three points whitch face are belong to.remenber this face’s normal ,when the second time point-A is colliding to the this face then determine the collision state.
by the way: in the my clothes data, thare is no actual face and normal only points position ,face and normal are virtual ,the normal is caculated by three or four points every time with mesh’s original DNA date MPoly/MVert and finally assign the result to the clothes KeyBlock date ,the simulation is completely runing on c++ code but not python.

the self-collision:

the self collision was implemented,though I didn’t test It in more complex situation.
the next step is to make the rigging character collided with the cloth…
http://i803.photobucket.com/albums/yy311/imdjs/imdjs/cloth_self_colli.gif

some codes of the self-collision:
http://i803.photobucket.com/albums/yy311/imdjs/imdjs/_4.jpg

wow… hope this code will be considered by the BF team :smiley:

This is going to be a paid addon, so no chance for that.

free as in freedom

great, than I gonna pay for this, no doubts . 8)

If it works better, absolutely! :slight_smile:

Hi Imdjs, I just bought your hair mesh addon and was reminded of this project. Hope it’s going well.

I just wanted to say that whenever you do release this addon would you please consider selling it on either Gumroad or the CGCookie Marketplace instead of Sellfy? Not that I have anything against Sellfy but it’s convenient to have my addons collected on the same site rather than spread out. Also it would be more exposure for you to put it on the Blendermarket.

thank you
it will be released to Gumroad or the CGCookie Marketplace when this addon is finished,but I will release a early version just for test here firstly.
I have a little free time to continue this project now.

I am currently working on optimizing the searching of vertex index.to construct multilevel of vertex index system,first I only search the top level of indices,to dectect if this point is near to the collider ,if it does ,then look down to the indices which were binded to the upper level indices.

I’m working on solving the collision and intersection issue,my collision algorithm will prevent intersection. below shows the comparison of cloth_node VS buildin-cloth.if the cloth start state is intersected , see what will happen to two of them.

cloth_node:
https://s5.postimg.org/eb1gv98uf/colli5.gif


buildin-cloth:
https://s5.postimg.org/nk3n5dhqf/colli5_IN.gif

:smiley: thanks, looks great

the math of when the cloth point is inside two faces, how to locate the collision point:
https://s5.postimg.org/rnlczoyrr/image.jpghttps://s5.postimg.org/qjwn9zoqv/math.gif

some collision test:
https://s5.postimg.org/wdbaoaps7/cloth4.gifhttps://s5.postimg.org/fsmx6tdl3/colli4.gif

the visualization of collision point forces (for debug only):
https://s5.postimg.org/wnit7n4ef/cloth_track.gif

This is very impressive! Please keep it going!

Would you be so kind to explain how exactly are you able to keep this as addon(python?) and efficiently communicate with external cpp library? I was under impression that such “plugins” that other 3D applications have, are not doable in Blender and source needs to be modified. As such I am interested in understanding your approach. Tnx

Hi cgstrive
this addons’ UI is written with python but the main functions is written with c++ which have compiled to a dll file,and use the python’s ctypes module to load this dll file.
in the dll,I pass the object’s pointer to the C++ function,read and modifer the mesh data directlly just like the blender buid-in functions did without losing any performence.
but to do this thing I must learn about the DNA stucture of blender base objects and the functions of soure files, this has taken me a lot of time.but It’s worth it.

What sorcery is this!? :open_mouth:

Thank you for sharing the insight! Hope you’ll continue your impressive work!

the self collision test:
self collision algorithm is different form the static collision.I’m still testing and looking for the best way to implement this.
https://s5.postimg.org/5c7tib1fr/cloth_self.gifhttps://s5.postimg.org/ihnboevbb/cloth_self_D.gif

Oh man, that looks super impressive!!!

Guys, so looking into cloth recently. Why is everybody reinventing the wheel here?
Why not to take what is in bullet library and improve it? It is surely much faster than other solvers, it just obviously needs some tweaking regarding stability e.t…c.
http://sa10.idav.ucdavis.edu/docs/sa10-Bullet-Cloth.pdf