Open GoogleCodeExporter opened 9 years ago
Found this from google searching the same error. I tried to resurrect some
6-month to 1-year old code from a previous version of Mayavi and EPD and
started getting these errors. I assumed it had something to do with the latest
version of Mayavi.
I also thought it might have something to do with switching from PyQt to
PySide, but the error occurs regardless of which one is used.
Original comment by flutefre...@gmail.com
on 25 Mar 2014 at 5:40
Found a fix!
In C:\Python27\Lib\site-packages\tvtk\pyface\light_manager.py, CameraLight
class, _color_changed method, change:
self.source.color = val
to
self.color = val
This was line 232 for me.
You can see above this in the CameraLight class variables / Traits that color
is defined as a vtk_color_trait on line 156 (thus accessible as self.color).
self.source refers to an instance of tvtk.Light, which I assume is a wrapped
VTK Light object. Looking at the VTK API, it looks like SetColor may be
write-only since it is a backwards compatibility wrapper which actually sets
DiffuseColor and SpecularColor... the source doesn't show a GetColor anywhere:
http://www.vtk.org/doc/nightly/html/classvtkLight.html#ae01c48b21dcc9f89baf64cec
ff90fd92. Maybe Mayavi updated which version of VTK they wrap with TVTK and
this property was deprecated?
There's a Mayavi Issue for this which I've commented on here:
https://github.com/enthought/mayavi/issues/126
Original comment by flutefre...@gmail.com
on 25 Mar 2014 at 7:01
Thanks, this solved the problem for me!
Original comment by heisenbe...@googlemail.com
on 25 Mar 2014 at 4:21
Thanks, #2 solved the same problem for me! But i wander how could the source
file (C:\Python27\Lib\site-packages\tvtk\pyface\light_manager.py) is wrong?
Original comment by hesin...@gmail.com
on 23 Apr 2014 at 2:08
For me that change allows the 3D diagram to be produced, but just as with the
original poster, the 3D elements are all black (though there is some
light-source effects applied). My diagram also has lines (not cylinders), and
THEY show up in color in the same diagram.
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\tvtk\pyface\ui\qt4\scene.py", line 73, in paintEvent
scene.light_manager = light_manager.LightManager(scene)
File "C:\Python27\lib\site-packages\tvtk\pyface\light_manager.py", line 351, in __init__
light = CameraLight(self.renwin)
File "C:\Python27\lib\site-packages\tvtk\pyface\light_manager.py", line 172, in __init__
self._color_changed(self.color)
File "C:\Python27\lib\site-packages\tvtk\pyface\light_manager.py", line 232, in _color_changed
self.color = val
traits.trait_errors.TraitError: Cannot set the undefined 'color' attribute of a
'Light' object.
Original comment by aaronbramson
on 29 May 2014 at 7:01
Original issue reported on code.google.com by
h...@cs.tu-berlin.de
on 14 Mar 2014 at 8:29