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. AnimatedSprite not run while implemented on a View3D Node?
Forum Updated to NodeBB v4.3 + New Features

AnimatedSprite not run while implemented on a View3D Node?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 400 Views 2 Watching
  • 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.
  • M Offline
    M Offline
    MeganeSenpai
    wrote 23 days ago last edited by MeganeSenpai
    #1

    So I have an animated sprite implemented in a View3D node similar to this:

    View3D {
        id: root
        environment: environment
        camera: camera01
        width: parent.width
        height: parent.height
        visible: true
        Node {
             id: imageNode
             visible: true
             position: Qt.vector3d(-2, 0, -70)
             scale: Qt.vector3d(0.01, 0.01, 0.01)
    
             Rectangle {
                    id: testRect
                    width: 250
                    height: 250
                    visible: true
                    color: "transparent"
                    border.color: "#ec001c"
                    border.width: 3
                    radius: 5
    
                    SpriteSheetAnimation {
                         id: testSprite
                         visible: true
                         source: "path/to/image.png"
                         frameCount: spriteCount
                         frameWidth: spriteWidth
                         frameHeight: spriteHeight
                         frameRate: 30
                         loops: AnimatedSprite.Infinite
    
                         onCurrentFrameChanged: {
                             console.log("Sprite current frame = " + currentFrame)
                         }
                     }
                }
        }
    }
    

    And it only shows the first frame of the animated sprite, despite the logs shows that the currentFrame keeps increasing.

    I tried moving the exact code of the SpriteSheetAnimation to a 2D view, and it runs just fine, so I don't think the sprite nor the asset is the problem here.

    I'm using QT version 6.2.4

    Please help me identify the issue here. Or if I shouldn't use Node, which should I use instead for the image to be updated? Thank you.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jonas Karlsson
      wrote 20 days ago last edited by
      #2

      I suggest you try with the latest Qt version (6.9 atm) first and if that does not work, create a bug report at https://bugreports.qt.io/

      M 1 Reply Last reply 20 days ago
      0
      • J Jonas Karlsson
        20 days ago

        I suggest you try with the latest Qt version (6.9 atm) first and if that does not work, create a bug report at https://bugreports.qt.io/

        M Offline
        M Offline
        MeganeSenpai
        wrote 20 days ago last edited by
        #3

        @Jonas-Karlsson Unfortunately I'm working on a sizable project for a company so I can't upgrade QT version if I want to.
        Also, I'm not sure if it was a bug or that's how nodes are intended to work and I'm just uninformed, as I'm quite new to QT. That's why I'm asking if there is any alternate method to implement it.
        Thank you,

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote 19 days ago last edited by
          #4

          Hi and welcome to devnet,

          While I understand the lock you are into, testing with a more recent version can help you check whether what you actually have is working. Two possible outcomes:

          • it does and you can try to back port the changes needed
          • it does not and you have to check if it's an issue (and possibly fill a new ticket about it)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          30 May 2025, 07:29

          • Login

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