nines
October 9, 2024, 3:51pm
1
Godot Version
4.3
Question
Following https://www.youtube.com/watch?v=E96m9Z4iTcc for Blender, suppose I have a texture ready for multiple facial expressions, what are the codes/functions to use in Godot when I would like to change the position of the UV to change the facial expression?
You may use a StandardMaterial3D with a scaled down UV1 for a sprite-sheet like face. Check out this other post I remember
Very good! The face/eyes also do not need to be a separate mesh, though I understand if you’d like to do that. You will not need a custom shader, godot’s standard material can alter UV coordinates like that without a custom shader, you will have to do a little math when switching faces.
[2024-07-12-155023_247x265_scrot] Sample of a 2x4 scaled grid like in the tutorial
With these settings we could use this function to set which face
@export var mat: StandardMaterial3D
func pick_face(x: int, y:…
1 Like
nines
October 10, 2024, 3:14pm
3
@gertkeno Thank you! From there, I tried this code below and it worked!
var mesh:MeshInstance3D = get_node("test_character/Armature_001/Skeleton3D/mesh1_001")
var mat:StandardMaterial3D = mesh.get_active_material(0)
mat.uv1_offset = Vector3(xxx, yyy, zzz)
system
Closed
November 9, 2024, 3:15pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.