• 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 to FSX - Skinned meshes mini-tutorial

Hello guys :)

The latest release, which hopefully resolves all the issues with skinned meshes, is out! Here are some tips concerning skinned meshes:
  • Constraints
First off, I have re-implemented the use of constraints into the exporter, as the "Bake action" function in Blender acts a little awkward. This way, you can simply add your constraint to the bone and let the exporter take care of placing the keyframes correctly.
  • Linear interpolation type
It is important now to set the interpolation type of your actions (animations) to Linear. The simulator uses this type by default, so there is nothing we can change about it, and if we want to see the same animation in Blender as in the sim, the interpolation type has to be set to Linear. Before v0.8.1 this didn't matter much, 'cause the exporter wrote a keyframe for every frame anyway and thus accurately depicted what you saw in Blender. I have changed this behavior to reduce the .MDL file size.
  • Rest position = undeformed mesh
The undeformed mesh corresponds to the rest position of its deforming armature, not any of its posed positions. What will get exported is always the mesh in rest position. Sometimes, this will differ from what you see in Blender, i.e. when you pose a bone in a position that is not its rest position and animate it relatively to that pose.
  • Don't parent armatures!
Don't make an armature parent of objects. Remember: bones don't need to be in LODs. Actually, bones can drive animations across multiple LODs at the same time! SO, don't bother including armatures in your hierarchy, they are not exported anyway and will only cause troubles. What matters is the internal hierarchy of the armature, i.e. the bone hierarchy.
I excluded armatures from export because of the "22 connected bones" limit in FSX, which made it practically impossible to have more than 22 bones in one armature. Without armatures, FSX sees the root bones of the armature as "free". Dutcheeseblend might find this useful with the cowl flaps of his Fokker T.5.

If anything more comes to my mind, I will post it here. Til then...

Happy blending! :)
 
Ok, had a first try and something failed. What can it be? Oh, and how can I conclude from these lines what the error might be?

Case I:

So, this is the result when I export the file (like I sent you Felix, a few days back), with the TW armature tagged, selected and within the LOD, armature modifier selected on the tailwheel, checked 'Skinned mesh' in the export options.

Code:
Traceback (most recent call last):
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\__init__.py", line 138, in execute
  Exporter = export_fsx.FSXExporter(self, context)
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 162, in __init__
  AnimationGenerators = self.__GatherAnimationGenerators()
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 715, in __GatherAnimationGenerators
  None, Object, self.modeldefTree))
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 1839, in __init__
  self._GenerateBoneKeys()
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 1862, in _GenerateBoneKeys
  framerange = int(animtag.attrib['length'])
AttributeError: 'NoneType' object has no attribute 'attrib'

location: <unknown location>:-1

Case II:

Tried it without selecting the armature modifier, with the TW armature in the LOD and selected, 'Skinned mesh' UNchecked. Got this:

Code:
Traceback (most recent call last):
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\__init__.py", line 138, in execute
    Exporter = export_fsx.FSXExporter(self, context)
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 74, in __init__
    ob.Children.append(ExportMap[child])
KeyError: bpy.data.objects['Armature_TW']

location: <unknown location>:-1

Case III:

Without the armature selected, armature out of the LOD, unchecked 'Skinned mesh' on export.

Code:
Traceback (most recent call last):
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\__init__.py", line 138, in execute
    Exporter = export_fsx.FSXExporter(self, context)
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 162, in __init__
    AnimationGenerators = self.__GatherAnimationGenerators()
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 718, in __GatherAnimationGenerators
    None, Object, self.modeldefTree))
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 1684, in __init__
    self._GenerateKeys()
  File "C:\Users\A.H.T. Kaasjager\AppData\Roaming\Blender Foundation\Blender\2.72\scripts\addons\io_scene_fsx\export_fsx.py", line 1704, in _GenerateKeys
    FCurves = BlenderObject.animation_data.action.fcurves
AttributeError: 'NoneType' object has no attribute 'fcurves'

location: <unknown location>:-1

I'm sorry that I can't read error messages...:oops:
 
Hi Daan,

Case I: The error is from line 1862 in export_fsx.py. Looking at the code in the vicinity of that line, you can tell that it comes from a bone with constraints and no animation tag applied. Bones with constraints move, so they need an animation tag. However, when I run your file as it is, with only an armature modifier added to Main_tailwheel_strut, I get no errors.

Case II: A case I had not envisioned. Thanks for finding that. Resolved in the next release.

Case III: Some object has an animation tag, but is not animated. This is the case when you have an object with constraints. It isn't animated by itself, it follows a constraint which is not written into its animation_data. But I can't find any such objects in your file.

Try this: Add armature modifier to Main_tailwheel_strut, select only Armature_TW and Main_tailwheel_strut and export selection with skinned mesh checked.
 
Ok, I found already a Case III object. The inner door part is another part than the door itself, it was not animated but it was tagged yet.

And yes, it now works! Whoohooo! Got my skinned animation of the tailwheel! Thanks Felix, now get yourself a beer ;)
 
... the problem is: Bones are only exported if you select the "Skinned mesh" option in the exporter. Bone is not exported -> Animation is lost. That's why you have to tag all the objects that do actually get exported. It is a bit complicated, but that's the way it is at the moment....

Hello everyone,

As explained in a previous post, with the old version of Blender2FSX, my landing gear animation work very well (all parts/objects tagged - no-tagged armatures, skinned mesh non checked). With version 8, I get the following message:


9w2rcuVzgXPGRTKxYHQua7-zxJoT78nD7wdPyWBIy7UHOF-6ZwXUM10_cweQSK-UPhmp_wxL1fU=w1242-h759


What is the solution to my problem?

Thank you for everything
 
Last edited:
@Chrismot: in order to display images correctly from Drive, locate the tab 'Details' next to 'Activity' when checked any image. It's on the right pane on the screen. There, in the bottom, find the 'Hosting' link an put that link into an image here.
 
Well, performed my 'cowl-flap-test' and it works fine, until you exceed 22 bones. That's it. Limit still present...

Important to note: you should have a bone for the non-moving vertices too!
Example on this: my 24 cowl flap movables are part of the nacelle (cowling, wheel bay). If I export only a part of these flaps (so I remove a number of bones from the armature, but keep the complete mesh), only the rigged flaps show up. Therefore I needed to create a separate, non-moving bone for the remainder of the nacelle. That worked out fine, now my complete nacelle AND animated cowl flaps show up and work in FS.

Problem at the other hand: I could reduce from 24 flaps to 22, but not more. And I had to add an extra bone, so I should get creative :D

Edit: the export goes fine, but the .x and .xanim won't be converted to .mdl.
 
Well, performed my 'cowl-flap-test' and it works fine, until you exceed 22 bones. That's it. Limit still present...
Did you check the parent relationships of the bones? They all need to have no parent at all.

Important to note: you should have a bone for the non-moving vertices too!
Yes! Very important. I already noted that in a post to kowal5376, but it can't be emphasized enough: static vertices need a static bone!

Let me check something and get back to you.
 
Hello everyone,

As explained in a previous post, with the old version of Blender2FSX, my landing gear animation work very well (all parts/objects tagged - no-tagged armatures, skinned mesh non checked). With version 8, I get the following message:

What is the solution to my problem?

Thank you for everything

Here is the link for the image that refuses to directly display ... !!! With apologies ...
 
@Dutcheeseblend

Hi Daan,

You are right, the 22 bone limit also applies per object. I set up a rudimentary nacelle similar to yours with 24 cowl flaps and 25 bones and it didn't animate in FSX. I then separated 3 cowl flaps into a new object, exported the two nacelle objects and the armature and it worked! And the best thing is: according to MCX, the whole thing is still one draw call, not two :D

@Chrismot
You are encountering Case II described by Dutcheeseblend above. It's a problem that will be resolved in the next release, which will be out very soon. Bear with me...

Cheers :)
 
Did you check the parent relationships of the bones? They all need to have no parent at all.


Yes! Very important. I already noted that in a post to kowal5376, but it can't be emphasized enough: static vertices need a static bone!

Let me check something and get back to you.

i have never been able to get my bear to animate in FSX (fine in blender). i used automatic weighting, i didn't to try to animate every vertex by hand like in the first tutorial video. is that my problem? does the FSX animation work at all with meshes that are rigged using automatic weights?

thx steve
 
Back
Top