[Blender 2.6x] Axis Orientation Copy?

Hi.

Prior to Blender version 2.5, there was a nice script called "Axis Orientation Copy" which allowed you to change the axis orientation of an object without moving the mesh. In Max, that would equal to manipulating the "Pivot" only. That script was lost in Blender since 2.5 and I've been wondering how to go about this task after moving to Blender 2.6. I have a workaround now but I wondered if I just missed something in the new interface that does just that. Anyone know what I'm talking about?
 
Ok, there is no such easy thing as in 3ds max.. like affect pivot only thing (grab & rotate ) If I understood you right you want to Copy the pivot orientation of another object, so basically the pivot of the first is oriented alike in the second.. I'll try to make lil tut so you can see what do I mean. Honestly I never used this technique in blender, but I just found the work around.. LOL Just bear with me..
 
You are fast, man. but that is not exactly what I meant. I mean for the object to *have* the new orientation as its own "Local" orientation (so when I choose "Local" with the object selected it shows the orientation I want). Here's what I do (note to self):duck::
  1. Add an empty and position it at the origin of the object I want to reorientate (is this even proper english?)
  2. Add the transform orientation (say "Face") I want the object to end in
  3. Align the empty to that transform orientation
  4. Now make the empty parent to the object
  5. Then align the empty to "Global"
  6. Now unparent the object with "Keep Transform"
  7. Then "Object→Apply→Rotation" on the object. now the object has rotation of 0,0,0.
  8. Now align the object to "Face", et voila!

You see that this is a somewhat cumbersome workaround... But I need it for proper animation with rotation.
 
Thanks for the fast compliment :D
Sure I got ya from the first post.. I know what you exactly mean...
Ill try to find the solution if no one else will. As I said that I never used this as my primary use of blender is architectural stuff at some stage..
 
Not sure I follow the question. You want to manipulate the local axis of an object or simply rotate an object on its local axis?
I want to animate an object with rotation about one of its local axis. Let's say I separated a hatch from the fuselage with P. It would now have the same axis orientation as the fuselage. But I need it to animate with respect to another axis at a certain angle. Then I would first have to set the proper axis orientation on the hatch.

Basically, I want to be able to change the "local" coordinate system of an object without affecting its mesh coordinates.
 

hairyspin

Resource contributor
Sounds as if this is a noticeable difference in method to those of Gmax/Max. Interesting question!
 

Dutcheeseblend

Resource contributor
I was looking for the same thing, but I didn't find it yet.

Though, I'd use an empty at the proper placing, let it be a parent of the mesh, and animate the parent. Maybe this will work out.
 

Dutcheeseblend

Resource contributor
Sorry, my option won't work, try instead moving an empty at the proper place, move 3D cursor to Selected, and set origin of the object to 3D cursor.
 
I want to animate an object with rotation about one of its local axis. Let's say I separated a hatch from the fuselage with P. It would now have the same axis orientation as the fuselage. But I need it to animate with respect to another axis at a certain angle. Then I would first have to set the proper axis orientation on the hatch.

Basically, I want to be able to change the "local" coordinate system of an object without affecting its mesh coordinates.
You mean separate the mesh selection creating a new object, then manipulating it along the same axis parameters as the original, but not along the same point of origin as the original. Correct? If so you just need to set origin to a new point on the object.

To manipulate along its local axis you just select object, then press the corresponding letter twice for the axis you want manipulation for, that sets manipulation to the objects local axis.

I set the origin in many ways. the best way for door pivot is demonstrated in the images.
 

Attachments

Last edited:
Explanation attempt 1

... then manipulating it along the same axis parameters as the original, but not along the same point of origin as the original. Correct?
No, I need the "local" axis also to be different from the original object's axis (while the mesh has to remain in place). With the "Axis Orientation Copy" script, one would add an empty, orient it in the right direction and then copy the axis directions to the newly created object. How can I explain this?

It's all about the "Local" transform orientation of an object. Let's say I have a rudder to animate. The rotation axis is obviously parallel to the leading edge of the rudder. So I want the rudder's local Z-axis to be aligned with the rotation axis.

I first start by separating the rudder from the fuselage,


then setting it's origin to the point i want it to rotate about:


Note that the local Z-axis (blue) of the rudder does not coincide with the axis of rotation (red line). I now create a new transform orientation (called "rudder"), aligned with the desired axis of rotation:


Note how the blue Z-axis is now parallel to the leading edge of the rudder. THE PROBLEM IS: This is not the rudder's "local" transform orientation, about which the animations are evaluated. So I want to change that "local" orientation to "rudder".
 
What I can do is add an empty, align it to the "rudder" transform orientation, make it parent to the rudder and animate the empty (like Dutcheeseblend said). But for workflow reasons, I don't want to export the empties, so that is actually a bad option, and the animationsmay be "wobbly"...
 

Dutcheeseblend

Resource contributor
My apologies, the method with an parenting empty won't work:eek: Then the animation is exported as around the initial origin, not the empty's. So you get a rudder flying free around the aircraft.

Again, apologies, I would have bet that it worked...
 

Dutcheeseblend

Resource contributor
Better try this, could also work:
Create a cube, or plane or any mesh.
Translate it into any desired position.
Remove all verts from this object in edit mode.
Leave Edit mode and select the rudder.
Shift select the empty object you just made.
Ctrl+J, to join it, et voila.

But a lot of work...
 
That's a better solution.

Thx Dutcheeseblend! Why didn't I think of that in the first place? That's a lot easier than my workaround and it should work.

Cheers,
 
Thx Dutcheeseblend! Why didn't I think of that in the first place? That's a lot easier than my workaround and it should work.

Cheers,
I was just about to suggest that. There is another way, modify the mesh orientation in edit mode, then rotate in its local mode to the location you want. If you know the end result, this would be the easier method to work in while designing. If you have already completed the modeling, dutcheeseblend suggestion would be mine. There are currently 3 or 4 ways I know of to do this without delving into the console scripting.

Also, as you described with your rudder example, if you are using R then pressing the axis letter, just setting it to local does not manipulate the local variables using those commands. You would need to press Z twice (R + Z+Z ) would set to local modification of the Z axis (restricts along the Z axis, shift+Z+Z would restrict against the Z axis). As long as you are in object mode, it would change the local axis orientation without affecting the global and other object variables.
Just a note, there are a lot of blender scripts out there by 3rd parties that expand blender functionality. It just takes a little searching.
 

Attachments

Last edited:

Dutcheeseblend

Resource contributor
Is it by the way sure that the local animations will work properly? Just to inform, because I remember about a half year ago, local animations were buggy, but maybe it has been a fault of mine.

Just take care.
 
Is it by the way sure that the local animations will work properly? Just to inform, because I remember about a half year ago, local animations were buggy, but maybe it has been a fault of mine.

Just take care.
Yea, 2.67 and 2.67a if correct I remember had local issues. Its working fine for me in current version 2.69.
 
Script

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.
 
Last edited:
Top