Blender V2.61 - r43446
Defines | Functions | Variables

bpy.c File Reference

#include <Python.h>
#include "bpy.h"
#include "bpy_util.h"
#include "bpy_rna.h"
#include "bpy_app.h"
#include "bpy_props.h"
#include "bpy_operator.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_bpath.h"
#include "BLI_utildefines.h"
#include "BKE_main.h"
#include "BKE_global.h"
#include "BKE_blender.h"
#include "RNA_access.h"
#include "MEM_guardedalloc.h"
#include "../generic/idprop_py_api.h"
#include "../generic/bgl.h"
#include "../generic/blf_py_api.h"
#include "../mathutils/mathutils.h"

Go to the source code of this file.

Defines

#define WITH_PYTHON

Functions

 PyDoc_STRVAR (bpy_script_paths_doc,".. function:: script_paths()\n""\n"" Return 2 paths to blender scripts directories.\n""\n"" :return: (system, user) strings will be empty when not found.\n"" :rtype: tuple of strings\n")
static PyObject * bpy_script_paths (PyObject *UNUSED(self))
static int bpy_blend_paths_visit_cb (void *userdata, char *UNUSED(path_dst), const char *path_src)
 PyDoc_STRVAR (bpy_blend_paths_doc,".. function:: blend_paths(absolute=False, packed=False, local=False)\n""\n"" Returns a list of paths to external files referenced by the loaded .blend file.\n""\n"" :arg absolute: When true the paths returned are made absolute.\n"" :type absolute: boolean\n"" :arg packed: When true skip file paths for packed data.\n"" :type packed: boolean\n"" :arg local: When true skip linked library paths.\n"" :type local: boolean\n"" :return: path list.\n"" :rtype: list of strings\n")
static PyObject * bpy_blend_paths (PyObject *UNUSED(self), PyObject *args, PyObject *kw)
static PyObject * bpy_user_resource (PyObject *UNUSED(self), PyObject *args, PyObject *kw)
 PyDoc_STRVAR (bpy_resource_path_doc,".. function:: resource_path(type, major=2, minor=57)\n""\n"" Return the base path for storing system files.\n""\n"" :arg type: string in ['USER', 'LOCAL', 'SYSTEM'].\n"" :type type: string\n"" :arg major: major version, defaults to current.\n"" :type major: int\n"" :arg minor: minor version, defaults to current.\n"" :type minor: string\n"" :return: the resource path (not necessarily existing).\n"" :rtype: string\n")
static PyObject * bpy_resource_path (PyObject *UNUSED(self), PyObject *args, PyObject *kw)
static PyObject * bpy_import_test (const char *modname)
void BPy_init_modules (void)

Variables

PyObject * bpy_package_py = NULL
static PyMethodDef meth_bpy_script_paths
static PyMethodDef meth_bpy_blend_paths
static PyMethodDef meth_bpy_user_resource
static PyMethodDef meth_bpy_resource_path

Detailed Description

This file defines the '_bpy' module which is used by python's 'bpy' package to access C defined builtin functions. A script writer should never directly access this module.

Definition in file bpy.c.


Define Documentation

#define WITH_PYTHON

Definition at line 31 of file bpy.c.


Function Documentation

static PyObject* bpy_blend_paths ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kw 
) [static]
static int bpy_blend_paths_visit_cb ( void *  userdata,
char *  UNUSEDpath_dst,
const char *  path_src 
) [static]

Definition at line 84 of file bpy.c.

References FALSE.

Referenced by bpy_blend_paths().

static PyObject* bpy_import_test ( const char *  modname) [static]

Definition at line 216 of file bpy.c.

References mod(), and NULL.

Referenced by BPy_init_modules().

void BPy_init_modules ( void  )
static PyObject* bpy_resource_path ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kw 
) [static]
static PyObject* bpy_script_paths ( PyObject *  UNUSEDself) [static]

Definition at line 71 of file bpy.c.

References BLENDER_SYSTEM_SCRIPTS, BLENDER_USER_SCRIPTS, BLI_get_folder(), and NULL.

static PyObject* bpy_user_resource ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kw 
) [static]
PyDoc_STRVAR ( bpy_blend_paths_doc  ,
".. function:: blend_paths(absolute=False, packed=False, local=False)\n""\n"" Returns a list of paths to external files referenced by the loaded .blend file.\n""\n"" :arg absolute: When true the paths returned are made absolute.\n"" :type absolute: boolean\n"" :arg packed: When true skip file paths for packed data.\n"" :type packed: boolean\n"" :arg local: When true skip linked library paths.\n"" :type local: boolean\n"" :return: path list.\n"" :rtype: list of strings\n"   
)
PyDoc_STRVAR ( bpy_script_paths_doc  ,
".. function:: script_paths()\n""\n"" Return 2 paths to blender scripts directories.\n""\n"" :return: (system, user) strings will be empty when not found.\n"" :rtype: tuple of strings\n"   
)
PyDoc_STRVAR ( bpy_resource_path_doc  ,
".. function:: resource_path(type, major=2, minor=57)\n""\n"" Return the base path for storing system files.\n""\n"" :arg type: string in .\n"" :type type: string\n"" :arg major: major  version['USER', 'LOCAL', 'SYSTEM'],
defaults to current.\n"":type major:int\n"":arg minor:minor  version,
defaults to current.\n"":type minor:string\n"":return:the resource path(not necessarily existing).\n"":rtype:string\n"   
)

Variable Documentation

PyObject* bpy_package_py = NULL

Definition at line 61 of file bpy.c.

Referenced by BPy_init_modules().

PyMethodDef meth_bpy_blend_paths [static]
Initial value:
    {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}

Definition at line 208 of file bpy.c.

PyMethodDef meth_bpy_resource_path [static]
Initial value:
    {"resource_path", (PyCFunction)bpy_resource_path, METH_VARARGS|METH_KEYWORDS, bpy_resource_path_doc}

Definition at line 212 of file bpy.c.

PyMethodDef meth_bpy_script_paths [static]
Initial value:
    {"script_paths", (PyCFunction)bpy_script_paths, METH_NOARGS, bpy_script_paths_doc}

Definition at line 206 of file bpy.c.

PyMethodDef meth_bpy_user_resource [static]
Initial value:
    {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, NULL}

Definition at line 210 of file bpy.c.