class QAttribute

Defines an attribute and how data should be read from a QBuffer . More

Inheritance diagram of PySide6.Qt3DCore.Qt3DCore.QAttribute

Synopsis

Properties

Methods

Slots

Signals

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

There are 3 types of attributes.

  • VertexAttribute : used to define data to be read on a per vertex basis

  • IndexAttribute : used to define vertex indices when indexed draw calls are to be used

  • DrawIndirectAttribute : used to specify the DrawIndirect buffer to be used when indirect draw calls are to be used

Note

when an attribute is of type DrawIndirectAttribute , only count, stride and offset are relevant.

When providing your own attributes, it may make sense to name your attribute using helpers such as defaultPositionAttributeName() as that will ensure your geometry will be compatible with picking and the various materials provided in the Qt3DExtras module.

See also

QBuffer

class AttributeType

The type of the attribute.

Constant

Description

Qt3DCore.QAttribute.VertexAttribute

Qt3DCore.QAttribute.IndexAttribute

Qt3DCore.QAttribute.DrawIndirectAttribute

class VertexBaseType

The type of the data.

Constant

Description

Qt3DCore.QAttribute.Byte

Qt3DCore.QAttribute.UnsignedByte

Qt3DCore.QAttribute.Short

Qt3DCore.QAttribute.UnsignedShort

Qt3DCore.QAttribute.Int

Qt3DCore.QAttribute.UnsignedInt

Qt3DCore.QAttribute.HalfFloat

Qt3DCore.QAttribute.Float

Qt3DCore.QAttribute.Double

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property attributeTypeᅟ: Qt3DCore.QAttribute.AttributeType

Holds the attribute type.

Access functions:
property bufferᅟ: QBuffer

Holds the buffer.

Access functions:
property byteOffsetᅟ: int

Holds the byte offset.

Access functions:
property byteStrideᅟ: int

Holds the byte stride.

Access functions:
property countᅟ: int

Holds the count.

Access functions:
property defaultColorAttributeNameᅟ: str
Access functions:
property defaultJointIndicesAttributeNameᅟ: str
Access functions:
property defaultJointWeightsAttributeNameᅟ: str
Access functions:
property defaultNormalAttributeNameᅟ: str
Access functions:
property defaultPositionAttributeNameᅟ: str
Access functions:
property defaultTangentAttributeNameᅟ: str
Access functions:
property defaultTextureCoordinate1AttributeNameᅟ: str
Access functions:
property defaultTextureCoordinate2AttributeNameᅟ: str
Access functions:
property defaultTextureCoordinateAttributeNameᅟ: str
Access functions:
property divisorᅟ: int

Holds the divisor.

Access functions:
property nameᅟ: str

Holds the name.

Access functions:
property vertexBaseTypeᅟ: Qt3DCore.QAttribute.VertexBaseType

Holds the data type.

Access functions:
property vertexSizeᅟ: int

Holds the data size, it can only be 1 to 4 units (scalars and vectors), 9 units (3x3 matrices) or 16 units (4x4 matrices).

Access functions:
__init__([parent=None])
Parameters:

parentQNode

Constructs a new QAttribute with parent.

__init__(buf, vertexBaseType, vertexSize, count[, offset=0[, stride=0[, parent=None]]])
Parameters:
  • bufQBuffer

  • vertexBaseTypeVertexBaseType

  • vertexSize – int

  • count – int

  • offset – int

  • stride – int

  • parentQNode

Constructs a new QAttribute from buf of type, dataSize, count, offset, and stride with parent.

__init__(buf, name, vertexBaseType, vertexSize, count[, offset=0[, stride=0[, parent=None]]])
Parameters:
  • bufQBuffer

  • name – str

  • vertexBaseTypeVertexBaseType

  • vertexSize – int

  • count – int

  • offset – int

  • stride – int

  • parentQNode

Constructs a new QAttribute named name from buf of type, dataSize, count, offset, and stride with parent.

attributeType()
Return type:

AttributeType

See also

setAttributeType()

Getter of property attributeTypeᅟ .

attributeTypeChanged(attributeType)
Parameters:

attributeTypeAttributeType

Notification signal of property attributeTypeᅟ .

buffer()
Return type:

QBuffer

See also

setBuffer()

Getter of property bufferᅟ .

bufferChanged(buffer)
Parameters:

bufferQBuffer

Notification signal of property bufferᅟ .

byteOffset()
Return type:

int

See also

setByteOffset()

Getter of property byteOffsetᅟ .

byteOffsetChanged(byteOffset)
Parameters:

byteOffset – int

Notification signal of property byteOffsetᅟ .

byteStride()
Return type:

int

See also

setByteStride()

Getter of property byteStrideᅟ .

byteStrideChanged(byteStride)
Parameters:

byteStride – int

Notification signal of property byteStrideᅟ .

count()
Return type:

int

See also

setCount()

Getter of property countᅟ .

countChanged(count)
Parameters:

count – int

Notification signal of property countᅟ .

dataSizeChanged(vertexSize)
Parameters:

vertexSize – int

The signal is emitted with vertexSize when the dataSize changes.

dataTypeChanged(vertexBaseType)
Parameters:

vertexBaseTypeVertexBaseType

The signal is emitted with vertexBaseType when the dataType changed.

static defaultColorAttributeName()
Return type:

str

QAttribute::defaultColorAttributeName Returns the name of the default color attribute

Getter of property defaultColorAttributeNameᅟ .

static defaultJointIndicesAttributeName()
Return type:

str

QAttribute::defaultJointIndicesAttributeName Returns the name of the default joint indices attribute

Getter of property defaultJointIndicesAttributeNameᅟ .

static defaultJointWeightsAttributeName()
Return type:

str

defaultJointIndicesAttributeName Returns the name of the default joint weights attribute

Getter of property defaultJointWeightsAttributeNameᅟ .

static defaultNormalAttributeName()
Return type:

str

QAttribute::defaultNormalAttributeName Returns the name of the default normal attribute

Getter of property defaultNormalAttributeNameᅟ .

static defaultPositionAttributeName()
Return type:

str

QAttribute::defaultPositionAttributeName Returns the name of the default position attribute

Getter of property defaultPositionAttributeNameᅟ .

static defaultTangentAttributeName()
Return type:

str

QAttribute::defaultTangentAttributeName Returns the name of the default tangent attribute

Getter of property defaultTangentAttributeNameᅟ .

static defaultTextureCoordinate1AttributeName()
Return type:

str

QAttribute::defaultTextureCoordinate1AttributeName Returns the name of the default attribute for the second layer of texture coordinates

Getter of property defaultTextureCoordinate1AttributeNameᅟ .

static defaultTextureCoordinate2AttributeName()
Return type:

str

QAttribute::defaultTextureCoordinate2AttributeName Returns the name of the default attribute for the third layer of texture coordinates

Getter of property defaultTextureCoordinate2AttributeNameᅟ .

static defaultTextureCoordinateAttributeName()
Return type:

str

QAttribute::defaultTextureCoordinateAttributeName Returns the name of the default texture coordinate attribute

Getter of property defaultTextureCoordinateAttributeNameᅟ .

divisor()
Return type:

int

See also

setDivisor()

Getter of property divisorᅟ .

divisorChanged(divisor)
Parameters:

divisor – int

Notification signal of property divisorᅟ .

name()
Return type:

str

See also

setName()

Getter of property nameᅟ .

nameChanged(name)
Parameters:

name – str

Notification signal of property nameᅟ .

setAttributeType(attributeType)
Parameters:

attributeTypeAttributeType

See also

attributeType()

Setter of property attributeTypeᅟ .

setBuffer(buffer)
Parameters:

bufferQBuffer

See also

buffer()

Setter of property bufferᅟ .

setByteOffset(byteOffset)
Parameters:

byteOffset – int

See also

byteOffset()

Setter of property byteOffsetᅟ .

setByteStride(byteStride)
Parameters:

byteStride – int

See also

byteStride()

Setter of property byteStrideᅟ .

setCount(count)
Parameters:

count – int

See also

count()

Setter of property countᅟ .

setDivisor(divisor)
Parameters:

divisor – int

See also

divisor()

Setter of property divisorᅟ .

setName(name)
Parameters:

name – str

See also

name()

Setter of property nameᅟ .

setVertexBaseType(type)
Parameters:

typeVertexBaseType

See also

vertexBaseType()

Setter of property vertexBaseTypeᅟ .

setVertexSize(size)
Parameters:

size – int

See also

vertexSize()

Setter of property vertexSizeᅟ .

vertexBaseType()
Return type:

VertexBaseType

See also

setVertexBaseType()

Getter of property vertexBaseTypeᅟ .

vertexBaseTypeChanged(vertexBaseType)
Parameters:

vertexBaseTypeVertexBaseType

Notification signal of property vertexBaseTypeᅟ .

vertexSize()
Return type:

int

See also

setVertexSize()

Getter of property vertexSizeᅟ .

vertexSizeChanged(vertexSize)
Parameters:

vertexSize – int

Notification signal of property vertexSizeᅟ .