Blender V2.61 - r43446
|
#include <Python.h>
#include "GPU_material.h"
#include "DNA_scene_types.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_lamp_types.h"
#include "DNA_object_types.h"
#include "DNA_ID.h"
#include "DNA_customdata_types.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "RNA_access.h"
#include "bpy_rna.h"
#include "gpu.h"
Go to the source code of this file.
Defines | |
#define | PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, #name, name) |
#define | PY_DICT_ADD_STRING(d, s, f) |
#define | PY_DICT_ADD_LONG(d, s, f) |
#define | PY_DICT_ADD_ID(d, s, f) |
#define | PY_OBJ_ADD_ID(d, s, f) |
#define | PY_OBJ_ADD_LONG(d, s, f) |
#define | PY_OBJ_ADD_STRING(d, s, f) |
Functions | |
PyDoc_STRVAR (M_gpu_doc,"This module provides access to the GLSL shader.") | |
PyMODINIT_FUNC | PyInit_gpu (void) |
PyDoc_STRVAR (GPU_export_shader_doc,"export_shader(scene, material)\n""\n"" Returns the GLSL shader that produces the visual effect of material in scene.\n""\n"" :return: Dictionary defining the shader, uniforms and attributes.\n"" :rtype: Dict") | |
static PyObject * | GPU_export_shader (PyObject *UNUSED(self), PyObject *args, PyObject *kwds) |
PyObject * | GPU_initPython (void) |
Variables | |
static struct PyModuleDef | gpumodule |
static PyMethodDef | meth_export_shader [] |
This file defines the 'gpu' module, used to get GLSL shader code and data from blender materials.
Definition in file gpu.c.
#define PY_DICT_ADD_ID | ( | d, | |
s, | |||
f | |||
) |
RNA_id_pointer_create((struct ID*)s->f, &tptr); \ val = pyrna_struct_CreatePyObject(&tptr); \ PyDict_SetItemString(d, #f, val); \ Py_DECREF(val)
Definition at line 127 of file gpu.c.
Referenced by GPU_export_shader().
#define PY_DICT_ADD_LONG | ( | d, | |
s, | |||
f | |||
) |
#define PY_DICT_ADD_STRING | ( | d, | |
s, | |||
f | |||
) |
Definition at line 61 of file gpu.c.
Referenced by PyInit_gpu().
#define PY_OBJ_ADD_ID | ( | d, | |
s, | |||
f | |||
) |
#define PY_OBJ_ADD_LONG | ( | d, | |
s, | |||
f | |||
) |
#define PY_OBJ_ADD_STRING | ( | d, | |
s, | |||
f | |||
) |
static PyObject* GPU_export_shader | ( | PyObject * | UNUSEDself, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Definition at line 156 of file gpu.c.
References GPUShaderExport::attributes, BLI_countlist(), ListBase::first, GPUShaderExport::fragment, GPU_DYNAMIC_SAMPLER_2DBUFFER, GPU_DYNAMIC_SAMPLER_2DIMAGE, GPU_DYNAMIC_SAMPLER_2DSHADOW, GPU_free_shader_export(), GPU_shader_export(), i, GPUInputUniform::image, GPUInputUniform::lamp, GPUInputAttribute::name, GPUInputAttribute::next, GPUInputUniform::next, NULL, PY_DICT_ADD_ID, PY_DICT_ADD_LONG, PY_DICT_ADD_STRING, GPUInputUniform::texpixels, GPUInputUniform::texsize, GPUInputUniform::type, GPUShaderExport::uniforms, simple_enum_gen::val, and GPUShaderExport::vertex.
PyObject* GPU_initPython | ( | void | ) |
Initalizes the gpu Python module.
Definition at line 294 of file gpu.c.
References module, NULL, and PyInit_gpu().
PyDoc_STRVAR | ( | M_gpu_doc | , |
"This module provides access to the GLSL shader." | |||
) |
PyDoc_STRVAR | ( | GPU_export_shader_doc | , |
"export_shader(scene, material)\n""\n"" Returns the GLSL shader that produces the visual effect of material in scene.\n""\n"" :return: Dictionary defining the | shader, | ||
uniforms and attributes.\n"":rtype:Dict" | |||
) |
PyMODINIT_FUNC PyInit_gpu | ( | void | ) |
Definition at line 76 of file gpu.c.
References CD_MCOL, CD_MTFACE, CD_ORCO, CD_TANGENT, GPU_DATA_16F, GPU_DATA_1F, GPU_DATA_1I, GPU_DATA_2F, GPU_DATA_3F, GPU_DATA_4F, GPU_DATA_4UB, GPU_DATA_9F, GPU_DYNAMIC_LAMP_DYNCO, GPU_DYNAMIC_LAMP_DYNCOL, GPU_DYNAMIC_LAMP_DYNENERGY, GPU_DYNAMIC_LAMP_DYNIMAT, GPU_DYNAMIC_LAMP_DYNPERSMAT, GPU_DYNAMIC_LAMP_DYNVEC, GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE, GPU_DYNAMIC_OBJECT_COLOR, GPU_DYNAMIC_OBJECT_IMAT, GPU_DYNAMIC_OBJECT_MAT, GPU_DYNAMIC_OBJECT_VIEWIMAT, GPU_DYNAMIC_OBJECT_VIEWMAT, GPU_DYNAMIC_SAMPLER_2DBUFFER, GPU_DYNAMIC_SAMPLER_2DIMAGE, GPU_DYNAMIC_SAMPLER_2DSHADOW, gpumodule, NULL, and PY_MODULE_ADD_CONSTANT.
Referenced by GPU_initPython().
struct PyModuleDef gpumodule [static] |
PyMethodDef meth_export_shader[] [static] |
{ {"export_shader", (PyCFunction)GPU_export_shader, METH_VARARGS | METH_KEYWORDS, GPU_export_shader_doc} }