please, help, ds script to make pose save-as preset?

MistaraMistara Posts: 38,675

please, help, to make ds script to make file, pose, save, preset?

 

i've done this a dozen times already, and many dozens to go. is taking forever frown

is it possible to make a script button to save a posewith just these options ticked?!!  thanks heart

 

i'm converting my daz dragons to duf and subdivision.

and i'se working to bring the poses up to my daz content folders, so i dont hafta keep drilling down to poser folders 

 

 

Comments

  • MistaraMistara Posts: 38,675

    or if i could save it as a default preferences til i'm done with the project?

  • QuixotryQuixotry Posts: 897

    I haven't seen a script that does that, but if someone found or created one, I'd grab it in a heartbeat. That would be incredibly useful and save a lot of time.

  • EsemwyEsemwy Posts: 577

    This snippet along with this sample script should get you there. 

  • carrie58carrie58 Posts: 3,951
    edited January 2017

    Misty  are you using the check all thingy??

    poses.jpg
    1920 x 1080 - 221K
    Post edited by carrie58 on
  • MistaraMistara Posts: 38,675

    checl all thingy is more than i want, 

    ise being cautious dont want him to move from his spot when applying a pose, smiley

  • MistaraMistara Posts: 38,675
    Esemwy said:

    This snippet along with this sample script should get you there. 

     

    thanks smiley

  • EsemwyEsemwy Posts: 577
    edited January 2017

    Alright, this is really hacked together, but it seems to work.

    // DAZ Studio version 4.9.2.70 filetype DAZ Script/**********************************************************************     Copyright (C) 2002-2017 Daz 3D, Inc. All Rights Reserved.     This script is provided as part of the Daz Script Documentation. The    contents of this script, and\or any portion thereof, may only be used    in accordance with the following license:     Creative Commons Attribution 3.0 Unported (CC BY 3.0)    - http://creativecommons.org/licenses/by/3.0     To contact Daz 3D or for more information about Daz Script visit the    Daz 3D website:     - http://www.daz3d.com **********************************************************************/// Source: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/save_duf_pose/start// DAZ Studio version 4.5.0.102g_AppName = "SimplePose";function getSavePath() {    var oContentMgr = App.getContentMgr();    var sBasePath = oContentMgr.getContentDirectoryPath( 0 );    var sDefaultPath = DzAppSettings(g_AppName).getStringValue( "savePath", sBasePath );    var sOutputPath = FileDialog.doFileDialog( false, "Save Pose", sDefaultPath, "DUF Files (*.duf)" );    var fi = DzFileInfo(sOutputPath);    if (fi) {        DzAppSettings(g_AppName).setStringValue( "savePath", fi.path() );        return sOutputPath;    }    return;}function createPropertiesArray(oNode) {    var aNodeProperties = new Array;    var aObjectNodes = oNode.getNodeChildren(true);    aObjectNodes[aObjectNodes.length] = oNode;    for (var iNodeNum = 0; iNodeNum < aObjectNodes.length; iNodeNum++) {        var oCurNode = aObjectNodes[iNodeNum];        var oSaveProperties = new Object;        var aPropNames = new Array;        for (var iPropNum = 0; iPropNum < oCurNode.getNumProperties(); iPropNum++) {            var sPropName = oCurNode.getProperty(iPropNum).getName();                // Only pick up rotation properties            if (sPropName.endsWith("Rotate")) {                aPropNames.push(sPropName);            }        }        oSaveProperties.nodeName = oCurNode.getName();        oSaveProperties.propNames = aPropNames;        aNodeProperties[iNodeNum] = oSaveProperties;    }    return aNodeProperties;}(function( bShowOptions ){        var oAssetIOMgr = App.getAssetIOMgr();    var sClassName = "DzPoseAssetFilter";    var nAssetIOFilter = oAssetIOMgr.findFilter( sClassName );    if( nAssetIOFilter < 0 ){        var sMessage = qsTr("An asset filter with the class name " +            "\"%1\" could not be found.").arg( sClassName );        MessageBox.critical( sMessage, qsTr("Not Found"), qsTr("&OK") );        return;    }        var oAssetIOFilter = oAssetIOMgr.getFilter( nAssetIOFilter );    if( !oAssetIOFilter ) return;    var oSettings = new DzFileIOSettings();    oAssetIOFilter.getDefaultOptions( oSettings );        var oNode = Scene.getPrimarySelection();    if( oNode && oNode.inherits( "DzBone" ) ) oNode = oNode.getSkeleton();        var sNode = (oNode ? oNode.getName() : "Genesis");            oSettings.setBoolValue( "SaveCurFrame", true );    oSettings.setIntValue( "StartFrame", 0 );    oSettings.setIntValue( "EndFrame", 30 );    oSettings.setBoolValue( "CompressOutput", false );        if ( !oAssetIOFilter.getOptions( oSettings, bShowOptions, "" ) ) return;        if ( !bShowOptions ){        oSettings.setBoolValue( "BypassFilter", false );                var sNamesSettingsKey = "NodeNames";        // Get the (nested) settings that hold the named nodes and properties        var oNamesSettings = oSettings.getSettingsValue( sNamesSettingsKey );        if( !oNamesSettings ){            oNamesSettings = oSettings.setSettingsValue( sNamesSettingsKey );        }                        var aNames = createPropertiesArray(oNode);                var oNodeSettings;        var nNodeSettings;                for( var i = 0; i < aNames.length; i += 1 ){            sNode = aNames[ i ][ "nodeName" ];            oNodeSettings = oNamesSettings.getSettingsValue( sNode );            if( !oNodeSettings ){                oNodeSettings = oNamesSettings.setSettingsValue( sNode );            }                        nNodeSettings = oNodeSettings.getNumValues();            aPropNames = aNames[ i ][ "propNames" ];            for( var j = 0; j < aPropNames.length; j += 1 ){                oNodeSettings.setStringValue(                    String( nNodeSettings ),                    aPropNames[ j ] );                nNodeSettings += 1;            }        }    }        oSettings.setBoolValue( "RunSilent", true );        print( oSettings.toString() );        var sFile = getSavePath();    if (!sFile) {        var sMessage = qsTr("No filename specified.");        MessageBox.critical( sMessage, qsTr("No file"), qsTr("&OK") );        return;    }    var fi = DzFileInfo(sFile);    oAssetIOMgr.doSaveWithOptions( oAssetIOFilter, oSettings,        false, sFile, fi.path(), "" );    })( false );

     

    Post edited by Esemwy on
  • carrie58carrie58 Posts: 3,951
    MistyMist said:

    checl all thingy is more than i want, 

    ise being cautious dont want him to move from his spot when applying a pose, smiley

    Ahhh but if you look at the checky all thingy you have options of check all translation or rotations or scale if you click on ALL ROTATIONS only then your pose won't cause your figure to jump around it's how I save my poses ,and if you only want a partial it's a bit easier to go in and uncheck what you don't want to save.

    Save

  • EsemwyEsemwy Posts: 577
    carrie58 said:
    MistyMist said:

    checl all thingy is more than i want, 

    ise being cautious dont want him to move from his spot when applying a pose, smiley

    Ahhh but if you look at the checky all thingy you have options of check all translation or rotations or scale if you click on ALL ROTATIONS only then your pose won't cause your figure to jump around it's how I save my poses ,and if you only want a partial it's a bit easier to go in and uncheck what you don't want to save.

    Good info. I wasn't aware of the right-click options. I do enjoy writing scripts, though....

  • carrie58carrie58 Posts: 3,951
    edited January 2017
    Esemwy said:
    carrie58 said:
    MistyMist said:

    checl all thingy is more than i want, 

    ise being cautious dont want him to move from his spot when applying a pose, smiley

    Ahhh but if you look at the checky all thingy you have options of check all translation or rotations or scale if you click on ALL ROTATIONS only then your pose won't cause your figure to jump around it's how I save my poses ,and if you only want a partial it's a bit easier to go in and uncheck what you don't want to save.

    Good info. I wasn't aware of the right-click options. I do enjoy writing scripts, though....

     

    and my ability to write a script  ......  is totally non-existentlaugh

     

    Save

    Post edited by carrie58 on
  • MistaraMistara Posts: 38,675
    carrie58 said:
    Esemwy said:
    carrie58 said:
    MistyMist said:

    checl all thingy is more than i want, 

    ise being cautious dont want him to move from his spot when applying a pose, smiley

    Ahhh but if you look at the checky all thingy you have options of check all translation or rotations or scale if you click on ALL ROTATIONS only then your pose won't cause your figure to jump around it's how I save my poses ,and if you only want a partial it's a bit easier to go in and uncheck what you don't want to save.

    Good info. I wasn't aware of the right-click options. I do enjoy writing scripts, though....

     

    and my ability to write a script  ......  is totally non-existentlaugh

     

    Save

     

    thank yoos smiley

     scripty thingy will save so much time 

     

  • MistaraMistara Posts: 38,675

    enlightened cans assign a keyboard shortcut to it?

  • MistyMist said:

    enlightened cans assign a keyboard shortcut to it?

    Find the script in a content pane, right-click and select Create Custom Action. Now go to Window>Workspace>Customise and find the new action under Custom on the left. Right-click on the new action and select Change Keyboard Shortcut, then press the key combination you want to use. You can also drag the new action into a menu or toolbar in the tabs in the right-hand half of the dialogue.

  • MistaraMistara Posts: 38,675
    MistyMist said:

    enlightened cans assign a keyboard shortcut to it?

    Find the script in a content pane, right-click and select Create Custom Action. Now go to Window>Workspace>Customise and find the new action under Custom on the left. Right-click on the new action and select Change Keyboard Shortcut, then press the key combination you want to use. You can also drag the new action into a menu or toolbar in the tabs in the right-hand half of the dialogue.

     

    cans add it to a toolbar?!!

    tyheart

  • CybersoxCybersox Posts: 8,757
    MistyMist said:

    enlightened cans assign a keyboard shortcut to it?

    Find the script in a content pane, right-click and select Create Custom Action. Now go to Window>Workspace>Customise and find the new action under Custom on the left. Right-click on the new action and select Change Keyboard Shortcut, then press the key combination you want to use. You can also drag the new action into a menu or toolbar in the tabs in the right-hand half of the dialogue.

    Two question I've always had on this... 1.) is there a limit to how many custom actions one can have at one time?  I have about twenty currently, but as I learn the usefulness of certain scripts and gather more utilities, that number keeps expanding..  And, on that note, 2.  Is there a way to create more than one custom actions folder on the toolbar, so you would have, say, a custom actions folder for Posing and one for lighting?

  • MistyMist said:

    enlightened cans assign a keyboard shortcut to it?

    Find the script in a content pane, right-click and select Create Custom Action. Now go to Window>Workspace>Customise and find the new action under Custom on the left. Right-click on the new action and select Change Keyboard Shortcut, then press the key combination you want to use. You can also drag the new action into a menu or toolbar in the tabs in the right-hand half of the dialogue.

    Two question I've always had on this... 1.) is there a limit to how many custom actions one can have at one time?  I have about twenty currently, but as I learn the usefulness of certain scripts and gather more utilities, that number keeps expanding..  And, on that note, 2.  Is there a way to create more than one custom actions folder on the toolbar, so you would have, say, a custom actions folder for Posing and one for lighting?

    There may be a limit, but I don't know what it is.

    I'm not sure what you mean on 2 - you can have multiple toolbars, and swap them in and out via the Customise dialogue (or, during a session, by right-click on a toolbar - however unless it has chnaged recently that will show only the toolbars that have been open during a session). It's also possible to script showing and hiding toolbars, so you could have custom actions to toggle the availablity of custom actions.

  • CybersoxCybersox Posts: 8,757
    MistyMist said:

    enlightened cans assign a keyboard shortcut to it?

    Find the script in a content pane, right-click and select Create Custom Action. Now go to Window>Workspace>Customise and find the new action under Custom on the left. Right-click on the new action and select Change Keyboard Shortcut, then press the key combination you want to use. You can also drag the new action into a menu or toolbar in the tabs in the right-hand half of the dialogue.

    Two question I've always had on this... 1.) is there a limit to how many custom actions one can have at one time?  I have about twenty currently, but as I learn the usefulness of certain scripts and gather more utilities, that number keeps expanding..  And, on that note, 2.  Is there a way to create more than one custom actions folder on the toolbar, so you would have, say, a custom actions folder for Posing and one for lighting?

    There may be a limit, but I don't know what it is.

    I'm not sure what you mean on 2 - you can have multiple toolbars, and swap them in and out via the Customise dialogue (or, during a session, by right-click on a toolbar - however unless it has chnaged recently that will show only the toolbars that have been open during a session). It's also possible to script showing and hiding toolbars, so you could have custom actions to toggle the availablity of custom actions.

    Actually I meant adding a second scripts menu to what DAZ calls the Main Menu bar in the documentation.  The one across the top with "FIle, Edit, Create, Tools, Render, Connect, Window, Scripts, and Help" at the top of City Limits.  Since I use City Limits there aren't any subtoolbars aka activity bars.  The thing is, I really prefer the layout of city limits, but there's almost no documentation on it in any of the DAZ literature and I don't think the information on the workspace in the reference guide has been updated since 4.0.  As it is, the best alternative I've been able to come up with is creating a Fav Actions folder and putting the things I normally use in there, but that still means leaving the panme that I'm in and jumping back and forth, whereas using with scripts on the main menu I can stay in Scene, Content LIbrary or wherever else I am. 

  • I'm going to ask a question which is somewhat related to the original post.

    Is there an easy way to reset a figure's location to (0,0,0) after a pose has been applied?

    I've got some pose sets that automatically move the figure quite far away from the origin. While I can understand why - they were originally intended for use with a specific bar/spaceship set - it's a real a drag to have to manually relocate and sometimes rotate the figure so I can use that same pose in a different set.

  • MistaraMistara Posts: 38,675

    fretting over the g3 poses packages, what if they forget to uncheck the face rig bones,
     

  • CybersoxCybersox Posts: 8,757
    MistyMist said:

    fretting over the g3 poses packages, what if they forget to uncheck the face rig bones,
     

    Or intentionally set them.  Which they sometimes do. 

    I have a zero face action taken from one of Ironman's posesets in my custom actions and I've taken to using Zev0 & Draagonstorm's Posebuilder products for loading/editing most poses, as PB ignores most X-Z translations and comes with a lot of utilities to zero out individual parts of the body like the head, each hand, foot, etc..  It's a big help for getting rid of all the high-heeled poses when I want flats.  You know a custom script I want?  "Selected foot flat to floor,"  which would zero the foot, align it with the floor and then drop the the whole figure onto the floor. 

    Hmm... actually, now that I think about it, it seems like zeroing the appropriate foot and then going through the whole "mcjhorizontalizeshoes" process, including creating sole planes, might do it, although that's like four button pushes and still some adjusting getting the soleplanes in the right spot.     

Sign In or Register to comment.