panda3d.core.GeomVertexArrayDataHandle

class GeomVertexArrayDataHandle

Bases: ReferenceCount, GeomEnums

This data object is returned by GeomVertexArrayData.getHandle() or modify_handle(). As long as it exists, the data is locked; when the last of these destructs, the data is unlocked.

Only one thread at a time may lock the data; other threads attempting to lock the data will block. A given thread may simultaneously lock the data multiple times.

This class serves in lieu of a pair of GeomVertexArrayDataPipelineReader and GeomVertexArrayDataPipelineWriter classes

Inheritance diagram

Inheritance diagram of GeomVertexArrayDataHandle

getObject() → GeomVertexArrayData
Return type

GeomVertexArrayData

getObject() → GeomVertexArrayData
Return type

GeomVertexArrayData

getArrayFormat() → GeomVertexArrayFormat
Return type

GeomVertexArrayFormat

getUsageHint() → UsageHint
Return type

UsageHint

getNumRows() → int
setNumRows(n: int) → bool
uncleanSetNumRows(n: int) → bool
reserveNumRows(n: int) → bool
clearRows() → None
getDataSizeBytes() → size_t
Return type

size_t

getModified() → UpdateSeq
Return type

UpdateSeq

requestResident() → bool

Returns true if the vertex data is currently resident in memory. If this returns true, the next call to get_handle()->get_read_pointer() will probably not block. If this returns false, the vertex data will be brought back into memory shortly; try again later.

prepareNow(prepared_objects: PreparedGraphicsObjects, gsg: GraphicsStateGuardianBase) → VertexBufferContext

Creates a context for the data on the particular GSG, if it does not already exist. Returns the new (or old) VertexBufferContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new datas. If this is not necessarily the case, you should use prepare() instead.

Normally, this is not called directly except by the GraphicsStateGuardian; a data does not need to be explicitly prepared by the user before it may be rendered.

Return type

VertexBufferContext

copyDataFrom(other: GeomVertexArrayDataHandle) → None

Copies the entire data array from the other object.

copyDataFrom(buffer: object) → None
copySubdataFrom(to_start: size_t, to_size: size_t, other: GeomVertexArrayDataHandle, from_start: size_t, from_size: size_t) → None

Copies a portion of the data array from the other object into a portion of the data array of this object. If to_size != from_size, the size of this data array is adjusted accordingly.

copySubdataFrom(to_start: size_t, to_size: size_t, buffer: object) → None
copySubdataFrom(to_start: size_t, to_size: size_t, buffer: object, from_start: size_t, from_size: size_t) → None
getData() → bytes

Returns the entire raw data of the GeomVertexArrayData object, formatted as a string. This is primarily for the benefit of high-level languages such as Python.

setData(data: bytes) → None

Replaces the entire raw data array with the contents of the indicated string. This is primarily for the benefit of high-level languages like Python.

getSubdata(start: size_t, size: size_t) → bytes

Returns a subset of the raw data of the GeomVertexArrayData object, formatted as a string. This is primarily for the benefit of high-level languages such as Python.

setSubdata(start: size_t, size: size_t, data: bytes) → None

Replaces a portion of the data array from the indicated string. If size != data.size(), the size of this data array is adjusted accordingly.

This is primarily for the benefit of high-level languages like Python.

markUsed() → None

Marks the array data recently-used.

static getClassType() → TypeHandle
Return type

TypeHandle

property object
Return type

GeomVertexArrayData

property array_format
Return type

GeomVertexArrayFormat

property usage_hint
Return type

UsageHint

property data_size_bytes
Return type

size_t

property modified
Return type

UpdateSeq