There is a standard command in 3D View window (Object mode): View=>Align View=>Align View to Selected. So, why I have created this script? Well, this standard command has two important drawbacks:

  • It aligns view always to the object’s local XY plane. It is impossible to align it to any other plane;
  • The alignment is not set properly, when one of the object’s scale factors is negative;
  • I have written this script as a workaround these two shortcomings.

    Here you can download the AlignView.py script file.

    To follow this tutorial, you should place the Align View script into your Blender script directory (here is the tutorial, which explains how to do that).


    Usage

    Let’s align view to the XY face of the Tube from the Fig 1.:

    Fig. 1. Selected object (the unselected cube is aligned to the world system).

    Select the object, first.

    Then run the Object=>Scripts=>Align View to Selected command (Fig. 2):

    Fig. 2. Run the Align View to Selected script.

    A popup menu will appear (Fig. 3). Select from it the desired plane:

    Fig. 3. Selection of the alignment plane.

    And here is the result (Fig. 4). I have switched into wireframe mode, to show it better:

    Fig. 4. View aligned to the XY plane.

    If you select from the popup menu (Fig. 3) another plane – let’s say, XZ – the result will be following:

    Fig. 5. View aligned to the XZ plane of the selected object.