I have just added a simple air pressure feature to Blender cloth simulator, and spring length scaling factor, hope it will be useful for somebody See screenshots:
Finally I have a question: My code added a new property āspring length scalingā to Cloth modifier, whose default value is 1.0. But when I open old blend files contain Cloth simulation, the property is loaded as 0.0, breaks the simulation What should I do to let the program load the default value correctly if old blend file doesnāt contain this property?
readfile.c is where you want to look, probably in the ādo versionsā part.
Though what really should happen is the old files donāt break on loading but simulate how they did before you added these changes i.e. spring_length_scaling == 0 is the old behavior while spring_length_scaling > 0 is the new fancy stuff.
People get mad when a new change breaks all the work they did to get whatever they were working on āperfectāā¦
Oh, and you really should use the patch tracker on projects.blender.org once you get this nailed down because itāll just get lost/ignored here.
to just have it disabled when the factor is 0, not that I really understand if having a 0 spring length is valid or not. Or just use do_versions to set it to 1 on loading old files.
Thanks for your advice, after checking ādo_versionsā function in readfile.c I think I shouldnāt change it now, instead I added check code in the simulator, only use spring_length_scale if itās positive, otherwise 1.0 (default value) will be usedā¦ And I have just submitted a patch on blender patch tracker (#30941).
That looks terrific! I wish it will be in trunk soon!
Thanks for your reply Any new ideas and suggestions are welcomeā¦
front left: cloth with air pressure
front right: cloth without air pressure
back: soft body (not carefully matched, just for rough comparison)
Videoās short because the soft body sim took by far the longest, so I imagine cloth with pressure will be a satisfactory substitute under at least some circumstances for its time-saving benefits alone?