[PyQt] setting a uniform value

Josh Stratton strattonbrazil at gmail.com
Sun Aug 14 23:40:00 BST 2011


I really need to add an entire program?  I'm passing a
QGLShaderProgram and QMatrix4x4 and getting an "argument doesn't
exist".  Would an entire program really provide that much more
information?

On Sun, Aug 14, 2011 at 2:45 PM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> On Sun, 14 Aug 2011 13:14:20 -0700, Josh Stratton
> <strattonbrazil at gmail.com> wrote:
>> I'm getting type errors sending a QMatrixr4x4 to a QGLShaderProgram.
>> The program was taken from a C++ version of comparable code, but I'm
>> assuming I need to do something more on the pyqt side to get the value
>> passed over correctly?
>
> No.
>
>> objToWorld = QMatrix4x4()
>> flatShader.setUniformValue("objToWorld", objToWorld)
>>
>> flatShader.setUniformValue("objToWorld", objToWorld)
>> TypeError: arguments did not match any overloaded call:
>>   QGLShaderProgram.setUniformValue(int, int): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, float): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, float, float): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, float, float, float): argument
>> 1 has unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, float, float, float, float):
>> argument 1 has unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, QVector2D): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, QVector3D): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, QVector4D): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(int, QColor): argument 1 has
>> unexpected type 'str'
>>   QGLShaderProgram.setUniformValue(str, QTransform): argument 2 has
>> unexpected type 'PyQt4.QtCore.pyqtWrapperType'
>>   etc.
>
> A short, complete program to demonstrate the problem would help.
>
> Phil
>


More information about the PyQt mailing list