enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.32k stars 285 forks source link

XMLPolyDataWriter instance is 'read only' #495

Open Antoine-Gerard opened 7 years ago

Antoine-Gerard commented 7 years ago

Hello,

I'm trying to use mayavi and tvtk with a VTK-7.1.0. When I want to write a XMLPolydata i have this error:

TraitError Traceback (most recent call last) /home/antoine/Python/env_2.7/Eikonal_Sphere.py in () 124 125 --> 126 w = tvtk.XMLPolyDataWriter(input=mesh, file_name='data.vtp') 127 w.write() 128

/home/antoine/Python/env_2.7/lib/python2.7/site-packages/tvtk/tvtk_classes.zip/tvtk_classes/xml_poly_data_writer.pyc``

in init(self, obj, update, traits) 46 """ 47 def init(self, obj=None, update=True, traits): ---> 48 tvtk_base.TVTKBase.init(self, vtk.vtkXMLPolyDataWriter, obj, update, **traits) 49 50 def _get_input(self):

/home/antoine/Python/env_2.7/lib/python2.7/site-packages/tvtk/tvtk_base.pyc

in init(self, klass, obj, update, traits) 334 # anyway. 335 self._in_set = 1 --> 336 super(TVTKBase, self).init(traits) 337 self._in_set = 0 338

/home/antoine/Python/env_2.7/lib/python2.7/site-packages/traits/trait_handlers.pyc`

in _read_only(object, name, value) 102 def _read_only ( object, name, value ): 103 raise TraitError, "The '%s' trait of %s instance is 'read only'." % ( --> 104 name, class_of( object ) ) 105 106 def _undefined_get ( object, name ):

TraitError: The 'input' trait of a XMLPolyDataWriter instance is 'read only'."

Is it because of VTK-7.1 ? Moreover when I'm trinyng to test contour3d with mlab.test_contour3d I have weird warning:

mlab.test_contour3d()

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window Generic Warning: In /home/antoine/config/VTK-7.1.0/Common/ExecutionModel/vtkAlgorithm.cxx, line 1808 vtkAlgorithm::SetUpdateExtent was deprecated for VTK 7.1 and will be removed in a future version.

Generic Warning: In /home/antoine/config/VTK-7.1.0/Common/ExecutionModel/vtkAlgorithm.cxx, line 1796 vtkAlgorithm::SetUpdateExtent was deprecated for VTK 7.1 and will be removed in a future version.

Generic Warning: In /home/antoine/config/VTK-7.1.0/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx, line 1531 vtkStreamingDemandDrivenPipeline::SetUpdateExtent was deprecated for VTK 7.1 and will be removed in a future version.

I'm using Python2.7. I think that I will install a lower version of vtk in order to have Mayavi working as before I had.

Thank you, Antoine

ognend commented 7 years ago

All Men must Py.

On Thu, Mar 16, 2017 at 10:26 AM, ValarDohaerys notifications@github.com wrote:

Hello,

I'm trying to use mayavi and tvtk with a VTK-7.1.0. When I want to write a XMLPolydata i have this error:

TraitError Traceback (most recent call last) /home/antoine/Python/env_2.7/Eikonal_Sphere.py in () 124 125 --> 126 w = tvtk.XMLPolyDataWriter(input=mesh, file_name='data.vtp') 127 w.write() 128

/home/antoine/Python/env_2.7/lib/python2.7/site-packages/ tvtk/tvtk_classes.zip/tvtk_classes/xml_poly_data_writer.pyc``

in init(self, obj, update, traits) 46 """ 47 def init(self, obj=None, update=True, traits): ---> 48 tvtk_base.TVTKBase.init(self, vtk.vtkXMLPolyDataWriter, obj, update, **traits) 49 50 def _get_input(self):

/home/antoine/Python/env_2.7/lib/python2.7/site-packages/ tvtk/tvtk_base.pyc

in init(self, klass, obj, update, traits) 334 # anyway. 335 self._in_set = 1 --> 336 super(TVTKBase, self).init(traits) 337 self._in_set = 0 338

/home/antoine/Python/env_2.7/lib/python2.7/site-packages/ traits/trait_handlers.pyc`

in _read_only(object, name, value) 102 def _read_only ( object, name, value ): 103 raise TraitError, "The '%s' trait of %s instance is 'read only'." % ( --> 104 name, class_of( object ) ) 105 106 def _undefined_get ( object, name ):

TraitError: The 'input' trait of a XMLPolyDataWriter instance is 'read only'."

Is it because of VTK-7.1 ? Moreover when I'm trinyng to test contour3d with mlab.test_contour3d I have weird warning:

mlab.test_contour3d()

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window

(ipython:14519): Gdk-WARNING **: gdkdrawable-x11.c:952 drawable is not a pixmap or window Generic Warning: In /home/antoine/config/VTK-7.1.0/Common/ExecutionModel/vtkAlgorithm.cxx, line 1808 vtkAlgorithm::SetUpdateExtent was deprecated for VTK 7.1 and will be removed in a future version.

Generic Warning: In /home/antoine/config/VTK-7.1.0/Common/ExecutionModel/vtkAlgorithm.cxx, line 1796 vtkAlgorithm::SetUpdateExtent was deprecated for VTK 7.1 and will be removed in a future version.

Generic Warning: In /home/antoine/config/VTK-7.1.0/Common/ExecutionModel/ vtkStreamingDemandDrivenPipeline.cxx, line 1531 vtkStreamingDemandDrivenPipeline::SetUpdateExtent was deprecated for VTK 7.1 and will be removed in a future version.

I'm using Python2.7. I think that I will install a lower version of vtk in order to have Mayavi working as before I had.

Thank you, Antoine

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/enthought/mayavi/issues/495, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdj3ibxr3xR9jfKC4SbMn2EHuxMEMhDks5rmVS2gaJpZM4Mfdx9 .

-- Christian Holton System Administrator Enthought, Inc. http://www.enthought.com Austin, TX 001 512-486-9298 (p) 001 512-536-1059 (f) www.Enthought.com "It's only a flesh wound..."

sunjc73 commented 6 years ago

You can use the solution in https://stackoverflow.com/questions/35089379/how-to-fix-traiterror-the-input-trait-of-a-instance-is-read-only

It works for me.

Jiancheng