X-Plane / XPlane2Blender

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

Export animation that uses curve #591

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello. I have simple question - HOW?) Blender cannot bake animations created by curving in a curve. When exporting such an animation, the mesh does not move with a curved ribbon, but simply flies up, as if there were no curved. It is clear that it is not exported to .obj. What should I do then? I use the animation of the "conveyor belt" in the IVR aircraft instrument (Tu-144D).

tngreene commented 4 years ago

Hi, XPlane2Blender does not use Blender's advanced tweening or interpolation modes between keyframes or anything like that. It simply pairs Blender Location/Rotation and XPlane2Blender keyframes and X-Plane's animation engine does the work of animating.

I'm having a little bit of a hard time imaging what your model looks like, could you post or send me some screenshots of the ribbon?

I'll say this now - suppose you have a cube that starts at (0,0,0) and moves to (8, 0, 10). You want it to be a long curving motion. If you were to simply use 2 keyframes, start and end, it would appear linear. However, if you were to space out the keyframes and add more in between you could create a nice smooth motion. Then, if you experimented with the space between those inner frames you'd see a slowing motion between the frames!

You could use the F-Curve editor to get the smooth motion you want and insert keyframes so that Blender will have that data.

tngreene commented 4 years ago

Observe the motion of this cube. What I did was

  1. Make the start and end keyframes (0,0,0) and (8, 0, 10)
  2. Set the interpolation mode of the keyframes to bezier and dragged the handle to get a nice motion along the X-Axis
  3. (Since I only want fancy movement on the X-Axis, Z-Axis channel doesn't technically need any keyframes at all but they snuck in there)
  4. I make XPlane2Blender keyframes at the beginning and end of 0,0 and 1,0
  5. Now that Blender is all set up and calculating the values at each position I simply make a keyframe at some number of steps. (for instance 10 when the resolution doesn't have to be that important and 5 when the motion is really complicated)

I have no idea the performance implications of having an animation with that many keyframes, but, when shown in OBJ VIew, you get that nice smooth motion, and I didn't have to do any math for it at all!

curved_motion.zip

ghost commented 4 years ago

Here is a link to a video of the animation that I need to export: https://youtu.be/40i6YdJThW4

ghost commented 4 years ago

The difficulty in implementing the device is that the graph tape should be straight in the observation window, but inside the front cockpit panel there is limited space to make a rotating cylinder with the device graph image there. After animating the UV-mapping, as I understand it, it will not work either. How do other virtual airplane developers make such devices? I know they work in 3d max - are there more advanced export addons?

airfightergr commented 4 years ago

X-Plane obj8 supports only translations and rotations. There is no support for "deforming" meshes.

tngreene commented 4 years ago

Thanks for the response @airfightergr! I'm asking a co-worker now for advice

airfightergr commented 4 years ago

I think @bsupnik mentioned in the past that will be supported in the next obj spec, whenever that will happen.

tngreene commented 4 years ago

So, I asked my co-worker and he said that he once pulled a trick like this making a mechanical part that involved show hide animations.

You could make a flat ribbon of many strips, with the casing around the gauge hiding a portion of them. Without show hide it would look like a rectangle clipping through the casing and going into the dash. But, with show hide animations each strip gets hidden as it goes beyond the case of the guage. So, you get a long ribbon texture showing through the casing and nothing else.

"It'll be tedious as hell" - Alex.

Otherwise, some trick using PlaneMaker panels and/or plugins?

ghost commented 4 years ago

Well, I'll try the hide animation

tngreene commented 4 years ago

If you can't find a way with show/hide re-open this bug. Best of luck and I can't wait to see the finished product!

ghost commented 4 years ago

I tried it, but the scale still shows up all the time. For each segment of the scale, I installed 2 dataref channels (sim / cockpit2 / gauges / indicators / altitude_ft_pilot) - one channel moves the segment up and down the dataref value, the other should show a segment in the interval from and to the dataref value. Keyframes are also was set to these values. And if the tape in the sim moves up and down, then the hiding of the segments protruding beyond the frame of the device does not occur. Снимок экрана_2020-09-21_12-02-45

Снимок экрана_2020-09-21_11-44-53 Link of .obj: https://drive.google.com/file/d/1oCgklHBCvNQzLdmU-MQUSeAi-X97Q8lZ/view?usp=sharing

airfightergr commented 4 years ago

To work correctly you must use a pair of hide/show animations, not only show. Now you are telling X-Plane when to show, but not when to hide the part.

ghost commented 4 years ago

To work correctly you must use a pair of hide/show animations, not only show. Now you are telling X-Plane when to show, but not when to hide the part.

got it, thanks