local function u(u)local W=NodeLookup[u]if not W then return end local O=nodeIsVisible(W)Selection:Remove(u,true)local Q=W.Parent remove(Q,W.Index)NodeLookup[u]=nil connLookup[u]:disconnect()connLookup[u]=nil if O then updateList()elseif nodeIsVisible(Q)then updateScroll()end end

local function removeObject(object)
	local objectNode = NodeLookup[object]
	if not objectNode then
		return
	end

	local visible = nodeIsVisible(objectNode)

	Selection:Remove(object,true)

	local parent = objectNode.Parent
	remove(parent,objectNode.Index)
	NodeLookup[object] = nil
	connLookup[object]:disconnect()
	connLookup[object] = nil

	if visible then
		updateList()
	elseif nodeIsVisible(parent) then
		updateScroll()
	end
end
