In the demo program \psychopy\demos\coder\misc\rigidBodyTransform.py
light source was setup with the following code:
win.lights = [
LightSource(win, pos=pivotPose.pos, lightType='point',
diffuseColor=(0, 0, 0), specularColor=(1, 1, 1))
]
However, this code seems to be outdated and no longer compatible with the current PsychoPy (2022.2.1). According to the following error message, an update to PsychoPy\lib\site-packages\psychopy\visual\stim3d.py should address this issue.
##
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Alert 8105: Color space attribute `.colorSpace` is no longer in use, as colors are no longer tied to one space.
Hello from the pygame community. https://www.pygame.org/contribute.html
For more info see https://docs.psychopy.org/alerts/8105.htmlAlert 8110: RGB attribute `.diffuseRGB` is no longer in use, as non-RGB colors now handle their own conversion.
For more info see https://docs.psychopy.org/alerts/8110.htmlTraceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\demos\coder\stimuli\stim3d.py", line 22, in <module>
LightSource(win, pos=pivotPose.pos, lightType='point',
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\contrib\lazy_import.py", line 118, in __call__
return obj(*args, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\stim3d.py", line 89, in __init__
self.diffuseColor = diffuseColor
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\stim3d.py", line 139, in diffuseColor
setColor(self, value, colorSpace=self.colorSpace, operation=None,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\helpers.py", line 222, in setColor
setattr(obj, colorAttrib, color)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\stim3d.py", line 138, in diffuseColor
self._diffuseColor = np.asarray(value, np.float32)
TypeError: float() argument must be a string or a number, not 'Color'
################ Experiment ended with exit code 1 [pid:98368] #################
I understand that presenting 3D objects with PsychoPy is still under test. Is there an alternative way to display and manipulate 3D objects with other stimulation control from PsychoPy?
Thanks,
Gabriel