diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-12 21:17:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-12 21:17:58 +0100 |
commit | 47e5b43160128ea6e466ad70952078ff386718cd (patch) | |
tree | 7f957c06e2e06419d35249a191b2b3693f8d55d8 /scene | |
parent | 858d3d4adc7e8ae80009ec61cc042d6c24e9e536 (diff) | |
parent | 2932cc79ee712a0cb5abe3b327ffc9aad4463c80 (diff) |
Merge pull request #12852 from djrm/pr_import_fixes
Update meshes when reimporting,
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/mesh.cpp | 13 | ||||
-rw-r--r-- | scene/resources/mesh.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index db5d87d703..26f5deae1d 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -574,7 +574,6 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { ERR_FAIL_COND_V(!d.has("format"), false); uint32_t format = d["format"]; - ERR_FAIL_COND_V(!d.has("primitive"), false); uint32_t primitive = d["primitive"]; ERR_FAIL_COND_V(!d.has("vertex_count"), false); @@ -598,8 +597,8 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { Rect3 aabb = d["aabb"]; Vector<Rect3> bone_aabb; - if (d.has("bone_aabb")) { - Array baabb = d["bone_aabb"]; + if (d.has("skeleton_aabb")) { + Array baabb = d["skeleton_aabb"]; bone_aabb.resize(baabb.size()); for (int i = 0; i < baabb.size(); i++) { @@ -1090,6 +1089,14 @@ void ArrayMesh::_bind_methods() { BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); } +void ArrayMesh::reload_from_file() { + for (int i = 0; i < get_surface_count(); i++) { + surface_remove(i); + } + Resource::reload_from_file(); + String path = get_path(); +} + ArrayMesh::ArrayMesh() { mesh = VisualServer::get_singleton()->mesh_create(); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index f4edb258b6..b11adf50b9 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -213,6 +213,8 @@ public: void center_geometry(); void regen_normalmaps(); + virtual void reload_from_file(); + ArrayMesh(); ~ArrayMesh(); |