Disable my effect if already added to layer
I'm developing a plugin in AfterEffects sdk and I want that a user can add only one effect per layer. Not actually one effect per layer, but just one effect that I am working on. I mean if the user has other effects added, there is no issue but if my effect is added once in a layer, it should be disabled the next time from the effect menu.
One way I can think of is to get all effects in layer, check if any of them is my effect, disable it in the effect menu. However I don't know how to disable my own effect.
Or is there some other direct solution or outflag that I can set so that the effect can be added just once per layer?
Also I don't know how can we uniquely identify an effect. If that is possible, I might not have to disable the effect. For example, we can uniquely identify layers with their AEGP_LayerIDVal, I don't find a way to uniquely identify an effect (if the type of effect is same).
