def METHOD_NAME(self, layer: LayerShellV1Layer) -> None:
    new_parent = self.core.layer_trees[layer]
    self.tree.node.reparent(new_parent)
    self.popup_tree.node.reparent(new_parent)
    if self.tree.node.enabled:
        # If we're mapped, we also need to update the lists on the output.
        self.output.layers[self._layer].remove(self)
        self.output.layers[layer].append(self)
        self.output.organise_layers()
    self._layer = layer