+5 votes

I'm trying to figure out how to animate the UVs on a model to do things such as change a characters face expression. Basically how most games back in the 90s did eye blinks and things.

In Blender, I can animate them using either the Anim All add-on, or the UV Warp modifier, but I've had no luck figuring out how to transfer either method into Godot.

Is there a way to transfer it out of Blender and into Godot? Alternatively, is there a way to do it in Godot, similar to Sprite3D except on a mesh?

in Engine by (20 points)

2 Answers

+9 votes
Best answer

You can animate uv co-ordinates, by using the animation player node and the UV Xform option.

  • Add an animation player node into your scene and create a new track.
  • On your material select the uv xform option for your diffuse texture.
  • On frame 0 of the animation player, create a keyframe by clicking on the key icon for uv xform on the material.
  • Move to another keyframe in the animation player.
  • Adjust the uv co-cordinates in the uv xform and hit the key icon again.
  • Rinse and repeat....
  • You can now scrub the animation player to view the results. The beautiful thing is that any parameters in Godot can be animated in this manner :)
by (268 points)
selected by

Oh wow, it's like super simple, but something that would have taken me a million years to discover on my own. Thanks for the fast reply!

+2 votes

Just to mention it, you can use shaders to do the job for you (and also, shader graphs). Here is a short article on docs for shaders. (Unfortunately, it doesn't use shader graphs...)

by (1,602 points)

Not the answer you are looking for but might get you moving in the right direction in regards to ShaderGraph.

If you wish to have a 'scrolling texture' through the use of ShaderGraph you can achieve that by doing the following:

  1. plug a time and a scalar constant node into a scalar operator node, set to multiply.
  2. plug the output of the operator to one or more scalar input(s) of a scalar2vector node.
  3. Plug the output from scalar2vector node into the first input in a vector operator node.
  4. add an Input node from which you plug the UV output to the vector operator node's second input.
  5. finally plug the vector operators output to the texture uniform's uv input.
  6. Control the scrolling speed from the scalar constant added in step 1.


edit: fixed image link. sadly google photos isn't a good platform for image hosting.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.