Add state to UIs and compute mesh properties