align an object to a face's normal?

I frequently want to manipulate objects in an arbitrary, local space, by using an empty as a Transform Orientation. Generally when I need to do this, that arbitrary space corresponds to or is defined by some face on some mesh. I would very much like to know the best way to make an object (an empty) align perfectly with a face or face normal. Which object axis becomes parallel with the normal doesn’t matter to me.

OR, how can I access the necessary data about the normal of an individual face, so I can key in the rotation manually? (Preferably without digging around in datablocks.)

What I’m doing now is too imprecise (guessing + ‘eye-balling’) to be viable. I feel like I’m missing something obvious… Can anyone give me an idea of how to do this?

Thank you for your time!! :slight_smile:

Attachments


You can create a custom transform by selecting the face and Ctrl+Alt+Spacebar. Set this to be the transform orientation in the 3d view header and selecting the empty you can use the Object / Transform / Align to Transform Orientation menu entry
or
Set the Snap tool (magnet icon on header), set it to Face then select the ‘Align rotation with the snapping target’ button. You can then drag the empty and it will snap to the face with the emptys z axis aligned with the face normal.
http://screencast.com/t/ir5g94mh

That second method was what I used to do - I forgot about the Align rotation w/ snapping target" thing!
The first method is something I never knew about at all, but I had a feeling blender had this functionality natively! Thank you very, very much for the speedy and thorough response. You saved the day!

edit:
Even got a screencast going? That’s above and beyond, thank you! I recall the problem with that method being aligning all three axis (where applicable) to the face, whereas the first method you mentioned overcomes that problem with zero fuss. I’m very glad I asked, I feel I got a great answer that will help my productivity a lot. :slight_smile:

Any how to do this with python script in Blender 2.8?
//W