Tue, Dec 3, 4:20 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: 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: PoserPython prevented from using os.system on OS X?


deastham ( ) posted Tue, 20 January 2015 at 11:49 AM · edited Tue, 19 November 2024 at 6:29 AM

I have a script which works on the PC side, but on OS X it seems that commands run with os.system(MyCommand) have no effect. Is there a workaround or solution for this (aside from only using my script on the PC)? Currently I have the script add the command to a string, separated by a '; '.. at the end, I just print thie command string, and copy and paste it into a terminal, where it works. Please advise.

Thanks in advance.


Pret-a-3D ( ) posted Tue, 20 January 2015 at 11:59 AM

Hi.

I just tried it with os.system("/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal") and it launched Terminal as expected. 

What is the exact command that you tried?

Paolo

https://www.preta3d.com
FB: https://www.facebook.com/RealityPlugIn
Tw: @preta3d
G+: https://plus.google.com/106625816153304163119
The Reality Gallery: https://reality-plug-in.deviantart.com


deastham ( ) posted Tue, 20 January 2015 at 1:04 PM

I am attempting to run tdlmake to convert a texture to TDL format. ("tdlmake inputtexturepath outputtexturepath" (where they were given values such that copying and pasting the whole string worked as a command in Terminal).

When I am in the PoserPython shell in Poser Pro 2012, I can run os.system("echo hello world") and it returns the exit code of 0 to the shell output, but if I attempt to run a command that requires an environment variable, it returns a non-zero error code. Even just os.system("echo $DELIGHT") (which returns the path in a real Terminal session) gives the same error code 32512. For what I am doing now, I can just store a variable in the script with that information, and now that I realize halfway through this reply what's going on, I can hopefully find the solution in a more general Python resource.

Thanks Paolo. :)


deastham ( ) posted Tue, 20 January 2015 at 1:20 PM

TDLmake works now if I specify the path to tdlmake as part of the string passed to os.system. However, multiple command strings such as "cd "/Users/deastham/Desktop/RIBoutput"; /Applications/3Delight/bin/renderdl -D /Users/deastham/Desktop/RIBoutput/dgfg_0.rib" still don't work. (I am making sure to use the escape codes for slashes correctly. They are also used in the tdlmake calls.


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.