[Maya] confused about scriptJob visibility detect only functions with on not off

Hey Guys,

jobNum = cmds.scriptJob(ac=['%s.visibility'%obj, functools.partial (self.funcVisibilityChangeDetected, 'visibilityChangeDetected')], killWithScene=True, protected=True, alc=True)

I am confused,
I am appending this scriptjobs in a loop to every light. Now I am printing for example the change value in self.funcVisibilityChangeDetected and strangely
it only prints when I unhide a light, but doesn’t do anything and has no value or doesn’t get executed when I hide a light.
Doesn’t matter what I try first, hiding then unhiding or unhiding then hiding, it seems like the scriptjob really acts exclusively for unhiding.

Anyone noticed this before? What can I do to make it work with hiding aswell?

thanks for your help.
Bastian

nevermind, found the solution.

first I need to spawn a selection changed scriptjob from which I am calling the attributeChange visibility detection scriptjob, that way he is always sourcing from the actual selected object.