Sorry about the late reply, there was some confusion about the status of this task. Thanks for letting us know about it.
The main issue is that the alphaMode of the material needs to be set to BLEND to display the transparent objects correctly. Here are the two solutions you can use to make that possible, only one of them is necessary:
In Grasshopper you can use the glTF 2.0 Display and the glTF 2.0 Material. In this material you can specify the AlphaMode as shown in the screenshot below:
If your plan has Viewer API access (starting from Designer Plus you have API access, please see this page for more information), you can change the material via the Viewer API. In the following code example I show how to that:
// create a callback that is executed whenever the session has been customized
const cb = (node: ITreeNode) => {
node.traverse(c => {
for(let i =0; i < c.data.length; i++) {
if(c.data[i] instanceof GeometryData) {
const geometry = c.data[i] as GeometryData;
// if the opacity is lower than 1, change the alphaMode and update the node
if(geometry.primitive.material.opacity < 1) {
geometry.primitive.material.alphaMode = MATERIAL_ALPHA.BLEND;
geometry.primitive.material.updateVersion();
geometry.updateVersion();
c.updateVersion();
}
}
}
})
}
// assign the callback and call it once to get immediate effects
session.updateCallback = cb;
cb(session.node!);
I tried to change the existing grasshopper using glTF Material with the previously suggested method, but the following problem continues to occur.
As you know, if you set the ALPHAMODE of the red plate to OPAQUE in the picture below, you can implement the desired render, but since some of the colors applied to the red plate must be applied with transparency, this problem seems to be solved. .
Additionally, apart from using Designer Plus, our website itself does not support API, so using API was excluded as an option.
Just to preface this, transparency in WebGL (which is the graphics language that is used here) is never an easy topic, so in some cases, the desired outcome may not be possible without changes to the geometry or the model (or in some cases, not at all possible).
The model you shared the screenshot of is a different model than you sent on me via PM. Please post a link to the model on the platform so that we can have a closer look a this issue. You can also send me a PM with a link to that model if you don’t want to share it here in the forum.
@MajorMeerkatThe3rd
Thank you for the reply
Once again, based on what you said, I will proceed once more and if it still does not work, I will send you a gh file by pm.