AnimatedSprite not run while implemented on a View3D Node?
-
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.
-
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/
-
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/
@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, -
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)