Morph animation pivot position

Hello guys.
I am trying to use morph animation from an imported glb model but I am having an issue where the paper change its position but the pivot stay the same and the bounding box stays the same this is a video of what I am talking about:

I just want to make sure that the paper stays in the same position while the morph animation play.

Can we see your model? While you provide it to us I’ll tag @PatrickRyan who might have a notion of what’s going on.

Yes, sure this is the link for the model

@Mostafa_Salloum, the reason you see the bounding box remaining in place is that the bounding box is not affected by deformation animation data such as animation from skinning or morphs. The bounding box is where the mesh lives in the scene before the skinning matrices and morph displacement is applied.

What I see with your morph targets is that there is a translation on all of the vertices as the morph plays. With no weight on any influence, this is what we see:

Moving the first influence to a weight of 1.0 we see translation on the vertices along with deformation (I have not moved the camera at all:

Moving the second influence to 1.0 and the first to 0.0, I see similar translation and what looks to be an identical morph.

Placing both influences at a weight of 1.0 produces an expected double transform if both morphs are identical:

If you are not seeing this in your authoring package, then there is a problem with your glTF export/conversion. Can you give us some details about the tools you are using to create your morph targets and how you are exporting to glTF? Can you share your original model with us if it is built in Blender, Maya, or Max (I don’t have other packages, but I can get access to Houdini if necessary)?

1 Like

Hello @PatrickRyan thank you for your reply
i am using 3dmax 2021 to build my model
i noticed those warnings in the exporter


but i dont know what do they mean.

those are the two models one exported one max file
is it an exporter problem so like if i download the new max version would it work?
thank you.

@Mostafa_Salloum, after hammering on this for a large chunk of the day, I am have some things that will help your files in the future, but also I think there is a bug in the exporter somewhere.

For your file, I noticed a couple things to keep an eye on. The first is that your morph meshes had animation on the bend modifier, which can mess up your morph targets depending on where the playhead is when you reload your morph meshes in the morpher modifier. It’s best to make sure your morph meshes are in the pose you need each one and they don’t change from there. The other thing I noticed is that your paper model has a lot of n-gons in the mesh due to the perforation modeled into the plane. Any of the vertices that are added and do not connect through an edge to the bounds of the mesh are creating faces with more than 4 vertices. This needs to be triangulated when rendered in engine, and with n-gons, the triangulation can cause some unexpected geometry and can affect the deformation. In this case, odds are low that it will cause major artifacts, but you might see some rendering artifacts based on some of the triangulated edges.

In terms of the problems in export, I ran a bunch of tests using FFD lattice deformers on a cube at the world origin and had success with that type of morph. But using FFD lattices on a plane, on a very thin cube similar to your page with a slight amount of thickness, and bend deformers on both, all produce very similar results to what you have. I tried rebuilding what you had. I also tried removing all n-gons in your file and redoing the morphs and none of that produced anything different.

I then went to Maya and recreated the plane mesh with two bend deformers on the morph targets to simulate what was done in Max. Exporting this in Maya worked just fine. So there is an issue going on with the Max exporter, even the latest build. I will raise the issue with the team to see what we can do with it.

A workaround would be to use a skeleton to deform the page bend rather than morph targets. The issue is that we are no longer funding future development of the exporters anymore. We should be able to work on bugs, but I don’t know how fast we can get to it with the release of 6.0 coming. If I find out anything major, I will ping back to this thread.

2 Likes

Hello Patrick, thank you alot for taking the time to check the bug i really appreciate it, i will try to do what you suggested and i hope it will work out, if it didnt i have other option where i import the model with its targets to babylon scene and i create the morphs in the code.
Thank you so much

1 Like

@Mostafa_Salloum, I opened an issue to track the bug, but we are tagging it as help wanted as we don’t have the bandwidth to take it on internally at the moment. You can follow the issue at 3ds Max morph not exporting correctly using bend and FFD lattice modifiers · Issue #1085 · BabylonJS/Exporters (github.com)

2 Likes