BundleWriteBlock

class omni.graph.core.BundleWriteBlock(context: GraphContext, activate=True)

Bases: object

Creates a thread-local scope to ensure that each bundle is marked as changed only once, regardless of the number of operations performed within the block.

This optimization is an integral part of the bundle change tracking system, designed to minimize overhead associated with high-volume operations during frequent bundle manipulations.

Example usage:

with omni.graph.core.BundleWriteBlock(graph_context):

# …each bundle written to will be bumped exactly once…

You can optionally pass in a second parameter to deactivate the block:

with omni.graph.core.BundleWriteBlock(graph_context, False):

# …the block is not active here…

Methods

__init__(context[, activate])

__init__(context: GraphContext, activate=True)