From e02b23b81ab05579c0ee11ee3a1acb283643e528 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 3 Nov 2012 14:32:26 +0000 Subject: Render API: shader script node for custom shaders. * Shader script node added, which stores either a link to a text datablock or file on disk, and has functions to add and remove sockets. * Callback RenderEngine.update_script_node(self, node) added for render engines to compile the shader and update the node with new sockets. Thanks to Thomas, Lukas and Dalai for the implementation. --- source/blender/makesdna/DNA_node_types.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/blender/makesdna/DNA_node_types.h') diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index aa382632b7b..bebe2ba20d5 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -703,6 +703,26 @@ typedef struct NodeTrackPosData { char track_name[64]; } NodeTrackPosData; +typedef struct NodeShaderScript { + int mode; + int flag; + + char filepath[1024]; /* 1024 = FILE_MAX */ + + char bytecode_hash[64]; + char *bytecode; + + IDProperty *prop; +} NodeShaderScript; + +/* script node mode */ +#define NODE_SCRIPT_INTERNAL 0 +#define NODE_SCRIPT_EXTERNAL 1 + +/* script node flag */ +#define NODE_SCRIPT_AUTO_UPDATE 1 + + /* frame node flags */ #define NODE_FRAME_SHRINK 1 /* keep the bounding box minimal */ #define NODE_FRAME_RESIZEABLE 2 /* test flag, if frame can be resized by user */ -- cgit v1.2.3