newton.utils.string_to_warp#
- newton.utils.string_to_warp(value, warp_dtype, default=None)[source]#
Parse a Warp value from a string. This is useful for parsing values from XML files. For example, “1.0 2.0 3.0” will be parsed as wp.vec3(1.0, 2.0, 3.0).
If fewer values are provided than expected for vector/matrix types, the remaining values will be filled from the default value if provided.
- Raises:
ValueError – If the dtype is invalid.
- Parameters:
- Returns:
The parsed Warp value.
- Return type: