Forum: Poser Python Scripting


Subject: Breaking a SimpleXMLRPCServer with a keystroke

FVerbaas opened this issue on Dec 10, 2020 ยท 40 posts


HartyBart posted Mon, 21 December 2020 at 4:34 AM Online Now!

Thanks for the tip on Kota Yamaguchi's PSD Tools for Poser 11. The working example given on the homepage is to open a PSD and extract a layer as a PNG. While there are several other such export scripts to be found, it apparently can't be done the other way. StackOverflow has (from 2017).... "there still is currently no way to write PSD files in pure Python in a manner that would satisfy at a productive level." The best answer there is to suggest a subprocess call to GIMP via command-line. Has anything changed in the three years, on having Python itself do a basic "stack six PNG renders into a new layered PSD, then save it with filename xyz.PSD"?

Or, is that function enabled by the newer Poser 12-only PSD Tools you mention? But if the basic starting stack still can't be made in this newer version, then the other (obviously powerful) features of the PSD Tools modules are of no use - they will have no saved PSD file to work on and re-sort / re-name / blend layers.

GIMP was for a moment looking like the best free alternative to calling Photoshop as a subprocess, but a robust stacking script would need to be found for it. Judging by a short search, again everyone seems to want to export from PSD - but no-one wants to import via a script.

Even then the problem would be that GIMP has no recordable Actions by which users could then brew their own artistic automation, by working on the saved "base" PSD file. So far as I know GIMP has no record-what-I-do / replay-what-I-did Actions feature like Photoshop has. Instead GIMP appears to expect users to write code in Script-fu, to create an automated script. This is not viable for the average creative user.

One interesting automated possibility I found mention of, however, was ImageMagick's "compose". This can be used when images are all of exactly the same size as Poser scene renders are...

convert render1.png render2.png render3.png -gravity center -composite combo.psd

The problem then is that ImageMagick cannot then run through and re-name and re-sort the layers in the resulting PSD. Nor can it set opacity blending on these layers. Also, Photoshop is said to throw errors on opening such a file ('blending modes not set').

Thus it all comes back to Photoshop. I would love to combine Poser renders via free software, to be combined to a "base" PSD for users to then play with creatively. But it doesn't seem viable.



Learn the Secrets of Poser 11 and Line-art Filters.