Forum: Poser Python Scripting


Subject: Installing Third-Party Packages into Poser's Internal Python Installation

Iuvenis_Scriptor opened this issue on May 24, 2022 ยท 6 posts


Iuvenis_Scriptor posted Tue, 24 May 2022 at 10:24 PM

On a whim, I decided to spend the better part of the day seeing if I could streamline and maybe even automate a particular postwork process that I like to call "filmicization."  Basically, it's all about emulating a much more lifelike color space (if I understand things correctly, ACES, the industry standard in film) rather than the apparently crappy sRGB that comes grandfathered into most household computers.  If you're interested in a more detailed explanation, this video from a Blender user does a great job.

While a plug-in makes "filmic" renders easy in Blender, filmicization of Poser renders originally involved re-rendering a previous SuperFly render on a square plane prop in FireFly, using a special shader designed by the ever indispensable BagginsBill, bringing both the original and the re-render into Photoshop, and overlaying a high-pass of the former over the latter to restore some of the fine detail that's inevitably lost otherwise.  What I've done is take the math that BB does with nodes and implemented it in a Python script that operates directly on an exported HDR render.  At least to me, the results are quite satisfying.  It's much simpler, quicker, and avoids that loss of fine detail that I kept having to add back in.

I would like to post this as a freebie, but it does require a third-party Python package called OpenCV, which is easy to install...in a Python instantiation that's independent from Poser.  I want to make it as user-friendly as possible, so I'd really prefer to be able to install it into Poser's internal Python instantiation, which is the one thing I haven't been able to figure out how to do yet, short of manually copying the files from my independent Python into Poser's Python.  So I would greatly appreciate anyone who can point me in the right direction!  Thanks in advance!


structure posted Tue, 24 May 2022 at 10:41 PM Forum Coordinator

import pip
pip._internal.main( [ 'install', packageName ] )


I am not sure if this still works, but this is how it was done when we upgraded to python3.7

Locked Out


Iuvenis_Scriptor posted Wed, 25 May 2022 at 12:10 AM

I don't think so, unfortunately.  It gave me this.

ERROR: Could not find a version that satisfies the requirement packageName (from versions: none).


Y-Phil posted Wed, 25 May 2022 at 2:41 AM

In fact, often, these packages have dedicated name for Python's world. In this case, give the official documentation, this works:

pip._internal.main(['install', 'opencv-python'])

On my Win10 platform, Poser thought quite a few seconds after sending ansi-escaped lines as pip does in any console. But it seemed to work


๐’ซ๐’ฝ๐“Ž๐“


(ใฃโ—”โ—กโ—”)ใฃ

๐Ÿ‘ฟ 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, Sonoma 14.6.1, 16GB, 500GB SSD
๐Ÿ‘ฟ Nas 10TB
๐Ÿ‘ฟ Poser 13 and soon 14 โค๏ธ


Iuvenis_Scriptor posted Wed, 25 May 2022 at 11:37 AM

Well, it took me a bit to figure out that I had to restart Poser for it to take effect, but Y-Phil's solution worked for me too!  Thanks, guys!  If you're interested, here's the freebie.


Y-Phil posted Wed, 25 May 2022 at 2:17 PM

Iuvenis_Scriptor posted at 11:37 AM Wed, 25 May 2022 - #4439123

Well, it took me a bit to figure out that I had to restart Poser for it to take effect, but Y-Phil's solution worked for me too!  Thanks, guys!  If you're interested, here's the freebie.

Thank you for sharing :smile:


๐’ซ๐’ฝ๐“Ž๐“


(ใฃโ—”โ—กโ—”)ใฃ

๐Ÿ‘ฟ 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, Sonoma 14.6.1, 16GB, 500GB SSD
๐Ÿ‘ฟ Nas 10TB
๐Ÿ‘ฟ Poser 13 and soon 14 โค๏ธ