From 77a045e902db9f5f0ea7961e827c337541a6436c Mon Sep 17 00:00:00 2001 From: reduz Date: Sat, 12 Dec 2020 09:06:59 -0300 Subject: Rework Mesh handling on scene importing. -Reworked how meshes are treated by importer by using EditorSceneImporterMesh and EditorSceneImporterMeshNode. Instead of Mesh and MeshInstance, this allows more efficient processing of meshes before they are actually registered in the RenderingServer. -Integrated MeshOptimizer -Reworked internals of SurfaceTool to use arrays, making it more performant and easy to run optimizatons on. --- scene/resources/mesh.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'scene/resources/mesh.h') diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index ae2139a0cf..586bb2f802 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -53,7 +53,10 @@ public: NO_INDEX_ARRAY = RenderingServer::NO_INDEX_ARRAY, ARRAY_WEIGHTS_SIZE = RenderingServer::ARRAY_WEIGHTS_SIZE }; - + enum BlendShapeMode { + BLEND_SHAPE_MODE_NORMALIZED = RS::BLEND_SHAPE_MODE_NORMALIZED, + BLEND_SHAPE_MODE_RELATIVE = RS::BLEND_SHAPE_MODE_RELATIVE, + }; enum ArrayType { ARRAY_VERTEX = RenderingServer::ARRAY_VERTEX, ARRAY_NORMAL = RenderingServer::ARRAY_NORMAL, @@ -171,12 +174,6 @@ class ArrayMesh : public Mesh { Array _get_surfaces() const; void _set_surfaces(const Array &p_data); -public: - enum BlendShapeMode { - BLEND_SHAPE_MODE_NORMALIZED = RS::BLEND_SHAPE_MODE_NORMALIZED, - BLEND_SHAPE_MODE_RELATIVE = RS::BLEND_SHAPE_MODE_RELATIVE, - }; - private: struct Surface { uint32_t format; @@ -268,6 +265,6 @@ VARIANT_ENUM_CAST(Mesh::ArrayType); VARIANT_ENUM_CAST(Mesh::ArrayFormat); VARIANT_ENUM_CAST(Mesh::ArrayCustomFormat); VARIANT_ENUM_CAST(Mesh::PrimitiveType); -VARIANT_ENUM_CAST(ArrayMesh::BlendShapeMode); +VARIANT_ENUM_CAST(Mesh::BlendShapeMode); #endif -- cgit v1.2.3