Python Script Question: Script to Extrude, Translate and Scale every face in mesh.

Hi, fairly new to Blender - I have been using it to create assets for Unity3d.

I am currently working on some pretty basic models with a simple structure across the board on all the faces.

My current method involves manually selecting each face, E + Esc (or right click), Grab and translate in the Faces Normal-z (+/-) by n1 (a small amount) and finally scale the extruded/translated face by n2 perpendicular to the faces Normal Z (another small amount).

I haven’t delved into Python yet and wondered if running a script that would take the currently selected faces and act on each one as above (preferably assigning the correct material at the same time) is easily doable?

I realise that this is a rather vague question but although I don’t mind spending the time learning to control Blender with Python (I am ok with C# and Javascript and from what I have seen the structure is pretty similar) - I am just a little concerned that I could end up spending many hours only to find it isn’t possible.

At this stage something that recorded my keystrokes and acted like a macro on each face would be better than doing it manually (and less prone to mistakes) but ideally acting on all the selected faces.

Not begging for someone to write the code but knowing it is the correct direction to take would be useful.

It is possible and shouldn’t be too hard as you know some scripting/coding, but make sure to get used to python’s specifities.

I recommend using the bmesh module, so check out:
http://www.blender.org/documentation/blender_python_api_2_67_1/bmesh.html

And especially the operators for mesh manipulation:
http://www.blender.org/documentation/blender_python_api_2_67_1/bmesh.ops.html#module-bmesh.ops

You should also search these forums, RickyBlender asked a lot of bmesh module-related questions and i posted some code snippets there.

That’s given me plenty to read up on - many thanks for the prompt response.