[Solved] Editor importing problem

Hi

it seems there is a problem with the editor when you import new models and drag them into a scene.

the error

Uncaught TypeError: Cannot read property 'getWorldTransform' of null
    at SkinInstance.updateMatrices (playcanvas-stable.js:12377)
    at ForwardRenderer.updateCpuSkinMatrices (playcanvas-stable.js:8787)
    at ForwardRenderer.render (playcanvas-stable.js:9727)
    at Func.Application.render (editor.js:65158)
    at editor.js:65192
updateMatrices @ playcanvas-stable.js:12377
updateCpuSkinMatrices @ playcanvas-stable.js:8787
render @ playcanvas-stable.js:9727
Application.render @ editor.js:65158
(anonymous) @ editor.js:65192

Steps to reproduce:

  • Import a .fbx skinned model.

  • Drag the JSon into the scene.

I used this fbx in an other project and it works fine.

project link: https://playcanvas.com/editor/scene/497424

thanks :slight_smile:

It looks like your skin has bone names:

"bon_spine01"
“bon_lup_leg”
“bon_rup_leg”
“bon_r_leg”
“bon_r_foot”
“bon_l_leg”
“bon_l_foot”

But your model doesn’t have these nodes. You have used this exact FBX in another PlayCanvas project and it works?

Thanks for your answer!

I’ve made some tests and you are right it doesn’t work anywhere but It used to work before. My guess is the editor didn’t parse bones and skinned mesh in previous versions. However now it have to since you implemented the animation preview feature.

We use those models without bones to swap them in game and attaching a character bones in code. It allow us to have all the animations on the character so we don’t have to animate it. Which in my opinion is a common and clean way to do it when you want make skinned models customizable by the player in game.

I think this particular case should be handled by the editor. If there is any problem with the skinning it should still be able to display the meshes and UVs. In more general ways non handled case in data (3d models, textures, Json) should not crash an editor and at least display an error of what went wrong.

Thanks for your answer :slight_smile: .
I hope this post will help you improving the editor.