Transparency of a TEveGeoNode

Hello,
I would like to be able to edit the colours and transparencies of a geometry imported from an xml or root file in TEveManager. I can import and display no problem but seems that whatever I do the colours of the volumes stay the same as the original.
Essentially the Top-node I want to make transparent to be able to display the tracks inside the volume.
Here is an example of what I do. I import the CMS geometry for this example, but I have my own. Same problem anyhow. As you can see from the result the colour and transparency of the top volume hasn’t changed and are still the default.

Thanks,
Sebastien

gEve= TEveManager.Create()
gGeo= gEve.GetGeometry(“http://root.cern.ch/files/cms.root”)
gGeo.DefaultColors()
top_node = gGeo.GetTopNode()
TopGeoNode = TEveGeoTopNode(gGeo, top_node)
TopGeoNode.CanEditElement()
TopGeoNode.CanEditMainColor()
TopGeoNode.SetMainColor(kRed)
TopGeoNode.SetMainTransparency(10)
gEve.AddGlobalElement(TopGeoNode)
gEve.FullRedraw3D(True)


ROOT 6.10/08 mac os 10.13.4


Hi Sebastien,

The top node is really just the mother volume and never gets drawn. You should expand the Scenes/Geometry scene/… and then fiddle with actual volumes. Also, try visualization options and depth in TEveGeoTopNode gui … these are passed to TGeo painter, see
https://root.cern.ch/root/html602/TGeoPainter.html
https://root.cern.ch/root/html602/TGeoPainter.html#TGeoPainter:SetVisOption
https://root.cern.ch/root/html602/TGeoPainter.html#TGeoPainter:SetVisLevel

Also see tutorials/eve/geom_cms.C - this shows how different branches of some geometry can be imported and controlled independently.

Finally, it is usually easier to just extract shapes that you want to show as detector outline and create TEveGeoShape objects to represent them in eve. See this for inspiration :slight_smile:

You can also save such selection into TEveGeoShapeExtract, see how it is loaded in tutorial alice_vsd.C (it seems you have to run it in compiled mode, as root.exe alice_vsd.C+).

Cheers,
Matevz

Hi Matevz,

thanks. The FindNode command (example in geom_CMS.C) was not returning anything. Maybe because in the Gdml file they were not define as nodes but as volumes. I don’t know.
But yes indeed opening the gdml file and playing with the shapes before hand (e.g gGeo.GetVolume(“volFoamPadding”).InvisibleAll(); gGeo.GetVolume(“volTPCActive”).SetTransparency(60), etc…) and then loading the top node in TEveManger (top_node = gGeo.GetTopNode() actually works.

Cheers,
Sebastien

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.