Visual component plugins for online (Javascript / Pavlovia) require PIXI access

I posted this in the PsychoJS repository issues (here: Github Issue), but that doesn’t seem to be active right now?

To summarise, I’ve built a Python visual component using the new-ish plugin system. That works great, but now I need to build the Javascript equivalent for online. For that I need access to the underlying PIXI classes (as the built-in PsychoJS components do), but there doesn’t seem to be any way to import PIXI directly from the server?

I know that in an older version of PsychoPy/PsychoJS you could import from pixi.js-legacy on the Pavlovia server (as well as the separate PsychoJS libraries individually), but that no longer seems to work?

What would be the best approach to deal with this?

Thanks for any assistance you can offer!

I can’t answer your question myself, but please could you describe what your plugin does – i.e. what do your visual components look like?

Maybe you need to create a visual stimulus in PsychoJS that can then be used in the Component?

It’s a pretty basic static ‘dots grid’ plugin for judgement experiments. It has similarities to both the dots and the noise components, but it’s static in the sense that the dots don’t move. Instead they have a dominant colour probability (fixed per-trial), and the dots update which colour they are at a customisable rate (currently 10x10 dots at 20fps, but either of those may need to be increased).

0667-0853-ezgif.com-crop

Here’s (hopefully) an gif showing the Python version. Because we need it running online, probably on very low-end machines, I want to avoid the overhead of, e.g., an array of ShapeStim or some other ‘heavy’ object (which would also be a pain to code), and just use PIXI.Graphics for each dot. Ideally it would use a GL mesh or a shader, but hopefully that’s not required.

Thanks for the reply, Jon! That is how I got an older version of this working, but I was hoping the plugin system might allow for a more elegant solution which doesn’t break Builder compatibility (useful to let experimenters do their own tweaking during piloting).

I’m not sure of the best way to add a stimulus to PsychoJS without using an entire custom version of PsychoJS in the experiment? I can always just edit the generated Javascript code to replace the PsychoJS import with my own, though.

Eventually I’d like to have the time to do a proper PR (if you think it’s worthwhile) to include in PsychoJS, but right now I just need to get something working.