5
$\begingroup$

I've been modeling an F-15, but when I rotate the flaps on Y-Axis the Flaps offset from the wing and they look like they are about to fall out, so I end up correcting it by rotating in the X and Z-axis to align them correctly.

However when I rotate them back from the Y-Axis they look distorted again because I did rotations on the X and Z axis. I tried riding it, no help. I saw something about custom orientation to fix it but that was not clearly explained and it was done on an ideal plane that was (0,0,0); mine is pre-rotated on all axis.

I'll take scripts if needed and I'm using Blender 2.8.

When I rotate it on the Y-Axis:

When I Rotate it on the Y-Axis

Fixing it using X and Z rotation:

Fixing it using X and Z rotations

Rotating it back on the Y distorted it again:

Rotating it back on the Y distorts it again

Here's the wing with ailerons and flaps:

$\endgroup$
4
  • $\begingroup$ have you parented them to bones? there should not be any difficulty $\endgroup$
    – moonboots
    Commented May 15, 2019 at 7:43
  • $\begingroup$ Yes I did, the same thing happens when I rotate the bone on Y $\endgroup$ Commented May 15, 2019 at 7:45
  • $\begingroup$ Could you please share just a wing so that we try on it? $\endgroup$
    – moonboots
    Commented May 15, 2019 at 7:49
  • $\begingroup$ Just did it. You can download just the wings now. $\endgroup$ Commented May 15, 2019 at 8:31

3 Answers 3

4
$\begingroup$

If you do it this way it seems to work:

  • Create a bone, in the Properties panel > Data > Display, enable X-Ray (called In Front in 2.8).
  • Put the bone along the aileron's axis. Use the shiftS > Cursor To Selected and the shiftS > Selection To Cursor to make sure the head and tail of the bone are on the exact positions.
  • If you want the bone to be displayed as B-Bone, go in the Properties panel > Data > Display (altctrlS to change its thickness).
  • Parent the aileron to the bone With Automatic Weight.
  • Select the bone, switch to Pose mode, create a first keyframe with i > RotLocScale.
  • In the Dopesheet go to frame 20, rotate the bone on its Y axis with RYY. Create a second keyframe.
  • The bone should make the aileron rotate correctly. You'll have to parent the bone to the wing bone (or whatever bone that will make the aileron stick to the plane).

enter image description here

$\endgroup$
0
2
$\begingroup$

Axis angle rotation.

Euler rotation lets us set a rotation based on local axes and an order. One of the flaps is pretty much y axis aligned and hence euler y rotation could be used. Note: really pays to set up parenting, eg flaps to empty, empty to wing. Align the empty such that an axis coincides with that of a flap.

However that little used other rotation type, Axis Angle enables you to set the axis of the rotation. The object will rotate on that axis direction passing through its origin.

A little helper script, since your objects have no rotation, can select an edge, that is parallel to axis of rotation, in edit mode and set the rotation axis from it. (as well as the mode to angle axis)

enter image description here

import bpy
from mathutils import Vector
import bmesh

context = bpy.context
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)

e = bm.select_history.active
if e and isinstance(e, bmesh.types.BMEdge):
    v = (e.verts[1].co - e.verts[0].co).normalized()
    ob.rotation_mode = 'AXIS_ANGLE'
    ob.rotation_axis_angle = 0, v.x, v.y, v.z

Once the axis is set, only the angle need be adjusted.

$\endgroup$
3
  • $\begingroup$ This helps a lot but I need precision and there aren't many edges that are exactly on the axis of rotation I want for the elevators and slats and rudders. But thanks $\endgroup$ Commented May 15, 2019 at 15:51
  • $\begingroup$ but, but, but they only need to be parallel to axis of rotation. The values can be taken from 3d cursor, or vertex locations to create axis vector. It would be the same precision as positioning a bone for instance. $\endgroup$
    – batFINGER
    Commented May 15, 2019 at 15:52
  • $\begingroup$ How about extendability, rigging the aircraft will make it easy to animate. But your way is perfect for making a still poses. $\endgroup$ Commented May 18, 2019 at 4:52
0
$\begingroup$

(Using Blender 4.2.2)

The proposed approach takes advantage that the rotation defined in the Object Properties > Transform panel is applied in the object local space.

Procedure to edit the aileron axis

In Object Mode:

Step 1 Initial configuration: the aileron origin is set on its rotation axis. Its axes are initially aligned with the world axes.

Step 2 Step 1: The aileron is rotated around Z axis until its leading edge is aligned with the world X axis. Save the value of the rotation angle (-7.06° in the demonstration).

Step 3 Step 2: Apply the rotation using the menu entry Object > Apply > Rotation. The Rotation Z angle is reset to 0.

Step 4 Step 3: The aileron is rotated back around Z axis changing the sign of the angle applied at step 1 (+7.06° in the demonstration).

Setup

Results 1. Flap and aileron are children of the wing.
2. Mobile surfaces are rotating around their local X axis.
3. Right wing mobile surfaces are driven by the values input for the left wing.
4. Drivers are built using Copy as New Driver (on left side) then Paste Driver (on right side) RMB menu entries.
5. The flap driver is a basic copy, of type Averaged Value.
6. The type of the aileron driver is changed to Scripted Expression to specify as Expression -rotation_euler.

Resources


(Blender 4.2.2+)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .