Importing models with hierarchy is now in soft launch! 🚀

This feature is now available to everyone! We will be doing an announcement down the line but we really wanted to get this out to people as soon as possible.

Video demo: https://www.youtube.com/watch?v=64fcCy9lvq8&t=4740s

Formal documentation still needs to be created but here’s the TLDR:

Enable the feature by ticking ‘Import Hierarchy’ under asset tasks in the settings:

Importing a model will create several assets (Container, Render(s) and Template).

You can add the template to the scene which will include the hierarchy of the model imported.

Some gotchas to remember:

  • The animation component will not work. To use animations, you will have to use the new Anim State Graph animator. By default this should be added to the top most entity (the template instance).
  • Collision components can now take a Render asset as a mesh.
  • When you select an object in the scene, it will be the render entity, not the template instance so be careful when moving entities in the scene. Ensure that you have the correct entity selected.
11 Likes

This would be a nice feature to have for us, but we have kind of a funky pipeline since some of our models need to be json because we want them to generate lightmaps. Will lightmap generation for the gbl format be supported in the future (or is it already here and did we just not realize)?

We don’t have UV1 unwrapping for GLB files, but will definitely add it in the future. In the meantime you could unwrap your model (generate uv1 for lightmaps) in Blender / Maya or any other software you export your FBX from, and Playcanvas can then bake lightmaps on it.

1 Like

Animation doesn’t work with hierarchy, I added it to the top of most entity.

You can see it in this project :
https://playcanvas.com/project/798229/overview/melee-hit-animation

Hmm… I didn’t run into this issue with Kenney’s test characters :thinking: @mvaligursky and @Elliott, any ideas?

Hey @commention, it looks like there’s a mismatch between the naming of nodes in the animation file and the hierarchy created by the model. The component is animating but it hasn’t been able to bind any of the animation curves onto the model.

1 Like

Alright, thank you!

Im having the same issue. I imported an fbx exported from mixamo. Placing the Anim State Graph component to the top entity didn’t work.

How could you tell if there is a mismatch between the naming nodes in the animation file and the hierarchy created by the model?

And if this is the case, how could one go about fixing this issue ?

Thanks for your time

There should be a warning printed out into the console.

Can you share the project please? Does it work if you use the model component?

Here is an example project showing 3 different versions : PlayCanvas 3D HTML5 Game Engine

  1. (Far Right) Model Component + Anim Component
    Result: Animation works!

  2. (Center) Render Component + Anim Component + Hierarchy
    Result: No animation

  3. (Far Left) Model Component + Animation Component + custom shader
    Result: No animation but shader works. is this expected behavior?

Thanks! @Elliott should hopefully find some time to take a look at this

I’m getting shader errors when running it

Failed to link shader program. Error: Uniforms with the same name but different type/precision: uTime

Do you see this in the console? If not, how can I see shader errors?

Yes in the chrome debug console.

I updated it https://playcanvas.com/project/813850/overview/mixamo-model-loader .
I just needed to add precision mediump float; to my vertex shader.
For some reason the error didn’t appear in chrome but it appeared in firefox.

However, even after removing or fixing the shader, the problem of the anim component not working when importing an fbx from mixamo still persists.

2 Likes

I made another update which adds a 4th test behind the 3rd Far Right one. It tests the Model + Anim Components + Shader script . Unfortunately it also breaks here as well PlayCanvas 3D HTML5 Game Engine .

I have a fix for this issue here: [Fix] Fixes skining using render component meshes imported using hierarchy in Editor by mvaligursky · Pull Request #3350 · playcanvas/engine · GitHub
This makes both characters without shader override animate correctly.
We should be releasing the fix in the next few days.

Playcanvas uses vertex shader to animate (skin) characters. As you use custom shader which does not handle skinning, your characters with this shader do not animate. You should probably continue using the standard material with automatically generated shader, but override some chunks to make it render the way you want to.

3 Likes

Thanks, I’m looking forward to the animation fix. I understand now that I need to use chunks for the shader effects.

I tried to study the character damage demo since it uses chunks here but it no longer works. Only the current public facing playcanvas build works as I assume it may have been using a version that allowed it to.

Thanks for your time

The animation fix has been released yesterday, so all should work now: Release v1.45.2 · playcanvas/engine · GitHub

I’ve just tried your example, and both default shader characters animate as expected.

The character damage demo is being upgraded to render component from model component, along with many other demos, and that is unfinished at the moment. I think there are some simpler projects showing how to modify shader chunks you can inspect … @Leonidas - any specific projects you know of?

1 Like

I would check these two, which work fine with the latest PlayCanvas build:

https://developer.playcanvas.com/en/tutorials/tutorial-plasma-shader-chunk/

https://developer.playcanvas.com/en/tutorials/warp-a-sprite-with-glsl/

2 Likes