BGE Python API
- initialize pythons sys.argv in the blenderplayer - ignore all arguments after a single " - " in the blenderplayer (like in blender), so args can be passed to the game. - add a utility function PyOrientationTo() - to take a Py euler, quat or 3x3 matrix and convert into a C++ MT_Matrix3x3. - add utility function ConvertPythonToMesh to get a RAS_MeshObject from a KX_MeshProxy or a name. - Added error prefix arguments to ConvertPythonToGameObject, ConvertPythonToMesh and PyOrientationTo so the error messages can include what function they came from. - deprecated brick.getOwner() for the "owner" attribute.
This commit is contained in:
@@ -1357,14 +1357,17 @@ void setSandbox(TPythonSecurityLevel level)
|
||||
/**
|
||||
* Python is not initialised.
|
||||
*/
|
||||
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie)
|
||||
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv)
|
||||
{
|
||||
STR_String pname = progname;
|
||||
Py_SetProgramName(pname.Ptr());
|
||||
Py_NoSiteFlag=1;
|
||||
Py_FrozenFlag=1;
|
||||
Py_Initialize();
|
||||
|
||||
|
||||
if(argv) /* browser plugins dont currently set this */
|
||||
PySys_SetArgv(argc, argv);
|
||||
|
||||
//importBlenderModules()
|
||||
|
||||
setSandbox(level);
|
||||
|
||||
Reference in New Issue
Block a user