Open renanfaccin opened 4 years ago
I have the same problem. When you set IsTwoSided as true, AssimpNet calls the code above:
set
{
MaterialProperty prop = GetProperty(AiMatKeys.TWOSIDED);
if(prop == null)
{
prop = new MaterialProperty(AiMatKeys.TWOSIDED_BASE, value);
AddProperty(prop);
}
prop.SetBooleanValue(value);
}
The value of AiMatKeys.TWOSIDED_BASE is "$mat.twosided".
A glTF/GLB material with value twosided as true should define the backside color.
export of doubleSided does not work since the exporter uses a boolean variable instead of an integer. Since there is no handling of boolean property values it is treated as a buffer instead which causes the Get function to fail. A simple workaround could be to do:
int doubleSided = 0; mat->Get(AI_MATKEY_TWOSIDED, doubleSided); m->doubleSided = doubleSided != 0;
When I export a WPF 3D model to GLB format, and to open it later in a viewer like Babylon.JS/glTF Viewer some sides are hidden it when rotate camera. The Assimp library (AssimpNet) has a property for enable double side, IsTwoSided property, however, is not work when I set true value.
Code snippet:
Follows the evidence of the problem:
Original model
Model opened in Babylon.JS viewer
Would appreciate if you can help me.