Hello all,
I am trying to load a wavefront obj created in blender, but I seem to get an error every time I use ObjMeshStim. I am not getting the error when using a SphereStim or BoxStim.
The code is adapted from stim3d.py demo:
from psychopy import core
import psychopy.visual as visual
from psychopy.visual import LightSource, BlinnPhongMaterial, BoxStim, ObjMeshStim
from psychopy.tools.gltools import createTexImage2dFromFile, loadObjFile
from psychopy import event
open a window to render the shape
win = visual.Window((600, 600), allowGUI=False, monitor=‘testMonitor’)
create the stimulus object, try other classes like SphereStim and PlaneStim
coinStim = ObjMeshStim(win, ‘data/circ0102.obj’,pos = (0,0,0))
However, I get this error at the console:
TypeError: int() argument must be a string, a bytes-like object or a number, not ‘list’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “gambling sandbox.py”, line 28, in
coinStim = ObjMeshStim(win, ‘data/gun.obj’,pos = (0,0,0))
File “C:\ProgramData\Anaconda3\envs\psychopy\lib\site-packages\psychopy\contrib\lazy_import.py”, line 120, in call
return obj(*args, **kwargs)
File “C:\ProgramData\Anaconda3\envs\psychopy\lib\site-packages\psychopy\visual\stim3d.py”, line 2166, in init
objModel = gt.loadObjFile(objFile)
File “C:\ProgramData\Anaconda3\envs\psychopy\lib\site-packages\psychopy\tools\gltools.py”, line 3787, in loadObjFile
materialGroups[key] = np.asarray(val, dtype=int)
File “C:\ProgramData\Anaconda3\envs\psychopy\lib\site-packages\numpy\core_asarray.py”, line 83, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence.
Your help on the matter would be much appreciated.
Thanks,
Snir