what do you think about it: align view3d.localview to object's local axis

Hi

Sometimes one wants to fine tune mesh of object already positioned (and rotated) in the scene. It would be much more comfortable to work with mesh in edit mode if keys 1/3/7 on numpad align view to front/side/top according to object’s local axis. It’s not about transform axis, which already can be changed, but about view axis. And more about its rotation than location and scale. Local View mode would be perfect place for such functionality, as itself name suggests it.

In object mode numpad shift-1/3/7 provide such functionality, but it doesn’t work in edit mode (view is aligned do selected vertex/edge/face axis).

Expected behavior:

When in local view mode (NUMPAD_7), numpad 1/3/7 gives front/side/top view of object no matter how object is rotated on the scene.

I can see following implementations:

  • temporarily cancel all object transformations when entering local view mode (perfect solution but only for one object selected when entering local view)
  • temporarily cancel objects rotation transformation when entering local view mode
  • align view axis rotation to last selected object’s axis rotation
  • add axis selection to view properties panel

What do you think about it?


Best regards,
Seweryn Niemiec

as of now you can use this workaround - key the object’s rotations in one frame and key the object’s rotations reset to zero in the next… the second frame is your local view, you also get 1,3,7 functionality… so remember - do not apply rotations… :slight_smile:

If you hit Shift+1/3/7 you get the respective views in local space, that is aligned with the axes of the selected object.

paolo

good point. currently I copy rotation to some empty obj., clear it, edit mesh and copy rotation back :slight_smile:

yeah… but it doesn’t work as expected in edit mode.

Come to think of it, you could probably write a quick Python operator that quickly switches to Object mode, chooses the local axis view, and then toggles back into Edit mode. It’s a bit of a kludgey hack, but it should work. You can even over-ride the Shift+1/3/7 hotkeys for this (or choose unique ones so you get both functionalities)

Good hack, Fweeb. This switched me to python thinking mode and I come with this…
new hotkey (toggle functionality) to:

check if object ‘A’ exists, if not then:

  1. create empty ‘A’
  2. copy selected object’s rotation to empty ‘A’
  3. clear object’s rotation
  4. turn on local view
  • here one can enter edit mode and do what he needs -

if empty object ‘A’ exists then:

  1. copy rotation of ‘A’ to currently selected object (or find some way to store reference to original object)
  2. delete ‘A’
  3. turn off local view

Is it possible to code this in blender python API? If so, this could be my first blender plugin :slight_smile:

Little idea modification:
Empty ‘A’ could be created as a selected object’s parent and then rotated to compensate object’s rotation.

OR
Maybe it is simply possible to change view’s axis from python? Does anyone know? That would be a perfect solution.

I’ve not done a lot of Python that changes the view from within the viewport… so my hack would be faster to code. However, I jut checked and you can manipulate the perspective matrix for the 3D View from Python… so what you propose is possible… perhaps even without the Empty.