Animated material cannot be added

Version: SDK 1.4.5

Frequency: Consistently

Severity: High

Context: Animation groups tool

Bug description:

When i try to add an animated material to the animation group i got an error message:

************** Exception Text **************
System.InvalidCastException: Unable to cast object of type ‘Autodesk.Max.Wrappers.Texmap’ to type ‘Autodesk.Max.IMtl’.
at MSFS2024_Max2Babylon.MaterialUtilities.IsMaterialAssignedInScene(IMtl mtl)
at MSFS2024_Max2Babylon.MaxMaterialView.AddMaterialFromSelection(IMtl material)
at MSFS2024_Max2Babylon.AnimationGroupControl.addSelectedButton_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Attachments:

The material is a standalone MSFS2024 material (standard) with animated Offset V coords (tire)

I have the same issue and was about to report it and found you added it today.

My bug is showing that only 2020 material is supported.

Hello @Lesco,

What is the 3DS Max version your are using ?


@Flysimware
Based on the window name we can see in your screenshot you are using the FS2020 Babylon animation group.

For MSFS 2024, you need to open the window named “Animation Group” (not Babylon animation group)

Regards,
Boris

1 Like

@Boris 3ds Max 2022

Hi @Boris

Interesting. I have the 2020 babylon group saved as a macro script shortcut and have been using it for many years now. So no wonder as I was not aware there was a second version or a 2024 version. I would have noticed if I opened it the normal slow way. I will make a new macro script today so I have one for each. Thanks.

Can we animate material alpha? And how? I am aware you can animate the rotation and offset under the material UV section. But I want to be able to make ice slowly fade away just like the GeoDecal Frosted melt does. The reason is we have several separate mesh for other types of systems that melt ice not just the structural deice system. Any tips would be appreciated.

My solution for now is we are making 5 ice meshes that have less and less ice and then using logic to swap them over a few minutes and then show none. This is better than our current visibility where we just hide the ice as soon as you turn on the nacelle engine de-ice switch.

Hello @Lesco ,

What are your exact repro steps ? what type of material is assigned to your mesh ? what are the parameters you have animated ?

Thank you

Hi @Yasmine its a standard MSFS2024 material (animated tire texture) with BC, ORM and Normal textures. The animated parameter is the “Offset V” UV coord in 5 frames (0, 0.25, 0.5 …1)

Hello,

I still can’t repro your issue with your informations..

Can you send us an example scene ?

Thank you

Hi @Yasmine, I was afraid that the scene I was working on or the 3dsmax might be corrupt.

So I did a few tests with the wheel tire mesh and its anim:

  1. In the original scene, I deleted all animation keys and the hierarchy of the mesh, and I got the above error message when i try to add the animated material. So its not working…

  2. saved the tire mesh only with material on it and merged the mesh only in a total empty 3dsmax. Then created the animation and added the material. All seems good…

  3. Open the scene with the tire mesh only, tried to add a new animation but it doesnt work. Error message again.

  4. Merge the whole scene from the original file into a new empty 3ds max. Its working again…

So i dont understand anything… Seems the original scene is corrupt but the content of it is not. Its working when i merge and doesnt when i open.

attached the scene with the tire:

tire.zip (835.6 KB)

Hello,

Tagging this bug as obsolete since it’s related to the scene itself and not the exporter.
Feel free to ping us if you have a way to reproduce the issue in a new max scene.

Regards,
Boris

Hello @Flysimware,
If you need assistance please create a dedicated topic in [MSFS 2024] Questions & Community Discussions or [MSFS 2024] Bug Reports if it’s related to a bug.

Regards,
Boris

1 Like