diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-03-22 18:38:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-22 18:38:28 +0100 |
commit | 3334a53ac37ea1443adb1ebc03a1a60d82cbbef0 (patch) | |
tree | 7d35031e64f59f1a6d4a66aaac9492cdffbefe47 /scene/resources/surface_tool.cpp | |
parent | 07f076fa4f2896415993bb8e3fb42128423de0d2 (diff) | |
parent | 97a3a662205d598dad195fa72d2dcb2f19c21088 (diff) | |
download | redot-engine-3334a53ac37ea1443adb1ebc03a1a60d82cbbef0.tar.gz |
Merge pull request #47166 from reduz/improve-scene-import
Improved 3D Scene Importer
Diffstat (limited to 'scene/resources/surface_tool.cpp')
-rw-r--r-- | scene/resources/surface_tool.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 47933bd69a..3d3900ecc5 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -1059,6 +1059,10 @@ void SurfaceTool::set_material(const Ref<Material> &p_material) { material = p_material; } +Ref<Material> SurfaceTool::get_material() const { + return material; +} + void SurfaceTool::clear() { begun = false; primitive = Mesh::PRIMITIVE_LINES; @@ -1088,6 +1092,10 @@ void SurfaceTool::set_custom_format(int p_index, CustomFormat p_format) { ERR_FAIL_COND(begun); last_custom_format[p_index] = p_format; } + +Mesh::PrimitiveType SurfaceTool::get_primitive() const { + return primitive; +} SurfaceTool::CustomFormat SurfaceTool::get_custom_format(int p_index) const { ERR_FAIL_INDEX_V(p_index, RS::ARRAY_CUSTOM_COUNT, CUSTOM_MAX); return last_custom_format[p_index]; @@ -1174,6 +1182,7 @@ void SurfaceTool::_bind_methods() { ClassDB::bind_method(D_METHOD("generate_lod", "nd_threshold", "target_index_count"), &SurfaceTool::generate_lod, DEFVAL(3)); ClassDB::bind_method(D_METHOD("set_material", "material"), &SurfaceTool::set_material); + ClassDB::bind_method(D_METHOD("get_primitive"), &SurfaceTool::get_primitive); ClassDB::bind_method(D_METHOD("clear"), &SurfaceTool::clear); |