Replace of submesh

Hi Guys,

I am playing around the 3D model customisization. Like changing the hairstyle. I see the hairstyle is the part of 3d model which need to be replaced with new one. I have no idea how to approach this.

Please suggest.

Hey @inevitable! Fun question.

If I were tackling this problem, I’d have a model of a character without hair. Then I’d have separate models for each hair style. Then I’d load the models in Babylon as needed (on user interaction as an example). Then the final step would be to parent the hair to the character’s head.

Note that depending on where (in 3D space) the hair geometry is actually located when you create it, you MAY have to take positional offsets into consideration.

Hope this is helpful!

1 Like

Hey @PirateJC Thanks for the replay. I tried with changing the applying meshes[0].parent = parent_node it is not properly appended mesh to head.

see below image.

This is likely due to the pivots and offsets of the character’s head and hair.

If you’d like to post a playground example with both assets in it, I’d be happy to help take a closer look!

1 Like

Sure i will update playground.