Modifying a model mesh [SOLVED]

EDIT: NEVERMIND! It was working. I just wasn’t seeing the changes due to copying a mesh from a model that has been scaled down significantly. Specifically this line:

			Geometry n = new Geometry(id, ((Geometry)s).getMesh().deepClone());

will clone the mesh, maintaining the scale of the original model, but the new model will have a default scale of 1f. So if the original model has been extremely scaled down (as it was, in this case) only really large changes to the mesh will even be noticeable.


So I’ve experimented with VertexBuffers to modify meshes dynamically. I am able to do it fine on the Cubes that I generate, but when I try to change a model with a skeleton, the changes to the mesh aren’t reflected at all. This includes changes to the BindPosePosition buffer. Any thing I could be missing that would cause the changes not to update for animated models specifically (even when they’re not animating)?

Is there a buffer I should be editing other than the BindPosePosition or Position buffers?

Is HardwareSkinning on ?
If so then you may turn it off first

SkeletonControl sc = spatial.getControl(SkeletonControl.class);
    if (sc != null) sc.setHardwareSkinningPreferred(false);
1 Like

In my experience, if the spatial has a skeleton control then you can’t modify its mesh as it will just get reset.

Try removing the skeleton and animation controls.

1 Like

@Ali_RS, I turn Hardware Skinning off. I should have mentioned that. Thanks for asking.

Nevermind. It was working all along. See original post for details.