From 7a0e4c822caa0d91506f693cb0cea2188927939f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 7 Jan 2015 01:45:46 -0300 Subject: -Visual Shader Editing Finished, PLEASE TEST! --- scene/resources/shader_graph.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scene/resources/shader_graph.h') diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index c73895db8a..984164b449 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -115,7 +115,7 @@ public: private: - String _find_unique_name(ShaderType p_which, const String& p_base); + String _find_unique_name(const String& p_base); struct SourceSlot { @@ -151,6 +151,7 @@ private: ShaderType shader_type; const char *name; const char *variable; + const char *postfix; SlotType slot_type; SlotDir dir; }; @@ -175,6 +176,9 @@ private: Array _get_node_list(ShaderType p_type) const; Array _get_connections(ShaderType p_type) const; + + void _set_data(const Dictionary& p_data); + Dictionary _get_data() const; protected: static void _bind_methods(); -- cgit v1.2.3 From 78f4b937034c8bc24c2a871b1fc08ecbe39d0e5e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 8 Jan 2015 00:41:34 -0300 Subject: Fixes to GraphEdit: -Working area is bigger now, solves #1148 -Using Position now works, fixes #1141 -RGB ops now work, fixes #1139 -Missing bindings to GraphEdit and GraphNode added -Shader Graph Editor Shows errors on cyclic links and missing connections --- scene/resources/shader_graph.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scene/resources/shader_graph.h') diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index 984164b449..55d09b4c38 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -267,9 +267,8 @@ public: RGB_MAX_OP }; - void rgb_op_node_set_op(ShaderType p_which,float p_id,RGBOp p_op,float p_c); + void rgb_op_node_set_op(ShaderType p_which,float p_id,RGBOp p_op); RGBOp rgb_op_node_get_op(ShaderType p_which,float p_id) const; - float rgb_op_node_get_c(ShaderType p_which,float p_id) const; void xform_vec_mult_node_set_no_translation(ShaderType p_which,int p_id,bool p_no_translation); bool xform_vec_mult_node_get_no_translation(ShaderType p_which,int p_id) const; @@ -349,6 +348,8 @@ public: Variant node_get_state(ShaderType p_type, int p_node) const; void node_set_state(ShaderType p_type, int p_id, const Variant& p_state); + GraphError get_graph_error(ShaderType p_type) const; + static int get_type_input_count(NodeType p_type); static int get_type_output_count(NodeType p_type); static SlotType get_type_input_type(NodeType p_type,int p_idx); @@ -388,6 +389,7 @@ VARIANT_ENUM_CAST( ShaderGraph::VecScalarOp ); VARIANT_ENUM_CAST( ShaderGraph::RGBOp ); VARIANT_ENUM_CAST( ShaderGraph::ScalarFunc ); VARIANT_ENUM_CAST( ShaderGraph::VecFunc ); +VARIANT_ENUM_CAST( ShaderGraph::GraphError ); class MaterialShaderGraph : public ShaderGraph { -- cgit v1.2.3