diff options
author | Daniel J. Ramirez <djrmuv@gmail.com> | 2017-11-11 21:48:00 -0600 |
---|---|---|
committer | Daniel J. Ramirez <djrmuv@gmail.com> | 2017-11-12 13:41:44 -0600 |
commit | 2932cc79ee712a0cb5abe3b327ffc9aad4463c80 (patch) | |
tree | 2311ef5a677c897cafaafaa43cc00124c5a86c93 /scene | |
parent | 48d57e4a30e01d0f8eec54d469bc9e69a77240b2 (diff) |
Update meshes when reimporting,
Save scene preview even when not doing save and play.
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(); |