rendered paste bodyimport BlenderTRUE = 1FALSE = 0class events: instances = [] events = [] def __init__(self, parent): events.instances.append(self) self.parent = parent self.event_queue = [] def __del__(self): events.instance.remove(self) def add_event(self, function): events.events.append(function)class layer: instances = [] def __init__(self, visible=TRUE, depth=0): layer.instances.append(self) self.visible = visible self.depth = depth self.children = [] def __del__(self): layer.instances.remove(self) self.children = None def add_child(child): self.children.append(child) def del_child(child): self.children.remove(child) def set_depth(self,depth=0): self.depth = depth def get_depth(self): return self.depth def set_visible(self, visible=TRUE): self.visible = visible def get_visible(self): return self.visibleclass element: instances = [] def __init__(self, parent): element.instances.append(self) self.parent = parent self.visible = parent.visible self.child = None self.events = events(self) def __del__(self): element.instances.remove(self) self.parent = None def set_parent(self, parent): parent.add_child(self) self.parent.del_child(self) def get_parent(self): return self.parent def set_visible(self, visible=TRUE): self.visible = visible def get_visible(self): return self.visible def set_parent(self, parent): parent.add_child(self) self.parent.del_child(self) def get_parent(self): return self.parent