Importing FBX with Multiple Animated Meshes

Forgive the long post, but I’m being thorough.:wink:

I’m creating what will be a fairly complex mesh-based effect. For now, It includes only 7 meshes that were animated in Maya 2020. I can export them, using the Game Exporter, to a single fbx file (fbx 2020 binary) that includes, to begin with, 4 animations involving 7 meshes. Playcanvas is successfully importing it (I think).

After import, I have the source FBX model file, a template file, a container file, the 4 animations as 1 file each named as I exported them from Maya, and 7 individual mesh files. If I open the container file in the viewer, everything is golden. I see all the meshes together correctly. I also see the animations are correct in the preview window.

I can’t do what the viewer does, though, and use a Render node to draw the Container. I have to either have a node with seven render components in it, or use a Batch Group somehow. RIght?

I know I could script the effect at this early, basic stage, but the goal is to use the editor to produce the anim states for this 3d mesh effect, as scripting it would be a nightmare. I’ve done it in Unreal already.

By the way, I can easily export the same thing as a single GLB file with multiple animations in it. It works perfectly and I even see the separate four animations, named correctly as “takes” in the viewer. I can use Maya, Blender, Gestaltor, and other apps to tune the GLB and still import it to Playcanvas cleanly. However…I understand for now, that I have to use the FBX method.

What is the least expensive way to draw these meshes? having multiple render nodes seems heavy-handed, and the single mesh group defined in the project settings doesn’t make sense to me yet.

Thank you all VERY much. I’m jazzed about the possibilities with Playcanvas!

-shadowlab

The model viewer loads the glb as a container asset and calls a function on asset that generates the entity hierarchy for the nodes and skinned meshes that uses render components.

When a FBX is imported into the Editor, it generates a bunch of assets including a template asset which contains the same entity hierarchy and render components as seen in the model viewer.

Adding the creating an instance of the template in the Editor will add that entity hierarchy to the scene.

Animations in the model viewer are done with the method here instead of an anim state graph asset: Animation without State Graph | Learn PlayCanvas

OK. That will work for setting them and firing them off.
Using the .transition, like that example, how do I stop the animations from looping (etc)?
Doesn’t that kind of control require AssignAnimation?

Thank you!

When you assign an animation to the anim layer, it creates a state on the anim component. That state controls the looping hence the parameter is on https://developer.playcanvas.com/api/pc.AnimComponentLayer.html#assignAnimation to state whether this will be a looping state or not.

If you want to change it after the assignAnimation was called, you have to get the state in the layer and change the loop property.