Util

Utility functions for pysg.

pysg.util.parameters_as_angles_deg_to_rad(*args_to_convert)

Converts specific angle arguments to angles in radians.

Used as a decorator to reduce duplicate code.

Arguments are specified by their argument name. For example

@parameters_as_angles_deg_to_rad('a', 'b', 'optional')
def myfunc(a, b, *args, **kwargs):
    pass

myfunc(20, [15,15], optional=[80,80,80])
pysg.util.pyrr_type_checker(var: object, var_type: type) → object

Makes sure that pyrr types are used as input. Tries to cast and raises PyrrTypeError if not possible.

Parameters:
  • var – Input variable.
  • var_type – Type of input variable.
Returns:

Variable in correct type. Otherwise raise PyrrTypeError exception.