Studio3D QML Type | Runtime 2.1

Qt 3D Studio | Runtime | QML Types | Studio3D QML Type

Qt 3D Studio Runtime 2.1 Manual

# Studio3D QML Type

Qt 3D Studio presentation viewer. More...

Import Statement: | import .
Inherits: | Item

- List of all members, including inherited members

## Properties

- error : string
- presentation : Presentation
- running : bool

## Signals

- frameUpdate()
- presentationLoaded()
- presentationReady()

## Detailed Description

This type enables developers to embed Qt 3D Studio presentations in Qt Quick.

### Example usage

      Studio3D {
          id: studio3D
          anchors.fill: parent

          Presentation {
              source: "qrc:///presentation.uia"
              SceneElement {
                  id: scene
                  elementPath: "Scene"
                  currentSlideIndex: 2
              }
              Element {
                  id: textLabel
                  elementPath: "Scene.Layer.myLabel"
              }
          }
          ViewerSettings {
              showRenderStats: true
          }
          onRunningChanged: {
              console.log("Presentation ready!");
          }
      }

### Controlling the presentation

Like the example above suggests, Studio3D and the other types under the QtStudio3D import offer more than simply rendering the animated Qt 3D Studio presentation. They also offer scene manipulation, including

- querying and changing scene object properties (for example, the transform of a model, colors and other settings of a material, etc.) via Presentation::getAttribute(), Presentation::setAttribute(), Element, and DataInput,
- changing slides (and thus starting the relevant animations and applying the scene object property changes associated with the new slide) via Presentation::goToSlide(), SceneElement, and DataInput,
- and controlling the timeline (the current playback position for the key-frame based animations) both on the main scene and on individual Component nodes via Presentation::goToTime(), SceneElement, and DataInput.

See also Presentation.

## Property Documentation

error : string

Contains the text for the error message that was generated during the loading of the presentation. When no error occurred or there is no presentation loaded, the value is an empty string.

This property is read-only.

presentation : Presentation

Accessor for the presentation. Applications are expected to create a single Presentation child object for Studio3D. If this is omitted, a presentation is created automatically.

This property is read-only.

running : bool

The value of this property is `true` when the presentation has been loaded and is ready to be shown.

This property is read-only.

## Signal Documentation

frameUpdate()

This signal is emitted each time a frame has been rendered.

presentationLoaded()

This signal is emitted when the presentation has been loaded and is ready to be shown.

presentationReady()

This signal is emitted when the presentation has fully initialized its 3D scene for the first frame.

The difference to presentationLoaded() is that this signal is emitted only when the asynchronous operations needed to build to 3D scene and the first frame have completed.

When implementing splash screens via Loader items and the Item::visible property, this is the signal that should be used to trigger hiding the splash screen.