Select to view content in your preferred language

Transparency issue with local SLPKs?

460
3
08-18-2023 08:58 AM
Winfried
New Contributor

Hi all,

I came across an issue when working with local SLPK files exported from ArcGIS Pro when using a C# script.

The following code snippet is pulled from my script

doorsLayer = new ArcGIS3DObjectSceneLayer(doorsSlpkPath, "Doors_Layer", 1.0f, true, "");
doorsLayer.MaterialReference = new Material(Resources.Load<Material>("Materials/Doors_Material"));
arcGISMap.Layers.Add(doorsLayer);

 

Currently the "Opacity" is set to 1.0f which is "no transparency". However, if a set something like 0.2f this is not reflected in the appearance of this layer.

The strange thing is when I set the "Opacity" without any C#, just by using the Map Creator UI, then Opacity/Transparency works just fine.

Any idea what might be causing this?

Thanks and best regards

Winfried

P.S. I'm working with ArcGIS Pro 3.1.2, Unity 2021.3.25f1 and ArcGIS Maps SDK for Unity 1.2

Tags (3)
0 Kudos
3 Replies
MarkusWall1
New Contributor III

Hi Winfried,

same problem here with transperency and using hosted scene layers. For me it was even not possible to activate or deactivate layers in the source code.

Same setup, but using unity 2021,3,28f1

Best regards,

Markus

 

0 Kudos
TomoTakeda
Esri Contributor

Hi,

The issue regarding the opacity setting on scene layers is a known issue. The workaround is to change the scene layer material to one with transparency. You can change the material with the same technique as the 3D attributes filtering: https://developers.arcgis.com/unity/filtering-and-modification/3d-attributes/

If you want to change the layer's visibility only, I recommend using the visible boolean value for it.
https://developers.arcgis.com/unity/api-reference/gameengine/layers/arcgis3dobjectscenelayer#constru...

I hope this helps.

0 Kudos
Winfried
New Contributor

Hi,

unfortunately it didn't matter if the material had been set to opaque or transparent. The result stays the same for me.

But I was able to find a workaround for my issue. Since my slpks are based on Autodesk Revit files imported into ArcGIS Pro I browsed through the different shaders available and gave it a try with the "AutodeskInteractiveTransparent" shader. And this shader works just fine when it comes to transparency with BIM models 🙂

transparency.jpg

 

0 Kudos