You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Expose ResourceImportMetadata::set_source_md5 for script
This commit is contained in:
@@ -133,6 +133,7 @@ void ResourceImportMetadata::_bind_methods() {
|
|||||||
ObjectTypeDB::bind_method(_MD("add_source","path","md5"),&ResourceImportMetadata::add_source, "");
|
ObjectTypeDB::bind_method(_MD("add_source","path","md5"),&ResourceImportMetadata::add_source, "");
|
||||||
ObjectTypeDB::bind_method(_MD("get_source_path","idx"),&ResourceImportMetadata::get_source_path);
|
ObjectTypeDB::bind_method(_MD("get_source_path","idx"),&ResourceImportMetadata::get_source_path);
|
||||||
ObjectTypeDB::bind_method(_MD("get_source_md5","idx"),&ResourceImportMetadata::get_source_md5);
|
ObjectTypeDB::bind_method(_MD("get_source_md5","idx"),&ResourceImportMetadata::get_source_md5);
|
||||||
|
ObjectTypeDB::bind_method(_MD("set_source_md5","idx", "md5"),&ResourceImportMetadata::set_source_md5);
|
||||||
ObjectTypeDB::bind_method(_MD("remove_source","idx"),&ResourceImportMetadata::remove_source);
|
ObjectTypeDB::bind_method(_MD("remove_source","idx"),&ResourceImportMetadata::remove_source);
|
||||||
ObjectTypeDB::bind_method(_MD("get_source_count"),&ResourceImportMetadata::get_source_count);
|
ObjectTypeDB::bind_method(_MD("get_source_count"),&ResourceImportMetadata::get_source_count);
|
||||||
ObjectTypeDB::bind_method(_MD("set_option","key","value"),&ResourceImportMetadata::set_option);
|
ObjectTypeDB::bind_method(_MD("set_option","key","value"),&ResourceImportMetadata::set_option);
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ func import(path,metadata):
|
|||||||
|
|
||||||
metadata.set_editor("silly_material")
|
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
|
# Update the import metadata
|
||||||
|
|
||||||
material.set_import_metadata(metadata)
|
material.set_import_metadata(metadata)
|
||||||
@@ -78,4 +82,3 @@ func config(base_control):
|
|||||||
|
|
||||||
dialog = preload("res://addons/custom_import_plugin/material_dialog.tscn").instance()
|
dialog = preload("res://addons/custom_import_plugin/material_dialog.tscn").instance()
|
||||||
base_control.add_child(dialog)
|
base_control.add_child(dialog)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user