Store and restore a 3d view?

HI

I would like to store the active view3d with all properties like current alignment, perspective value, etc as is and restore it later to pre operation state (an operation changes the rotation and alignment of it because). What would be the best way to achive it?

1 Like

copy the relevant values from the RegionView3d type and restore it when you need it. Since you can have more than one view3d I wouldn’t recommend searching through all of the areas in the workspace, rather- use context.area

Remember that a view3d area has many regions, and only one of them is the actual 3d view you are looking for. Loop through them and check for the correct type.

https://docs.blender.org/api/current/bpy.types.RegionView3D.html?highlight=view3d#bpy.types.RegionView3D

1 Like

Thank for the idea, I will try it