scene layer and object layer equal?

OK, I having trouble figuring this out. I’m trying to figure out how to determine if the scene layer and object layer are equal. Needing a panel to display a error message, if the scene layer selected is not the same layer as where the object is at. Any idea how to do that?

are you talking about render layers ?

I think ob layer - scene layers

I mean one objet can be on several layers at same time !

import bpy

theObject =[0]
i = 0
for e in theObject.layers:
	print("Layer " + str(i) + ": " + str(e))
	i += 1

happy bl

I think I solved my problem in a weird way(so far seems to work). I was talking visible layers and object layers. So if object is on the first layer, but you selected layer 5 for visible layer, it would give an error.

They’re both just a list of booleans, so easy to compare, but RickyBlender does bring up a legitimate problem with objects being on multiple layers and scene having multiple visible layers. Not a problem really but something to consider…