Sat, Jan 25, 4:38 AM 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 Dec 02 3:16 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: Python import problem


gbn ( ) posted Sat, 25 August 2007 at 5:31 PM · edited Sat, 10 August 2024 at 12:42 AM

Hi,

I've written a set of render-scripts which all import the module rndrJob.py. This module and all the importing scripts are in the same directory named 'C:Program Filese frontierPoser 7RuntimePythonposerScriptsScriptsMenuUtility' .
When I start one of the importing scripts inside of Poser7 I got the error message
'RuntimePythonPoserScriptsScriptsMenuUtility newRJB.py", line 7, in ?
from rndrJob import RenderJob
ImportError: No module named rndrJob'.
But when I start one of the importing scripts outside of Poser7, there is no error except that poser module isn't found (not a problem here).
How can I solve the first problem inside Poser7?

TIA


svdl ( ) posted Sat, 25 August 2007 at 5:47 PM

You might have to add the path to mdrJob to the system path in your Python script. An example of how to do that can be found in Poseworks' PzrXml scripts.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


PhilC ( ) posted Sat, 25 August 2007 at 7:19 PM

I use:-

import os
import sys
import poser
pathname = os.path.split(poser.AppLocation())[0]
scriptPath = os.path.join(pathname, 'Runtime', 'Python', 'poserScripts', 'ScriptsMenu', 'Utility')
sys.path.append(scriptPath)
import newRJB


gbn ( ) posted Sun, 26 August 2007 at 1:56 PM

THX PhilC,

your solution worked at first go.

/Gunnar


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.