Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Unable to adjust the diffuse color of a 3D model using DataInput in QML

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 156 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Parsa Mousavi
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved