~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/gameengine/Ketsji/KX_PythonInit.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: KX_PythonInit.cpp,v 1.6 2004/04/08 11:43:41 kester Exp $
 
2
 * $Id: KX_PythonInit.cpp,v 1.13 2005/03/25 10:33:37 kester Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
40
40
#endif //WIN32
41
41
 
42
42
#include "KX_PythonInit.h"
 
43
//python physics binding
 
44
#include "KX_PyConstraintBinding.h"
 
45
 
 
46
#include "KX_KetsjiEngine.h"
43
47
 
44
48
#include "SCA_IInputDevice.h"
45
49
#include "SCA_PropertySensor.h"
46
50
#include "SCA_RandomActuator.h"
47
51
#include "KX_ConstraintActuator.h"
48
52
#include "KX_IpoActuator.h"
 
53
#include "KX_SoundActuator.h"
 
54
#include "BL_ActionActuator.h"
49
55
#include "RAS_IRasterizer.h"
50
56
#include "RAS_ICanvas.h"
51
57
#include "MT_Vector3.h"
54
60
#include "KX_Scene.h"
55
61
#include "SND_DeviceManager.h"
56
62
 
 
63
#include "KX_PyMath.h"
 
64
 
 
65
#include "SumoPhysicsEnvironment.h"
57
66
// FIXME: Enable for access to blender python modules.  This is disabled because
58
67
// python has dependencies on a lot of other modules and is a pain to link.
59
68
//#define USE_BLENDER_PYTHON
84
93
static PyObject* ErrorObject;
85
94
STR_String gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1)";
86
95
 
87
 
static PyObject* gPyGetRandomFloat(PyObject* self,
88
 
                                                                                 PyObject* args, 
89
 
                                                                                 PyObject* kwds)
 
96
static PyObject* gPyGetRandomFloat(PyObject*,
 
97
                                        PyObject*, 
 
98
                                        PyObject*)
90
99
{
91
100
        return PyFloat_FromDouble(MT_random());
92
101
}
93
102
 
94
 
 
95
 
 
96
 
void GlobalConvertPythonPylist(PyObject* pylist, MT_Vector3 &pos)
97
 
{
98
 
        bool error=false;
99
 
        if (pylist->ob_type == &CListValue::Type)
100
 
        {
101
 
                CListValue* listval = (CListValue*) pylist;
102
 
                unsigned int numitems = listval->GetCount();
103
 
                if (numitems <= 3)
104
 
                {
105
 
                        for (unsigned int index=0;index<numitems;index++)
106
 
                        {
107
 
                                pos[index] = listval->GetValue(index)->GetNumber();
108
 
                        }
109
 
                }       else
110
 
                {
111
 
                        error = true;
112
 
                }
113
 
                
114
 
        } else
115
 
        {
116
 
                
117
 
                // assert the list is long enough...
118
 
                unsigned int numitems = PyList_Size(pylist);
119
 
                if (numitems <= 3)
120
 
                {
121
 
                        for (unsigned int index=0;index<numitems;index++)
122
 
                        {
123
 
                                pos[index] = PyFloat_AsDouble(PyList_GetItem(pylist,index));
124
 
                        }
125
 
                }
126
 
                else
127
 
                {
128
 
                        error = true;
129
 
                }
130
 
 
131
 
        }
132
 
}
133
 
 
134
 
void GlobalConvertPythonPylist(PyObject* pylist, MT_Vector4 &vec)
135
 
{
136
 
        bool error=false;
137
 
        if (pylist->ob_type == &CListValue::Type)
138
 
        {
139
 
                CListValue* listval = (CListValue*) pylist;
140
 
                unsigned int numitems = listval->GetCount();
141
 
                if (numitems <= 4)
142
 
                {
143
 
                        for (unsigned index=0;index<numitems;index++)
144
 
                        {
145
 
                                vec[index] = listval->GetValue(index)->GetNumber();
146
 
                        }
147
 
                } else
148
 
                {
149
 
                        error = true;
150
 
                }
151
 
                
152
 
        } else
153
 
        {
154
 
                // assert the list is long enough...
155
 
                unsigned int numitems = PyList_Size(pylist);
156
 
                if (numitems <= 4)
157
 
                {
158
 
                        for (unsigned index=0;index<numitems;index++)
159
 
                        {
160
 
                                vec[index] = PyFloat_AsDouble(PyList_GetItem(pylist,index));
161
 
                        }
162
 
                }
163
 
                else
164
 
                {
165
 
                        error = true;
166
 
                }
167
 
 
168
 
        }
169
 
}
170
 
 
171
 
 
172
 
void GlobalConvertPythonVectorArg(PyObject* args, MT_Vector3 &pos)
173
 
{
174
 
        PyObject* pylist;
175
 
        PyArg_ParseTuple(args,"O",&pylist);
176
 
 
177
 
        GlobalConvertPythonPylist(pylist, pos);
178
 
}
179
 
 
180
 
void GlobalConvertPythonVectorArg(PyObject* args, MT_Vector4 &vec)
181
 
{
182
 
        PyObject* pylist;
183
 
        PyArg_ParseTuple(args,"O",&pylist);
184
 
 
185
 
        GlobalConvertPythonPylist(pylist, vec);
186
 
}
187
 
 
188
 
 
189
 
static PyObject* gPySetGravity(PyObject* self,
 
103
static PyObject* gPySetGravity(PyObject*,
190
104
                                                                                 PyObject* args, 
191
 
                                                                                 PyObject* kwds)
 
105
                                                                                 PyObject*)
192
106
{
193
107
        MT_Vector3 vec = MT_Vector3(0., 0., 0.);
194
 
        GlobalConvertPythonVectorArg(args, vec);
195
 
 
196
 
        if (gp_KetsjiScene)
197
 
                gp_KetsjiScene->SetGravity(vec);
 
108
        if (PyVecArgTo(args, vec))
 
109
        {
 
110
                if (gp_KetsjiScene)
 
111
                        gp_KetsjiScene->SetGravity(vec);
 
112
                
 
113
                Py_Return;
 
114
        }
198
115
        
199
 
        Py_Return;
 
116
        return NULL;
200
117
}
201
118
 
202
119
 
203
120
static bool usedsp = false;
204
121
 
205
122
// this gets a pointer to an array filled with floats
206
 
static PyObject* gPyGetSpectrum(PyObject* self,
 
123
static PyObject* gPyGetSpectrum(PyObject*,
207
124
                                                                PyObject* args, 
208
 
                                                                PyObject* kwds)
 
125
                                                                PyObject*)
209
126
{
210
127
        SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
211
128
 
232
149
 
233
150
 
234
151
 
235
 
static void gPyStartDSP(PyObject* self,
 
152
static PyObject* gPyStartDSP(PyObject*,
236
153
                                                PyObject* args, 
237
 
                                                PyObject* kwds)
 
154
                                                PyObject*)
238
155
{
239
156
        SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
240
157
 
244
161
                {
245
162
                        audiodevice->StartUsingDSP();
246
163
                        usedsp = true;
 
164
                        Py_Return;
247
165
                }
248
166
        }
 
167
        return NULL;
249
168
}
250
169
 
251
170
 
252
171
 
253
 
static void gPyStopDSP(PyObject* self,
 
172
static PyObject* gPyStopDSP(PyObject*,
254
173
                                           PyObject* args, 
255
 
                                           PyObject* kwds)
 
174
                                           PyObject*)
256
175
{
257
176
        SND_IAudioDevice* audiodevice = SND_DeviceManager::Instance();
258
177
 
262
181
                {
263
182
                        audiodevice->StopUsingDSP();
264
183
                        usedsp = false;
 
184
                        Py_Return;
265
185
                }
266
186
        }
267
 
}
268
 
 
 
187
        return NULL;
 
188
}
 
189
 
 
190
static PyObject* gPySetLogicTicRate(PyObject*,
 
191
                                        PyObject* args,
 
192
                                        PyObject*)
 
193
{
 
194
        float ticrate;
 
195
        if (PyArg_ParseTuple(args, "f", &ticrate))
 
196
        {
 
197
                KX_KetsjiEngine::SetTicRate(ticrate);
 
198
                Py_Return;
 
199
        }
 
200
        
 
201
        return NULL;
 
202
}
 
203
 
 
204
static PyObject* gPyGetLogicTicRate(PyObject*, PyObject*, PyObject*)
 
205
{
 
206
        return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate());
 
207
}
 
208
 
 
209
static PyObject* gPySetPhysicsTicRate(PyObject*,
 
210
                                        PyObject* args,
 
211
                                        PyObject*)
 
212
{
 
213
        float ticrate;
 
214
        if (PyArg_ParseTuple(args, "f", &ticrate))
 
215
        {
 
216
 
 
217
                PHY_GetActiveEnvironment()->setFixedTimeStep(true,ticrate);
 
218
                Py_Return;
 
219
        }
 
220
        
 
221
        return NULL;
 
222
}
 
223
 
 
224
static PyObject* gPyGetPhysicsTicRate(PyObject*, PyObject*, PyObject*)
 
225
{
 
226
        return PyFloat_FromDouble(PHY_GetActiveEnvironment()->getFixedTimeStep());
 
227
}
 
228
 
 
229
static STR_String gPyGetCurrentScene_doc =  
 
230
"getCurrentScene()\n"
 
231
"Gets a reference to the current scene.\n";
 
232
static PyObject* gPyGetCurrentScene(PyObject* self,
 
233
                                           PyObject* args, 
 
234
                                           PyObject* kwds)
 
235
{
 
236
        Py_INCREF(gp_KetsjiScene);
 
237
        return (PyObject*) gp_KetsjiScene;
 
238
}
 
239
                                           
269
240
 
270
241
 
271
242
static struct PyMethodDef game_methods[] = {
272
243
        {"getCurrentController",
273
244
        (PyCFunction) SCA_PythonController::sPyGetCurrentController,
274
245
        METH_VARARGS, SCA_PythonController::sPyGetCurrentController__doc__},
 
246
        {"getCurrentScene", (PyCFunction) gPyGetCurrentScene,
 
247
        METH_VARARGS, gPyGetCurrentScene_doc.Ptr()},
275
248
        {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator,
276
249
        METH_VARARGS, SCA_PythonController::sPyAddActiveActuator__doc__},
277
250
        {"getRandomFloat",(PyCFunction) gPyGetRandomFloat,
279
252
        {"setGravity",(PyCFunction) gPySetGravity, METH_VARARGS,"set Gravitation"},
280
253
        {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_VARARGS,"get audio spectrum"},
281
254
        {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS,"stop using the audio dsp (for performance reasons)"},
 
255
        {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_VARARGS, "Gets the logic tic rate"},
 
256
        {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, "Sets the logic tic rate"},
 
257
        {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_VARARGS, "Gets the physics tic rate"},
 
258
        {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS, "Sets the physics tic rate"},
282
259
        {NULL, (PyCFunction) NULL, 0, NULL }
283
260
};
284
261
 
285
262
 
286
 
static PyObject* gPyGetWindowHeight(PyObject* self, 
 
263
static PyObject* gPyGetWindowHeight(PyObject*, 
287
264
                                                                                 PyObject* args, 
288
 
                                                                                 PyObject* kwds)
 
265
                                                                                 PyObject*)
289
266
{
290
267
        int height = (gp_Canvas ? gp_Canvas->GetHeight() : 0);
291
268
 
295
272
 
296
273
 
297
274
 
298
 
static PyObject* gPyGetWindowWidth(PyObject* self, 
 
275
static PyObject* gPyGetWindowWidth(PyObject*, 
299
276
                                                                                 PyObject* args, 
300
 
                                                                                 PyObject* kwds)
 
277
                                                                                 PyObject*)
301
278
{
302
279
                
303
280
 
312
289
// temporarility visibility thing, will be moved to rasterizer/renderer later
313
290
bool gUseVisibilityTemp = false;
314
291
 
315
 
static PyObject* gPyEnableVisibility(PyObject* self, 
 
292
static PyObject* gPyEnableVisibility(PyObject*, 
316
293
                                                                                 PyObject* args, 
317
 
                                                                                 PyObject* kwds)
 
294
                                                                                 PyObject*)
318
295
{
319
296
        int visible;
320
297
        if (PyArg_ParseTuple(args,"i",&visible))
330
307
 
331
308
 
332
309
 
333
 
static PyObject* gPyShowMouse(PyObject* self, 
 
310
static PyObject* gPyShowMouse(PyObject*, 
334
311
                                                                                 PyObject* args, 
335
 
                                                                                 PyObject* kwds)
 
312
                                                                                 PyObject*)
336
313
{
337
314
        int visible;
338
315
        if (PyArg_ParseTuple(args,"i",&visible))
353
330
 
354
331
 
355
332
 
356
 
static PyObject* gPySetMousePosition(PyObject* self, 
 
333
static PyObject* gPySetMousePosition(PyObject*, 
357
334
                                                                                 PyObject* args, 
358
 
                                                                                 PyObject* kwds)
 
335
                                                                                 PyObject*)
359
336
{
360
337
        int x,y;
361
338
        if (PyArg_ParseTuple(args,"ii",&x,&y))
367
344
   Py_Return;
368
345
}
369
346
 
370
 
 
371
 
 
372
 
static PyObject* gPySetBackgroundColor(PyObject* self, 
 
347
static PyObject* gPySetEyeSeparation(PyObject*,
 
348
                                                PyObject* args,
 
349
                                                PyObject*)
 
350
{
 
351
        float sep;
 
352
        if (PyArg_ParseTuple(args, "f", &sep))
 
353
        {
 
354
                if (gp_Rasterizer)
 
355
                        gp_Rasterizer->SetEyeSeparation(sep);
 
356
                        
 
357
                Py_Return;
 
358
        }
 
359
        
 
360
        return NULL;
 
361
}
 
362
 
 
363
static PyObject* gPyGetEyeSeparation(PyObject*, PyObject*, PyObject*)
 
364
{
 
365
        if (gp_Rasterizer)
 
366
                return PyFloat_FromDouble(gp_Rasterizer->GetEyeSeparation());
 
367
        
 
368
        return NULL;
 
369
}
 
370
 
 
371
static PyObject* gPySetFocalLength(PyObject*,
 
372
                                        PyObject* args,
 
373
                                        PyObject*)
 
374
{
 
375
        float focus;
 
376
        if (PyArg_ParseTuple(args, "f", &focus))
 
377
        {
 
378
                if (gp_Rasterizer)
 
379
                        gp_Rasterizer->SetFocalLength(focus);
 
380
                Py_Return;
 
381
        }
 
382
        
 
383
        return NULL;
 
384
}
 
385
 
 
386
static PyObject* gPyGetFocalLength(PyObject*, PyObject*, PyObject*)
 
387
{
 
388
        if (gp_Rasterizer)
 
389
                return PyFloat_FromDouble(gp_Rasterizer->GetFocalLength());
 
390
        return NULL;
 
391
}
 
392
 
 
393
static PyObject* gPySetBackgroundColor(PyObject*, 
373
394
                                                                                 PyObject* args, 
374
 
                                                                                 PyObject* kwds)
 
395
                                                                                 PyObject*)
375
396
{
376
397
        
377
398
        MT_Vector4 vec = MT_Vector4(0., 0., 0.3, 0.);
378
 
        GlobalConvertPythonVectorArg(args, vec);
379
 
 
380
 
        if (gp_Canvas)
 
399
        if (PyVecArgTo(args, vec))
381
400
        {
382
 
                gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
 
401
                if (gp_Canvas)
 
402
                {
 
403
                        gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
 
404
                }
 
405
                Py_Return;
383
406
        }
384
 
   Py_Return;
 
407
        
 
408
        return NULL;
385
409
}
386
410
 
387
411
 
388
412
 
389
 
static PyObject* gPySetMistColor(PyObject* self, 
 
413
static PyObject* gPySetMistColor(PyObject*, 
390
414
                                                                                 PyObject* args, 
391
 
                                                                                 PyObject* kwds)
 
415
                                                                                 PyObject*)
392
416
{
393
417
        
394
418
        MT_Vector3 vec = MT_Vector3(0., 0., 0.);
395
 
        GlobalConvertPythonVectorArg(args, vec);
396
 
 
397
 
        if (gp_Rasterizer)
 
419
        if (PyVecArgTo(args, vec))
398
420
        {
399
 
                gp_Rasterizer->SetFogColor(vec[0], vec[1], vec[2]);
 
421
                if (gp_Rasterizer)
 
422
                {
 
423
                        gp_Rasterizer->SetFogColor(vec[0], vec[1], vec[2]);
 
424
                }
 
425
                Py_Return;
400
426
        }
401
 
   Py_Return;
 
427
        
 
428
        return NULL;
402
429
}
403
430
 
404
431
 
405
432
 
406
 
static PyObject* gPySetMistStart(PyObject* self, 
 
433
static PyObject* gPySetMistStart(PyObject*, 
407
434
                                                                                 PyObject* args, 
408
 
                                                                                 PyObject* kwds)
 
435
                                                                                 PyObject*)
409
436
{
410
437
 
411
438
        float miststart;
421
448
 
422
449
 
423
450
 
424
 
static PyObject* gPySetMistEnd(PyObject* self, 
 
451
static PyObject* gPySetMistEnd(PyObject*, 
425
452
                                                                                 PyObject* args, 
426
 
                                                                                 PyObject* kwds)
 
453
                                                                                 PyObject*)
427
454
{
428
455
 
429
456
        float mistend;
439
466
 
440
467
 
441
468
 
442
 
static PyObject* gPyMakeScreenshot(PyObject* self,
 
469
static PyObject* gPyMakeScreenshot(PyObject*,
443
470
                                                                        PyObject* args,
444
 
                                                                        PyObject* kwds)
 
471
                                                                        PyObject*)
445
472
{
446
473
        char* filename;
447
474
        if (PyArg_ParseTuple(args,"s",&filename))
481
508
  {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"},
482
509
  {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"},
483
510
  
 
511
  {"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"},
 
512
  {"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_VARARGS, "get the eye separation for stereo mode"},
 
513
  {"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"},
 
514
  {"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"},
484
515
  { NULL, (PyCFunction) NULL, 0, NULL }
485
516
};
486
517
 
560
591
        KX_MACRO_addTypesToDict(d, KX_RANDOMACT_FLOAT_NORMAL,    SCA_RandomActuator::KX_RANDOMACT_FLOAT_NORMAL);
561
592
        KX_MACRO_addTypesToDict(d, KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL, SCA_RandomActuator::KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL);
562
593
 
 
594
        /* 6. Sound actuator                                                      */
 
595
        KX_MACRO_addTypesToDict(d, KX_SOUNDACT_PLAYSTOP,              KX_SoundActuator::KX_SOUNDACT_PLAYSTOP);
 
596
        KX_MACRO_addTypesToDict(d, KX_SOUNDACT_PLAYEND,               KX_SoundActuator::KX_SOUNDACT_PLAYEND);
 
597
        KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPSTOP,              KX_SoundActuator::KX_SOUNDACT_LOOPSTOP);
 
598
        KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPEND,               KX_SoundActuator::KX_SOUNDACT_LOOPEND);
 
599
        KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPBIDIRECTIONAL,     KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL);
 
600
        KX_MACRO_addTypesToDict(d, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP,     KX_SoundActuator::KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP);
 
601
 
 
602
        /* 7. Action actuator                                                                                                      */
 
603
        KX_MACRO_addTypesToDict(d, KX_ACTIONACT_PLAY,     BL_ActionActuator::KX_ACT_ACTION_PLAY);
 
604
        KX_MACRO_addTypesToDict(d, KX_ACTIONACT_FLIPPER,     BL_ActionActuator::KX_ACT_ACTION_FLIPPER);
 
605
        KX_MACRO_addTypesToDict(d, KX_ACTIONACT_LOOPSTOP,     BL_ActionActuator::KX_ACT_ACTION_LOOPSTOP);
 
606
        KX_MACRO_addTypesToDict(d, KX_ACTIONACT_LOOPEND,     BL_ActionActuator::KX_ACT_ACTION_LOOPEND);
 
607
        KX_MACRO_addTypesToDict(d, KX_ACTIONACT_PROPERTY,     BL_ActionActuator::KX_ACT_ACTION_PROPERTY);
 
608
        
563
609
        // Check for errors
564
610
        if (PyErr_Occurred())
565
611
    {
666
712
        }
667
713
}
668
714
 
669
 
 
670
 
 
 
715
/**
 
716
 * Python is not initialised.
 
717
 */
 
718
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level)
 
719
{
 
720
        STR_String pname = progname;
 
721
        Py_SetProgramName(pname.Ptr());
 
722
        Py_NoSiteFlag=1;
 
723
        Py_FrozenFlag=1;
 
724
        Py_Initialize();
 
725
 
 
726
        //importBlenderModules()
 
727
        
 
728
        setSandbox(level);
 
729
 
 
730
        PyObject* moduleobj = PyImport_AddModule("__main__");
 
731
        return PyModule_GetDict(moduleobj);
 
732
}
 
733
 
 
734
void exitGamePlayerPythonScripting()
 
735
{
 
736
        Py_Finalize();
 
737
}
 
738
 
 
739
/**
 
740
 * Python is already initialized.
 
741
 */
671
742
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level)
672
743
{
673
744
        STR_String pname = progname;
674
745
        Py_SetProgramName(pname.Ptr());
675
746
        Py_NoSiteFlag=1;
676
747
        Py_FrozenFlag=1;
677
 
#ifndef USE_BLENDER_PYTHON
678
 
        Py_Initialize();
679
 
#else
680
 
        BPY_start_python();
681
 
#endif
 
748
 
682
749
        setSandbox(level);
683
750
 
684
751
        PyObject* moduleobj = PyImport_AddModule("__main__");
689
756
 
690
757
void exitGamePythonScripting()
691
758
{
692
 
#ifndef USE_BLENDER_PYTHON
693
 
        Py_Finalize();
694
 
#else
695
 
        BPY_end_python();
696
 
#endif
697
759
}
698
760
 
699
761