From b02c7387c7ed26f2b436964f3a771502aeef0be2 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 28 Apr 2022 11:46:45 +0200 Subject: Implement placeholder assets * Placeholder textures * Placeholder meshes * Placeholder material This PR is the first step towards implementing https://github.com/godotengine/godot-proposals/issues/2756 It adds an asset type that uses no resources, which can be used to replace the existing ones on export for using on the upcoming server export. --- scene/resources/mesh.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scene/resources/mesh.cpp') diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 3c67a20f50..1f31fab715 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -2092,3 +2092,17 @@ ArrayMesh::~ArrayMesh() { RenderingServer::get_singleton()->free(mesh); } } +/////////////// + +void PlaceholderMesh::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_aabb", "aabb"), &PlaceholderMesh::set_aabb); + ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb", PROPERTY_HINT_NONE, ""), "set_aabb", "get_aabb"); +} + +PlaceholderMesh::PlaceholderMesh() { + rid = RS::get_singleton()->mesh_create(); +} + +PlaceholderMesh::~PlaceholderMesh() { + RS::get_singleton()->free(rid); +} -- cgit v1.2.3