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. --- release/scripts/startup/bl_ui/space_text.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'release/scripts/startup/bl_ui/space_text.py') diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index eca9bc22db9..8a853a09199 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -56,12 +56,17 @@ class TEXT_HT_header(Header): row.prop(st, "show_syntax_highlight", text="") if text: - row = layout.row() - row.operator("text.run_script") + osl = text.name.endswith(".osl") or text.name.endswith(".oso") - row = layout.row() - row.active = text.name.endswith(".py") - row.prop(text, "use_module") + if osl: + row = layout.row() + row.operator("node.shader_script_update") + else: + row = layout.row() + row.operator("text.run_script") + + row = layout.row() + row.prop(text, "use_module") row = layout.row() if text.filepath: -- cgit v1.2.3