Blender V2.61 - r43446
Classes | Defines | Functions | Variables

bpy_interface.c File Reference

#include <Python.h>
#include "MEM_guardedalloc.h"
#include "RNA_types.h"
#include "bpy.h"
#include "gpu.h"
#include "bpy_rna.h"
#include "bpy_util.h"
#include "bpy_traceback.h"
#include "bpy_intern_string.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "BLI_path_util.h"
#include "BLI_math_base.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_text.h"
#include "BKE_main.h"
#include "BKE_global.h"
#include "CCL_api.h"
#include "BPY_extern.h"
#include "../generic/bpy_internal_import.h"
#include "../generic/py_capi_utils.h"
#include "../generic/bgl.h"
#include "../generic/blf_py_api.h"
#include "../mathutils/mathutils.h"

Go to the source code of this file.

Classes

struct  PyModuleObject

Defines

#define PYMODULE_CLEAR_WORKAROUND

Functions

void bpy_context_update (bContext *C)
void bpy_context_set (bContext *C, PyGILState_STATE *gilstate)
void bpy_context_clear (bContext *UNUSED(C), PyGILState_STATE *gilstate)
void BPY_text_free_code (Text *text)
void BPY_modules_update (bContext *C)
void BPY_context_set (bContext *C)
PyObject * AUD_initPython (void)
void BPY_python_start (int argc, const char **argv)
void BPY_python_end (void)
static void python_script_error_jump_text (struct Text *text)
static int python_script_exec (bContext *C, const char *fn, struct Text *text, struct ReportList *reports, const short do_jump)
int BPY_filepath_exec (bContext *C, const char *filepath, struct ReportList *reports)
int BPY_text_exec (bContext *C, struct Text *text, struct ReportList *reports, const short do_jump)
void BPY_DECREF (void *pyob_ptr)
int BPY_button_exec (bContext *C, const char *expr, double *value, const short verbose)
int BPY_string_exec (bContext *C, const char *expr)
void BPY_modules_load_user (bContext *C)
int BPY_context_member_get (bContext *C, const char *member, bContextDataResult *result)

Variables

static int py_call_level = 0
BPy_StructRNAbpy_context_module = NULL
static struct _inittab bpy_internal_modules []

Detailed Description

This file deals with embedding the python interpreter within blender, starting and stopping python and exposing blender/python modules so they can be accesses from scripts.

Definition in file bpy_interface.c.


Define Documentation

#define PYMODULE_CLEAR_WORKAROUND

Definition at line 329 of file bpy_interface.c.


Function Documentation

PyObject* AUD_initPython ( void  )
int BPY_button_exec ( bContext C,
const char *  expr,
double *  value,
const short  verbose 
)
void bpy_context_clear ( bContext UNUSEDC,
PyGILState_STATE *  gilstate 
)
int BPY_context_member_get ( bContext C,
const char *  member,
bContextDataResult result 
)
void BPY_context_set ( bContext C)

Definition at line 173 of file bpy_interface.c.

References BPy_SetContext().

Referenced by WM_init().

void bpy_context_set ( bContext C,
PyGILState_STATE *  gilstate 
)
void bpy_context_update ( bContext C)
void BPY_DECREF ( void *  pyob_ptr)

Definition at line 463 of file bpy_interface.c.

Referenced by fcurve_free_driver(), RE_engine_free(), and WM_operator_free().

int BPY_filepath_exec ( bContext C,
const char *  filepath,
struct ReportList reports 
)

Definition at line 452 of file bpy_interface.c.

References FALSE, NULL, and python_script_exec().

Referenced by run_pyfile_exec(), and run_python().

void BPY_modules_load_user ( bContext C)
void BPY_modules_update ( bContext C)
void BPY_python_end ( void  )
void BPY_python_start ( int  argc,
const char **  argv 
)
int BPY_string_exec ( bContext C,
const char *  expr 
)
int BPY_text_exec ( bContext C,
struct Text text,
struct ReportList reports,
const short  do_jump 
)

Definition at line 458 of file bpy_interface.c.

References NULL, and python_script_exec().

Referenced by text_run_script().

void BPY_text_free_code ( Text text)

Definition at line 152 of file bpy_interface.c.

References Text::compiled, and NULL.

Referenced by free_text(), python_script_exec(), text_reload_exec(), and txt_make_dirty().

static void python_script_error_jump_text ( struct Text text) [static]

Definition at line 316 of file bpy_interface.c.

References FALSE, Text::id, ID::name, python_script_error_jump(), TRUE, and txt_move_to().

Referenced by python_script_exec().

static int python_script_exec ( bContext C,
const char *  fn,
struct Text text,
struct ReportList reports,
const short  do_jump 
) [static]

Variable Documentation

Definition at line 81 of file bpy_interface.c.

Referenced by BPy_init_modules().

struct _inittab bpy_internal_modules[] [static]
Initial value:
 {
    {(char *)"mathutils", PyInit_mathutils},


    {(char *)"bgl", BPyInit_bgl},
    {(char *)"blf", BPyInit_blf},






    {(char *)"gpu", GPU_initPython},
    {NULL, NULL}
}

Definition at line 189 of file bpy_interface.c.

int py_call_level = 0 [static]

Definition at line 80 of file bpy_interface.c.

Referenced by bpy_context_clear(), bpy_context_set(), and BPY_modules_load_user().