diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2018-10-23 15:25:38 +0200 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2018-10-23 15:25:38 +0200 |
commit | 68270964d45802b1a76a429dad1812a1be3333ec (patch) | |
tree | 537f7fbee66288d5998f60c71c632dc5bdb4d8d7 /scene/3d/mesh_instance.cpp | |
parent | ee858d0d85123de004c85131914e1f421e7f06ab (diff) | |
download | redot-engine-68270964d45802b1a76a429dad1812a1be3333ec.tar.gz |
Get surface material count in MeshInstance for scripts
Diffstat (limited to 'scene/3d/mesh_instance.cpp')
-rw-r--r-- | scene/3d/mesh_instance.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 4cbf6f2de3..cf0317cd58 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -253,6 +253,11 @@ void MeshInstance::_notification(int p_what) { } } +int MeshInstance::get_surface_material_count() const { + + return materials.size(); +} + void MeshInstance::set_surface_material(int p_surface, const Ref<Material> &p_material) { ERR_FAIL_INDEX(p_surface, materials.size()); @@ -359,6 +364,7 @@ void MeshInstance::_bind_methods() { ClassDB::bind_method(D_METHOD("set_skeleton_path", "skeleton_path"), &MeshInstance::set_skeleton_path); ClassDB::bind_method(D_METHOD("get_skeleton_path"), &MeshInstance::get_skeleton_path); + ClassDB::bind_method(D_METHOD("get_surface_material_count"), &MeshInstance::get_surface_material_count); ClassDB::bind_method(D_METHOD("set_surface_material", "surface", "material"), &MeshInstance::set_surface_material); ClassDB::bind_method(D_METHOD("get_surface_material", "surface"), &MeshInstance::get_surface_material); |