diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-25 12:32:02 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-11-25 12:32:41 -0300 |
commit | 9738ebcda047fd9b4ddf71a0da5d682ade1a2666 (patch) | |
tree | a7b5703d635fef7bf2b70933b4f0f7a512691213 /editor | |
parent | e1cf789593ce344726f43e087e5746802454c208 (diff) |
-Fixed height fog (was broken)
-Make sure materials are named in OBJ importer, so they can be saved outside as resources.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/import/resource_importer_obj.cpp | 1 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index bd24aac99b..14bda9bb4e 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -58,6 +58,7 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati current_name = l.replace("newmtl", "").strip_edges(); current.instance(); + current->set_name(current_name); material_map[current_name] = current; } else if (l.begins_with("Ka ")) { //uv diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index af766128b0..95445693b4 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -952,7 +952,10 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String for (int i = 0; i < mesh->get_surface_count(); i++) { mat = mesh->surface_get_material(i); - if (!mat.is_valid() || mat->get_name() == "") + + if (!mat.is_valid()) + continue; + if (mat->get_name() == "") continue; if (!p_materials.has(mat)) { |