I am not able to get how to load .glb file which I had along with a different mesh
I want to load that .glb in a mesh
Like I tried this:
material = scene.getMeshByName("Layered_sweater");
SceneLoader.ImportMesh("", "./expo-files/models/characters/male/black jacket.glb", "", scene, function (newMeshes) {
var mesh = newMeshes[1];
material = mesh;
});
@carolhmj In the above code I mentioned,
I got mesh from getMeshByName(“my_mesh_name”) of the material I want to change,
and after loading .glb file in ImportMesh, I got mesh of the .glb file,
So, while trying to replace with new mesh its updating in json data but not rendering in UI
Actualy here I am trying to rendering .glb file dynamically based on based on the image I clicked,
Like, I load .glb file of the image which I click with ImportMesh and trying to render the mesh of character.
I mesh of the character is updating with the new .glb mesh, but not rendering in UI
What exactly is happening or not happening?
Are your panels created from the length of your shirt_images. Do you have the correct number of panels and do they stack correctly (not one on top of the other)?
If so, what happens to the image? Does it display only the first image in the first panel or the first in all panels? Does it display at all?
I mean, if @carolhmj cannot spot it just like that from your code extract, I don’t know who can (and certainly not me).
We do not need everything in the PG but without a PG, I think the only thing we can do is to create our own duplicate to understand what’s going on here. And personally, I’d rather spare this time for something else (sry). But then with a PG, I believe the answer will come to you rather quickly…
Here I am trying to change the mesh (Shirt) of the character by click on image,
But it’s appending as mesh on another mesh, instead of replacing the mesh
In this case you may need to reparent your shirt to the main character.
Here - https://playground.babylonjs.com/#Z6SWJU#661 - old shirt mesh and the root of new shirt are disposed. Be aware that you’ll have a new shirt mesh added every time with button click, so you may need additional logic to prevent it.