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
setDataSize
(size)def
setDataType
(type)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 usedNote
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:
- param vertexBaseType:
- param buf:
- param offset:
uint
- param name:
str
- param stride:
uint
- param count:
uint
- param vertexSize:
uint
Constructs a new
QAttribute
withparent
.Constructs a new
QAttribute
frombuf
oftype
,dataSize
,count
,offset
, andstride
withparent
.Constructs a new
QAttribute
namedname
frombuf
oftype
,dataSize
,count
,offset
, andstride
withparent
.
- 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:
Holds the attribute type.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.attributeTypeChanged(attributeType)¶
- Parameters:
attributeType –
AttributeType
- PySide2.Qt3DRender.Qt3DRender.QAttribute.buffer()¶
- Return type:
Holds the buffer.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.bufferChanged(buffer)¶
- Parameters:
- PySide2.Qt3DRender.Qt3DRender.QAttribute.byteOffset()¶
- Return type:
uint
Holds the byte offset.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.byteOffsetChanged(byteOffset)¶
- Parameters:
byteOffset –
uint
- PySide2.Qt3DRender.Qt3DRender.QAttribute.byteStride()¶
- Return type:
uint
Holds the byte stride.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.byteStrideChanged(byteStride)¶
- Parameters:
byteStride –
uint
- PySide2.Qt3DRender.Qt3DRender.QAttribute.count()¶
- Return type:
uint
Holds the count.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.countChanged(count)¶
- Parameters:
count –
uint
- PySide2.Qt3DRender.Qt3DRender.QAttribute.dataSizeChanged(vertexSize)¶
- Parameters:
vertexSize –
uint
- PySide2.Qt3DRender.Qt3DRender.QAttribute.dataTypeChanged(vertexBaseType)¶
- Parameters:
vertexBaseType –
VertexBaseType
- 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:
divisor –
uint
- 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:
attributeType –
AttributeType
Holds the attribute type.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setBuffer(buffer)¶
- Parameters:
Holds the buffer.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setByteOffset(byteOffset)¶
- Parameters:
byteOffset –
uint
Holds the byte offset.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setByteStride(byteStride)¶
- Parameters:
byteStride –
uint
Holds the byte stride.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setCount(count)¶
- Parameters:
count –
uint
Holds the count.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setDataSize(size)¶
- Parameters:
size –
uint
Note
This function is deprecated.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setDataType(type)¶
- Parameters:
type –
VertexBaseType
Note
This function is deprecated.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setDivisor(divisor)¶
- Parameters:
divisor –
uint
Holds the divisor.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setName(name)¶
- Parameters:
name – str
Holds the name.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.setVertexBaseType(type)¶
- Parameters:
type –
VertexBaseType
Holds the data type.
- PySide2.Qt3DRender.Qt3DRender.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).
- PySide2.Qt3DRender.Qt3DRender.QAttribute.vertexBaseType()¶
- Return type:
Holds the data type.
- PySide2.Qt3DRender.Qt3DRender.QAttribute.vertexBaseTypeChanged(vertexBaseType)¶
- Parameters:
vertexBaseType –
VertexBaseType
- 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:
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.