- Qt 6.7
- Qt Quick 3D
- C++ Classes
- QSSGModelHelpers
- Qt Quick 3D | Commercial or GPLv3

# QSSGModelHelpers Class

Class containing helper functions for modifying and setting data for model renderables. More...

Header: | #include <QSSGModelHelpers>
Since: | Qt 6.7

- List of all members, including inherited members

## Static Public Members

float | getGlobalOpacity(const QSSGFrameData &frameData, QSSGNodeId model)
float | getGlobalOpacity(const QSSGFrameData &frameData, QSSGNodeId model, QSSGPrepContextId prepId)
QMatrix4x4 | getGlobalTransform(const QSSGFrameData &frameData, QSSGNodeId model, QSSGPrepContextId prepId = {})
float | getLocalOpacity(const QSSGFrameData &frameData, QSSGNodeId model)
QMatrix4x4 | getLocalTransform(const QSSGFrameData &frameData, QSSGNodeId model)
void | setGlobalOpacity(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, float opacity)
void | setGlobalTransform(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, const QMatrix4x4 &transform)
void | setModelMaterials(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, QSSGModelHelpers::MaterialList materials)
void | setModelMaterials(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGModelHelpers::MaterialList materials)

## Detailed Description

## Member Function Documentation

### `[static]` float QSSGModelHelpers::getGlobalOpacity(const QSSGFrameData &frameData, QSSGNodeId model)

Returns Returns the global opacity for the model.

frameData

### `[static]` float QSSGModelHelpers::getGlobalOpacity(const QSSGFrameData &frameData, QSSGNodeId model, QSSGPrepContextId prepId)

Returns Returns the global opacity for the model in context of the prepId. By default the prep context argument is QSSGPrepContextId::Uninitialized which returns the model's original global opacity.

frameData

See also QSSGRenderHelpers::createRenderables().

### `[static]` QMatrix4x4 QSSGModelHelpers::getGlobalTransform(const QSSGFrameData &frameData, QSSGNodeId model, QSSGPrepContextId prepId = {})

Returns Returns the global transform for the model in context of the prepId. By default the prep context argument is QSSGPrepContextId::Uninitialized which returns the model's original global transform.

frameData

See also QSSGRenderHelpers::createRenderables().

### `[static]` float QSSGModelHelpers::getLocalOpacity(const QSSGFrameData &frameData, QSSGNodeId model)

Returns Returns the local opacity for the model.

frameData

### `[static]` QMatrix4x4 QSSGModelHelpers::getLocalTransform(const QSSGFrameData &frameData, QSSGNodeId model)

Returns Returns the local transform for the model.

frameData

### `[static]` void QSSGModelHelpers::setGlobalOpacity(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, float opacity)

Sets the global opacity for model in the context of the renderablesId.

frameData, opacity

See also QSSGRenderHelpers::createRenderables().

### `[static]` void QSSGModelHelpers::setGlobalTransform(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, const QMatrix4x4 &transform)

Sets the global transform for model in the context of the renderablesId.

frameData, transform

See also QSSGRenderHelpers::createRenderables().

### `[static]` void QSSGModelHelpers::setModelMaterials(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGNodeId model, QSSGModelHelpers::MaterialList materials)

Sets the materials to be used on model.

Note: As with the materials on the model item, materials are applied in the same manner.

The sub-mesh uses a material from the materials list, corresponding to its index. If the number of materials is less than the sub-meshes, the last material in the list is used for subsequent sub-meshes.

frameData renderablesId

See also QSSGRenderHelpers::createRenderables().

### `[static]` void QSSGModelHelpers::setModelMaterials(const QSSGFrameData &frameData, QSSGRenderablesId renderablesId, QSSGModelHelpers::MaterialList materials)

Convenience function to apply materials to all models in the renderablesId set.

frameData, renderablesId

See also QSSGRenderHelpers::createRenderables().