Sun, Sep 15, 11:55 PM 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 08 5:10 pm)

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: Alternate Runtime Location for Scripts


dburdick ( ) posted Fri, 17 October 2008 at 11:04 AM · edited Tue, 03 September 2024 at 2:01 AM

I there anyway to launch a Python script from a PZ2 or CR2 file that tells it to use the currently loaded Runtime path as the path to the script?  It seems that all scripts which are executed from a PZ2 or CR2 have to be located in the main Poser runtime (where the Poser app is located).  What I'm trying to do is to get around of forcing the user to have to install any of my products on the main Poser runtime versus simply installing it on runtime they choose.  I see that in Poser 7 Python, there is a new Libraries() method which will return a list of all of the available runtimes but it does not indicate which runtime is currently loaded.  What is needed is something like a symbolic link to the currently loaded runtime - e.g.:

:$Runtime:Libraries:Python:poserScripts......

Any ideas?


PhilC ( ) posted Fri, 17 October 2008 at 11:25 AM

You could iterate through the list supplied by the Libraries() method and use  try/except to load the script. If its not in the first library then it will try the next, and so on.

Maybe? :)


PhilC ( ) posted Fri, 17 October 2008 at 11:26 AM

ummmm.....

but the iteration script would need to be in the Poser 7 Runtime .... doh!


semidieu ( ) posted Fri, 17 October 2008 at 1:31 PM

Since Poser 7 SR3 and Poser Pro SR1, the script doesn't need to be in the main Poser runtime. It is looking for the script as it looks for a texture...

But some scripts needs to be in the main Poser runtime if they have specific code inside (ths script I'm doing always use this, for backward compatibility).


dburdick ( ) posted Fri, 17 October 2008 at 11:59 PM · edited Sat, 18 October 2008 at 12:09 AM

semidieu, yes I saw that nifty little feature that was added to Poser but like you, I need to worry about the backward compatibility issues.  I was hoping there was some symbolic keyword or some magical formating string I could stick inside of a PZ2 file to indicate that the script search should be directed into the current runtime.  I suspect there isn't such a beast, otherwise the Poser folks would not have made the new local runtime script execution change in SR3 and Poser Pro. 

Phil, I considered your idea which is a good one since I could just place a small script in the Main Poser Runtime and have it search and load a script by iterating through the libraries as you suggest.  The problem is that Poser 6 doesn't support the Libraries() method - only P7.  So I would be limited to Poser 7 or greater for the products. 

What I'm trying to do is to simply bury some scripts behind buttons in the Pose folder of the runtime.  Ideally, I would love to just stick the scripts in the same Pose folder with all of the .PNG files and PZ2's.  I would even settle for having the scripts located in the users local Python scripts runtime - which according to semideu, is possible with SR3 and Pro. 


semidieu ( ) posted Sat, 18 October 2008 at 7:13 AM

What can be done is the following... create a script that move the all scripts in the correct runtime.

The script would browse all connected runtimes and search for a python folder.
Then, it will copy all scripts from external runtime (located in the python folder) to the Poser runtime.

This would allow to create the 'launcher' as pz2 or cr2 and put then in any libraries. Once the copy script is launched, you don't have to care for where the scripts are installed...

Also, for the Libraries() method, I build one that is working for poser 6 if you want :)


dburdick ( ) posted Sat, 18 October 2008 at 3:41 PM · edited Sat, 18 October 2008 at 3:41 PM

Quote - What can be done is the following... create a script that move the all scripts in the correct runtime.

The script would browse all connected runtimes and search for a python folder.
Then, it will copy all scripts from external runtime (located in the python folder) to the Poser runtime.

This would allow to create the 'launcher' as pz2 or cr2 and put then in any libraries. Once the copy script is launched, you don't have to care for where the scripts are installed...

Also, for the Libraries() method, I build one that is working for poser 6 if you want :)

Terrific idea semideu.  Yes, I would love the P6 version of the Libraries() method.  Can you either post it here or just e-mail to me at dburdick@SkinVue.net

Thanks again


semidieu ( ) posted Sun, 19 October 2008 at 7:56 AM

email sent :D

If someone just need it, let me know :D


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.