Giter Club home page Giter Club logo

Comments (9)

GaelVaroquaux avatar GaelVaroquaux commented on July 21, 2024

What happens if you comment out only the first line of the if block:

if scene.light_manager is None:
scene.light_manager = light_manager.LightManager(scene)

from mayavi.

itohnobue avatar itohnobue commented on July 21, 2024

It works, but the mouse cursor keeps going 'busy' like the program is doing some work in the background and everything works much slower.

I commented this line:

scene.light_manager = light_manager.LightManager(scene)

from mayavi.

GaelVaroquaux avatar GaelVaroquaux commented on July 21, 2024

It works, but the mouse cursor keep going 'busy' like the program is doing some work in background.

Allright, so the issue seems to be that some software renderers cannot
cope with the lights that we give them. Can you, on a computer for which
you have the problem, play with the properties of the lights (for
instance by pressing 'l' on a scene) until you can get the rendering to
work again.

from mayavi.

itohnobue avatar itohnobue commented on July 21, 2024

I tried to change light mode, number of lights, lights properties (elevation, azimuth, intensity, color) but the mesh still keeps black colored without any effect.

from mayavi.

GaelVaroquaux avatar GaelVaroquaux commented on July 21, 2024

Even when setting the number of lights to 1?

from mayavi.

itohnobue avatar itohnobue commented on July 21, 2024

I can't set it to be less than 3, the error is:

The 'number_of_lights' trait of a LightManager instance must be 3 <= an integer <= 8, but a value of 1 <type 'int'> was specified.

from mayavi.

prabhuramachandran avatar prabhuramachandran commented on July 21, 2024

There is little point in setting the number of lights to one. VTK always creates one by default. I'm not sure why commenting the self.light_manager code keeps the cursor busy. This is strange and it has been a little too long since I wrote that code. :(

from mayavi.

nmz787 avatar nmz787 commented on July 21, 2024

This problem seems to still exist. I used the lfd.uci.edu Python library binaries to install VTK and ets, then copied the installed files to my Portable Python site-packages folder (since Portable Python doesn't show up on the Registry). After I got the wx_embedding example to load and found it was black, I tried compiling mayavi-4.3.1 from source, but that still didn't fix things. Then I found this thread.

I added

event.Skip()
return

just after this line:
self._vtk_control.OnPaint(event) in this file:
https://github.com/enthought/mayavi/blob/master/tvtk/pyface/ui/wx/scene.py#L528

Pressing 'i' on my keyboard with the wx_embedding demo open did nothing, but clicking the gear (settings) icon and setting the foreground color to something other than white causes python to crash (segfault, not a Python exception). I enabled the faulthandler Python module for wx_embedding.py and got this Segfault Trace:

Fatal Python error: Segmentation fault

Current thread 0x0000027c:
  File "C:\Portable Python 2.7.5.1\App\lib\site-packages\wx-2.9.4-msw\wx\_core.p...", line 9203 in DestroyChildren
  File "C:\ThirdParty\lib\traitsui\wx\toolkit.py", line 477 in destroy_children
  File "C:\ThirdParty\lib\traitsui\ui.py", line 323 in reset
  File "C:\ThirdParty\lib\traitsui\ui.py", line 267 in finish
  File "C:\ThirdParty\lib\traitsui\wx\ui_live.py", line 320 in close
  File "C:\ThirdParty\lib\traitsui\wx\ui_live.py", line 360 in _on_ok
  File "C:\Portable Python 2.7.5.1\App\lib\site-packages\wx-2.9.4-msw\wx\_core.p...", line 7952 in MainLoop
  File "C:\Portable Python 2.7.5.1\App\lib\site-packages\wx-2.9.4-msw\wx\_core.p...", line 8660 in MainLoop
  File "mayavi-4.3.1\examples\mayavi\interactive\wx_embedding.py", line 66 in <module>

strangely the error is slightly different in wx_mayavi_embed_in_notbook.py (I actually had to make some modifications to the way this .py file was calling wxPyhon, but I don't think that is related to the crash):


Thread 0x00000aa8:
  File "C:\ThirdParty\lib\traitsui\image\image.py", line 292 in _process
  File "C:\Portable Python 2.7.5.1\App\lib\threading.py", line 761 in run
  File "C:\Portable Python 2.7.5.1\App\lib\threading.py", line 808 in __bootstrap_inner
  File "C:\Portable Python 2.7.5.1\App\lib\threading.py", line 781 in __bootstrap

Current thread 0x0000026c:
  File "C:\ThirdParty\lib\wx-3.0.1-msw-classic\wx\_core.py", line 9191 in DestroyChildren
  File "C:\ThirdParty\lib\traitsui\wx\toolkit.py", line 477 in destroy_children
  File "C:\ThirdParty\lib\traitsui\ui.py", line 323 in reset
  File "C:\ThirdParty\lib\traitsui\ui.py", line 267 in finish
  File "C:\ThirdParty\lib\traitsui\wx\ui_live.py", line 320 in close
  File "C:\ThirdParty\lib\traitsui\wx\ui_live.py", line 360 in _on_ok
  File "C:\ThirdParty\lib\wx-3.0.1-msw-classic\wx\_core.py", line 7952 in MainLoop
  File "C:\ThirdParty\lib\wx-3.0.1-msw-classic\wx\_core.py", line 8657 in MainLoop
  File "mayavi-4.3.1\examples\mayavi\interactive\wx_mayavi_embed_in_notebook.py", line 95 in <module>

I haven't tried this yet on my computer that I think should have graphics acceleration, I'm pretty sure the machine that is crashing doesn't have acceleration as it is a Virtual Machine.

Any ideas?

from mayavi.

ewoudenberg avatar ewoudenberg commented on July 21, 2024

This solved the exact same problem I encountered running Mayavi on a Windows 2003 Server machine over Remote Desktop.

If you're testing from within the Canopy IDE/Editor, you'll need to restart the kernel after commenting out the block starting with:

 if scene.light_manager is None: 

in tvtk/pyface/ui/qt4/scene.py

from mayavi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.