I am trying to make a character creator, and want to include a slider that would change the size or shape of a feature with a blend shape/key. I already know how blend keys in Blender work, but I’m still very new to game dev and Godot, and have no idea how to implement this. I imagine it’s possible.
So far I’ve figured out how to import a model with blend shapes, and how to signal the value_changed/_on_h_slider_value_changed to the mesh’s script. Don’t know where to go from there… Any help at all will be very much appreciated :3
MeshInstance3D has a set_blend_shape_value function, so long as you know the blend shape index and it’s value bounds you can directly connect the value changed to the set blend shape function
Thank you for responding! I think I’m still missing something, because interacting with the slider only changes the mesh once by whatever the value is. No more increasing or decreasing after that, it’s acting like a button that only works once.
I think I should also have mentioned that the mesh I want to change the blend shapes of has multiple blend shapes. So maybe I need a way to define what blend shape I’m trying to change with each slider.
Do any messages appear in your output or debugging panel?
Yes, the first argument is the index. in my example I used 0, you will need to fill in a value for each slider, you would use multiple functions or bind the index during the connection.
No errors in output or debugging when 0 is used, except for The parameter "value" is never used in the function "_on_h_slider_value_changed()". If this is intended, prefix it with an underscore: "_value". Then none at all when I do as the error says.
When I use “blend_shapes/Width” in place of 0, I get the error: Invalid type in function set_blend_shape_value in base MeshInstance3D (cube_2.gd). Cannot convert argument 1 from String to int.