Hue slider help
modelsbymike3d or anyone who has scripting knowledge
Im working on a snapchat lens but i want to add a color slider so i can move the slider and itll change the hue of the crown, flames, eyes, and heart border. Here's a picture of the lens
Is there any way i can make it so i can move the slider above the sub text to change the colors of the lens without changing the color of the LUT. I just want to change the overlays on the image such as the eyes, crown, heart border, and flames. Thank you to anyone that helps.
The color slider by default can only target a single object. To simultaneously change the colors of multiple entities, you will need a custom script. It will be somewhat similar to what I have here, but with some important changes. Here is some sample code. Usually I would use arrays to input multiple images and materials, but Lens Studio wasn't liking that for whatever reason.
And here is an example project: https://1drv.ms/u/s!AgrmjXTXUbfzgthXl1_JmVds6NZtTg?e=xQ6G0w
I know the flame outline is some sort of custom material, so to adjust the color for that you may need to change a separate value rather than the baseColor. You can hover your mouse over the color name to get the property. So an arbitrary example you may be setting script.mat1.mainPass.flame1Color = value; instead of script.mat1.mainPass.baseColor.
You'll have to adjust the script inputs so you have the right number of inputs for your lens. When the lens turns on, everything will have their original colors and then once you adjust the slider it will start changing things. You might want to select the color picker script, enable the "Edit Properties" option, and then change the initial value to 1.0 which corresponds to the color white which in turn would make all your starting images/materials not have a tint.
hey modelsbymike3d i changed the script to be like this and it doesnt work. it doesnt change the colors or do anything
No need for the case statements. It'll just be
and remove the following lines
The initial value portion in my original script was meant for when using the slider as a 0-1 scale. It doesn't directly translate to when you are grabbing the color so I removed it.
i added those becuase i thought maybe it'll make the color work, but neither do
modelsbymike3d i changed it again from your last post the way you said to, and still nothing. i move the slider and it doesnt do anything
Can you share the files with me? My email address is my username at gmail.com. It's probably just a small scripting error.
modelsbymike3d i actually just figured it out! thank you so so much for the help! i couldnt have done it without you!
Glad to hear! Looks like a cool lens!
thank you! im gonna add more features and then update it!