I’ve discovered a new method that works the same on Linux and Windows (not sure about Mac) using the os.system() function. Hopefully I’ll post v2 sometime soon, but basically, you just need to make the command and options into one string, and run it like this:
import os os.system("blenderplayer -f 800 600 60 32 -g show_framerate myGame.blend")
Leave off the “.exe” on blenderplayer and it will work on both Windows and Linux (and probably Mac, too… I’ll test next week).
If you want to run a compiled runtime, you should put the name of a non-existent .blend file name at the end.
IMPORTANT NOTE: There was an error with the original release that caused it not to run properly on computers without a full Python 2.4 install. If you downloaded the original, you need to copy the files "Python24.zip" and "zlib.dll" from your Blender directory to the Custom Display directory for it to work on all machines. The links below have been updated with the new files.
import os os.system("myGame -p 10 10 640 480 no.blend")
Be amazed. You have no other option.
Currently only Windows is supported. I know how to code multiplatform support, so I can make a “big three” version, but I don’t know how the command lines should be set up for each OS (that is, how to set up whatever replaces a .bat file on other systems). If anyone can offer information it would be greatly appreciated and I would promptly make available a multiplatform solution. I need to know exactly what you would type in to run the blenderplayer on a blend as well as what the flags are and how to properly apply them.
A zip file (3.0MB)
A rar file (2.4MB)
“OpenGL” is the same as “Use Blender Materials”. While I know that it outputs the right commands, I wasn’t able to test the OpenGL option, since my card doesn’t support it. Also, I don’t have any quad-buffered shutter glasses lying around to check the Hardware PageFlipping stereo mode.
The in-code documentation is sparse and incomplete. Sorry. To run it on your own blends, alter line 14 and 19 in “SaveToBat” as well as line 8 in “RunGame”. Hope you find this interesting. I know I do.
Edit: I forgot to tell you all how to run it outside of Blender. Double click “CustomDisplay.bat” to launch the menu.