Comments (8)
Adding an idea from Gael here:
Bug #21: figure out which call in VTK has changed signature, and what is
the new signature. For this inspect the call stack using pdb to see where
'vtk_method' comes from when the error is raised, then look at the online
VTK reference and see what is the more recent signature of this VTK
method, finally implement both options in abstract_picker, with a
try/except.
from mayavi.
I can't replicate this bug either. What's your VTK version?
from mayavi.
I have VTK 5.6.1
Which is yours?
from mayavi.
I'm trying to get a bit more a clear view into this and I think I've got a lead:
This is the current stack trace:
mtime: 814019.Print the args passed to the picker:
((105, 134, 0), <libvtkRenderingPython.vtkOpenGLRenderer vtkobject at 0x769da20>)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/mattions/.virtualenvs/mayavi_git/src/mayavi/mayavi/core/mouse_pick_dispatcher.pyc in on_button_release(self, vtk_picker, event)
166 x, y = vtk_picker.GetEventPosition()
167 for picker in self._active_pickers.values():
--> 168 picker.pick((x, y, 0), self.scene.scene.renderer)
169 self._mouse_no_mvt = 0
170
/home/mattions/.virtualenvs/mayavi_git/src/mayavi/tvtk/tvtk_classes.zip/tvtk_classes/abstract_picker.pyc in pick(self, *args)
151 """
152 my_args = [deref_vtk(x) for x in args]
--> 153 ret = self._wrap_call(self._vtk_obj.Pick, *my_args)
154 return ret
155
/home/mattions/.virtualenvs/mayavi_git/src/mayavi/tvtk/tvtk_base.py in _wrap_call(self, vtk_method, *args)
523 print("mtime: %s.Print the args passed to the picker:" %mtime)
524 print(args)
--> 525 ret = vtk_method(*args)
526 self._in_set -= 1
527 if self._wrapped_mtime(vtk_obj) > mtime:
TypeError: function takes exactly 4 arguments (2 given)
which means there is something going on in the zipped class.
I've extracted and I found on the doc:
def pick(self, *args):
"""
V.pick(float, float, float, Renderer) -> int
V.pick((float, float, float), Renderer) -> int
return this Pick selectionPt selectionPt selectionPt ren
Perform pick operation with selection point provided. Normally the
first two values for the selection point are x-y pixel coordinate, and
the third value is =0. Return non-zero if something was successfully
picked.
"""
my_args = [deref_vtk(x) for x in args]
ret = self._wrap_call(self._vtk_obj.Pick, *my_args)
return ret
So the method should exists, however the selection for the methods is somehow wrong.
The first one is used and therefore I get the error.
Any idea about this?
from mayavi.
If I pass the single coordinates instead of the tuple, I get this working
from
picker.pick((x, y, 0), self.scene.scene.renderer)
to
picker.pick(x, y, 0, self.scene.scene.renderer)
Should I open a pull request to have it in this format?
from mayavi.
On Wed, Feb 08, 2012 at 03:36:33AM -0800, Michele Mattioni wrote:
Should I open a pull request to have it in this format?
Yes, with a try/except trying the current solution, and if it fails with
the exception that is currently been raised, trying the other.
Thanks
from mayavi.
I've update the pull request #23 with the try except clause mattions@4ffeaab
It should merge without trouble. Works here.
from mayavi.
taken car in pull #23
from mayavi.
Related Issues (20)
- Data containing NaN values
- Installation of Cadquery results in import error on Mayavi HOT 2
- Pick on surface and pick on ball only work when connected to monitor (MacOS)
- Animation freezes unexpectedly
- Install with pip HOT 9
- How to volume render a transparent space with mlab.pipleine.volume() and mlab.pipleine.scalar_field() as a data source?? HOT 1
- Error with VTK 9.3.0 HOT 3
- Failed Cython compilation (Cython > 3.0) HOT 2
- mlab.savefig saves wrong resolution (for first two images in loop)
- Potential issue with upcoming changes in VTK
- itkwidgets error in Jupyter Notebook
- Update a mayavi plot programmatically
- Release? HOT 6
- Warnings reported in the Mayavi testsuite
- Warnings and errors reported by the tvtk testsuite
- ImportError: Could not import backend for traitsui.
- Moving the cursor into a mayavi window causes a crash
- pip install not working HOT 2
- [regression in 4.8.2] TVTK not built properly. HOT 1
- Mayavi example protein.py not working, plus the solution
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mayavi.