Sun, Feb 16, 6:58 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: 2025 Feb 05 6:41 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: FreeImage for Poser Python


stewer ( ) posted Fri, 20 April 2007 at 7:18 PM · edited Mon, 10 February 2025 at 5:06 AM

Attached Link: http://web.mac.com/keindesign/Python%20FreeImage.zip

I'm happy to announce that there is now a solution to maniuplate images from within Poser Python. It's a Python wrapper for the FreeImage library created with SWIG. The FreeImage library is documented at http://prdownloads.sourceforge.net/freeimage/FreeImage393.pdf. Consider this a "by product" of the Photoshop CS 3 exporter by e frontier. The library is compatible with Poser 7 for Windows and Mac OS X and comes with source code. Since this is derived from the original FreeImage library, it is also placed under the FreeImage license. Therefore, you are allowed to redistribute the library with your scripts as long as you include a copy of the license and acknowledge it in the documentation of the script. I will try to provide a sample script soon.


adp001 ( ) posted Fri, 20 April 2007 at 7:52 PM

http://freeimagepy.sourceforge.net/

Made with ctypes. Works with all Python versions where lib ctypes can be used.




adp001 ( ) posted Fri, 20 April 2007 at 7:58 PM

By the way: Freeimage has no support for PSD files (Photoshop).
PIL can at least read PSD files.




stewer ( ) posted Fri, 20 April 2007 at 8:11 PM

FreeImage can read PSD files, it just can't write them.


semidieu ( ) posted Sun, 22 April 2007 at 11:37 PM

Thanks stewer ! It's really useful for me !


semidieu ( ) posted Tue, 05 June 2007 at 3:15 PM

Hi,

I'm working with FreeImage and a tester had this message. As you are both German if I rememeber well, can you help me ?

Traceback (most recent call last):
   File
"E:Programme3DPoser7runtimepythonposerscriptsartmaterialsartmaterialstoon.py",
line 6, in ?
     from FreeImage import *
   File "RuntimePythonposerScriptsArtMaterialsFreeImage.py", line
5, in ?
     import _FreeImage
ImportError: DLL load failed: Diese Anwendung konnte nicht gestartet
werden, weil die Anwenungskonfiguration nicht korrekt ist. Zur
Problembehebung sollten Sie die Anwendung neu installieren.

My main code is starting with:

import poser
import os, sys, string, re, fnmatch, time

os.chdir( os.path.dirname(poser.AppLocation()) )
sys.path.append(os.path.join("Runtime","Python","poserScripts","ArtMaterials"))
from FreeImage import *

Thanks for your help !


adp001 ( ) posted Tue, 05 June 2007 at 4:18 PM

The error says that FreeImage should be reinstalled (Application configuration isn't correct - what ever that means).




semidieu ( ) posted Tue, 05 June 2007 at 4:23 PM

That's what I was thinking... But there is no installation. The files must simply be in the correct folder (and they are !).


adp001 ( ) posted Tue, 05 June 2007 at 4:46 PM

Sounds that FreeImages DLL(s) aren't in the right place. May happen if a seperate Python installation is on the machine. FreeImage's setup will look into the Registry and may find something like "c:Python25" where it installs itself.

On my site here you can find a possibility to make a Registry-Entry for Poser Python. After this Python Libraries will be installed in the right place automatically.




nruddock ( ) posted Tue, 05 June 2007 at 5:29 PM

Two things that it would be useful to know :-

  1. Which directory "_FreeImage.pyd" is in.
  2. The directories in sys.path

As an aside, serveral people have reported trouble with the CS3Exporter script, which fails with the same error, and I haven't seen that explained (or resolved) yet.


semidieu ( ) posted Wed, 06 June 2007 at 1:19 AM

_FreeImage.pyd is in the same folder than the FreeImage.py and _FreeImage.so

I added the path where those files are in the sys.path.

I will ask the tester if she have another Python installation.


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.