Cache materials in gltf as the abstract class of Material

Use the abstract material class instead of BaseMaterial3D. This allows inserting ShaderMaterials into gltf. Like in VRM.
This commit is contained in:
K. S. Ernest (iFire) Lee
2022-11-23 15:29:01 -08:00
parent e3a51e53ef
commit baab97302a
4 changed files with 207 additions and 199 deletions

View File

@ -209,11 +209,11 @@ void GLTFState::set_meshes(TypedArray<GLTFMesh> p_meshes) {
GLTFTemplateConvert::set_from_array(meshes, p_meshes);
}
TypedArray<BaseMaterial3D> GLTFState::get_materials() {
TypedArray<Material> GLTFState::get_materials() {
return GLTFTemplateConvert::to_array(materials);
}
void GLTFState::set_materials(TypedArray<BaseMaterial3D> p_materials) {
void GLTFState::set_materials(TypedArray<Material> p_materials) {
GLTFTemplateConvert::set_from_array(materials, p_materials);
}