BruceSherwood / vpython-wx

VPython based on wxPython
Other
70 stars 38 forks source link

Another strange bug with opacity #75

Closed dorverbin closed 9 years ago

dorverbin commented 9 years ago

Below is a simple code. When ran, it crashes my program. This does not happen when setting any different opacity for b (instead of b.opacity = 1), or when not setting the frame for b. Why would this happen?

import visual as v

f = v.frame()
b = v.box(frame=f, opacity=0.5)
b.opacity = 1
b.visible = False
BruceSherwood commented 9 years ago

I have no idea what could cause this crash. I do find that if I don't set b.visible = False there is no crash. Also, in the following version the crash occurs after the click:

import visual as v
f = v.frame()
b = v.box(frame=f, opacity=0.5)
b.opacity = 1
v.scene.waitfor('click')
b.visible = False
dorverbin commented 9 years ago

Yes, I forgot to mention that setting b.visible = False is the line that causes the crash. I do need to remove objects, so perhaps I should just set the opacity of every object I remove to 0, and just then do b.visible = False.

BruceSherwood commented 9 years ago

It's possible that the bug is related to categorizing opaque and transparent objects into two different lists, and that there's a conflict with categorizing visible and invisible objects into different lists. I did notice that b.opacity = anything but 1.0 makes the crash go away.

dorverbin commented 9 years ago

Thank you for the quick answers!