Bug with Envelope Gratings + how to fix

When inserting an envelop grating using Builder it will crash saying: “TypeError: ‘float’ object cannot be interpreted as an integer.”
OS: MacOS
PsychoPy version: v2021.2.3
Standard Standalone? (y/n): Yes
What are you trying to achieve?: Envelop gratings cause the experiment to crash.

What did you try to make it work?: I figured out where the problem is and how to make it work: If you open it into Coder view, you must change the “texRes=128.0” for your envelop grating to an integer (e.g. texRes=128). The problem seems to be that the drop down choices for texture resolution are actually float numbers, not integers (e.g. when you select 128, it’s actually reading as 128.0, not an integer).

What specifically went wrong when you tried that?:
I’m able to fix it manually by opening in Coder view, however my changes are not saved back in the Builder view, meaning I have to open in Coder, edit texRes to be an integer and run the experiment from there.

I’ve put in a fix for this, should be in the next bug fix release :slight_smile: Essentially, a Builder parameter can be various types - that one was set to “num” so it’s covered to a float, but it can just as easily be “code”, meaning it’s added as is with no transformation.