QAttribute

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

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QAttribute

Synopsis

Functions

Slots

Signals

Static functions

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 PySide2.Qt3DRender.Qt3DRender.QAttribute([parent=None])

PySide2.Qt3DRender.Qt3DRender.QAttribute(buf, vertexBaseType, vertexSize, count[, offset=0[, stride=0[, parent=None]]])

PySide2.Qt3DRender.Qt3DRender.QAttribute(buf, name, vertexBaseType, vertexSize, count[, offset=0[, stride=0[, parent=None]]])

param parent:

PySide2.Qt3DCore.Qt3DCore.QNode

param vertexBaseType:

VertexBaseType

param buf:

PySide2.Qt3DRender.Qt3DRender.QBuffer

param offset:

uint

param name:

str

param stride:

uint

param count:

uint

param vertexSize:

uint

Constructs a new QAttribute with parent .

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

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

PySide2.Qt3DRender.Qt3DRender.QAttribute.AttributeType

The type of the attribute.

Constant

Description

Qt3DRender.QAttribute.VertexAttribute

Qt3DRender.QAttribute.IndexAttribute

Qt3DRender.QAttribute.DrawIndirectAttribute

PySide2.Qt3DRender.Qt3DRender.QAttribute.VertexBaseType

The type of the data.

Constant

Description

Qt3DRender.QAttribute.Byte

Qt3DRender.QAttribute.UnsignedByte

Qt3DRender.QAttribute.Short

Qt3DRender.QAttribute.UnsignedShort

Qt3DRender.QAttribute.Int

Qt3DRender.QAttribute.UnsignedInt

Qt3DRender.QAttribute.HalfFloat

Qt3DRender.QAttribute.Float

Qt3DRender.QAttribute.Double

PySide2.Qt3DRender.Qt3DRender.QAttribute.attributeType()
Return type:

AttributeType

Holds the attribute type.

PySide2.Qt3DRender.Qt3DRender.QAttribute.attributeTypeChanged(attributeType)
Parameters:

attributeTypeAttributeType

PySide2.Qt3DRender.Qt3DRender.QAttribute.buffer()
Return type:

PySide2.Qt3DRender.Qt3DRender.QBuffer

Holds the buffer.

PySide2.Qt3DRender.Qt3DRender.QAttribute.bufferChanged(buffer)
Parameters:

bufferPySide2.Qt3DRender.Qt3DRender.QBuffer

PySide2.Qt3DRender.Qt3DRender.QAttribute.byteOffset()
Return type:

uint

Holds the byte offset.

PySide2.Qt3DRender.Qt3DRender.QAttribute.byteOffsetChanged(byteOffset)
Parameters:

byteOffsetuint

PySide2.Qt3DRender.Qt3DRender.QAttribute.byteStride()
Return type:

uint

Holds the byte stride.

PySide2.Qt3DRender.Qt3DRender.QAttribute.byteStrideChanged(byteStride)
Parameters:

byteStrideuint

PySide2.Qt3DRender.Qt3DRender.QAttribute.count()
Return type:

uint

Holds the count.

PySide2.Qt3DRender.Qt3DRender.QAttribute.countChanged(count)
Parameters:

countuint

PySide2.Qt3DRender.Qt3DRender.QAttribute.dataSizeChanged(vertexSize)
Parameters:

vertexSizeuint

PySide2.Qt3DRender.Qt3DRender.QAttribute.dataTypeChanged(vertexBaseType)
Parameters:

vertexBaseTypeVertexBaseType

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultColorAttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultJointIndicesAttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultJointWeightsAttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultNormalAttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultPositionAttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultTangentAttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultTextureCoordinate1AttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultTextureCoordinate2AttributeName()
Return type:

str

static PySide2.Qt3DRender.Qt3DRender.QAttribute.defaultTextureCoordinateAttributeName()
Return type:

str

PySide2.Qt3DRender.Qt3DRender.QAttribute.divisor()
Return type:

uint

Holds the divisor.

PySide2.Qt3DRender.Qt3DRender.QAttribute.divisorChanged(divisor)
Parameters:

divisoruint

PySide2.Qt3DRender.Qt3DRender.QAttribute.name()
Return type:

str

Holds the name.

PySide2.Qt3DRender.Qt3DRender.QAttribute.nameChanged(name)
Parameters:

name – str

PySide2.Qt3DRender.Qt3DRender.QAttribute.setAttributeType(attributeType)
Parameters:

attributeTypeAttributeType

Holds the attribute type.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setBuffer(buffer)
Parameters:

bufferPySide2.Qt3DRender.Qt3DRender.QBuffer

Holds the buffer.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setByteOffset(byteOffset)
Parameters:

byteOffsetuint

Holds the byte offset.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setByteStride(byteStride)
Parameters:

byteStrideuint

Holds the byte stride.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setCount(count)
Parameters:

countuint

Holds the count.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setDataSize(size)
Parameters:

sizeuint

Note

This function is deprecated.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setDataType(type)
Parameters:

typeVertexBaseType

Note

This function is deprecated.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setDivisor(divisor)
Parameters:

divisoruint

Holds the divisor.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setName(name)
Parameters:

name – str

Holds the name.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setVertexBaseType(type)
Parameters:

typeVertexBaseType

Holds the data type.

PySide2.Qt3DRender.Qt3DRender.QAttribute.setVertexSize(size)
Parameters:

sizeuint

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

PySide2.Qt3DRender.Qt3DRender.QAttribute.vertexBaseType()
Return type:

VertexBaseType

Holds the data type.

PySide2.Qt3DRender.Qt3DRender.QAttribute.vertexBaseTypeChanged(vertexBaseType)
Parameters:

vertexBaseTypeVertexBaseType

PySide2.Qt3DRender.Qt3DRender.QAttribute.vertexSize()
Return type:

uint

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

PySide2.Qt3DRender.Qt3DRender.QAttribute.vertexSizeChanged(vertexSize)
Parameters:

vertexSizeuint