Fit To Script?

Can someone post a code snippet of fitting a piece of clothing to a character, using script?
Thanks.

Comments

  • If you want a script written the proper place to ask would be Product Suggestions, you can edit the first post to move the thread.

    If you want to write your own script, look at http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/skeleton_dz and specifically the setFollowTarget() member.

  • Seven193Seven193 Posts: 1,096

    Thanks, I tried that method, but as far as I can tell, it didn't do anything.  Nothing visually change, nor did any properties change.

    I see that Figures have two properties related to Fit to.
    - "Fit to"
    - "Fit to Mode"

    I can get the first property and set it directly:
    var fitProp = clothingItem.findPropertyByLabel( "Fit to" );

    fitProp.setValue(targetSkeleton);

    But what other behind-the-scenes fixups need to be set to complete the process?
    - Changing the parent node?

    Assuming the item to fit is already fitted on another character, and I would like to refit it from character A to character B.

  • There can be only one fit to target at a time, so setting it to the new figure will clear the link to the old. Parenting is optional, though DS does it by default and it is required for Hierarchical presets to work.

  • Seven193Seven193 Posts: 1,096

    What I'm trying to do is create a Batch "Fit To" script tool.  I want to refit all clothing from character A to character B, without having to do it by hand. And I can make it more convenient if I use a list view box to select the items I want to refit, rather than letting the script figure it out. As I don't know of any good way to identify what an item is, clothing or not.

     

Sign In or Register to comment.