Skip to content

Commit

Permalink
Expose ResourceImportMetadata::set_source_md5 for script
Browse files Browse the repository at this point in the history
  • Loading branch information
Geequlim committed Jun 3, 2016
1 parent 25afca1 commit 3534533
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plugins/custom_import_plugin/import_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -78,4 +82,3 @@ func config(base_control):

dialog = preload("res://addons/custom_import_plugin/material_dialog.tscn").instance()
base_control.add_child(dialog)

0 comments on commit 3534533

Please sign in to comment.