Babylon.js cannot export due to Newtonsoft.Json

Hi! I’m new to Babylon! Whilst exporting a model, I got this error at the bottom in relation to ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’. Any idea how to fix this issue?

"Export started
Saving Maya file
Selected nodes full path
DAG: full
DAG: relevant
Exporting nodes
Capsule_Top_Logo
no morph targets
mFnMesh.fullPathName=|Capsule_Top_Logo|Capsule_Top_LogoShape
Mesh Capsule_Top_Logo has more than 65536 vertices which means that it will require specific WebGL extension to be rendered. This may impact portability of your scene on low end devices.
Mesh Capsule_Top_Logo has 95404 vertices. This may prevent your scene to work on low end devices where 32 bits indice are not supported
95404 vertices, 150112 faces
BabylonExporter.Mesh | done
Capsule_Top
Capsule_Bottom
Total meshes: 3
No camera defined
Total lights: 0
Exporting materials
Export cancelled: Could not load file or assembly ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’
at Maya2Babylon.BabylonExporter.Write(BabylonScene babylonScene, String outputBabylonDirectory, String outputFileName, String outputFormat, Boolean generateManifest)
at Maya2Babylon.BabylonExporter.Export(ExportParameters exportParameters)
at Maya2Babylon.Forms.ExporterForm.d__32.MoveNext()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]."

cc @srzerbetto

I’m taking a look

1 Like

@cvvv , what Maya version are you using?

Maya 2023

Can you check if there is a “Newtonsoft.Json.dll” file at “C:\Program Files\Autodesk\Maya2023\bin\plug-ins”?

Yep. The file was there. I was wondering if I could scour around to try to replace it with a newer version of the file, but it also didn’t work.

Yep, the file should be installed with the plugin (it is part of the package). Have you tried uninstalling it completely and re-installing using the latest installer?

Ok, so I reinstalled it and now it works, but none of my materials show up and the object seems to not show up entirely in three.js (code seems fine since the gltf viewer site I use has the same visual itself).

Can you provide a sample asset?

Would the gltf file be ok? Or would you need it and a mayabinary?

The maya binary would be better.

Huh. says “new users cannot upload attachments” on this forum. Is there a better way to send it to you?

Any shared folder would be ok like onedrive, and the likes of it

Does the link work?

I just requested access

Should be all set on that. Can you access?

Yep, just got it. I will do some investigation on the file.

2 Likes

@cvvv , I’m able to export you model as a GLB and I’m able to load it using https://sandbox.babylonjs.com. I see 4 materials there, but the GLB seems to have some validation issues, maybe this is a problem for thee.js when parsing the file. I’m investigating to see if we can prevent the generated glb from having validation issues.