The hook was called below the `if (!currentSceneObject) return null`
guard, so renders where `currentSceneObject` was null skipped the hook
entirely. When it flipped to non-null on a later render, React saw a
new hook appear and threw "rendered more hooks than during the previous
render".
Move `useViewportSize()` (and the `getScale` helper that consumes it)
above the early return so the hook order is stable across renders.