• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

[Blender 2.6x] Axis Orientation Copy?

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:
Back
Top