I’ve just released a new module in my plugin and was surprised that the preview image in the library has some “garbage” text where labels generated by nvgText() should be. While I can’t go back in time to be sure, I believe there’s a similar problem with an older module in the library (some widgets that displayed numbers via nvgText() are no longer displaying numbers corresponding to module params, but some text suggesting uninitialized variables). I’m guessing that my widget isn’t fully initialized when the preview is made.
Has something changed in the way VCV generates these previews? Is there a way I can “pre test” that my module paints the preview text properly before I try to submit a fix to the library?
You can start Rack from the command line with the proper flags and Rack will produce a screenshot capture of all of your modules and put them in the /screenshots folder. I have noticed on my Meander module that the button light states are not glowing in the screen-capture, making me think as you said that the image is captured before the module is fully initialized (but I do not know exactly how). All of my text is produced proceedurally via NVG but all seems correctly placed in the screen capture.
In my experience with Meander’s procedural panels, I had to do quite a bit of module code customization to get the preview to work in the Rack browser, all having to do with the fact there is no module instance in the browser.
In the module browser, ModuleWidget->module is NULL, so you can check for that and make your widgets to display the desired preview or placeholder state.
Yep - that’s probably the root of the problem. (and given what I’m doing in the code, I’m a bit surprised I just have garbage in the image - would have predicted a crash!). Time to get that fixed…!
Was an easy fix, but I’m having a hard time confirming the test before I resubmit to the library. The manual says:
-t / --screenshot <zoom percentage>: Captures screenshots of all installed modules and saves each to <Rack user folder>/screenshots/<plugin slug>/<module slug>.png.
But when I invoke Rack with -t, it seems to just launch “normally” and there’s no side effect of any png’s (in fact, no screenshots subdirectory at all).