diff options
author | David Snopek <dsnopek@gmail.com> | 2022-12-20 15:49:11 -0600 |
---|---|---|
committer | David Snopek <dsnopek@gmail.com> | 2023-01-23 13:24:54 -0600 |
commit | 74458b6e9bed0f28db3374c7406eacbcf4b09b9d (patch) | |
tree | 9ce6e2833dbe29a75461f1cf3b171fc7e090bdcf /scene/resources/mesh.cpp | |
parent | 91713ced81792b10fdc9367b7f355738e5d52777 (diff) |
Add "dedicated server" export mode which can strip unneeded visual resources
Diffstat (limited to 'scene/resources/mesh.cpp')
-rw-r--r-- | scene/resources/mesh.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 5e18b5df37..ce54a674db 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -614,6 +614,13 @@ Size2i Mesh::get_lightmap_size_hint() const { return lightmap_size_hint; } +Ref<Resource> Mesh::create_placeholder() const { + Ref<PlaceholderMesh> placeholder; + placeholder.instantiate(); + placeholder->set_aabb(get_aabb()); + return placeholder; +} + void Mesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_lightmap_size_hint", "size"), &Mesh::set_lightmap_size_hint); ClassDB::bind_method(D_METHOD("get_lightmap_size_hint"), &Mesh::get_lightmap_size_hint); @@ -626,6 +633,7 @@ void Mesh::_bind_methods() { ClassDB::bind_method(D_METHOD("surface_get_blend_shape_arrays", "surf_idx"), &Mesh::surface_get_blend_shape_arrays); ClassDB::bind_method(D_METHOD("surface_set_material", "surf_idx", "material"), &Mesh::surface_set_material); ClassDB::bind_method(D_METHOD("surface_get_material", "surf_idx"), &Mesh::surface_get_material); + ClassDB::bind_method(D_METHOD("create_placeholder"), &Mesh::create_placeholder); BIND_ENUM_CONSTANT(PRIMITIVE_POINTS); BIND_ENUM_CONSTANT(PRIMITIVE_LINES); |