Skip to content

A simple plugin that offers a dock displaying the names of parameters from a selected shader. It includes click-to-copy functionality to minimize bugs caused by incorrectly typed string literals.

License

Notifications You must be signed in to change notification settings

Dev-Marco/CCSP---Copy-Correct-Shader-Parameters

Repository files navigation

CCSP - Copy Correct Shader Parameters

Overview

This plugin for the Godot Engine adds an extra dock that showcases all parameters of a selected shader, which can be manipulated via code (also known as uniforms). The dock features a clean and readable table-like layout, presenting each parameter's name required for addressing it, along with its expected data type.

It also offers the functionality to copy a parameter's name to the clipboard by either clicking directly on the name itself when the corresponding setting at the top of the dock is enabled, or by clicking on the dedicated copy button. This feature aims to mitigate unnecessary and frustrating bugs caused by misspelled string literals.

Features

  • A useful custom dock: Either place the dock in the dedicated slots of the Godot Engine or make it floating and place it freely whereever you want.
  • Simple Shader Selection: Easy selection of .gdshader files through the Load Shader button.
  • Easy to read list of Parameters: After loading a shader file the uniform parameters are listed easy to read in a scrollable list (see Screenshots).
  • Reload to update the list: If you added or removed some uniforms in the selected shader file simply press Reload to update the overview.
  • Copy Button: To prevent misspelled string literals by manual typing simply click the Copy Button to copy the name of the uniform to your clipboard.
  • Copy on click: Alternatively, by enabling the setting Copy on Click in the top, you can also copy the uniform name to the clipboard by simply clicking on the name itself (Activated by default).
  • Add quotes to copied name: By activating the Add Quotes setting quotes will be automatically applied to the copied name. By default the editor settings will be respected. Other possible choices are single ('') and double quotes ("")

Installation

  1. Clone or download this repository.
  2. Copy the addons/copy_correct_shader_parameters folder into the addons directory of your Godot project.
  3. In Godot, go to Project -> Project Settings -> Plugins.
  4. Find "Copy Correct Shader Parameters" in the list and click "Activate".

Usage

  1. Once the plugin is activated, the new dock will appear on the right side of the engine.

Alt Text

  1. Click on Load Shader to open a file dialog to select a .gdshader file.

Alt Text

  1. Once a shader file is selected, the dock will list the uniform parameters that were found in that shader.

Alt Text

Compatibility

As of now, this plugin has been tested and confirmed to work on Godot 4.2.2, as this is the version I am currently using. Version 4.0.0 stable lacks a function necessary for displaying the type of the uniform. If there are requests for it to work on that version I will be looking into solving this.

Contributing

Contributions to the plugin are welcome! If you have suggestions for improvements or have found a bug, please open an issue or a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Thanks to the Godot community for their continuous support and feedback.

About

A simple plugin that offers a dock displaying the names of parameters from a selected shader. It includes click-to-copy functionality to minimize bugs caused by incorrectly typed string literals.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published