- Qt 6.5
- Qt Quick 3D
- QML Types
- QtQuick3D.Particles3D
- ModelBlendParticle3D
- Qt Quick 3D | Commercial or GPLv3

# ModelBlendParticle3D QML Type

Blends particle effect with a 3D model. More...

Import Statement: | import QtQuick3D.Particles3D
Inherits: | Particle3D

- List of all members, including inherited members

## Properties

- ModelBlendEmitMode : enumeration
- ModelBlendMode : enumeration
- activationNode : Node
- delegate : Component
- emitMode : bool
- endNode : Node
- endTime : int
- modelBlendMode : ModelBlendMode

## Detailed Description

The type provides a way to blend particle effect with a 3D model. The provided model needs to be triangle-based. Each triangle in the model is converted into a particle, which are then used by the emitter. Instead of particle shader, the model is shaded using the material specified in the model. The way the effect is blended is determined by the modelBlendMode.

The possible modes are:

- Construct, where the model gets constructed from the particles.
- Explode, where the model gets converted into particles.
- Transfer, where Construct and Explode are combined to create an effect where the model is transferred from one place to another.

By default the particles are emitted in the order they are specified in the model unless emitMode is set to `Random` or emitMode is set to `Activation` and activationNode is set.

Some features defined in base class and emitters are not functional with this type:

- Particle3D::alignMode is not functional since the particles can be in arbitrary orientation in the model.
- Particle3D::sortMode is not functional since the particles are always rendered in the order the primitives are specified in the model.
- ParticleEmitter3D::depthBias is not functional since the model depth bias is used instead.

Note: The default fadeInEffect and fadeOutEffect are `Particle3D.FadeNone`.

## Property Documentation

ModelBlendEmitMode : enumeration

Defines the emit mode of the particles

Constant | Description
--- | ---
`ModelBlendParticle3D.Sequential` | The particles are emitted in the order they are defined in the model.
`ModelBlendParticle3D.Random` | The particles are emitted in random order.
`ModelBlendParticle3D.Activation` | The particles are emitted when they are activated by the activationNode.

ModelBlendMode : enumeration

Defines the blending mode for the particle effect.

Constant | Description
--- | ---
`ModelBlendParticle3D.Explode` | The model gets exploded i.e. the particles are emitted from the position of the model.
`ModelBlendParticle3D.Construct` | The model gets constructed i.e the particles fly from the emitter and construct the model at the end.
`ModelBlendParticle3D.Transfer` | Combines Explode and Transfer for the same model.

activationNode : Node

This property holds a node that activates particles and overrides the reqular emit routine. The activation node can be used to control how the particles are emitted spatially when the model is exploded/constructed from the particles. The activation node emits a particle if the center of that particle is on the positive half of the z-axis of the activation node. Animating the activation node to move trough the model will cause the particles to be emitted sequentially along the path the activation node moves.

delegate : Component

The delegate provides a template defining the model for the ModelBlendParticle3D.

For example, using the default sphere model with default material

     Component {
         id: modelComponent
         Model {
             source: "#Sphere"
             scale: Qt.vector3d(0.5, 0.5, 0.5)
             materials: DefaultMaterial { diffuseColor: "red" }
         }
     }

     ModelBlendParticle3D {
         id: particleRedSphere
         delegate: modelComponent
     }

emitMode : bool

This property holds the emit mode of the particles.

endNode : Node

This property holds the node that specifies the transformation for the model at the end of particle effect. It defines the size, position and rotation where the model is constructed when using the `ModelBlendParticle3D.Construct` and `ModelBlendParticle3D.Transfer` blend modes.

endTime : int

This property holds the end time of the particle in milliseconds. The end time is used during construction and defines duration from particle lifetime at the end where the effect is blended with the model positions. Before the end time the particles positions are defined only by the particle effect, but during end time the particle position is blended linearly with the model end position.

modelBlendMode : ModelBlendMode

This property holds blending mode for the particle effect.