Fri, Nov 29, 7:09 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: A more basical question ...


JoEtzold ( ) posted Wed, 29 January 2020 at 11:59 AM ยท edited Tue, 26 November 2024 at 9:47 AM

... for the Poser AND Python specialists ...

I have learned that in Poser 11.2 a Python version 2.7 is on board, thats correct ?

I have some self-build programs made in VB5 and VB6 incl. paided libraries for zipping, ftp/email or graphical work (2D). But nowadays with Win10 good old VB is mostly obsolete at least having trouble to install especial with ADO/ODBC etc.. VB.NET was and is never a option for me cause too much silly snippet stuff and I everytime had some doubt/problems with MS automatical updating of libraries and such (in german "Verschlimmbesserung").

Python mainwhile is a good and stable alternative and having a lot of stuff for zipping, ftp or graphics on board or with also free libraries on hand. So its time to port the old (and needed) VB-stuff to Python. But for this a dedicated programming surrounding is a fine idea.

So now the question(s): Does I get trouble with Poser if installing for example Python 3(.5) or Python 2.7 as a separate surrounding ? And can I install both in parallel ? Or should/can I use the Python stuff in Poser as 2.7 surrounding ?

Are there any experiences using 7zip as a zipping companion with Python either as library or as command line process with intermediate text file usage (special for .rar with list command to get and archive packed content informations) ?


adp001 ( ) posted Wed, 29 January 2020 at 12:10 PM

Last Question first: There is a Python lib for RAR (but no "Plug&Play" use with Poser-Python)

https://pypi.org/project/rarfile/




adp001 ( ) posted Wed, 29 January 2020 at 12:29 PM

Poser is using Python Version 2.7. Correct. And there is little chance that Poser will be upgraded to 3.x for the next few years.

Poser brings it's own Python installation. Including some libs. If a script needs libs not provided by Poser, this script needs an installer able to download the required libs and installs them into the correct folder on the target machine. This can become a pain in the ass, because more and more libs require an installation via PIP for example.

And yes, it is possible to install Python 2.7 or 3.x side-by-side, not disturbing Poser-Python (scripts running in this environment can't access Poser directly). Poser Python is completly independent.

Python (even Poser Python) can call other installed programs and is able to communicate with them. Both, in a simple way (just let another program run) or as a watched and controlled task. See libs "popen2" and "subprocess" (subprocess is the way to go: https://docs.python.org/2.7/library/subprocess.html)




adp001 ( ) posted Wed, 29 January 2020 at 12:39 PM ยท edited Wed, 29 January 2020 at 12:44 PM

About restrictions using libs: I scripted something complicated with Python 3.x and used RPC to communicate with Poser.

In another project I have in the making (pure fun) my external running program communicates with Poser via MQTT.

Advantage of both methods: The other software can run on a different machine.

So, many roads lead to Rom :)




adp001 ( ) posted Wed, 29 January 2020 at 1:03 PM

Are there any experiences using 7zip as a zipping companion with Python either as library or as command line process with intermediate text file usage (special for .rar with list command to get and archive packed content informations) ?

No experience with 7zip and Python. But, there is no need for this. Python has excelent ZIP support. You can deal with a zip file as if it where a directory. And yes, the lib is included in Poser Python.

https://docs.python.org/2.7/library/zipfile.html




JoEtzold ( ) posted Wed, 29 January 2020 at 5:43 PM

Thanx a lot, adp ...

That all sounds very well. As far as there is somewhat to do for/in Poser I will best use the Poser Python stuff. But for other projects away from Poser a separat surrounding would be more handy, I think this will than be version 3.x and version 2.7 stays with only Poser.

Thanks for the RAR info, so ZIP and RAR are well covered. But 7zip as own called process is further on of charm cause I have some older archives like arj, lzh, cab ... seems I'm lastly too long in business ... ๐Ÿ˜‡ ... and even iso-files can 7zip handle in reading. Ok, all these not writing but who wants to write such old stuff ... ๐Ÿ˜„

So a lot to do ... OUT MS-Office, VB, beloved Photoshop, Corel Draw, lots of tools ... IN Libre-Office, Python, Gimp, Blender and lots of tools ... and then I need some 20-30 years back and can start carreer again from educated scratch ... ๐Ÿ˜‚ ... or not cause most of the users might not be updated and so awkward as ever ... ๐Ÿ˜‚


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.