Another member of my research group doesn’t get the same error message.
Does anyone know of this error and could help me to solve the problem?
Thank you!
Hi, thank you very much for your help! I saw that you answered in an earlier blog post from 2020 about the same question. Do I have to manually change all the color names in Builder? So instead of “black” I’d use “$[-1,-1,-1]”?
Thank you!
The thing is, I don’t know which components exactly don’t work (it doesn’t say, and it can’t start the experiment at all). But I guess one of the first color component would be the polygon here:
Do you think, the latter could be the issue? Otherwise, we didn’t use that many colors, actually. And the weird thing about it is that a colleague doesn’t have these issues using the same files…
Okay, at least I know what’s the problem now!
I’m still struggling to solve it, though. Is it enough if I define color variables in the first routine of my experiment and then use those variables in the code? If I run the experiment offline, it works, but online the error persists…
I’m not sure if I misunderstood something about defining the colours in a code_Both component.
loadDecks appears top be a Python online code component, and will therefore not do anything online. If you change it to a Both component then you can have rd = [1,0,0] on the Python side and rd = new util.Color([1,0,0]); on the JavaScript side.
I think this should also work with named colours, e.g.
Updating to version 2024.2.1 (2024.2.1-win64-py3.8), I have, as usual, in a simple, dummy experiment, set colours in Builder directly with named colours, not through a variable. For each ShapeStim, the newly generated .js script shows the fillColor argument twice, once given the colour name, and once as returned from util.Color. This hasn’t happened with other colour arguments, like lineColor, only fillColor. As I get the same error re “color components should all belong to [-1,1]” now, I wonder if this is expected, or the source of the error. Thank you please.
This is an error in the writing of JS code from Builder I think, looks like the code to write fillColor is written twice, and the second time it doesn’t have the fix @wakecarter added for writing new util.Color( around the value. Will get a fix in for this ASAP!
I seem to have posted this issue just after another PsychoPy version was released. So it might be helpful to note that, having updated to this newer version 2024.2.2, the above issue remains. Can also note that this issue also occurs when newly creating a ShapeStim with default, unedited properties – that is, after generating the JS file from the Builder, the script shows fillColor listed twice for each ShapeStim, once simply as fillColor = ‘white’, once with fillColor = new util.Color(‘white’). Also, when generating the script (directly, or when synchronising with pavlovia), it might be useful to note that the following error pops up as something to send to the developers (had not seen it with 2024.2.1):
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\wx\core.py”, line 3427, in
lambda event: event.callable(*event.args, **event.kw) )
File “C:\Program Files\PsychoPy\lib\site-packages\wx\lib\agw\aui\framemanager.py”, line 6342, in DoUpdate
self.Repaint()
File “C:\Program Files\PsychoPy\lib\site-packages\wx\lib\agw\aui\framemanager.py”, line 8473, in Repaint
client_dc = wx.BufferedDC(wx.ClientDC(self._frame), wx.Size(w, h))
wx._core.wxAssertionError: C++ assertion “m_buffer && m_buffer->IsOk()” failed at …..\src\common\dcbufcmn.cpp(135) in wxBufferedDC::UnMask(): invalid backing store
However, that error doesn’t appear to be critical. I can still run this script, even in localhost, and get past “initialising”, and only get stopped with the error as originally given in this post – here seen as:
Checking console, error output seems to confirm that this issue is re ShapeStim: