Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | matthewyan |
I have an imported .glb scene, there is a MeshInstance in the scene and it has blendshaps.
I use the script to set the blendshape weights and the change can be seen in the game. However, I export the scene to a new .glb file, and find that the blendshapes weights are reset to 0.
My script is as follows:
gltf_handler = PackedSceneGLTF.new()
var loaded_scene = gltf_handler.import_gltf_scene(model_path, 1, 25)
var mesh = loaded_scene.get_children()[0] # this is the mesh instance
mesh.set('blend_shapes/bs0', 1.0) # weight of blendshape 0 changed to 1.0
mesh.set('blend_shapes/bs5', 1.0) # weight of blendshape 5 changed to 1.0
add_child(loaded_scene) # now I can see the change in the game window
gltf_handler.export_gltf(loaded_scene, save_path) # the scene can be exported, however, the blendshape weights are 0.
I am not sure if this is normal that Godot does not support the modification of blendshape weights to be saved? Or is there a way to save the weights as well?
I am using Godot 3.4.stable