• 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.

MSFS Blender cloth simulation baked to bones

I wrote some more scripts which now need nearly no manual clicking, weight painting etc. anymore. I will definitely share them but until now I cannot get a corrrect animation working. And so I'll wait until this is fixed.

Could somebody of you help me what is wrong? The flag gets "exaggerated" and too long.
I attached the files (.blend and also the xml)

test3.gif


1617722589481.png
 

Attachments

  • Karlo_EDSP_Flag_Try.zip
    1.3 MB · Views: 32
Hey This is awesome! Perhaps I'll attempt it soon! I'm in the process of making steam locomotives and needed a way to make the rope for the bell to swing appropriately! This may be my answer!

Thanks!
 
Has anybody solved the distortion problem? After some experimentation, I can avoid/minimize distortion when the bones have no translations (rotation, scale, location have been cleared or are 0) in frame 0. However, it appears that any animation in MSFS starts at frame 0. So every loop the animation jumps as starts with an erect flag without any translation and then shows the waving animation. Needless to say this is not acceptable.
 
To fix the distortion with animations, check the "Do channels contribute to result" checkbox for each animation in the NLA Editor (circled in the screenshot below) before you export to gltf. This simple checkbox seems to solve the problem and result in great looking animations in MSFS.

Screenshot 2021-04-22 135047.png
 
To fix the distortion with animations, check the "Do channels contribute to result" checkbox for each animation in the NLA Editor (circled in the screenshot below) before you export to gltf. This simple checkbox seems to solve the problem and result in great looking animations in MSFS.

View attachment 72460

For me this was checked by default - and the export wasn't fine :(
 
Good news. I have fixed your flag, @karlo922. See the attached.

I added a second NLA animation called Default_State and exported with the "Do channels contribute to the result" checkbox checked for the Default_State animation (it does not hurt to have the checkbox check for other animations, but it seems to be required for Default_State). The Default_State is the "unposed" armature: scale, location and rotation are 0. I saw that Asobo used this with its Windsock and tried it with my flags (see my screenshot above). Asobo used a three frame animation for the Default_State. I am not sure if three frames are required or not, but I suspect that MSFS is looking for a Default_State animation when initializing the model.

In conclusion, it appears that, with Blender, you need to do two things to avoid distortion:
  1. Add an animation named "Default_State" which is the armature without any scale, rotation and location.
  2. Check "Do channels contribute to the result" checkboxes checked for the Default_State animation.
I am curious if others will get the same results. I am getting correct results consistently, now.
 

Attachments

  • Clements_EDSP_Flag_Try.zip
    1.4 MB · Views: 20
Asobo used a three frame animation for the Default_State. I am not sure if three frames are required or not, but I suspect that MSFS is looking for a Default_State animation when initializing the model.
It's needed - I tried with only one frame and it was distorted again.
 
Good news. I have fixed your flag, @karlo922. See the attached.
Would you be so kind as to look at my file as well? I'm battling this animation for several days now and no matter what I do - it's distorted. I'm missing something simple most likely. Animation looks fine in Blender, but all I'm getting in the sim is this:
1619280951677.png

I've made it all a child of Empty, and created the Default_State 3 frame animation, resetting the armature pose and making 3 keyframes from location/rotation/scale. And still all I are monsters.
 

Attachments

  • Briefcase.zip
    1.7 MB · Views: 5
Has anyone yet created an animated flag that turns with the wind direction, and changes animation based on strength of the wind, and which you are willing to share with us mere mortals who lack the Blender skills to create our own such flag from scratch? I have read this thread and every other bit of information I can find, at least a hundred times, and have spent hours in Blender trying to replicate what you have done, but I am not there yet. I can create very nice cloth animations in Blender, but do not have the vaguest idea of how to "bake it to bones", much less export the whole mess to MSFS. If nobody has a flag that they can share, then I will keep beating my head against this problem until I figure it out. But it seems silly to reinvent the wheel if one or more of you has already mastered it. Thanks.
 
@trfsd, here is a link for both a Blender file and a SimObject. A few notes about this file:
  • This is a SimObject, not a scenery object. To place in MSFS, copy the folder under PackageSources to your project's PackageSources and then add a SimObject Asset Group to your project. The OutputDir should be SimObjects\Misc\Windsox_Flag\. You could do the same thing in a scenery object, the XML would just be a little different.
  • This example also contains different animations for different windspeeds. I do not think it is not necessary to add as many speed animations. I did it as a test and it seems like it is overkill. You could probably use half as many animations.
  • I am using the FBW exporter to get from Blender to MSFS. So, my materials may be different and will not work if you are using Blender2MSFS.
Orienting the flag to the wind direction requires two things:
  1. Create an "Orientation" animation. This does not require bones. You simply rotate an object around an axis. In the attached example, I rotate around an Empty that is the parent for both the flag and the armature. To create the animation:
    1. Insert a keyframe at frame 0 with the Z axis at 0 degrees
    2. Insert a second keyframe at frame 360 with the Z axis at -359 degrees.
    3. Set the interpolation to Linear. To do that, select both keyframes, press T and then click "Linear".
    4. In the Action editor, I recommend renaming the action to "Orientation".
    5. Click the Push Down button to create an NLA strip.
    6. Rename the NLA strip to "Orientation".
  2. Code the animation in MSFS. In the model's XML file, you'll need to add a Behaviors tag that looks like this:
Code:
<Behaviors>

    <Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml"/>

    <Component ID="Windsox_Flag">
        <UseTemplate Name="ASOBO_WindDirection_Template"/>
        <!-- Animation name should be set to Orientation -->
    </Component>
        
</Behaviors>

I hope this helps. Please understand, I am providing this as an example. It may not be the "official" way of doing all of this but it works for me. And, it is provided without warranty or support.
 
Would you be so kind as to look at my file as well? I'm battling this animation for several days now and no matter what I do - it's distorted. I'm missing something simple most likely. Animation looks fine in Blender, but all I'm getting in the sim is this:
View attachment 72548
I've made it all a child of Empty, and created the Default_State 3 frame animation, resetting the armature pose and making 3 keyframes from location/rotation/scale. And still all I are monsters.
@RomanDesign, just looking at it in blender, I'd apply all transformations (CTRL-A) to the Armature. It's x rotation is 90 degrees and its scale is 0.100 on all axes. I suspect this is the main issue.
 
@clements and @karlo922 , are you creating all of the bones, vertex groups, etc. manually, or do you have a working script to automate some of the tedious work of creating the armature?
I wrote some scripts for it and clements is just checking them out. I will fine tune them and write a small documentation how to use them. But give me some days to finish it.
 
For creating the armature itself I don't have a script. But this is actually also very easy.
Set snapping to "vertex". Just start top left, use "e" to extrude while holding CTRL to snap to the next vertex and do this for until you reach the last vertex in the first row. Then just select all bones. SHIFT + d to duplicate, CTRL to snap one row down. Repeat until last row.

My scripts are doing following:
1. Create Vertex group for each vertex of the plane
2. Assign bone constraints to each vertex group
3. Do the weight painting after baking the animation
 
Top