Thu, Nov 28, 2:57 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Adding an undo option to a script


ironsoul ( ) posted Sun, 02 September 2018 at 9:31 PM · edited Mon, 25 November 2024 at 11:05 AM

Hi
I have a script that performs multiple changes to a scene and would like to add the ability to rollback if the update fails. I've looked at save/revert but save requires the doc name to be set which could impact a users own save/backup strategy. I'm suspicious of using the undo function as don't know how comprehensive it is. Any thoughts/suggestions would be welcome.



FVerbaas ( ) posted Tue, 18 September 2018 at 3:05 PM · edited Tue, 18 September 2018 at 3:07 PM
Forum Coordinator

It seems you can save with an optional name:

Manual says: SaveDocument Explanation Save an existing Poser document. Takes an optional file name as argument.

Arguments Enter a valid path to save the file to that location/filename. If you do not specify an argument, the file will be saved in its current path with its current name.

Syntax SaveDocument({ filePath})

Example poser.SaveDocument(“C:My DocumentsPoser Stuffmyscene2.pz3”)


ironsoul ( ) posted Fri, 21 September 2018 at 2:58 AM

Thanks FVerbaas. From the point of view of using SaveDocument as a temporary save method it also changes the users current document name which could cause problems if the python script fails during execution. I think the best approach is to use it as an option the user can take prior to the changes.



Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.