X-Plane / XPlane2Blender

Scenery & Aircraft export addon for Blender and X-Plane
GNU General Public License v3.0
197 stars 67 forks source link

Propeller animation #365

Closed Hueyman540 closed 6 years ago

Hueyman540 commented 6 years ago

Hi there,

I already succeeded to do this once or twice ... But can't really remember exactly how, it was after many trials.

I wanted to install my own prop on an X-Plane A/C. So I opened the .obj under AC3D, deleted the prop mesh, then in X-Plane 2.79 and XPlane2Blender, I animated mine without bones first and then with.

Using two frames, 1 is 0 and 2 is one. I applied rotation keyframe, then used

When exporting, the prop doesn't spins. With a different dataref, it would turns very slowly according to actual RPM, but would never do a full revolution.

I'm not sure :

Your help would be much appreciated !

Thank you

tngreene commented 6 years ago

Thanks for submitting this bug!

Although your description was very detailed, I'm having a hard time visualizing this object. Would you be willing to make a .blend file with just the prop in it with the animations you're trying to make?

You could attach it here or e-mail it to me privately.

Hueyman540 commented 6 years ago

Hello dude !

Thanks for your support.

Here is the .Blend

http://pasteall.org/blend/index.php?id=49996

Let me know,

Valentin


De : tngreene notifications@github.com Envoyé : mardi 24 juillet 2018 17:54:30 À : der-On/XPlane2Blender Cc : Hueyman540; Author Objet : Re: [der-On/XPlane2Blender] Propeller animation (#365)

Thanks submitting this bug!

Although your description was very detailed, I'm having a hard time visualizing this object. Would you be willing to make a .blend file with just the prop in it with the animations you're trying to make?

You could attach it here or e-mail it to me privately.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/der-On/XPlane2Blender/issues/365#issuecomment-407457469, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGAsroR-sxAGCUa91qToMjv6Ggf7IQ4Qks5uJ0M2gaJpZM4Vc3q3.

tngreene commented 6 years ago

Alright, I have some feedback. Firstly, great looking Propeller! Super cool! Secondly, there are a few categories of problems here. So, here is some easy stuff.

tngreene commented 6 years ago

Now for the tougher part. Regretably this is not well documented, but, if you look at the README you can see an example of a whole Microjet someone made.

XPlane2Blender requires Blender Keyframes and Dataref Keyframes for each Blender Mesh (or Light or Empty) or Blender Pose Bone you want to animate. It pairs those together, per object and produces the animation table. Per object is important because it is not per object and whatever its children are.

I see your Armature has Blender Keyframes and Dataref Keyframes for the dataref sim/flightmodel/engine/POINT_prop_ang_deg. Although I'm not sure the use of POINT_prop_ang_deg (you really could be right to use there! I'm a bit confused as to how this is trying to work is all), it will animate.

Its *child Hub, however, only has the dataref sim/flightmodel2/engines/prop_no_disc_rotation_angle_deg. Only the dataref, no keyframes of any kind. And no index for that dataref. All of the Blades are similarly lacking in keyframes.

Hueyman540 commented 6 years ago

Hello dude,

Thank you ! Yeah it's large, it has no impact on frame rate with current optimiosed engine, even though I know it could be optimised ( but for no valid reasons ). I did the Hamitlon Standard 24E60 Hub in a CNC


De : tngreene notifications@github.com Envoyé : mercredi 25 juillet 2018 00:27:00 À : der-On/XPlane2Blender Cc : Hueyman540; Author Objet : Re: [der-On/XPlane2Blender] Propeller animation (#365)

Alright, I have some feedback. Firstly, great looking Propeller! Super cool! Secondly, there are a few categories of problems here. So, here is some easy stuff.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/der-On/XPlane2Blender/issues/365#issuecomment-407572337, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGAsrtsQtua6jMq9DSz-1BqlcTpL53X1ks5uJ580gaJpZM4Vc3q3.

Hueyman540 commented 6 years ago

Hello dude,

Thank you ! Yeah it's large, it has no impact on frame rate with current optimiosed engine, even though I know it could be optimised ( but for no valid reasons ). I did the Hamitlon Standard 24E60 Hub in a CNC program that's why !

Okay, I'll take a look at this, thank you very much for your input.

Valentin


De : tngreene notifications@github.com Envoyé : mercredi 25 juillet 2018 00:41:27 À : der-On/XPlane2Blender Cc : Hueyman540; Author Objet : Re: [der-On/XPlane2Blender] Propeller animation (#365)

Now for the tougher part. Regretably this is not well documented, but, if you look at the README you can see an example of a whole Microjet someone made.

XPlane2Blender requires Blender Keyframes and Dataref Keyframes for each Blender Mesh (or Light or Empty) or Blender Pose Bone you want to animate. It pairs those together, per object and produces the animation table. Per object is important because it is not per object and whatever its children are.

I see your Armature has Blender Keyframes and Dataref Keyframes for the dataref sim/flightmodel/engine/POINT_prop_ang_deg. Although I'm not sure the use of POINT_prop_ang_deg (you really could be right to use there! I'm a bit confused as to how this is trying to work is all), it will animate.

Its *child Hub, however, only has the dataref sim/flightmodel2/engines/prop_no_disc_rotation_angle_deg. Only the dataref, no keyframes of any kind. And no index for that dataref. All of the Blades are similarly lacking in keyframes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/der-On/XPlane2Blender/issues/365#issuecomment-407575342, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGAsrrl4i0Ci5jLP0PPLoSxdrS2Iq_4cks5uJ6KXgaJpZM4Vc3q3.

tngreene commented 6 years ago

So, were you able to fix this and get the animation you wanted?

Hueyman540 commented 6 years ago

Hello dude !

Thanks for your interest !

Not yet, I'm stuck with wonky axis animations...

You know, I have a four blade prop, and two blades ( opposite, like the top 0° and bottom 180° ) blade are spinning around their pitch axis properly, but the two others do strange stuff, spins around weird axis.

On keyframes, I used LocRot for all blades, then rotated witth blade local axis thanks to an empty that helped me get the exact local axis ( because frame 1 is prop straight ( top blade 0°, right one 90°, bottom 180 ° ) and the second frame for make it turn is 1 ° offset, so I have to deal with that for pitch changing animation at frame 1.

If you have any idea how to this properly, I'm totally lost ..

Thanks

Valentin


De : tngreene notifications@github.com Envoyé : jeudi 9 août 2018 16:16:40 À : der-On/XPlane2Blender Cc : Hueyman540; Author Objet : Re: [der-On/XPlane2Blender] Propeller animation (#365)

So, were you able to fix this and get the animation you wanted?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/der-On/XPlane2Blender/issues/365#issuecomment-411773365, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGAsrvNEL24Dh0BtAzdDlGAFIHyXeU_dks5uPERIgaJpZM4Vc3q3.

tngreene commented 6 years ago

If you could post another .blend file like you did before, or e-mail it to me, I'd be glad to take a look! I'm guessing its some small thing in the wrong place, because it sounds like you've got a very good idea of what it should look like in the end, however it could be a bug! You never know where they're going to show up unless you really confirm its just an authoring issue.

So, this is indeed important to investigate: not just for helping out our users but also for the product itself!

Hueyman540 commented 6 years ago

Hi dude,

Yeah, for sure, please take a look http://pasteall.org/blend/index.php?id=50130

Valentin

Provenance : Courrierhttps://go.microsoft.com/fwlink/?LinkId=550986 pour Windows 10

De : tngreene notifications@github.com Envoyé : Saturday, August 11, 2018 4:03:36 PM À : der-On/XPlane2Blender Cc : Hueyman540; Author Objet : Re: [der-On/XPlane2Blender] Propeller animation (#365)

If you could post another .blend file like you did before, or e-mail it to me, I'd be glad to take a look! I'm guessing its some small thing in the wrong place, because it sounds like you've got a very good idea of what it should look like in the end, however it could be a bug! You never know where they're going to show up unless you really confirm its just an authoring issue.

So, this is indeed important to investigate: not just for helping out our users but also for the product itself!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/der-On/XPlane2Blender/issues/365#issuecomment-412291902, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGAsrmOw76fW1QCzr-O5BzO3jn52pulzks5uPxx4gaJpZM4Vc3q3.

tngreene commented 6 years ago

I just wanted to say that this hasn't been forgotten! I'm currently asking some of our artists to look at it when they are able to. Hopefully that will be soon.

tngreene commented 6 years ago

Okay, so, I think know what the problem is! I don't think D9511F.000 and D9511F.003 are properly animated - they are rotating around the same axis as the hub. You can see this more easily if you mute the Hub's animation (open the Dope Sheet and click the Mute button next to Hub's Rotation channel.).

What I am guessing you did was you made 1 blade, stuck straight up, copied it 3 times, rotating them in place, then attempted to animating the by 1 degree for all of them.

Look at D9511F.000 from the side and D9511F.002 from the top very closely. You'll see D9511F.000/003 rocks up and down, not twisting back and forth! .001/.002 can simply be rotated by 1 degree around the Z-Axis because the blade was modeled up and down it and it will look right.

Euler XYZ rotation mode works by rotating x degrees along the X axis, then y degrees along the Y axis, then z degrees along the Z axis.

To have the .000/.003 blade's vertices be modeled as straight up and down, but be shown as on the side and twisting would require more than your 90 and 91 degrees of rotation along the Y axis. Play around with the rotation tool and see at the values Blender comes up with. Yikes! In addition, you have also have a performance decrease! To always have to rotate the vertices of the blade into position, then rotate to twist them (in reality it would be quiet complex to make it look right, not something you'd want to figure out by hand) is a waste of time.

Two solutions:

  1. Edit the mesh for .000/.003 (or do it once and copy and paste it), select everything and prerotate it into position in edit mode. Now you truely can rotate one degree along one axis, just like .001/.002! You'll also reduce the amount of animations needed. Pro Tip: Moving the vertices so the base of the blade is at the origin may help in positioning them. That's just a tip.

  2. Keep the meshes where they are and use Axis Angle instead of Euler XYZ. Use the Rotate tool to set the degrees of rotation, and Blender will figure out that special axis that makes it all work. XPlane2Blender figures it out too, but it won't be as optimized.

See if that helps!

tngreene commented 6 years ago

(Also, as a quick rule, make the most simple rotation as possible. A rotation of 0,91,0 is effectively the same as 90,91,90. The simpler animation is easier to debug and performs better.)

Hueyman540 commented 6 years ago

I succeed to do it properly before on other prop/planes but it seems more of a luck than a working method..

Maybe you can edit the .blend to show the exact stuff that needs to be done, or show a simple example with basic meshes ?

Thanks,

Valentin


De : tngreene notifications@github.com Envoyé : jeudi 16 août 2018 19:42:54 À : der-On/XPlane2Blender Cc : Hueyman540; Author Objet : Re: [der-On/XPlane2Blender] Propeller animation (#365)

(Also, as a quick rule, make the most simple rotation as possible. A rotation of 0,91,0 is effectively the same as 90,91,90. The simpler animation is easier to debug and performs better.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/der-On/XPlane2Blender/issues/365#issuecomment-413627674, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGAsrstMIAqN374R02owjoUDASp_uejKks5uRa8dgaJpZM4Vc3q3.

tngreene commented 6 years ago

example_of_solutions.zip

This contains 4 "blades", simple twisted cubes. The original shape which was copied and pasted, a copy of .000, and an example of my 2 solutions. Its not the most clean and precise, but it illustrates the principles.

tngreene commented 6 years ago

How's it going? Did you find the examples useful?

tngreene commented 6 years ago

If you still need help, please re-open this or e-mail me. I hope your animation is going well!