Simple Data Type Examples
This file contains example usage for all of the AutoNode simple data types. For access to the other types of examples see AutoNode Examples.
bool
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_bool(first_value: ot.bool, second_value: ot.bool) -> ot.boolean:
"""Takes in two boolean values and outputs the logical AND of them.
The types of both inputs and the return value are Python booleans.
Note that the return type name is the Warp-compatible "boolean", which is just a synonym for "bool".
"""
return first_value and second_value
bool[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_boolarray(first_value: ot.boolarray, second_value: ot.boolarray) -> ot.boolarray:
"""Takes in two arrays of boolean attributes and returns an array with the logical AND of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=bool) where "N" is the
size of the array determined at runtime.
"""
return first_value & second_value
double
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_double(first_value: ot.double, second_value: ot.double) -> ot.float64:
"""Takes in two double precision values and outputs the sum of them.
The types of both inputs and the return value are Python floats as Python does not distinguish between
different precision levels. When put into Fabric and USD the values are stored as double.
precision values.
Note that the return type is the Warp-compatible "float64" which is a synonym for "double".
"""
return first_value + second_value
double[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_doublearray(first_value: ot.doublearray, second_value: ot.doublearray) -> ot.doublearray:
"""Takes in two arrays of double attributes and returns an array containing the sum of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.float64) where "N" is
the size of the array determined at runtime.
"""
return first_value + second_value
float
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_float(first_value: ot.float, second_value: ot.float) -> ot.float32:
"""Takes in two single-precision floating point values and outputs the sum of them.
The types of both inputs and the return value are Python floats as Python does not distinguish between
different precision levels. When put into Fabric and USD the values are stored as single-precision
floating point values.
Note that the return type is the Warp-compatible "float32" which is a synonym for "float".
"""
return first_value + second_value
float[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_floatarray(first_value: ot.floatarray, second_value: ot.floatarray) -> ot.floatarray:
"""Takes in two arrays of float attributes and returns an array containing the sum of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.float32) where "N" is
the size of the array determined at runtime.
"""
return first_value + second_value
half
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_half(first_value: ot.half, second_value: ot.half) -> ot.float16:
"""Takes in two half-precision floating point values and outputs the sum of them.
The types of both inputs and the return value are Python floats as Python does not distinguish between
different precision levels. When put into Fabric and USD the values are stored as half
precision floating point values.
Note that the return type is the Warp-compatible "float16" which is a synonym for "half".
"""
return first_value + second_value
half[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_halfarray(first_value: ot.halfarray, second_value: ot.halfarray) -> ot.halfarray:
"""Takes in two arrays of half attributes and returns an array containing the sum of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.float16) where "N" is
the size of the array determined at runtime.
"""
return first_value + second_value
int
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_int(first_value: ot.int, second_value: ot.int) -> ot.int32:
"""Takes in two 32-bit precision integer values and outputs the sum of them.
The types of both inputs and the return value are Python ints as Python does not distinguish between
different precision levels. When put into Fabric and USD the values are stored as 32-bit precision
integer values.
Note that the return type is the Warp-compatible "int32" which is a synonym for "int".
"""
return first_value + second_value
int[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_intarray(first_value: ot.intarray, second_value: ot.intarray) -> ot.intarray:
"""Takes in two arrays of integer attributes and returns an array containing the sum of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.int32) where "N" is
the size of the array determined at runtime.
"""
return first_value + second_value
int64
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_int64(first_value: ot.int64, second_value: ot.int64) -> ot.int64:
"""Takes in two 64-bit precision integer values and outputs the sum of them.
The types of both inputs and the return value are Python ints as Python does not distinguish between
different precision levels. When put into Fabric and USD the values are stored as 64-bit precision
integer values.
"""
return first_value + second_value
int64[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_int64array(first_value: ot.int64array, second_value: ot.int64array) -> ot.int64array:
"""Takes in two arrays of 64-bit integer attributes and returns an array containing the sum of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.int64) where "N" is
the size of the array determined at runtime.
"""
return first_value + second_value
string
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_string(first_value: ot.string, second_value: ot.string) -> ot.string:
"""Takes in two string values and outputs the concatenated string.
The types of both inputs and the return value are Python str. When put into Fabric the values are
stored as uchar arrays with a length value. USD stores it as a native string type.
"""
return first_value + second_value
token
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_token(first_value: ot.token, second_value: ot.token) -> ot.token:
"""Takes in two tokenized strings and outputs the string resulting from concatenating them together.
The types of both inputs and the return value are Python strs as Python does not have the concept of a
unique tokenized string. When put into Fabric and USD the values are stored as a single
64-bit unsigned integer that is a token .
"""
return first_value + second_value
token[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_tokenarray(first_value: ot.tokenarray, second_value: ot.tokenarray) -> ot.tokenarray:
"""Takes in two arrays of tokens and returns an array containing the concatenations of each element.
The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype="<US") where "N" is
the size of the array determined at runtime.
"""
return np.array([x + y for x, y in zip(first_value, second_value)])
uchar
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_uchar(first_value: ot.uchar, second_value: ot.uchar) -> ot.uint8:
"""Takes in two 8-bit precision unsigned integer values and outputs the sum of them.
The types of both inputs and the return value are Python ints as Python does not distinguish between
different precision levels or signs. When put into Fabric and USD the values are stored as 8-bit
precision unsigned integer values.
Note that the return type is the Warp-compatible "uint8" which is a synonym for "uchar".
"""
return first_value + second_value
uchar[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_uchararray(first_value: ot.uchararray, second_value: ot.uchararray) -> ot.uchararray:
"""Takes in two arrays of 8-bit unsigned integer attributes and returns an array containing the sum of each
element. The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.uchar8) where
"N" is the size of the array determined at runtime.
"""
return first_value + second_value
uint
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_uint(first_value: ot.uint, second_value: ot.uint) -> ot.uint:
"""Takes in two 32-bit precision unsigned integer values and outputs the sum of them.
The types of both inputs and the return value are Python ints as Python does not distinguish between
different precision levels or signs. When put into Fabric and USD the values are stored as 32-bit
precision unsigned integer values.
"""
return first_value + second_value
uint[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_uintarray(first_value: ot.uintarray, second_value: ot.uintarray) -> ot.uintarray:
"""Takes in two arrays of 32-bit unsigned integer attributes and returns an array containing the sum of each
element. The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.uint32) where
"N" is the size of the array determined at runtime.
"""
return first_value + second_value
uint64
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_uint64(first_value: ot.uint64, second_value: ot.uint64) -> ot.uint64:
"""Takes in two 64-bit precision unsigned integer values and outputs the sum of them.
The types of both inputs and the return value are Python ints as Python does not distinguish between
different precision levels or signs. When put into Fabric and USD the values are stored as 64-bit
precision unsigned integer values.
"""
return first_value + second_value
uint64[]
import omni.graph.core as og
import omni.graph.core.types as ot
@og.create_node_type
def autonode_uint64array(first_value: ot.uint64array, second_value: ot.uint64array) -> ot.uint64array:
"""Takes in two arrays of 8-bit unsigned integer attributes and returns an array containing the sum of each
element. The types of both inputs and the return value are numpy.ndarray(shape=(N,), dtype=numpy.uint64) where
"N" is the size of the array determined at runtime.
"""
return first_value + second_value