warp.handle#

class warp.handle(x=0)[source]#

Object handle type for meshes, volumes, BVHs, and hash grids.

Use this type for scalar object IDs in kernel parameters and struct fields, for example mesh: warp.handle.

For arrays of object IDs, annotate kernel parameters as warp.array[warp.handle] and construct the arrays with dtype=warp.handle. An annotation alone does not change an array’s dtype. An existing Warp array of 64-bit integer IDs can be reinterpreted with ids.view(warp.handle) without copying its storage.

Handles use the same native 64-bit representation as warp.uint64. See Object Handles for legacy integer compatibility and API Capture: Saving and Loading Graphs for resource serialization requirements and limitations.

A handle does not keep its object alive. Keep the corresponding warp.Mesh, warp.Volume, warp.Bvh, or warp.HashGrid alive while its handle is in use.

warp.tile_load() and warp.tile_store() do not yet support arrays with dtype=warp.handle. Handle arrays support ordinary kernel indexing.

Parameters:

x (int | float)