def buildVisibilityModel(self): self.vis_model = VisibilityModel() # Add all layers in the project to the visModel. If this layer is visible, put it at the top g = VisibilityModelGroup("Current") self.vis_model.addChild(g) l = self.visMakeLeaf(self.il) g.addChild(l) unassigned_ils = set(self.project.imagery.imagelayers) # Add stackup groups for sl in self.project.stackup.layers: g = VisibilityModelGroup(sl.name) for il in sl.imagelayers: unassigned_ils.discard(il) if il is not self.il: l = self.visMakeLeaf(il) g.addChild(l) self.vis_model.addChild(g) g = VisibilityModelGroup("Unassigned") for il in unassigned_ils: if il is not self.il: l = self.visMakeLeaf(il) g.addChild(l) self.vis_model.addChild(g) self.vis_model.propagate_model()