Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Qt 3D Animation Easter Teaser

Using Blender and Qt 3D in Qt 5.9 to create, texture, and animate a model


    Entity {
        id: cube

        components: [
            Transform {
                id: cubeTransform
            },
            Mesh {
                source: "qrc:/assets/egg/egg.obj"
            },
            TexturedMetalRoughMaterial {
                baseColor: TextureLoader {
                    format: Texture.SRGB8_Alpha8
                    source: "qrc:/assets/egg/basecolor.png"
                }
                metalness: TextureLoader { source: "qrc:/assets/egg/metalness.png" }
                roughness: TextureLoader { source: "qrc:/assets/egg/roughness.png" }
                normal: TextureLoader { source: "qrc:/assets/egg/normal.png" }
                ambientOcclusion: TextureLoader { source: "qrc:/assets/egg/ambientocclusion.png" }
            },
            ObjectPicker {
                onClicked: animator.running = true
            },
            ClipAnimator {
                id: animator
                loops: 3
                clip: AnimationClipLoader { source: "qrc:/jumpinganimation.json" }
                channelMapper: ChannelMapper {
                    mappings: [
                        ChannelMapping { channelName: "Location"; target: cubeTransform; property: "translation" },
                        ChannelMapping { channelName: "Rotation"; target: cubeTransform; property: "rotation" },
                        ChannelMapping { channelName: "Scale"; target: cubeTransform; property: "scale3D" }
                    ]
                }
            }
        ]
    }

1 Comment

29 - Apr - 2018

Adriel

SeanHarmer

Sean Harmer

Managing Director KDAB UK