How to Restore Figure Shape

Looking for the scripting method to restore figure shape, or for that matter, activate any of the actions in the Edit -> Figure menu. 

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,858

    See this sample file (and, if you use its code, make sure you abide by the license terms) http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start#actions

  • CStratCStrat Posts: 30

    For anyone else interested, the specific action is 

    DzRestoreFigureShapeAction

    And the link Richard provided can help you set up the trigger, for example (and as stated, please use proper attribution since this code comes from the Docs):
     

    triggerAction("DzRestoreFigureShapeAction");    function triggerAction(sClassName) {        var oActionMgr = MainWindow.getActionMgr();        if (!oActionMgr) {            return;        }        var oAction = oActionMgr.findAction(sClassName);        if (!oAction) {            MessageBox.warning("The \"" + sClassName + "\" action could not be found.", "Resource Error", "&OK", "");            return;        }        if (!oAction.enabled) {            MessageBox.warning("The \"" + oAction.text + "\" action is currently disabled.", "Resource Error", "&OK", "");            return;        }        oAction.trigger();    }

     

  • I wonder why do I see the whole scripts as one line? This is absolutely unreadable. How to fix it?

    OneLine.png
    1105 x 77 - 9K
  • Forum limitation/bug, the code tags used to work but now scrunch everything together.

  • OmnifluxOmniflux Posts: 377

    If you "Quote" the post, as if you were going to reply to it, it will display correctly in the "Leave a Comment" input box, and you can read the script there. Just remember to delete instead of "Post Comment" when you are done :)

  • Great! Thank you.

Sign In or Register to comment.