summaryrefslogtreecommitdiff
path: root/modules/gdscript/editor_templates/VisualShaderNodeCustom
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2022-01-04 11:30:47 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2022-01-06 12:06:33 +0300
commit21cfcaa1299976ddba2b2ebd6421bf06c9a05863 (patch)
treea546d7dae990e758cdb9b39c52456e0d84fd9ce0 /modules/gdscript/editor_templates/VisualShaderNodeCustom
parentb2382183635acb4117d6b88eaffa8fd841052f10 (diff)
Add a GDScript template for `VisualShaderNodeCustom`
Diffstat (limited to 'modules/gdscript/editor_templates/VisualShaderNodeCustom')
-rw-r--r--modules/gdscript/editor_templates/VisualShaderNodeCustom/basic.gd41
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/gdscript/editor_templates/VisualShaderNodeCustom/basic.gd b/modules/gdscript/editor_templates/VisualShaderNodeCustom/basic.gd
new file mode 100644
index 0000000000..27383b878d
--- /dev/null
+++ b/modules/gdscript/editor_templates/VisualShaderNodeCustom/basic.gd
@@ -0,0 +1,41 @@
+# meta-description: Visual shader's node plugin template
+
+@tool
+extends _BASE_
+class_name VisualShaderNode_CLASS_
+
+func _get_name() -> String:
+ return "_CLASS_"
+
+func _get_category() -> String:
+ return ""
+
+func _get_description() -> String:
+ return ""
+
+func _get_return_icon_type() -> int:
+ return PORT_TYPE_SCALAR
+
+func _get_input_port_count() -> int:
+ return 0
+
+func _get_input_port_name(port: int) -> String:
+ return ""
+
+func _get_input_port_type(port: int) -> int:
+ return PORT_TYPE_SCALAR
+
+func _get_output_port_count() -> int:
+ return 1
+
+func _get_output_port_name(port: int) -> String:
+ return "result"
+
+func _get_output_port_type(port: int) -> int:
+ return PORT_TYPE_SCALAR
+
+func _get_global_code(mode: Shader.Mode) -> String:
+ return ""
+
+func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
+ return output_vars[0] + " = 0.0;"