C

Using Behavior Scripts

Qt 3D Studio supports using behavior scripts. Included in Studio is a set of behavior scripts. These can be found in the scripts asset library.

It is possible to write new behavior scripts and use them in Studio.

Behavior scripts can be applied to objects to give the specific object a certain behavior. Behavior properties can be edited in the inspector palette.

Add a Behavior

This is an example on how to add a behavior and use it in your project. In this example we are using the CopyTransform behavior.

  1. From the project palette, open the behavior library. Then select the CopyTransform.qml file from the file dialog to import it to your project.

  2. Add two cubes to the scene by dragging and dropping from the basic objects palette.
  3. Move the cubes away from each other.

  4. Animate the position of one of the cubes.
  5. Drag the CopyTransform script from the project palette to the cube (in the scene graph) that has no animation. The CopyTransform script appears as a child object to the Cube.

  6. Select the CopyTransform script in the scene graph and set the properties in the inspector palette:
    • Copy Target: The cube with the animation
    • Additive mode: True
    • Position: True
    • Start Immediately: True

  7. Preview the presentation in the Viewer to see the result.

Available under certain Qt licenses.
Find out more.