convert_type_name#
- omni.graph.tools.ogn.convert_type_name(
- type_name: str,
- source_type: DataTypeNameRepresentation,
- return_type: DataTypeNameRepresentation,
Convert the name of a specific supported data type between two different representations.
assert “bool[]” == convert_type_name(“bool[]”, DataTypeNameRepresentation.OGN, DataTypeNameRepresentation.USD) assert “color3d[]” == convert_type_name(“colord[3]”, DataTypeNameRepresentation.OGN, DataTypeNameRepresentation.USD)
- Parameters:
type_name – Name of the data type using the source representation
source_type – Representation that type_name should be in
return_type – Equivalent representation for type_name to be returned
- Returns:
type_name in the given return_type representation
- Raises:
DataTypeError if the type_name was not a legal value in the source representation, or had no equivalent in –
the return representation. This includes the case where there is more than one unique answer to the return –
type name, as you might find in the case of asking for the equivalent for the C++ data type "ogn::SimpleInput". –