I work around that by:
helper.py to create a “fake”
.cpp file from the “real”
- Manually copy across the changes to the “real”
.cpp file from the “fake” one.
- Remove the details for the “fake” module from the
plugin.json file, and delete the “fake”
Rack-SDK/helper.py createmodule MyFakeModule res/MyRealModule.svg src/MyFakeModule.cpp
As for custom components.
I put an example module repo on GitHub which contains a file called
res/Thing.svg which contains a components layer with the “placeholder circles” for a param, input, output, light and custom widget. The resulting
src/Thing.cpp file, created by the
helper.py script, is also in the repo.
You’ll see in the
src/Thing.cpp file that the labels for the placeholder circles from the
res/Thing.svg file are kept for the param, input, output and light, using the format
NAME_TYPE, e.g. the placeholder circle in the Inkscape file named
a_param is named
However, for the custom widget all you get in the
src/Thing.cpp file is…
No name, just the position of the placeholder circle from the
Which is OK, when you think about it. The custom widget is up to you to write and the helper script (correct me if I’m wrong, folks!) can’t really predict all the different widgets people might want to write and have a bunch of boilerplate code to hand just in case. I realise that sounds awkward. Don’t mean it to.
I found that looking at other developers’ module source code helps to understand how to get custom widgets working.
Also (apologies if you know these already):
- Make sure that you have created circles in Inkscape for the placeholders, not ellipses. Press F5 to get circles.
- Check that you’ve set the fill colours correctly for each component type, as listed in the Panel Guide.
- Put the placeholder circles on an Inkspace layer of their own named
components, and hide the layer when you save the
.svg file or the placeholder circles will show on the module in Rack.
- Remember to press ENTER when you change the name of an object’s label in Inkscape. Just typing the new name and clicking away doesn’t save it.