Code cleanup

This commit is contained in:
Chris Bradfield
2018-03-13 21:52:41 -07:00
parent 1c2ec4c2e8
commit 9d66e8f2ef
31 changed files with 319 additions and 361 deletions

View File

@@ -41,7 +41,7 @@ func get_option_visibility(option, options):
func import(source_file, save_path, options, r_platform_variants, r_gen_files):
var file = File.new()
var err = file.open(source_file, File.READ)
if (err != OK):
if err != OK:
return err
var line = file.get_line()

View File

@@ -20,7 +20,6 @@ func load_pressed():
func save_file_selected(path):
# Get the values from the sliders and color picker
var color = get_node("ColorPicker_albedo").color
var metallic = get_node("HSlider_metallic").value
@@ -45,14 +44,11 @@ func save_file_selected(path):
return true
func load_file_selected(path):
# Using the passed in editor interface, get the selected nodes in the editor
var editor_selection = editor_interface.get_selection()
var selected_nodes = editor_selection.get_selected_nodes()
var file = File.new()
var SpatialMaterial_Silly = null
@@ -91,7 +87,5 @@ func load_file_selected(path):
else:
return false
# If we somehow get here, then return false (failure)
return false

View File

@@ -7,7 +7,6 @@ extends Node
#
# See material_import.gd for more information
var albedo_color
var metallic_strength
var roughness_strength
@@ -58,4 +57,3 @@ func make_material():
mat.roughness = roughness_strength
return mat

View File

@@ -18,7 +18,7 @@ func _enter_tree():
io_material_dialog = preload("res://addons/custom_import_plugin/Custom_material_dock.tscn").instance()
io_material_dialog.editor_interface = get_editor_interface();
add_control_to_dock( DOCK_SLOT_LEFT_UL, io_material_dialog )
add_control_to_dock(DOCK_SLOT_LEFT_UL, io_material_dialog)
func _exit_tree():
remove_control_from_docks(io_material_dialog)
remove_control_from_docks(io_material_dialog)