diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-06-03 13:12:45 +0200 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-06-03 13:12:45 +0200 |
commit | f9af57f3bdb16e015ee10b979fe18cf2195077f9 (patch) | |
tree | 1475baeb29393bf94b06581a8d0855ed71c0917a /demos | |
parent | b8d31c5eb5ff91c5c4f0af3c74d92aabbbebac9f (diff) | |
parent | 2bbedd35ddfa0eb4872003383c5ea91b887427ac (diff) |
Merge pull request #4950 from Geequlim/fix-editor-import-plugin
Expose ResourceImportMetadata::set_source_md5 for script
Diffstat (limited to 'demos')
-rw-r--r-- | demos/plugins/custom_import_plugin/import_plugin.gd | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/demos/plugins/custom_import_plugin/import_plugin.gd b/demos/plugins/custom_import_plugin/import_plugin.gd index 2cf8a0302f..99f0289e51 100644 --- a/demos/plugins/custom_import_plugin/import_plugin.gd +++ b/demos/plugins/custom_import_plugin/import_plugin.gd @@ -56,17 +56,21 @@ func import(path,metadata): if (use_red_anyway): color=Color8(255,0,0) - - material.set_parameter(FixedMaterial.PARAM_DIFFUSE,color) + + 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) @@ -78,4 +82,3 @@ func config(base_control): dialog = preload("res://addons/custom_import_plugin/material_dialog.tscn").instance() base_control.add_child(dialog) - |