Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unable to adjust the diffuse color of a 3D model using DataInput in QML



  • Hello everybody.
    I want to adjust the diffuse color of a 3D model imported to a Qt3DStudio project(.uia) via DataInput QML type in a QtQuick project.

    I added the project folder to my .qrc file and I imported the scene successfully using the Presentation QML type.

    I had two data inputs in the Qt3DStudio project:

    • sphereRotation
    • sphereDiffuseColor

    I can successfully adjust the rotation of the 3D sphere via something like this:

            DataInput{
                id:sphereRotationDI
                name:"sphereRotation"
                value:Qt.vector3d(0,0,100);
            }
    

    but the following doesn't work:

            DataInput{
                id:sphereDiffuseColorDI
                name:"sphereDiffuseColor"
                value: Qt.vector4d(100 , 200 , 80 , 255)
            }
    

    The Input type of the data input for sphereDiffuseColor is set automatically to Vector4 in the studio,so I used Qt.vector4d() to match that.And also the Diffuse color property in the Inspector panel has turned orange,so the data input should work.

    There's no specific warning or error message in the program output during runtime.

    What am I missing?

    Thanks in advance.


Log in to reply