Godot-Palette-Swap-Shader
Godot-Palette-Swap-Shader copied to clipboard
Using `PaletteGenerator.gd` always results in "Assertion failed: No selected node has 'texture' property with a valid Texture."
The shader itself is working just fine, and I've been able to manually create palettes and have them work as expected, but I can't seem to use the provided palette generator script at all. I've tried it on both AnimatedSprite2D and Sprite2D and neither seem to work - just gives me this same error.
Do you run the script with Sprite2D node selected in scene tree? Does it have a texture assigned?
I have my AnimatedSprite2D node selected when running it, it has animations and sprites present in its SpriteFrames, the "Texture" dropdown in the inspector only shows "Filter" and "Repeat" fields (which are both set to "Inherit")
The generator only works on nodes with texture property that holds any Texture2D. "Texture" category is something else and unrelated.
Though maybe the detection could be improved. It wasn't intended to be super reliable though; at worst you can just drop the texture to 2D editor, which will create a sprite, and use it to generate palette.
I reworked the generator, it's now a Tools menu option.