Custom preview material for parameter selection

Hi guys,

I’m trying to add some custom preview logic to my objects. I want my objects to have custom materials that would change whenever the parameter on the canvas is selected by the user. Some kind of similar behavior with the default red/greenish preview but with custom materials.

I inherit my class from GH_GeometricGoo and override DrawViewportMeshes method. But I can’t find a way to know if the parameter is selected on the canvas. It seems to be tricky since the object can be nested.

I could compare the args.Material with the material that is set for selection by the user. But I don’t know where to look for it.