Hi,
I was inquired about how to implement a scaled viewport drawing option. There are different ways of acchieving this.
I decided to share the anwer here so that it can benefit more people. But also as a way to illustrate how to tackle such a problem.
Tools/Workflow
-
Lattice
-
Work in a collection, and instance that collection as a separate object: scale the instanced collection
-
Geometry Nodes: add to an object that you want to see scaled.
The Geometry Nodes solution has the advantage that it works even in Edit Mode, with the On Cage option.
Python
You can render the viewport from the point of view of a camera, and overlay it in the viewport.
The API documentation has an example that does precisely this. Just change the scale it draws back.
You can have a viewport dedicated to draw this, while another one dedicated to the interaction itself.
C++ coding
You can either approach this as a engine level setting (for the Workbench Engine), or a per-object Viewport Display option.
The nice thing about the engine option, is that it would be global and easily setup. The downside is that you won’t (easily anyways) manage to get the gizmos, mouse selection and other UI elements to play nice with it.
Blender does have a separation between what the render engine handles, and what the interaction layer does. So you would need to make sure the render engines is changing the view transform of the render buffer (and the depth and selection buffer). And make sure the interaction layer is NOT distorted, while is made aware of the new transforms.
Not rocket science, but probably not a walk in the park either. But if done well it could be acceptable as Blender contribution. This topics comes around any time we talk about supporting fisheye lens, fulldomes, panoramas on the viewport.
You can also make a custom render engine (using a hydra delegate even), that just ignores the fact that the interaction/clicking don’t match what you see on the viewport. Not a good experience, but technically is what Blender does with Cycles when you use Panorama/Fisheye lens. (and what EEVEE plans to do once it supports those options too).