From 49e3ca0a2d289fc67be229670795c4ca93924243 Mon Sep 17 00:00:00 2001 From: RodZill4 Date: Thu, 13 Feb 2020 08:37:01 +0100 Subject: [PATCH] Fixed a few warnings and disabled some others --- addons/material_maker/engine/gen_base.gd | 4 ++-- addons/material_maker/engine/gen_graph.gd | 3 +-- addons/material_maker/engine/gen_remote.gd | 4 ---- addons/material_maker/engine/gen_shader.gd | 5 ----- project.godot | 3 +-- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/addons/material_maker/engine/gen_base.gd b/addons/material_maker/engine/gen_base.gd index 562d44f..e787b08 100644 --- a/addons/material_maker/engine/gen_base.gd +++ b/addons/material_maker/engine/gen_base.gd @@ -139,7 +139,7 @@ func get_targets(output_index : int) -> Array: return [] # get the list of outputs that depend on the input whose index is passed as parameter -func follow_input(input_index : int) -> Array: +func follow_input(_input_index : int) -> Array: var rv = [] for i in range(get_output_defs().size()): rv.push_back(OutputPort.new(self, i)) @@ -238,7 +238,7 @@ func serialize() -> Dictionary: rv = _serialize(rv) return rv -func _deserialize(data : Dictionary) -> void: +func _deserialize(_data : Dictionary) -> void: pass func deserialize(data : Dictionary) -> void: diff --git a/addons/material_maker/engine/gen_graph.gd b/addons/material_maker/engine/gen_graph.gd index 0fd6576..8136463 100644 --- a/addons/material_maker/engine/gen_graph.gd +++ b/addons/material_maker/engine/gen_graph.gd @@ -331,5 +331,4 @@ func _deserialize(data : Dictionary) -> void: if data.has("label"): label = data.label var nodes = data.nodes if data.has("nodes") else [] - var connections = data.connections if data.has("connections") else [] - mm_loader.add_to_gen_graph(self, nodes, connections) + mm_loader.add_to_gen_graph(self, nodes, data.connections if data.has("connections") else []) diff --git a/addons/material_maker/engine/gen_remote.gd b/addons/material_maker/engine/gen_remote.gd index ea1da41..5ca6782 100644 --- a/addons/material_maker/engine/gen_remote.gd +++ b/addons/material_maker/engine/gen_remote.gd @@ -37,7 +37,6 @@ func get_next_widget_name() -> String: func fix() -> void: # Make sure all widgets have a name - var i = 0 for w in widgets: if !w.has("name"): w.name = get_next_widget_name() @@ -76,7 +75,6 @@ func get_type_name() -> String: func get_parameter_defs() -> Array: var rv = [] - var i = 0 for w in widgets: match w.type: "config_control": @@ -90,7 +88,6 @@ func get_parameter_defs() -> Array: for c in configurations: p.values.push_back({ name=c, value=c }) rv.append(p) - i += 1 "linked_control": var linked = w.linked_widgets[0] var p : Dictionary @@ -105,7 +102,6 @@ func get_parameter_defs() -> Array: p.name = w.name p.label = w.label rv.append(p) - i += 1 _: print("Unsupported widget of type "+str(w.type)) return rv diff --git a/addons/material_maker/engine/gen_shader.gd b/addons/material_maker/engine/gen_shader.gd index a80d467..3410f79 100644 --- a/addons/material_maker/engine/gen_shader.gd +++ b/addons/material_maker/engine/gen_shader.gd @@ -78,7 +78,6 @@ func find_keyword_call(string, keyword): return null var parenthesis_level = 0 var parameter_begin = position+search_string.length() - var parameter_end = -1 for i in range(parameter_begin, string.length()): if string[i] == '(': parenthesis_level += 1 @@ -236,10 +235,6 @@ func subst(string : String, context : MMGenContext, uv : String = "") -> Diction cont = changed and new_pass_required return { string=string, globals=required_globals, defs=required_defs, code=required_code, textures=required_textures } -func create_input_function(function_name : String, input_index : int, context : MMGenContext) -> Dictionary: - var rv = { globals=[], defs="", code="", textures={} } - return rv - func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -> Dictionary: var genname = "o"+str(get_instance_id()) var rv = { globals=[], defs="", code="", textures={} } diff --git a/project.godot b/project.godot index b6ff273..2bd16b2 100644 --- a/project.godot +++ b/project.godot @@ -189,8 +189,7 @@ mm_renderer="*res://addons/material_maker/engine/renderer.tscn" [debug] -gdscript/warnings/unsafe_property_access=true -gdscript/warnings/unsafe_method_access=true +gdscript/warnings/exclude_addons=false gdscript/warnings/unsafe_cast=true gdscript/warnings/unsafe_call_argument=true