Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2025 Feb 05 6:41 am)
Quote - On the Mac, relative paths begin with a colon, but as a special case, paths with no colons at all are also relative.
Anything else is absolute (the string up to the first colon is the volume name)
Above quote is from the docstring for join in macpath.py
Quote - If any component is an absolute path, all previous components are thrown away, and joining continues.
and this one from the docs for os.path.join
What this suggests you need to do is put all the subdirectories as individual arguments to the join call.
So instead of
ROOT = "poser:poser 6:runtime:libraries:props"
SUB = "hello:world"
thePath = os.path.join(ROOT, SUB)
use ROOT = "poser:poser 6:runtime:libraries:props" SUB1 = "hello" SUB2 = "world" thePath = os.path.join(ROOT, SUB1, SUB2)
so that all the SUBs are correctly treated as relative paths.
I don't have a Mac, but code inspection seems sufficient in this case.
Putting some print statements in macpath.py would be the best way to go if the above doesn't solve the problem.
semi, it could also be as simple as the problem with tkinter and Poser 6 in OS X that
prevents most or all python scripts from running in said app. ask your tester if he/she
has ever run any scripts successfully in Poser 6 OS X. if the answer is "yes", then
request some screenshots of said scripts in action as evidence that they really work.
Attached Link: http://www.renderosity.com/mod/forumpro/showthread.php?message_id=2178409&ebot_calc_page#message_2178409
one of the representatives for whomever owned Poser 6 during beta testing made a public statement, upon the release of the first version of poser 6 OS X , apologising for the tkinter deficiency. whilst they didn't provide a fix for this in poser 6, e-f remedied the python script problem with the first release of poser 7, OS X. *quel dommage* that your tester was unaware of this.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.
OK... here is a simple question and I cannot answer...
Say I have a path that has been read from a TEXT file.
ROOT = poser:poser 6:runtime:libraries:props
and another path like this:
SUB = hello:world
Then, when I use:
os.path.join(ROOT, SUB)
it returns only the SUB path (hello:world)
Is there something wrong ?
I know I can use:
ROOT + os.sep + SUB
but it would need a LOT of changing (as the script was made for Poser 7 and this problem does not appear on P7 Mac !)
Thanks :D