[vtkusers] VTK Python + GLSL shaders type casting and methods overloading

A. Sottoriva asottori at science.uva.nl
Tue Sep 26 19:13:42 EDT 2006


Hi all,

I'm using VTK 5.1 with python 2.4 and GLSL shaders. I've 2 uniform float
variables on the vertex shader and 2 uniform vec3 variables on the
fragment one. These are passed by the application with the
AddShaderVariable as describe de following code:

prop = myactor.GetProperty()
prop.LoadMaterial("myshader.xml")
prop.AddShareVariable("cTemp", 0.0)
prop.AddShareVariable("tRange", 10.0)
prop.AddShareVariable("cColor", 0.0, 0.0, 1.0)
prop.AddShareVariable("hColor", 1.0, 0.0, 0.0)
...

if I execute the code it gives me the following error:

DeprecationWarning: integer argument expected, got float

I tryied the same identical code in C++ and it works perfectly, it seems
to be a problem with the Python wrappers that cannot recognize correctly
the AddShareVariable() method overloading.
Any suggestion ?

regards,

-- 
[[ Andrea Sottoriva
[[ MSc student in Grid Computing
[[ Computational Science Programme
[[ Universiteit van Amsterdam (The Netherlands)
[[ ...
[[ http://hifi.metalabs.org






More information about the vtkusers mailing list