i've been trying to implement real time lip sync into my project but i'm a lil stuck at this point, i have it set up so the face changes uv in the material so i can set the face to what i want and a mic setup to read volume but the problem now is that i don't actually know how to set up the shader parameter in the script. i've tried using a get_shader_parameter but when running the project godot says it's not a real thing?
also i just realised it should be set_shader_parameter but that still gives the same error
#how to get and change a shader parameter in gd script?
1 messages · Page 1 of 1 (latest)
I wonder if there's something off with the way it initializes it.
Have you tried using @export and assigning the material that way?
i havent tried that i'll give it a go now
The way it's saying "base string" kinda implies it's trying to use the function on that piece of text
tried the export, same error
so i need to change the text to something else maybe?
What I mean is uh
sorry i'm pretty new to coding
Did you try @export var face: Material
oh, no i'll try that now
It should give you a button in inspector and you can use it to get a search box for the material
I'm sure there's a valid way to do it with a file path, too, though. Like maybe with preload.
i got it set up and the error goes away but it's not updating the uv
Yeah you are calling face.get_shader_parameter but you aren't saving it anywhere.
Or doing anything with it
i've swapped it to set instead
but nothing changes
oh wait it's how i wrote index x is why it wasnt changing
thank you for the help!
Oh and also the export way is just what I'm used to since I used to use Unity and it didn't really use paths much.
I think @onready var face: Material = "your path" might work if you want it as a string.
Pros and cons. Export shouldn't break when files are renamed/moved, but it sometimes acts wonky when copypasting etc.
Either way yeah glad it's working now!