Model issue, or material issue?

I am having a difficult time changing the material and diffuse texture on a model. It’s a Synty model and I’ve tried to clean it up as much as I can, but it doesn’t seem to be making a difference.

https://playground.babylonjs.com/#QGEIWL#2

The mesh can be found here: https://cdn.jsdelivr.net/gh/antidamage/Filestore/Hipster.glb

They’ve done their usual thing and mapped the polygons as tiny bits to the right color on the texture. At my end I’ve converted the fbx to glb using Cinema4D, but that didn’t seem to affect the default material.

Can anyone see what’s wrong with this mesh?

Update: I tried repacking the UVs just to be sure and yep, now the material can change. The UV islands are literally zero in size. That doesn’t fix the original issue though.

Hello and welcome!

Here is the corrected PG - https://playground.babylonjs.com/#QGEIWL#3
Feel free to ask more questions :slight_smile:

1 Like

Thank you! That was a most excellent answer.

My second question is regarding skeletal animations. I’ve not found good documentation or examples for setting this up. A Threejs viewer shows my mesh is definitely animated.

So far I have tried this:

Globals.Avatar.Meshes['Base'].skeleton = Skeletons[1];
Globals.Scene.beginAnimation(Skeletons[1], 0, 60, true, 1.0);

Skeletons is fetched from the Scene earlier. But nothing happens. If I inspect the bone hierarchy in the skeleton, the bones with animations do not list themselves as having an animation.

I have updated the earlier model with the animated version: https://playground.babylonjs.com/#QGEIWL#8

I would say that the model looks a bit strange and the number of errors seems too high; maybe it is better to start with the model which is properly made and definitely works as it should to?

That’s my question - what’s wrong with it? The morph targets shouldn’t be an issue (they’re working and removing them doesn’t help.) Seems to work in threejs (without any more target handling though)

If you’ll click for ‘More details’ in Sandbox, you’ll see all errors of your file.
I deleted some of your code and now without it animation seems to be working somehow - https://playground.babylonjs.com/#QGEIWL#10

So there’s no standard list of gotchas with skeletal animation? I guess I’ll start with something simpler and work back up to the Synty model. Cheers.

There is the big section about skeletal animation in docs - Bones and Skeletons | Babylon.js Documentation

I’ve worked through it. The model is fine (aside from the morph targets not applying at the right point in the pipeline.)

However passing an array of valid mesh names to BABYLON.SceneLoader.ImportMesh() was crippling the animation. Why? It’s because I forgot to include the root skeleton in the list of valid meshes to import. So even though skeleton data structures were being created from the skin weights, no animations were being imported into them. Stick a null in instead and boom, it works.