When I use babylon exporter plugin in 3ds max 2018 to export model with skeleton animation to babylon file,the animation in babylon run incorrect.
This is the fbx and the max file.
There are two babylon exporter plugins.
This is new babylon exporter plugin for 3ds max2018.
The export setting is as follow.
This is the babylon.
The babylon file in sandbox is as follow.
This is old babylon exporter plugin for 3ds max2018.
The export setting is as follow.
This is the babylon.
The babylon file in sandbox is as follow.
Because the babylon file of new babylon exporter plugin is too large.
I want to use old babylon exporter plugin to export babylon file to get correct skeleton animation. Is there any method to achieve this goal?
cc @PatrickRyan, in case it would be related to some settings in Max / the exporter.
Also, have you been able to test in others glTF viewers (like https://gltf-viewer.donmccurdy.com/), to know if it’s a problem at export or rendering time?
glTF viewers can only acccept gltf and glb file but not babylon file.
Ah sorry, I didn’t understand you were exporting to a .babylon file!
What if you try to export to a .glb instead? Do you have some missing features when exporting to a .glb file?
I didn’t even know that the Max exporter could export to .babylon files…
I tried to export glb. Then get error “bones influences per vertex more than 4”.
Is this the reason lead to uncorrect animation in babylon file?
@xiaopangoo, there are two questions here so let me answer them in order.
If you want to install any prior version of the Babylon exporters, you can’t use the installer as that will always use the latest version. However, it’s fairly easy to install the exporter manually which is what we did before the installer was created. There are complete, step-by-step instructions in our docs to manually installing the Max plugin. To get the version you want, you can simply head to the repository for the exporters and find the previous version you want. There are many pages of versions, available, so you may need to search a little to find the exact version you want.
For the second question, limiting bone influences in a skeleton is something that is commonly done in real-time rendering. For pre-render you can push as many bone influences as you want because the only tradeoff is in render time. The film industry commonly uses eight influences from what I’ve heard, likely a balance between more control over mesh deformations and render time per frame. The final product will not be diminished by the longer render time per frame so it doesn’t matter if a bone has more than 4 influences.
For real-time rendering, however, many engines limit the number of influences per bone because of the overhead that generates per frame, and a lot of them use a limit of four. Babylon.js limits the number of influences to four for this reason. Most motion can be captured with just four influences and extra calculations per frame to determine the final vertex position aren’t needed.
The warning you got when you exported to glb should still be there when exporting to a babylon file, but maybe the console log looks different, or we are missing an error message. I can’t say for certain that losing extra influences per vertex would create the delta you show in your images because I can’t say for certain how your mesh is weighted. It seems unlikely unless you had a lot of influences per vertex. The quickest way to test would be to reskin your mesh with just an auto skin limited to four influences per vertex and export that to test. The weight painting won’t be as good as your current asset, but it would be a quick test to know if your influence number is causing the issue.
Note that Babylon.js now supports up to 8 weights per bone (I don’t know which is the first version of Babylon that added this support), as we have matricesIndicesExtra
and matricesWeightsExtra
as additional vertex buffers. Maybe the .babylon export uses these extra buffers?
2 Likes
I tried to reduce influence number to 4 and can export gltf file.
The fbx and max file is as follow.
With new plugin to export gltf, the pose is mostly correct expect hair, the animation is correct.
With new plugin to export babylon, the pose is correct,the animation is uncorrect.
With old plugin to export gltf, the pose is uncorrect, the animation is uncorrect.
With old plugin to export babylon, the pose is uncorrect, the animation is uncorrect.
First, I want to know how to use new plugin to get babylon with correct skeleton animation.
Second, I want to know how to use old plugin to get babylon with correct skeleton animation.
@xiaopangoo, I am able to repro your issue with this file so I am wondering if you can create a repro with a very simple asset. Simply a cylinder skinned to three or four bones that animate a simple bend back and forth. I want to be able to see if the method you are using for skinning and weighting can point us to a solution. If the simple asset can repro this issue, it is likely an issue with the exporter doing something wrong when exporting to a babylon format. If it can’t be reproduced with a simple asset, it points back to the more complex asset having an issue.
The reason I am asking you to create a simpler test asset is so that the process of creation and skinning is done the same way as I might do something differently than you when creating a simple asset which won’t point us to the answer.
Also, @srzerbetto, I looked at the character and skinning and it all seems reasonable. I am thinking that there may be an issue with saving skinning information to the babylon format in the Max exporter. I wanted to ping you in case you have an idea what may be going on even before seeing a simple repro. I don’t think any of the animation work @Evgeni_Popov has been doing would cause this issue unless something changed in the loader for glTF that wasn’t also changed for the babylon loader.
1 Like
@PatrickRyan
I tried Simply a cylinder skinned to three or four bones that animate a simple bend back and forth.
The max is as follow.
With new plugin to export gltf
With new plugin to export babylon
With old plugin to export gltf
With old plugin to export babylon
@PatrickRyan
I tried another Simply a cube skinned to three bones that animate a simple bend.
The max is as follow.
With new plugin to export gltf
With new plugin to export babylon
With old plugin to export gltf
With old plugin to export babylon
@PatrickRyan
I tried another model to export babylon with new Plugin. The babylon is correct.
The model is produced by maya,then exported to fbx, then open fbx in 3ds max, finally export to babylon, the skeleton animation is correct.
But when I tried to produce model in 3dsmax and directly export to babylon, the skeleton animation is uncorrect.
Is there any special settings in 3dmax can solve my problem?
What do you call “old” and “new” plugin in the .babylon export case? What are the versions you are using in both cases?
Clearly there has been some changes in this exporter that makes the export for the simple cube skinning fail in the newer version.
I’m not sure when 1.3.33 has been created because there’s no corresponding tag in the repo, but I can see a tag “1.4.2” which is from more than 4 years ago…
I’m afraid there had been too many changes during this time so that we are able to easily find why the current exporter does not generate the same file than the older one.
For context, here’s the diff between both versions:
@Evgeni_Popov @PatrickRyan
I konw V1.3.33 is too old, so now I don’t must to use this old plugin.
But when I use V20230608.5 or the the latest V 20230905.2 in 3ds max 2018, it can export correct gltf, but often can not export correct babylon file. The skeleton seems uncorrect.
Sometimes some model can get correct babylon file like
.
So I don’t what kind of model can be export to correct babylon file in 3ds max 2018.
Is there any special settings in 3dmax to export correct babylon file?
Unfortunately, I can’t really help you as I don’t know Max or the exporters…
We now rely on the community to maintain the exporters, as stated in the readme of the exporter repo:
The Babylon.js Exporters are no longer in active development. While the tools will continue to work for existing versions of Maya & Max (2022), we cannot guarantee that they will continue to work for future versions. If you are interested in helping us maintain these tools for future versions of Maya & Max, we'd GLADLY welcome the help, please contact us on the [Babylon.js Forum](https://forum.babylonjs.com/)
For alternative export options, please see this doc: https://doc.babylonjs.com/preparingArtForBabylon/dccToGltf
It looks like you’ve found a workflow that works (even if it’s a bit cumbersome), perhaps this is an acceptable workaround while waiting for the (eventual) fix in the exporter?
@xiaopangoo, if you are seeing your mesh imported from FBX to Max exporting to .babylon correctly, then my guess is that the stack is to blame. If you collapse your stack, it will bake everything to the asset. This means that you can’t go back and make changes in the stack - which is the strength of Max - but may be necessary. The Maya export to FBX may also be cleaning up some things in the original file (if you didn’t create the original) by removing things that aren’t supported by FBX that may be the root of the export problem.
Without in-depth knowledge of how the original asset was created, I am just guessing based on circumstantial evidence here. It would be very hard to point to an exact culprit without being able to see the entire creation workflow.
1 Like