EZCloth Settings

  • Okay, let me knock up some basic user notes (I'll remove the PhilC defaults as I haven't heard anything from him.)

  • Poser Ambassadors

    @amethystpendant Okay, thank you so much :) Very much appreciate your effort.

  • The purpose of EZCloth is to be able to store / apply presets of parameters for use in Poser's Cloth Simulator.

    The code is based on that created by @Snarlgribbly for EZDome which he kindly put in to the public domain and I completely ripped off!

    Save the EZCloth.py file either in your scripts menu, or anywhere on your hard drive

    So how do you use it.

    If it is in your scripts menu simply select it from there, if not go File: Run Python Script, browse to where you stored it and double click.

    You have to be in the cloth room to launch the app, if you leave the cloth room the window will vanish but return if you go back to the cloth room.

    Because of limitations in the Python implementation of Poser's cloth simulation api you need to select the Actor you are going to apply the settings to. In poser if you are in the cloth room and have multiple simulations, if you select an actor (dress, skirt etc) that is in a simulation, Poser goes to that simulation. Python can only apply settings to the current simulation and the current dynamic group, so if you have more than one dynamic group you need to select the one you wish to apply your settings to in Poser's window.

    Once you have the Actor, sim and correct dynamic group selected, simply select one of your presets, amend as required, then click the heart shaped icon on the toolbar to apply (Top left). You will be asked to confirm that you have selected the actor (this is so I can find the correct sim, as there is no "SelectedSimulation" in the API.) If you choose no, nothing happens, if you choose yes your settings are coppied to the simulation. For some reason a call to Poser's Redraw does not refresh the settings. I therefore change the selected Actor to be the Ground and then reselect the previously selected actor and that does refresh the settings.

    To save your current choices as a preset simply click the "Add" button, choose a name and it is saved. Similarly to delete a preset, select it then hit the Delete button. If you want to change the values for a previously saved preset, make the changes and hit the "Update" button.

    There are 2 extra settings "Cloth-Cloth Force" and "Cloth Bend Rate" that are not exposed via Poser's GUI. They both deal with how cloth interacts with itself during a simulation. The Cloth-Cloth Force increases the force trying to stop cloth intersecting itself. It goes from 0 to 1000. Poser defaults this to 10. Cloth Bend Rate limits the amount a poly can bend in relation to it's neighbour. It runs from 0 to 1 and poser defaults it to 0. Both these settings help with larger density meshes where the fold resistance is low. I generally set them to 980 and 1. I haven't noticed a particular slow down when they are used but the results are certainly worth setting them, though your mileage may vary.

    Clicking on the gear on the tool bar will ask if you want to load defaults, currently there is only one and it matches the default for Poser so not very useful, I might add more in the final release.

    Please let me know of any bugs and I'll do my best to fix them, probably a post to this thread would be best.

    Hope it helps some people, and if it does please let me know.


    Download the app

  • Poser Ambassadors

    @amethystpendant OMG, this is awesome. Thank you.

  • @amethystpendant

    Thanks Amanda, will do few tests later on

    Thanks, Jura

  • @amethystpendant
    Very interesting that is!!
    I never thought of the possibility to use Snarly's EZxx approach for cloth.

    Looking at the settings in the Python manual I note there is an provision for separate properties in u- and v- direction:

    The Bend Rate parameter operating on the U coordinate axis.
    The Fold Resistance parameter specifies the resistance to out-of plane bending (folding). The UBendResistance code specifies the U coordinate axis of the Fold Resistance parameter.
    The Scale parameter operating on the U coordinate axis.
    The UseEdgeSprings parameter sets whether or not the cloth will use edge spring calculations.
    The Stretch Resistance parameter specifies the cloth’s resistance to in-plane bending (stretching). The UStretchResistance code specifies the U coordinate axis of the Stretch Resistance parameter.
    The Bend Rate parameter operating on the V coordinate axis.
    The Fold Resistance parameter specifies the resistance to out-of plane bending (folding). The VBendResistance code specifies the V coordinate axis of the Fold Resistance parameter.
    The Scale parameter operating on the V coordin ate axis.
    The Stretch Resistance parameter specifies the cloth’s resistance to in-plane bending (stretching). The VStretchResistance code specifies the V coordinate axis of the Stretch Resistance parameter

    It could be worth while to separate them. Clothing models made in Marvelous Designer come with a .xml file giving the physical parameters of fabrics (= materials) used, separate for U and V direction, scale parameters; the whole shebang.
    I never included this datafile in my published products because they had no use. This may change it.

    If the scale parameter is what I think it is and represent shrinkage, it would be the mechanism I used in MD for making the Prefitter object.

    Very interesting!!

  • @F_Verbaas Hi, although they are separated Poser only passes through (ISTR the U versions) I tried when I first looked at this many years ago setting them differently but it made no difference and some like U/VScale have no effect at all, the only 2 I found that did have an effect were the CLOTHCLOTHForce andU/VBendRate which I have exposed in my tool.

  • BTW I've only tested this on windows, but on that platform it appears to work in Poser 11 and Poser 2014

  • @amethystpendant
    It would seem strange to make a function that does not do anything. When it is provided for compatibility that should be noted in the docs.
    Was this confirmed by support?

  • @F_Verbaas said in EZCloth Settings:

    It would seem strange to make a function that does not do anything. When it is provided for compatibility that should be noted in the docs.
    Was this confirmed by support?

    Have you ever tried contacting support at SM? You have access to the code, add the split for the U & V as I said it was a long time ago that I tested it.

  • @amethystpendant
    They usually are/were? responsive to me, but yes, I can hack the code.
    Not sure if the new crew has the knowledge so I may need to try it out myself.
    Had already planned to do so but if you had confirmation the V-variants are not working (yet)/are not transferred to the simulator (yet) I could have saved myself the trouble.

  • @F_Verbaas I believe they never were implemented, Max did in their implementation but Poser didn't, and lets face it cloth sim has not had ANY work done on it from when it was first released and was at the time amazing, now not so much. It's the one thing I REALLY hope is addressed in the next release of Poser. If all they have are new rigging tools (which I don't use) or new characters (which don't deserve to be used) then I doubt I will upgrade to the next release, I only went to P11 because of Superfly.

    The cloth sim and render engine are what I use. I make my own clothes in Blender and sim them in Poser as the cloth sim in Blender, although very flexible doesn't come up to snuff yet, if it did, I would pose in Poser, export to alembic cloth sim and render in Blender.

  • @amethystpendant
    Having different stretch parameters does have an effect, but more complicated than one would expect.

    Below is the standard hgh density cloth pane, secured by the top row of vertices as 'choreographed'.
    The stripes in the cloth are parallel to v-direction.

    I tweaked the code so the u-stretch-stiffness is as specified (here default 50) vstretch-stiffness set to 0.1
    Result is non-symetry!!!
    The sim was 300 frames and the end result was stable.

    I think the problem lies with the shear springs, the difference in stiffness and the fabric being ordered quads. Will see what happens with a Delaunay triangulation.

  • It was exactly that! When I use a random triangulation, the result is as expected!!
    Used vstretchstiffness 0.1 again.
    stretch and wrinkly contraction.

    1 - it makes sense to explore further. I need to extend the code a little to include the other parameters.
    2 - there is sense in using irregular triangulated meshes for dynamic clothing.

  • Have you tried it swapping the stiffness U & V as I can't see why that would have an effect on a simple drop, the second picture you showed seems simply do demonstrate the left to right top to bottom calculation of the simulation engine. I'll look forward to your continued testing :)


  • @amethystpendant
    You are right! I was carried away. (and called away for other things so wanted to close too swiftly)


    seeing the amount of sag (and some previous observations I did not share) I had assumed the U-stretch would be untouched.
    Unfortunately when I rotate the cloth 90 degrees and do the same hanging test with the u=1.0 area, I get the same sag.

    Sorry. Shouted too quickly.
    (hides in shame)

  • @F_Verbaas Nothing wrong with an experiment that went wrong, it proves something :) I really would have been surprised if they had suddenly decided to implement individual UV params when they never had before, altough from what I understand of the stitch API there is no logical reason why they wouldn't

  • Or not:
    there is a difference but I cannot exactly understand it:
    Stripes are parallel to v-axis:

    Both cloths have the UStretchResistance set to 0.1 and the VStretchResistance set to 50.

    It is not a misleading visual effect of the stripes:

    I heve deleted the simulations, re-ran them, a few times but this remains to be the result.
    The cloth hung parallel to the u-axis wrinkles, the cloth hung parallel to the v-axis remains straight.

    Looks like I come to the inevitable conclusion that 'more research is necessary'.
    (but that will not be tonight)

  • Poser Ambassadors

    It's really cool to see this development being done.
    Seeing as the release of EZDome into the public domain has proven useful I have released the EZSkin 3 code too, in case it is also of any use.
    Get it at: http://snarlygribbly.org/snarlyspace/ezskin.html

    @amethystpendant Good luck with the rest of this project!

  • @amethystpendant said in EZCloth Settings:

    I've emailed PhilC to ask if he minded me including his material room preset values...

    From what I remember, the values weren't Phil's work anyway. They were posted on the RDNA forums by a member whose name escapes me for the present - I saved the images, but they have no name on them. However they say that the values were based on a table by Serge Marck at poserfashion (dot) net, which is long gone, although I haven't tried the Wayback Machine for it. Phil wasn't the only one to use these values in a script, either; svdl made something similar.

    If you manage to get the attributions sorted out I look forward to having this! I used to use svdl's script regularly in Poser 7.