Matthew Riley
mgriley97@gmail.com
Clay
Clay is a python library (in progress) for creating your own graphical developer tools, such as 2D map editors for games. The goal is to be able to make your own mini Unity-like editor for your own custom data-types and needs.
Clay is a work in progress that I hack on occassionally when I have time. I’ve included explanations and demos of some of the cooler features below.
Architecture
The user installs the library using PyPi (eventually), and calls the entry point launch_main_app()
from a script. This function launches a desktop window called the Clay Editor. It reads a clay config file to load a list of user-written Python scripts.
These user scripts register the data-types that you want to work with. You tell Clay what properties are in each data-type and how it should be drawn/represented in the Editor. Clay generates a full-featured property-editor for each of your data-types, with automatic serialization support for saving/loading files. Want a List of List of Option{Int} objects? Clay will generate an editor for it! It comes with a number of utilities for things like: drawing simple primitives/images, click-to-select/drag, add/delete/move nodes in a tree, and so on.
Here is a (sped up) demo of setting up a “Hello World” project from scratch:
More Features
- Child Components: Embed one state tree / scene into another scene as a component. Change the original and all dependent scenes will update, too, while maintaining their independent property overrides.
- Command Palette: Register custom operations, and open a Cmd palette (think Spotlight on MacOS) to fuzzy search + execute ops.
- Reference Viewer: A special view to see all the interdependencies between components. I’m always frustrated when editors that allow references don’t have one comprehensive view where you can see them all.
- Window System: Many window-wrangling features. Divide windows, create split layouts with just WASD, focus windows, oh my.