- Messages
- 1,693
- Country

Since joining two meshes messes up some internal blender data (like mesh names and maybe materials), I have now written a small script that simply rotates the mesh back in place. Seems to do what I want it to do... (this is in Blender 2.69)
Code:[COLOR="Green"]#select objects with source as active and run script ;-)[/COLOR] import bpy, mathutils def Rotate(myMesh, mat): for v in myMesh.vertices: vec = mat * v.co v.co = vec source = bpy.context.active_object objects = bpy.context.selected_objects mat_source = source.rotation_euler.to_matrix() mat_source.invert() for ob in objects: if ob != source: mat_ob = ob.rotation_euler.to_matrix() if ob.type == 'MESH': mat = mat_source * mat_ob Rotate(ob.data, mat) ob.rotation_euler = source.rotation_euler
If you care to test it, here is how: copy/paste the code into your Blender "text editor", select the objects you want to reorientate and select the object with the target orientation last. Click "Run Script" in the text editor (or Alt-P). I might incorporate it in the UI later on when I find out how to do that.
You can seek help over at http://www.blenderartists.org/forum/ for ui scripting. I would just hotkey the script to activate on the selected mesh honestly. Then you would have the script installed.
Also, i recommend uploading the script in a txt file. sometimes copy and pasting scripts from forums breaks the script. This is actually a common issue with python.
And finally, 2.69 uses python 3.2, all blender versions that use 3.0+ should work with this script. blender 2.6+ should work fine with this.
Last edited:

