Export transparent PNG and use it in a GLTF display

Hello,

I have a new SD file where I use the GLTF display component.
I managed to use a transparent png in the material.

A have another SD file, where I need to export a transparent png
I need this png to be generated live and then used in the first SD.

Problem A :
I do not manage to export a transparent png file (background black and holes transparent)

Problem B :
I do not manage to use the GLTF display with a black and white texture

I need to resolve A or B, to get a working combinaison
I try many things : use Curves, Brep, Surface, Mesh
Change every option in the GLTF material
Etc

Attached, you’ll find an exemple of my code.
Both SD a represented in the same example file.

debugDisplayTransparency.gh (79.4 KB)

Could you help me?

Thanks !
Olivia

The way the Squid plugin generates bitmaps is by using successive draw actions (draw the background, draw curves, etc…). If you draw transparent curves on a black background, you just get black (it adds transparent curves on top of a black background). This is a limitation inherent to the way the plugin works.

As a workaround, you could try to use other bitmap manipulation plugins that work differently (for example Bitmap+).
Alternatively, I am attaching your file modified with a script that inverts the values of the alpha channel for each pixel. This solves your problem but note that this is not very efficient in terms of computation time (it adds a couple of seconds to the script’s execution).

debugDisplayTransparency.gh (79.6 KB)

Hello Mathieu

Thanks for your help
I face many issues

1/ You script is too heavy to be used in live..

2/ I try the plugin BitmapPlus but when importing into ShapeDiver it says
Plugin BitmapPlus, Version 1.6.3.0, AssemblyVersion 1.6.3.0 by David Mans can not be used yet. The currently installed maximum version is 1.6.2.0.
The version 1.6.2.0 is not available for download

3/ I try the plugin Javid but when importing into ShapeDiver it says
Plugin Javid, Version 1.2.1, AssemblyVersion 1.2.1.0 by Mahdiyar may not be used yet.

4/ I’m trying to forget the transparency and work with a black and white image
If the background of the viewer is white, it should “do the trick”
But whatever I try, the image always appear black and GREY instead of Black and white
(I’m still using the GLTF Material)

Can you show me, how to display a B&W image in a GLTF display ?
Exemple image : https://medias.dampere.fr/shapediver/poseSystem/SPM20038-OPERA-PARONS_V_1500x2000_BW_Ratio1.png

Can you help me?
Thanks

displayBWimage.gh (26.8 KB)

So after few more hours on this subject, I think I’ll go with the solution of using a transparent png file, created before, and cropped live.

So could you help me having a working plugin to be able to crop a bitmap on shapeDiver ?

Thanks

You can get version 1.6.2 of the Bitmap+ plugin using the package manager:

Bitmap+ includes a component for cropping images:

I managed to install Bitmap plugin version 1.6.2

Unfortunatly, this plugin loose the transparency when using the Crop component

With the Javid plugin, the transparency is keeped.

Is it possible to allow the “Javid” plugin the the ShapeDiver server ?
sdr7euc1 (Rhino 7, Europe, Shared system)

Attached, a simple demo of the 2 plugins

BitmapVersusJavidPlugin.gh (9.6 KB)

Thanks

Hello @mathieu1

Any update on “Javid” Plugin?

I also found out the “View Capture” component witch seams to be very interested
I’m looking for a solution to capture the Rhino View and generate an image (to get it via the export API, without using the shapediver viewer)

Both components would really help me!

Thanks

We are evaluating the Javid plugin and will likely be able to support it in the future. Alternatively, you could contact the developer of Bitmap+ since the issue you are describing sounds like a bug.

The “View capture” component cannot be supported on ShapeDiver because there is no active Rhino document there. Images can only be generated from the viewer or through components such as Make2D.

OK, I’m going to contact Bitmap+ to see if it’s a bug
I’ll let you know

Thanks