Hello, I was testing the engine importer in my personal project, and I noticed that while importing models, it doesn't carry over material names to the converted Three.js objects. I needed to show material names in UI so I made following small changes. I think this small improvement can be useful for others as well.
// /engine/threejs/threeconverter.js
CreateThreeFaceMaterial (materialIndex)
{
//...
let materialParams = {
name : material.name, // add this line to carry material name over three.js object
color : baseColor,
vertexColors : material.vertexColors,
opacity : material.opacity,
transparent : material.transparent,
alphaTest : material.alphaTest,
side : THREE.DoubleSide
};
//...
}
// /engine/threejs/threeconverter.js
CreateThreeLineMaterial (materialIndex)
{
//...
let materialParams = {
name : material.name, // add this line to carry material name over three.js object
color : baseColor,
opacity : material.opacity
};
//...
}
Hello, I was testing the engine importer in my personal project, and I noticed that while importing models, it doesn't carry over material names to the converted Three.js objects. I needed to show material names in UI so I made following small changes. I think this small improvement can be useful for others as well.