Blender V2.61 - r43446
Defines | Functions | Variables

gpu.c File Reference

#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 []

Detailed Description

This file defines the 'gpu' module, used to get GLSL shader code and data from blender materials.

Definition in file gpu.c.


Define Documentation

#define PY_DICT_ADD_ID (   d,
  s,
 
)
Value:
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,
 
)
Value:
val = PyLong_FromLong(s->f);    \
    PyDict_SetItemString(d, #f, val);   \
    Py_DECREF(val)

Definition at line 122 of file gpu.c.

Referenced by GPU_export_shader().

#define PY_DICT_ADD_STRING (   d,
  s,
 
)
Value:
val = PyUnicode_FromString(s->f);   \
    PyDict_SetItemString(d, #f, val);   \
    Py_DECREF(val)

Definition at line 117 of file gpu.c.

Referenced by GPU_export_shader().

#define PY_MODULE_ADD_CONSTANT (   module,
  name 
)    PyModule_AddIntConstant(module, #name, name)

Definition at line 61 of file gpu.c.

Referenced by PyInit_gpu().

#define PY_OBJ_ADD_ID (   d,
  s,
 
)
Value:
val = PyUnicode_FromString(&s->f->id.name[2]);  \
    PyObject_SetAttrString(d, #f, val); \
    Py_DECREF(val)

Definition at line 133 of file gpu.c.

#define PY_OBJ_ADD_LONG (   d,
  s,
 
)
Value:
val = PyLong_FromLong(s->f);    \
    PyObject_SetAttrString(d, #f, val); \
    Py_DECREF(val)

Definition at line 138 of file gpu.c.

#define PY_OBJ_ADD_STRING (   d,
  s,
 
)
Value:
val = PyUnicode_FromString(s->f);   \
    PyObject_SetAttrString(d, #f, val); \
    Py_DECREF(val)

Definition at line 143 of file gpu.c.


Function Documentation

static PyObject* GPU_export_shader ( PyObject *  UNUSEDself,
PyObject *  args,
PyObject *  kwds 
) [static]
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  )

Variable Documentation

struct PyModuleDef gpumodule [static]
Initial value:
 {
    PyModuleDef_HEAD_INIT,
    "gpu",     
    M_gpu_doc, 
    -1,        
   NULL, NULL, NULL, NULL, NULL
}

Definition at line 66 of file gpu.c.

Referenced by PyInit_gpu().

PyMethodDef meth_export_shader[] [static]
Initial value:
 {
    {"export_shader", (PyCFunction)GPU_export_shader, METH_VARARGS | METH_KEYWORDS, GPU_export_shader_doc}
}

Definition at line 290 of file gpu.c.