diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-06-03 17:30:09 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-06-03 17:30:09 +0200 |
commit | a0a16aec3ae3a1df90ef8b5d1f041eca5e476f08 (patch) | |
tree | 0054c7d23d0976384c7799616cdef9872e39322e | |
parent | c7d45ec085086ab86192a7890b9622320d57b89d (diff) |
Remove leftover from the demos
Was missed in c7d45ec085086ab86192a7890b9622320d57b89d.
-rw-r--r-- | demos/plugins/custom_import_plugin/import_plugin.gd | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/demos/plugins/custom_import_plugin/import_plugin.gd b/demos/plugins/custom_import_plugin/import_plugin.gd deleted file mode 100644 index 99f0289e51..0000000000 --- a/demos/plugins/custom_import_plugin/import_plugin.gd +++ /dev/null @@ -1,84 +0,0 @@ -tool - -extends EditorImportPlugin - - -# Simple plugin that imports a text file with extension .mtxt -# which contains 3 integers in format R,G,B (0-255) -# (see example .mtxt in this folder) -# Imported file is converted to a material - -var dialog = null - -func get_name(): - return "silly_material" - -func get_visible_name(): - return "Silly Material" - -func import_dialog(path): - var md = null - if (path!=""): - md = ResourceLoader.load_import_metadata(path) - dialog.configure(self,path,md) - dialog.popup_centered() - -func import(path,metadata): - - assert(metadata.get_source_count() == 1) - - var source = metadata.get_source_path(0) - var use_red_anyway = metadata.get_option("use_red_anyway") - - var f = File.new() - var err = f.open(source,File.READ) - if (err!=OK): - return ERR_CANT_OPEN - - var l = f.get_line() - - f.close() - - var channels = l.split(",") - if (channels.size()!=3): - return ERR_PARSE_ERROR - - var color = Color8(int(channels[0]),int(channels[1]),int(channels[2])) - - var material - - if (ResourceLoader.has(path)): - # Material is in use, update it - material = ResourceLoader.load(path) - else: - # Material not in use, create - material = FixedMaterial.new() - - if (use_red_anyway): - color=Color8(255,0,0) - - material.set_parameter(FixedMaterial.PARAM_DIFFUSE,color) - - # Make sure import metadata links to this plugin - - metadata.set_editor("silly_material") - - # Update the md5 value of the source file - - metadata.set_source_md5(0, f.get_md5(source)) - - # Update the import metadata - - material.set_import_metadata(metadata) - - - # Save - err = ResourceSaver.save(path,material) - - return err - - -func config(base_control): - - dialog = preload("res://addons/custom_import_plugin/material_dialog.tscn").instance() - base_control.add_child(dialog) |