csvurt/assimp2xml3d

DefaultMaterial has an opacity value of 0

Closed this issue · 1 comments

Hi, is it possible to output a Mesh without the DefaultMaterial light and lightshader?

[Warn] Material with name 'DefaultMaterial' has an opacity value of 0. Meshes rendered with this material will be fully transparent!

This is what I have at the beginning of my file after converting an STL file.


0.6 0.6 0.6
0.6 0.6 0.6
0 0 0
0
1

Thanks a lot

The default material is created automatically by Assimp during the import process so right now it's not possible to export the mesh without it. I'll look into adding this as an option in the next release. Until then you might have to remove the shader attribute of the exported <assetmesh> elements by hand (or by script since it's just a simple find/replace).

Note if you do that XML3D won't render the model properly (it will be a flat red color) unless you give it a material from inside your XML3D scene, eg:

<group shader="#someMaterial">
    <model src="myModel.xml#myModel"></model>
</group>

But it's pretty strange that the default material is fully transparent, I'll have to look into what Assimp is doing here.

Lights and lightshaders shouldn't be exported at all since the XML3D asset format doesn't support them.