QAttribute¶
Defines an attribute and how data should be read from a QBuffer
. More…
Synopsis¶
Functions¶
def
attributeType
()def
buffer
()def
byteOffset
()def
byteStride
()def
count
()def
divisor
()def
name
()def
vertexBaseType
()def
vertexSize
()
Slots¶
def
setAttributeType
(attributeType)def
setBuffer
(buffer)def
setByteOffset
(byteOffset)def
setByteStride
(byteStride)def
setCount
(count)def
setDivisor
(divisor)def
setName
(name)def
setVertexBaseType
(type)def
setVertexSize
(size)
Signals¶
def
attributeTypeChanged
(attributeType)def
bufferChanged
(buffer)def
byteOffsetChanged
(byteOffset)def
byteStrideChanged
(byteStride)def
countChanged
(count)def
dataSizeChanged
(vertexSize)def
dataTypeChanged
(vertexBaseType)def
divisorChanged
(divisor)def
nameChanged
(name)def
vertexBaseTypeChanged
(vertexBaseType)def
vertexSizeChanged
(vertexSize)
Static functions¶
def
defaultColorAttributeName
()def
defaultNormalAttributeName
()def
defaultPositionAttributeName
()def
defaultTangentAttributeName
()
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 PySide6.Qt3DCore.Qt3DCore.QAttribute(buf, vertexBaseType, vertexSize, count[, offset=0[, stride=0[, parent=None]]])¶
PySide6.Qt3DCore.Qt3DCore.QAttribute(buf, name, vertexBaseType, vertexSize, count[, offset=0[, stride=0[, parent=None]]])
PySide6.Qt3DCore.Qt3DCore.QAttribute([parent=None])
- Parameters
offset –
uint
vertexSize –
uint
name – str
count –
uint
vertexBaseType –
VertexBaseType
stride –
uint
parent –
PySide6.Qt3DCore.Qt3DCore.QNode
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
.
Constructs a new QAttribute
with parent
.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.AttributeType¶
The type of the attribute.
Constant
Description
Qt3DCore.QAttribute.VertexAttribute
Qt3DCore.QAttribute.IndexAttribute
Qt3DCore.QAttribute.DrawIndirectAttribute
- PySide6.Qt3DCore.Qt3DCore.QAttribute.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
- PySide6.Qt3DCore.Qt3DCore.QAttribute.attributeType()¶
- Return type
Holds the attribute type.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.attributeTypeChanged(attributeType)¶
- Parameters
attributeType –
AttributeType
- PySide6.Qt3DCore.Qt3DCore.QAttribute.buffer()¶
- Return type
Holds the buffer.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.bufferChanged(buffer)¶
- Parameters
buffer –
PySide6.Qt3DCore.Qt3DCore.QBuffer
- PySide6.Qt3DCore.Qt3DCore.QAttribute.byteOffset()¶
- Return type
uint
Holds the byte offset.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.byteOffsetChanged(byteOffset)¶
- Parameters
byteOffset –
uint
- PySide6.Qt3DCore.Qt3DCore.QAttribute.byteStride()¶
- Return type
uint
Holds the byte stride.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.byteStrideChanged(byteStride)¶
- Parameters
byteStride –
uint
- PySide6.Qt3DCore.Qt3DCore.QAttribute.count()¶
- Return type
uint
Holds the count.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.countChanged(count)¶
- Parameters
count –
uint
- PySide6.Qt3DCore.Qt3DCore.QAttribute.dataSizeChanged(vertexSize)¶
- Parameters
vertexSize –
uint
- PySide6.Qt3DCore.Qt3DCore.QAttribute.dataTypeChanged(vertexBaseType)¶
- Parameters
vertexBaseType –
VertexBaseType
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultColorAttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultJointIndicesAttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultJointWeightsAttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultNormalAttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultPositionAttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultTangentAttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultTextureCoordinate1AttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultTextureCoordinate2AttributeName()¶
- Return type
str
- static PySide6.Qt3DCore.Qt3DCore.QAttribute.defaultTextureCoordinateAttributeName()¶
- Return type
str
- PySide6.Qt3DCore.Qt3DCore.QAttribute.divisor()¶
- Return type
uint
Holds the divisor.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.divisorChanged(divisor)¶
- Parameters
divisor –
uint
- PySide6.Qt3DCore.Qt3DCore.QAttribute.name()¶
- Return type
str
Holds the name.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.nameChanged(name)¶
- Parameters
name – str
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setAttributeType(attributeType)¶
- Parameters
attributeType –
AttributeType
Holds the attribute type.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setBuffer(buffer)¶
- Parameters
buffer –
PySide6.Qt3DCore.Qt3DCore.QBuffer
Holds the buffer.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setByteOffset(byteOffset)¶
- Parameters
byteOffset –
uint
Holds the byte offset.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setByteStride(byteStride)¶
- Parameters
byteStride –
uint
Holds the byte stride.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setCount(count)¶
- Parameters
count –
uint
Holds the count.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setDivisor(divisor)¶
- Parameters
divisor –
uint
Holds the divisor.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setName(name)¶
- Parameters
name – str
Holds the name.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setVertexBaseType(type)¶
- Parameters
type –
VertexBaseType
Holds the data type.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.setVertexSize(size)¶
- Parameters
size –
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).
- PySide6.Qt3DCore.Qt3DCore.QAttribute.vertexBaseType()¶
- Return type
Holds the data type.
- PySide6.Qt3DCore.Qt3DCore.QAttribute.vertexBaseTypeChanged(vertexBaseType)¶
- Parameters
vertexBaseType –
VertexBaseType
- PySide6.Qt3DCore.Qt3DCore.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).
- PySide6.Qt3DCore.Qt3DCore.QAttribute.vertexSizeChanged(vertexSize)¶
- Parameters
vertexSize –
uint
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.