Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2011-09-09 15:55:38 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2011-09-09 15:55:38 +0400
commit01744abd8187d1566b336bf38033673aa05b6786 (patch)
tree848742d2ce1be126a4b6381aecf03b6c2e9d93b4 /source/blender/python/intern/bpy_interface.c
parent2b33c6b0b27c0a4fee5a1a405e012eb4032bba05 (diff)
GPU: add gpu python module with export_shader() function to export GLSL shader.
shader = gpu.export_shader(scene,material) Returns the GLSL shader that blender generates to produce the visual effect of material in scene for the purpose of reusing the shader in an external engine. This function is meant to be used in a material exporter so that the GLSL shader can be exported entirely. The return value is a dictionary containing the shader source code and all associated data. The full documentation is under sphinx. Warning: there has been an API between the patch and this commit: uniform['lamp'] and uniform['image'] now return python reference to ID block instead of ID name as before. The X3D exporter that uses this function must be adapted.
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index e5e90380d61..e5bfc1d633f 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -40,6 +40,7 @@
#include "RNA_types.h"
#include "bpy.h"
+#include "gpu.h"
#include "bpy_rna.h"
#include "bpy_util.h"
#include "bpy_traceback.h"
@@ -181,6 +182,7 @@ static struct _inittab bpy_internal_modules[]= {
#ifdef WITH_AUDASPACE
{(char *)"aud", AUD_initPython},
#endif
+ {(char *)"gpu", GPU_initPython},
{NULL, NULL}
};