Wed, Sep 18, 11:46 AM CDT

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: Scripted CR2 Saving Causes Poser to Exit


Iuvenis_Scriptor ( ) posted Mon, 25 April 2022 at 12:36 PM · edited Sat, 10 August 2024 at 7:19 PM

I've encountered quite a mystery in Poser 12.0.757.  I'm working on a script that starts out like this:


import os
import poser
loc = os.path.dirname(os.path.abspath(__file__))
lib = loc.split("Materials")[0]
fig = os.path.join(lib,"Character\Genesis 8 Male\Characters\Iuvenis_Scriptor\Calisto")
scene = poser.Scene()
figure = scene.CurrentFigure()
scene.SaveLibraryFigure(os.path.join(fig,"Calisto.cr2"))


The odd thing is that, when it reaches the last line reprinted above, Poser thinks for a bit and then just closes.  No error message or anything.  It just exits, as if I'd clicked the X in the top right corner of the window.  And yet, when I do the exact same thing manually (via the '+' button in the Library palette), it works just fine.  The same code (with paths and filenames appropriately adjusted) also works just fine on La Femme, but not on a converted G8M.  I'm at a loss, so I'd be thankful for any tips!


Y-Phil ( ) posted Tue, 26 April 2022 at 1:21 AM

I suppose that your scripts lies at "runtime:library:", wherever it is on your computer, hence my silly question:
I suppose that the relative path "Genesis 8 Male\Characters\Iuvenis_Scriptor\Calisto" exists?


𝒫𝒽𝓎𝓁


(っ◔◡◔)っ

👿 Win11 on i9-13900K@5GHz, 64GB, RoG Strix B760F Gamng, Asus Tuf Gaming RTX 4070 OC Edition, 1 TB SSD, 6+4+8TB HD
👿 Mac Mini M2, 16GB, 500GB SSD
👿 Nas 10TB
👿 Poser 13 and soon 14 ❤️


FVerbaas ( ) posted Tue, 26 April 2022 at 7:31 AM · edited Tue, 26 April 2022 at 7:31 AM
Forum Coordinator

That is likely to be the issue indeed. One should always check the existence of the path before trying to read or write it. 

at least put a try/except: around any operation on files to minimize surprises like you experience now. 


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.