Fix a crash when clicking reimport with the current 3.x head commit.

This commit is contained in:
Relintai 2021-07-19 18:48:22 +02:00
parent 780ec90655
commit d42024d928
2 changed files with 14 additions and 2 deletions

View File

@ -57,10 +57,16 @@ String EditorImportColladaMdr::get_preset_name(int p_idx) const {
Error EditorImportColladaMdr::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
//MeshDataResource::ColliderType collider_type = static_cast<MeshDataResource::ColliderType>(static_cast<int>(p_options["collider_type"]));
Node *n = _importer->import_scene(p_source_file, 0, 15);
Error erri;
Node *n = _importer->import_scene(p_source_file, 0, 15, nullptr, &erri);
ERR_FAIL_COND_V(!n, Error::ERR_PARSE_ERROR);
if (erri != Error::OK) {
return erri;
}
Error err = process_node(n, p_source_file, p_save_path, p_options, r_platform_variants, r_gen_files, r_metadata);
n->queue_delete();

View File

@ -58,10 +58,16 @@ String EditorImportGLTFMdr::get_preset_name(int p_idx) const {
Error EditorImportGLTFMdr::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
//MeshDataResource::ColliderType collider_type = static_cast<MeshDataResource::ColliderType>(static_cast<int>(p_options["collider_type"]));
Node *n = _importer->import_scene(p_source_file, 0, 15);
Error erri;
Node *n = _importer->import_scene(p_source_file, 0, 15, nullptr, &erri);
ERR_FAIL_COND_V(!n, Error::ERR_PARSE_ERROR);
if (erri != Error::OK) {
return erri;
}
Error err = process_node(n, p_source_file, p_save_path, p_options, r_platform_variants, r_gen_files, r_metadata);
n->queue_delete();