[vtk-developers] A weird 6.x specific bug with ModifiedEvents

Prabhu Ramachandran prabhu at aero.iitb.ac.in
Mon Apr 14 11:35:49 EDT 2014


Hi everyone,

I just discovered a weird bug with VTK 6.1 and 6.0 that doesn't happen 
with VTK 5.x.  Here is a tiny Python script:

##################################################
import vtk
def f(o, e):
     print e, o.GetAmbientColor(), o.GetColor(),
     print o.GetDiffuseColor(), o.GetSpecularColor()

p = vtk.vtkProperty()
p.AddObserver('ModifiedEvent', f)
p.SetColor(0,0,0)
print p.GetColor()
##################################################

If you comment out the AddObserver line, everything works correctly but 
with it, you can never set the color of the property!  This doesn't seem 
to be specific to Python and happens with a small C++ example as well.

Thoughts?

cheers,
Prabhu


More information about the vtk-developers mailing list